MATLAB: Blurring/Filling in color on jpeg image.

digital image processingImage Processing Toolboximfillmorphological closingshading

Hi,
I'm working with painmaps (see example attached), and I'm trying to shade in the red areas. As you can see the red is scribbled on and there are white spaces within, I'd like to take the outer extremities of the red scribbling and fill in everything inside of it red, so that it's one solid block of red. This is so that I can quantify the shaded pixels for analytical purposes. Any help with this would be much appreciated. I was thinking that perhaps imfill or morphological closing could be used, but I'm struggling to make either option work.
Thanks, Matt

Best Answer

You need to do some steps like I showed you before to get the red scribbles. Then you need to call activecontour() to get the "envelope" of the red scribbles. See attached demo.