How can I accurately segment an image based on pixel intensity and density ?
1 view (last 30 days)
Show older comments
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 .
0 Comments
Answers (1)
Image Analyst
on 30 Jun 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 Comments
Image Analyst
on 30 Jun 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.
See my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!