opencv::gapi

Function phase

source
pub fn phase(
    x: &impl GMatTraitConst,
    y: &impl GMatTraitConst,
    angle_in_degrees: bool,
) -> Result<GMat>
Expand description

Calculates the rotation angle of 2D vectors.

The function cv::phase calculates the rotation angle of each 2D vector that is formed from the corresponding elements of x and y : block formula

The angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 , the corresponding angle(I) is set to 0.

§Parameters

  • x: input floating-point array of x-coordinates of 2D vectors.
  • y: input array of y-coordinates of 2D vectors; it must have the same size and the same type as x.
  • angleInDegrees: when true, the function calculates the angle in degrees, otherwise, they are measured in radians.

§Returns

array of vector angles; it has the same size and same type as x.

§C++ default parameters

  • angle_in_degrees: false