MATLAB: How to find the difference of adjacent pixels in an image? Thanks

image processingImage Processing Toolboxlocal binary patternspatial filter

How to find the difference of adjacent pixels in an image? Thanks

Best Answer

In which direction? Assuming left and right, you can use conv2() or imfilter():
img = imread('moon.tif');
diffImage = imfilter(img, [1, -1]);
imshow(diffImage, [])