Reputation: 35
Im trying to segment an image into three categories using Matlab Image Segmenter.
The raw image:
Three categories are as follows: 1. Large white shapes 2. Small white shapes 3. Background
I have managed to segment Large shapes using tresholding and morphology options.
And backround using tresholding and inverse mask
However I don't know how to segment small shapes from the image. Morphology option allows to segment shapes larger than some treshold value, but does not allow to segment shapes smaller than treshold value, or in between.
I need to treshold more than 100 of these images so manual filling is not an option.
Upvotes: 3
Views: 118
Reputation: 6863
Here is one solution. If your other segmentation steps already work, you can export all the steps to a function. Save function, and just add the logic yourself. If BW1
corresponds to the large shapes, BW2
to the background, then the small shapes correspond to:
BW3 = ~(BW1 | BW1);
Upvotes: 1