Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Median filtering could help to make the areas more uniform. You'll need to work at optimizing parameters, and maybe even break the area of interest into different segments, since the pixels near the apex appear to be close in value. That area looks like it will be the toughest to solve, since pixel values are less differentiated.

In order to better delineate edges, you could try bilateral filtering or another of the 'anisotropic' variants (also check the contrib libs). Expect that to be slower than normal Gaussian blur, but it will not blur edges as severely as Gaussian.

Judicious use of erode and dilate afterward may help to get rid of any remaining small islands, though I would try to do more pre-processing before resorting to that.

After the areas are more uniform, adaptive thresholding could help to 'ride' larger variations in luminance. This is another algorithm that can be sensitive to its parameters, so I recommend patching in a limited GUI with a couple slider controls to help in finding best settings.

After finding contours, you can sort the list by area, and choose only the largest three (or however many you want).