How can I use a loop to subtract a pixel's gray level to it´s neighbor pixel's gray level?

2 views (last 30 days)
How can I use a loop to subtract a pixel's gray level to it´s neighbor pixel's gray level?

Accepted Answer

Thorsten
Thorsten on 13 Feb 2013
Edited: Thorsten on 13 Feb 2013
I = im2double(imread('cameraman.tif'));
Ix = diff(I')';
Iy = diff(I);
  5 Comments
Teemu
Teemu on 14 Feb 2013
Can I use diff function to subtract pixel from 2-pixel away from it? So it not neigbour pixel anymore.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!