Gradient of an image

4 visualizaciones (últimos 30 días)
Nur Mohd
Nur Mohd el 17 de Dic. de 2020
Respondida: Image Analyst el 17 de Dic. de 2020
I want to extract gradient from an image. Can I do in Matlab using the following command?
ims=imread('A.png');
Rx = ims(:,1:end-1,1) - ims(:,2:end,1);
Gx = ims(:,1:end-1,2) - ims(:,2:end,2);
Bx = ims(:,1:end-1,3) - ims(:,2:end,3);
Ry = ims(1:end-1,:,1) - ims(2:end,:,1);
Gy = ims(1:end-1,:,2) - ims(2:end,:,2);
By = ims(1:end-1,:,3) - ims(2:end,:,3);
Pl = [[Rx(:),Gx(:),Bx(:)];[Ry(:),Gy(:),By(:)]];

Respuestas (1)

Image Analyst
Image Analyst el 17 de Dic. de 2020
I'd simply use imgradient() or imgradientxy().

Community Treasure Hunt

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

Start Hunting!

Translated by