Skip to content

gapi_phase

gapifunctionOpenCV 5.0.0
import { gapi_phase } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSx, y, angleInDegrees
FUNCTIONgapi_phase
RETURN TYPEGMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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 :

\texttt{angle} (I) =  \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))

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

gapi_phase(x: GMat, y: GMat, angleInDegrees: boolean): GMat;
2 available overloads
gapi_phase(x: GMat, y: GMat): GMat;
gapi_phase(x: GMat, y: GMat, angleInDegrees: boolean): GMat;
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. Release returned native handles with using or delete(), including handles nested in results.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.