我对imgradient
函数中使用的方程式有疑问。
在第127行:
Gdir = atan2(-Gy,Gx)*180/pi; % Radians to degrees
为什么Gy必须是负数?我对imgradient
函数中使用的方程式有疑问。
在第127行:
Gdir = atan2(-Gy,Gx)*180/pi; % Radians to degrees
为什么Gy必须是负数?atan2
能够返回从 -PI
到 PI
的结果...为什么我们还需要添加负号呢?也许你有其他的解释方式吗?提前感谢! - undefinedatan2
前面加上负号。 - undefined
Gdir
位于第四象限是必要的(尽管这实际上是假设Gy
和Gx
都是正数)。 - undefined