How to guide bwconncomp to specific region of image?
조회 수: 14 (최근 30일)
이전 댓글 표시
Hello,
I am new to image processing and have been trying to use bwconncomp() to identify components in images.
In my image there is a background which is set to zero or NaN. The area of interest is a circle where there are different values signifying specific regions of that circle that have more or less of some quantity. The image is similar to a topoplot https://www.google.com/search?client=firefox-b-d&q=topoplot
How can I guide bwconncomp() to only look for components inside the area of interest? My issue is that bwconncomp identifies more or less, the entire circle as one large component relative to the background.
댓글 수: 1
Rik
2021년 7월 18일
Have you tried setting all pixels outside of the circle (and the circle itself) to false?
채택된 답변
Image Analyst
2021년 7월 19일
I don't know what the different components are? The blue/purple regions? The colored region is just a continuum of colors smoothly varying and I don't know what would be a component in them. What do you want as a component? Not the circle you've told us. So what/where are the components? Can you outline each individual component in red and repost it?
댓글 수: 0
추가 답변 (3개)
Image Analyst
2021년 7월 18일
편집: Image Analyst
2021년 7월 18일
Make a mask of the circle and use it to erase everything outside of the circle, then call bwconncomp() To maks a circle mask, see the FAQ:
Or you can threshold your original image.
then use it to mask your binary image
binaryImage(~circleMask) = false; % Erase outside circle.
cc = bwconncomp(binaryImage);
Attach your image if you need more help.
See my image segmentation tutorial
댓글 수: 2
Image Analyst
2021년 7월 19일
Sure, I'll help if you let me. Attach your image if you need more help.
You can try a closing with imclose() to merge nearby blobs together into a single blob.
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!