Set pixel value to zero in intensity image
1 次查看(过去 30 天)
显示 更早的评论
I wish to set the value of a pixel at a certain coordinate to zero in an image. Any idea how to do this? The coordinate is (641,513) (the middle).
Thanks in advance,
JB
0 个评论
采纳的回答
Nitin
2013-6-25
I = imread(img);
I(614,513)=0;
3 个评论
Image Analyst
2013-6-25
x is column, y is row. So I(x,y) is not the same location as I(row, column). If you want x = 20, y = 100, you need to do I(100, 20), not I(20,100) because the row (the y value) index comes first. This is a common source of confusion and errors and you need to always watch out for this.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!