필터 지우기
필터 지우기

Gradient Field of an Image...

조회 수: 3 (최근 30일)
Philip
Philip 2011년 2월 17일
Hi,
Does anyone know how to calculate the gradient field of an image? I have checked the use of Quiver plots to achieve this, but am having difficulties applying it to an image...
Many thanks in advance for any help anyone can give!
Phil

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 2월 17일
You can calculate the gradient using:
doc gradient
and then use the results from that for your quiver plot.
  댓글 수: 1
Philip
Philip 2011년 2월 21일
Thanks! I think this should be on the right lines, but I'm having a few issues using quiver... How can I overlay the gradient field for the entire image?
I am currently using:
[gx gy] = gradient(dens,.2,.2);
figure('name','Gradient');
imshow(img(1:r,1:c),'InitialMagnification','fit');
hold on;
quiver(gx(1:r,1:c),gy(1:r,1:c));
title('Gradient Field');
And after some processing time, I just get back a completely blue figure... Do you happen to know what I am doing wrong?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by