Filling empty white pixels with nearest coloured pixel

Viewed 309

Problem Statement: I have an image obtained after plotting several points and coloured according to a certain parameter value. Since I need to perform contour detection, I need to actually form a "contour". Thus I need to colour the white pixel (especially in the top right of the image) inside the "contour" to have the same colour as the nearest coloured pixel. Alternatively, suggest a better morphological/blurring/smoothing technique.

enter image description here

My attempt: enter image description here As you can see that the corrected components appear jagged (Used erosion and blur selectively to the right half of the image). Any suggestions are welcome :)

0 Answers
Related