Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 758
Ziemway Avatar asked May 10 '26 01:05

Ziemway


1 Answers

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);
like image 187
rinkert Avatar answered May 11 '26 15:05

rinkert