{
  "id": 369799,
  "title": "ROI Extraction for breast using OpenCV - How to crop images? 💻 ",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/369799",
  "author_name": "Sinan Calisir",
  "post_date": "2022-12-01T13:33:41.905000",
  "votes": 15,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi everyone,</p>\n<p>I shared a notebook on how to crop images to focus on the breast part of the image which could be useful for training. Here you can find some of the results:</p>\n<p>Where to crop the images:<br>\n<img src=\"https://raw.githubusercontent.com/snnclsr/kaggle_images/main/rectangles.png\" alt=\"\"></p>\n<p>And the final results after normalization and enhancement:<br>\n<img src=\"https://raw.githubusercontent.com/snnclsr/kaggle_images/main/final_imgs.png\" alt=\"\"></p>\n<p>Here is the notebook: 💻 <a href=\"https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv\" target=\"_blank\">https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv</a><br>\nAnd here is the source: <a href=\"https://github.com/Guarouba/breast_mass_detection\" target=\"_blank\">https://github.com/Guarouba/breast_mass_detection</a></p>",
  "messages": [
    {
      "id": 2051518,
      "postDate": "2022-12-01T13:33:41.907Z",
      "content": "<p>Hi everyone,</p>\n<p>I shared a notebook on how to crop images to focus on the breast part of the image which could be useful for training. Here you can find some of the results:</p>\n<p>Where to crop the images:<br>\n<img src=\"https://raw.githubusercontent.com/snnclsr/kaggle_images/main/rectangles.png\" alt=\"\"></p>\n<p>And the final results after normalization and enhancement:<br>\n<img src=\"https://raw.githubusercontent.com/snnclsr/kaggle_images/main/final_imgs.png\" alt=\"\"></p>\n<p>Here is the notebook: 💻 <a href=\"https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv\" target=\"_blank\">https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv</a><br>\nAnd here is the source: <a href=\"https://github.com/Guarouba/breast_mass_detection\" target=\"_blank\">https://github.com/Guarouba/breast_mass_detection</a></p>",
      "rawMarkdown": "Hi everyone,\n\nI shared a notebook on how to crop images to focus on the breast part of the image which could be useful for training. Here you can find some of the results:\n\nWhere to crop the images:\n![](https://raw.githubusercontent.com/snnclsr/kaggle_images/main/rectangles.png)\n\nAnd the final results after normalization and enhancement:\n![](https://raw.githubusercontent.com/snnclsr/kaggle_images/main/final_imgs.png)\n\nHere is the notebook: 💻 https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv\nAnd here is the source: https://github.com/Guarouba/breast_mass_detection",
      "votes": 14
    },
    {
      "id": 2052109,
      "postDate": "2022-12-02T00:01:00.467Z",
      "content": "<p>you can train a segmentation network  by using available labeled dataset:<br>\n<a href=\"https://paperswithcode.com/dataset/csaw-s\" target=\"_blank\">https://paperswithcode.com/dataset/csaw-s</a></p>\n<p>there are a couple of of dataset, you can google for it</p>",
      "rawMarkdown": "you can train a segmentation network  by using available labeled dataset:\nhttps://paperswithcode.com/dataset/csaw-s\n\nthere are a couple of of dataset, you can google for it\n",
      "votes": 1
    },
    {
      "id": 2051873,
      "postDate": "2022-12-01T17:01:50.577Z",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/snnclsr\" target=\"_blank\">@snnclsr</a> , great to see this approach. Got a question. I can see that you resized ROIs after cropping, but since ROIs have different dimensions wouldnt this distort the images? This is my main concern with using an object detector. </p>",
      "rawMarkdown": "Thanks @snnclsr , great to see this approach. Got a question. I can see that you resized ROIs after cropping, but since ROIs have different dimensions wouldnt this distort the images? This is my main concern with using an object detector. ",
      "votes": 1,
      "replies": [
        {
          "id": 2052062,
          "postDate": "2022-12-01T21:56:42.833Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a> </p>\n<p>Yes, it would. But we are already doing that before cropping the image as I am using 1024x1024-sized images. Maybe it would be better to crop squares from the image like in augmentation? but in the end, it's all experimental imho. </p>",
          "rawMarkdown": "Hi @alejopaullier \n\nYes, it would. But we are already doing that before cropping the image as I am using 1024x1024-sized images. Maybe it would be better to crop squares from the image like in augmentation? but in the end, it's all experimental imho. ",
          "votes": 1
        },
        {
          "id": 2052093,
          "postDate": "2022-12-01T22:55:03.840Z",
          "content": "<blockquote>\n  <p>it's all experimental imho</p>\n</blockquote>\n<p>Totally agree. In the end you use what gives the best results. I'll probably start with a baseline and check if using an object detector improves the score.</p>",
          "rawMarkdown": ">it's all experimental imho\n\nTotally agree. In the end you use what gives the best results. I'll probably start with a baseline and check if using an object detector improves the score.",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2052109,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-02T00:01:00.467000",
      "content": "<p>you can train a segmentation network  by using available labeled dataset:<br>\n<a href=\"https://paperswithcode.com/dataset/csaw-s\" target=\"_blank\">https://paperswithcode.com/dataset/csaw-s</a></p>\n<p>there are a couple of of dataset, you can google for it</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2051873,
      "author_name": "moth",
      "author_url": "",
      "post_date": "2022-12-01T17:01:50.577000",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/snnclsr\" target=\"_blank\">@snnclsr</a> , great to see this approach. Got a question. I can see that you resized ROIs after cropping, but since ROIs have different dimensions wouldnt this distort the images? This is my main concern with using an object detector. </p>",
      "votes": 1,
      "replies": [
        {
          "id": 2052062,
          "author_name": "Sinan Calisir",
          "author_url": "",
          "post_date": "2022-12-01T21:56:42.833000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a> </p>\n<p>Yes, it would. But we are already doing that before cropping the image as I am using 1024x1024-sized images. Maybe it would be better to crop squares from the image like in augmentation? but in the end, it's all experimental imho. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2052093,
          "author_name": "moth",
          "author_url": "",
          "post_date": "2022-12-01T22:55:03.840000",
          "content": "<blockquote>\n  <p>it's all experimental imho</p>\n</blockquote>\n<p>Totally agree. In the end you use what gives the best results. I'll probably start with a baseline and check if using an object detector improves the score.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2051518": "Hi everyone,\n\nI shared a notebook on how to crop images to focus on the breast part of the image which could be useful for training. Here you can find some of the results:\n\nWhere to crop the images:\n![](https://raw.githubusercontent.com/snnclsr/kaggle_images/main/rectangles.png)\n\nAnd the final results after normalization and enhancement:\n![](https://raw.githubusercontent.com/snnclsr/kaggle_images/main/final_imgs.png)\n\nHere is the notebook: 💻 https://www.kaggle.com/code/snnclsr/roi-extraction-using-opencv\nAnd here is the source: https://github.com/Guarouba/breast_mass_detection",
    "2052109": "you can train a segmentation network  by using available labeled dataset:\nhttps://paperswithcode.com/dataset/csaw-s\n\nthere are a couple of of dataset, you can google for it\n",
    "2051873": "Thanks @snnclsr , great to see this approach. Got a question. I can see that you resized ROIs after cropping, but since ROIs have different dimensions wouldnt this distort the images? This is my main concern with using an object detector. "
  }
}