码迷,mamicode.com
首页 > 其他好文 > 详细

OpenCV - cartToPolar()

时间:2020-07-23 23:08:23      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:cti   cal   @param   卡尔   must   rac   output   polar   func   

笛卡尔坐标转换为极坐标。

 

cartToPolar(...)
    cartToPolar(x, y[, magnitude[, angle[, angleInDegrees]]]) -> magnitude, angle
    .   @brief Calculates the magnitude and angle of 2D vectors.
    .   
    .   The function cv::cartToPolar calculates either the magnitude, angle, or both
    .   for every 2D vector (x(I),y(I)):
    .   \f[\begin{array}{l} \texttt{magnitude} (I)= \sqrt{\texttt{x}(I)^2+\texttt{y}(I)^2} , \\ \texttt{angle} (I)= \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))[ \cdot180 / \pi ] \end{array}\f]
    .   
    .   The angles are calculated with accuracy about 0.3 degrees. For the point
    .   (0,0), the angle is set to 0.
    .   @param x array of x-coordinates; this must be a single-precision or
    .   double-precision floating-point array.
    .   @param y array of y-coordinates, that must have the same size and same type as x.
    .   @param magnitude output array of magnitudes of the same size and type as x.
    .   @param angle output array of angles that has the same size and type as
    .   x; the angles are measured in radians (from 0 to 2\*Pi) or in degrees (0 to 360 degrees).
    .   @param angleInDegrees a flag, indicating whether the angles are measured
    .   in radians (which is by default), or in degrees.
    .   @sa Sobel, Scharr

cv.cartToPolar(1, 0)
(array([[1.],
        [0.],
        [0.],
        [0.]]),
 array([[0.],
        [0.],
        [0.],
        [0.]]))

cv.cartToPolar((1, 0, -1, 0), (0, 1, 0, -1))
(array([[1.],
        [1.],
        [1.],
        [1.]]),
 array([[0.        ],
        [1.57079637],
        [3.14159274],
        [4.71238899]]))

OpenCV - cartToPolar()

标签:cti   cal   @param   卡尔   must   rac   output   polar   func   

原文地址:https://www.cnblogs.com/zhangzhihui/p/13368718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!