Ziemway
Ziemway

Reputation: 35

Matlab Image Segmenter morphology

Im trying to segment an image into three categories using Matlab Image Segmenter.

The raw image:

enter image description here

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.

enter image description here

And backround using tresholding and inverse mask

enter image description here

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

Answers (1)

rinkert
rinkert

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

Related Questions