필터 지우기
필터 지우기

Direction gradient value of edge pixel

조회 수: 3 (최근 30일)
Balkar Singh
Balkar Singh 2019년 6월 25일
댓글: KALYAN ACHARJYA 2019년 6월 25일
I applied imgradient on a grayscale image to get its edge direction but i got direction value in the form of negative value , zero and positive value. What is the reason negative values come of edge direction. I am using MATLAB 2019a.Thank you.

답변 (1개)

Image Analyst
Image Analyst 2019년 6월 25일
As you know, the gradient is a vector. So you can get magnitude and direction from imgradient(), or get the direction as x and y components using the imgradientxy() function. The help for imgradient() says
Gradient direction, returned as a numeric matrix the same size as image I. Gdir contains angles in degrees within the range [-180 180] measured counterclockwise from the positive x-axis.
So the vector could be pointing in a negative direction, for example if you had an edge where it's dark for upper pixels (top part of the step in intensity) and bright for lower pixels. For example if the image had the top half be all 120 and the bottom half pixels all had the value 150. The gradient right at the edge would be 30 and it would be pointing downward (-90 degrees).
Does that explain it?
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 6월 25일
Yes sir, I misundestood the question (the question is negative value of gradient direction). You clearly explained the reason of negative direction of gradient.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by