How can I change the values of certain segments to 0?
1 次查看(过去 30 天)
显示 更早的评论
I have a segmented image, it looks like this:
and I would like to further filter out some parts of the image by "excluding" the segments in the image that do not fit certain dimensions (I have the certain dimensions figured out already). How can I change the values of these segments that I would like exclude to 0 instead of 1?
0 个评论
采纳的回答
Benjamin Thompson
2022-2-2
An image is just a matrix in MATLAB. If you know the rows and columns in your image that correspond to segments you want to zero out, then use the colon notation to set portions of the matrix to zero:
A(rowStart:rowEnd,colStart:colEnd) = 0
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!