How can I accurately segment an image based on pixel intensity and density ?

1 visualizzazione (ultimi 30 giorni)
The image attached is what im working on. I need to turn this image into a binary one, to highlight the central dark region( batman logo shaped kind of). Im not getting how to segment this .

Risposte (1)

Image Analyst
Image Analyst il 30 Giu 2017
Get two masks and AND them. One from thresholding and one from a texture filter. Basically try starting with something like this:
mask1 = stdfilt(grayImage, 9) > threshold1;
mask2 = grayImage < threshold2;
% Then you'll undoubtedly have to do some clean up, like with bwareafilt() or imclose().
% Now create final mask.
mask = mask1 & mask2;
  2 Commenti
igishaan
igishaan il 30 Giu 2017
Modificato: Image Analyst il 30 Giu 2017
stdfilt needs the second argument to be a neighbourhood of 0s and 1s right ? so what does the 9 mean ?.
Also I think I know what you are getting at , so i tried thresholding the image to make it binary. Then I used imfill to fill the holes and got the image attached. Kind of resembles what I need , but how do I clean up the background now ? segmentation ? Sorry for adding more questions :P.
Image Analyst
Image Analyst il 30 Giu 2017
Yes, use ones(9) or some other number instead of 9.
Like I said, try imclose() to join small nearby particles that you think should be part of the same blob, and use bwareafilt() to extract out blobs only within a certain size range.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by