Skip to content

gapi_polarToCart

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

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

ARGUMENTSmagnitude, angle, angleInDegrees
FUNCTIONgapi_polarToCart
RETURN TYPEtuple_GMat_and_GMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates x and y coordinates of 2D vectors from their magnitude and angle.

The function polarToCart calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle:

\begin{array}{l} \texttt{x} (I) =  \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) =  \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}

The relative accuracy of the estimated coordinates is about 1e-6.

First output is a matrix of x-coordinates of 2D vectors. Second output is a matrix of y-coordinates of 2D vectors. Both output must have the same size and depth as input matrices.

Note: Function textual ID is "org.opencv.core.math.polarToCart"

See: cartToPolar, exp, log, pow, sqrt

gapi_polarToCart(magnitude: GMat, angle: GMat, angleInDegrees: boolean): tuple_GMat_and_GMat;
2 available overloads
gapi_polarToCart(magnitude: GMat, angle: GMat): tuple_GMat_and_GMat;
gapi_polarToCart(magnitude: GMat, angle: GMat, angleInDegrees: boolean): tuple_GMat_and_GMat;
magnitude

input floating-point CV_32FC1 matrix (1xN) of magnitudes of 2D vectors;

angle

input floating-point CV_32FC1 matrix (1xN) of angles of 2D vectors.

angleInDegrees

when true, the input angles are measured in degrees, otherwise, they are measured in radians.

Returns

The tuple_GMat_and_GMat result.

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.