Image.direction#
- Image.direction(vertical: Any) Any[source]#
Gradient direction
- Parameters:
im (
Image) – vertical gradient image- Returns:
gradient direction in radians
- Return type:
Compute the per-pixel gradient direction from two images comprising the horizontal and vertical gradient components.
\[\theta_{u,v} = \tan^{-1} \frac{\mat{I}_{v: u,v}}{\mat{I}_{u: u,v}}\]Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Read('monalisa.png', grey=True) >>> Iu, Iv = img.gradients() >>> direction = Iu.direction(Iv)
- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 11.5.1.3.
- Seealso: