How to find the difference of adjacent pixels in an image? Thanks
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jab
el 4 de Ag. de 2016
Comentada: Image Analyst
el 27 de Mzo. de 2017
How to find the difference of adjacent pixels in an image? Thanks
0 comentarios
Respuesta aceptada
Image Analyst
el 4 de Ag. de 2016
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 comentarios
Sidra Aleem
el 27 de Mzo. de 2017
Editada: Sidra Aleem
el 27 de Mzo. de 2017
Below figure illustrates what I want to do
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/183800/image.png)
Image Analyst
el 27 de Mzo. de 2017
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!