mapbox / robosat

Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds
MIT License
2.03k stars 383 forks source link

Automatically refine generated training dataset masks #8

Open daniel-j-h opened 6 years ago

daniel-j-h commented 6 years ago

At the moment we generate the segmentation masks based on OpenStreetMap geometries in rs rasterize. There is no standard of how fine or coarse geometries are mapped in OpenStreetMap. Sometimes we get fine-detailed masks, sometimes they can be very coarse.

See the following for quite a good mask:

Image Mask
95309 95309

We should check if the cv2.floodFill algorithm can help us automatically refining the masks.

It works as follows: start out with a seed pixel in the image and from there grow a region as long as the neighboring pixels are "similar" by color. We probably need to experiment with different color spaces, e.g. converting RGB into HSV and then maybe only using the H channel? The problem I'm seeing here is huge color differences: think cars of different colors, lane marking, parking lot concrete. Needs experimentation.

Tasks:

Note: this does not depend on parking lots. The same applies e.g. for buildings, roads, etc.

Geoyi commented 6 years ago

Hi @daniel-j-h, Nvidia's blog states that they use flood fill on SpaceNet Road Detection, I explored it for a day and try to see how it would work on Segmentation training dataset prep. I wasn't able to work it out, and would love to know how you approach it. Keep me updated on your progress, please.