machinevisiontoolbox.Image.direction

Image.direction(vertical)

Gradient direction

Parameters:

im (Image) – vertical gradient image

Returns:

gradient direction in radians

Return type:

Image

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:
  • Robotics, Vision & Control for Python, Section 11.5.1.3, P. Corke, Springer 2023.

Seealso:

gradients