How do I get the values of the surrounding pixels when I choose a particular pixel in an image?
5 次查看(过去 30 天)
显示 更早的评论
I'm trying to estimate the possible points of intersection between two lines (arrays) in an image. Is there any function to return the values of the surrounding pixels for a particular value of the array?
0 个评论
采纳的回答
Image Analyst
2016-11-2
Assuming it's a gray scale image, and that the row and column is not on the edge of the image:
surroundingWindow = grayImage(row-1:row+1, col-1:col+1);
If it's color:
surroundingWindow = rgbImage(row-1:row+1, col-1:col+1, :);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!