How to fill the regions within the traced boundry using "bwboundaries"
이전 댓글 표시
Hi, I am using bwboundaries to trace the boundaries. I want to know,how to fill the traced region alone with white pixels.
채택된 답변
추가 답변 (1개)
Image Analyst
2014년 2월 19일
filledImage = poly2mask(xBoundaries, yBoundaries, rows, columns);
댓글 수: 6
Image Analyst
2014년 2월 19일
Since you must already have the binary image, why use bwboundaries if all you want to do is to fill holes. You can do
filledImage = imfill(binaryImage, 'holes');
No call to bwboundaries() is needed, unless you need it for some other reason.
BAKIYA LAKSHMI
2014년 2월 19일
Image Analyst
2014년 2월 19일
I don't understand. You need a binary image FIRST to even call bwboundaries. Please attach your image.
BAKIYA LAKSHMI
2014년 2월 19일
편집: Image Analyst
2014년 2월 19일
Dishant Arora
2014년 2월 19일
@Image analyst,I guess she probably wants a binary mask having 1's only at boundary positions.
Image Analyst
2014년 2월 19일
For that they'd use bwperim(). I ran the code and it does an auto-threshold and then gets the boundaries of all the regions. If that is not wanted then I need to know what is wanted. I have not heard a really clear explanation of what is wanted. I don't even know what a traced region is, as opposed to a regular connected components region that you get from thresholding. Perhaps a figure showing what the desired outcome is would be helpful if explaining it in English is difficult because English is not the native language of the poster. I'm pretty sure what is wanted is trivial if I could just understand what is wanted.
카테고리
도움말 센터 및 File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
