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

9 ビュー (過去 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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by