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

조회 수: 8 (최근 30일)
Jab
Jab 2016년 8월 4일
댓글: Image Analyst 2017년 3월 27일
How to find the difference of adjacent pixels in an image? Thanks

채택된 답변

Image Analyst
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
Sidra Aleem
Sidra Aleem 2017년 3월 27일
편집: Sidra Aleem 2017년 3월 27일
Below figure illustrates what I want to do
Image Analyst
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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by