选择像素的4个邻居 [英] Selecting the 4-neighbours of a pixel
本文介绍了选择像素的4个邻居的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 matlab
中选择像素的4个邻居?
How can I select the 4-neighbours of a pixel in matlab
?
谢谢。
推荐答案
如果图像为 img
且当前像素索引为我
和 j
,然后四个邻居将是:
If the the image is img
and the current pixel indices are i
and j
, then the four neighbors will be:
img(i-1,j);
img(i+1,j);
img(i,j-1);
img(i,j+1);
这篇关于选择像素的4个邻居的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文