{
  "id": 26875,
  "title": "Creating labeled mask to fit with image",
  "url": "/competitions/dstl-satellite-imagery-feature-detection/discussion/26875",
  "author_name": "",
  "post_date": "2016-12-23T17:05:04.140Z",
  "votes": 1,
  "comment_count": 4,
  "views": 283,
  "content": "<p>Hi guys,</p>\n\n<p>I am new to machine learning and want to participate in this competition.</p>\n\n<p>I am trying to create a mask that will contain all the classes e.g. each pixel will have the value from 0-9 for 1-10 classes. This mask has to fit exactly over the input image for which this mask is created.</p>\n\n<p>I am reading forums here but still the approach is not clear to me how to do it. If someone even can help me with a starting point, that will be great.</p>\n\n<p>Thanks and greetings from California.</p>",
  "messages": [
    {
      "id": "152153",
      "postDate": "12/23/2016 17:05:04",
      "content": "<p>Hi guys,</p>\n\n<p>I am new to machine learning and want to participate in this competition.</p>\n\n<p>I am trying to create a mask that will contain all the classes e.g. each pixel will have the value from 0-9 for 1-10 classes. This mask has to fit exactly over the input image for which this mask is created.</p>\n\n<p>I am reading forums here but still the approach is not clear to me how to do it. If someone even can help me with a starting point, that will be great.</p>\n\n<p>Thanks and greetings from California.</p>",
      "rawMarkdown": "Hi guys,\r\n\r\nI am new to machine learning and want to participate in this competition.\r\n\r\nI am trying to create a mask that will contain all the classes e.g. each pixel will have the value from 0-9 for 1-10 classes. This mask has to fit exactly over the input image for which this mask is created.\r\n\r\nI am reading forums here but still the approach is not clear to me how to do it. If someone even can help me with a starting point, that will be great.\r\n\r\nThanks and greetings from California.",
      "votes": null
    },
    {
      "id": "152161",
      "postDate": "12/23/2016 18:49:56",
      "content": "<p>For an example of the transformation from polygon coordinates to pixel coordinates see this script from @shawn, </p>\n\n<p><a href=\"https://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments\">https://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments</a></p>\n\n<p>but note that some pixels can be labeled with multiple classes (i.e. the polygons from more than one class overlap with the pixel)</p>",
      "rawMarkdown": "For an example of the transformation from polygon coordinates to pixel coordinates see this script from @shawn, \r\n\r\nhttps://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments\r\n\r\nbut note that some pixels can be labeled with multiple classes (i.e. the polygons from more than one class overlap with the pixel)",
      "votes": null
    },
    {
      "id": "152162",
      "postDate": "12/23/2016 18:53:17",
      "content": "<p>Hi!</p>\n\n<p>I am doing the same thing that you want to. While I can't give you my full code because kaggle notebooks are alien to me, I can give you snippets. </p>\n\n<p>I use anaconda with opencv2 (nice surprise, they packed 3.1) numpy, pandas, shapely and as suggested in another thread, descartes and tifffile</p>\n\n<p>I depicetd shortly my method here:</p>\n\n<p><a href=\"https://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548\">https://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548</a></p>\n\n<p>I will try later (if I will not forget) to put the code together somewhere.</p>\n\n<p>Cristi</p>",
      "rawMarkdown": "Hi!\r\n\r\nI am doing the same thing that you want to. While I can't give you my full code because kaggle notebooks are alien to me, I can give you snippets. \r\n\r\nI use anaconda with opencv2 (nice surprise, they packed 3.1) numpy, pandas, shapely and as suggested in another thread, descartes and tifffile\r\n\r\nI depicetd shortly my method here:\r\n\r\nhttps://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548\r\n\r\nI will try later (if I will not forget) to put the code together somewhere.\r\n\r\nCristi",
      "votes": null
    },
    {
      "id": "152377",
      "postDate": "12/25/2016 17:32:49",
      "content": "<p>Hi! I've just posted this:</p>\n\n<p><a href=\"https://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code\">https://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code</a></p>\n\n<p>Enjoy!</p>\n\n<p>p.s. I am not using gdal but access a bit low level the actual polygon coordinates.</p>",
      "rawMarkdown": "Hi! I've just posted this:\r\n\r\nhttps://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code\r\n\r\nEnjoy!\r\n\r\np.s. I am not using gdal but access a bit low level the actual polygon coordinates.",
      "votes": null
    },
    {
      "id": "152387",
      "postDate": "12/25/2016 19:04:05",
      "content": "<p>Thanks man. I was really looking for this.</p>",
      "rawMarkdown": "Thanks man. I was really looking for this.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 152161,
      "author_name": "gabrielaltay",
      "author_url": "",
      "post_date": "12/23/2016 18:49:56",
      "content": "<p>For an example of the transformation from polygon coordinates to pixel coordinates see this script from @shawn, </p>\n\n<p><a href=\"https://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments\">https://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments</a></p>\n\n<p>but note that some pixels can be labeled with multiple classes (i.e. the polygons from more than one class overlap with the pixel)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 152162,
      "author_name": "visoft",
      "author_url": "",
      "post_date": "12/23/2016 18:53:17",
      "content": "<p>Hi!</p>\n\n<p>I am doing the same thing that you want to. While I can't give you my full code because kaggle notebooks are alien to me, I can give you snippets. </p>\n\n<p>I use anaconda with opencv2 (nice surprise, they packed 3.1) numpy, pandas, shapely and as suggested in another thread, descartes and tifffile</p>\n\n<p>I depicetd shortly my method here:</p>\n\n<p><a href=\"https://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548\">https://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548</a></p>\n\n<p>I will try later (if I will not forget) to put the code together somewhere.</p>\n\n<p>Cristi</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 152377,
      "author_name": "visoft",
      "author_url": "",
      "post_date": "12/25/2016 17:32:49",
      "content": "<p>Hi! I've just posted this:</p>\n\n<p><a href=\"https://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code\">https://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code</a></p>\n\n<p>Enjoy!</p>\n\n<p>p.s. I am not using gdal but access a bit low level the actual polygon coordinates.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 152387,
      "author_name": "djkalia",
      "author_url": "",
      "post_date": "12/25/2016 19:04:05",
      "content": "<p>Thanks man. I was really looking for this.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "152153": "Hi guys,\r\n\r\nI am new to machine learning and want to participate in this competition.\r\n\r\nI am trying to create a mask that will contain all the classes e.g. each pixel will have the value from 0-9 for 1-10 classes. This mask has to fit exactly over the input image for which this mask is created.\r\n\r\nI am reading forums here but still the approach is not clear to me how to do it. If someone even can help me with a starting point, that will be great.\r\n\r\nThanks and greetings from California.",
    "152161": "For an example of the transformation from polygon coordinates to pixel coordinates see this script from @shawn, \r\n\r\nhttps://www.kaggle.com/shawn775/dstl-satellite-imagery-feature-detection/polygon-transformation-to-match-image/comments\r\n\r\nbut note that some pixels can be labeled with multiple classes (i.e. the polygons from more than one class overlap with the pixel)",
    "152162": "Hi!\r\n\r\nI am doing the same thing that you want to. While I can't give you my full code because kaggle notebooks are alien to me, I can give you snippets. \r\n\r\nI use anaconda with opencv2 (nice surprise, they packed 3.1) numpy, pandas, shapely and as suggested in another thread, descartes and tifffile\r\n\r\nI depicetd shortly my method here:\r\n\r\nhttps://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/forums/t/26678/bad-data-thread?forumMessageId=151548#post151548\r\n\r\nI will try later (if I will not forget) to put the code together somewhere.\r\n\r\nCristi",
    "152377": "Hi! I've just posted this:\r\n\r\nhttps://www.kaggle.com/visoft/dstl-satellite-imagery-feature-detection/export-pixel-wise-mask/code\r\n\r\nEnjoy!\r\n\r\np.s. I am not using gdal but access a bit low level the actual polygon coordinates.",
    "152387": "Thanks man. I was really looking for this."
  },
  "source": "meta"
}