How can I accurately segment an image based on pixel intensity and density ?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Image Analyst
2017-6-30
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 个评论
Image Analyst
2017-6-30
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
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!