How to find the difference of adjacent pixels in an image? Thanks
조회 수: 8 (최근 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!