Turn pixels in connected components to zero based on logical array
이전 댓글 표시
I want to switch all pixels in connected components to zero, based on a logical array.
I have CC.PixelIdxList obtained from bwconncomp performed on binary image BW.
I have a logical array, X, the size of CC.PixelIdxList, based on which I would like to turn pixels in CC.PixelIdxList{y} to zero if the value in X=0 at index y.
I tried this:
BW(CC.PixelIdxList{y}) =X;
where y is just an array of numbers from 1 to the size of CC.PixelIdxList.
But it is not working, there must be another way that I cant think of.
Appreciate any suggestions. Thanks.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Region and Image Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!