How to find the difference of adjacent pixels in an image? Thanks
4 次查看(过去 30 天)
显示 更早的评论
How to find the difference of adjacent pixels in an image? Thanks
0 个评论
采纳的回答
Image Analyst
2016-8-4
In which direction? Assuming left and right, you can use conv2() or imfilter():
img = imread('moon.tif');
diffImage = imfilter(img, [1, -1]);
imshow(diffImage, [])
8 个评论
Image Analyst
2017-3-27
That would have been helpful to know in advance. I have no time to program this up for you but it's very similar to my local binary pattern demo where I get the values in a circle around the pixel like that. You just have to add or subtract them rather than take them as a binary number. See attached demo.
更多回答(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!