Skip to content

Commit 0d2fab8

Browse files
author
Ilya Krylov
committed
Changed documentation for namespace fisheye
1 parent 651b13f commit 0d2fab8

File tree

1 file changed

+47
-51
lines changed

1 file changed

+47
-51
lines changed

modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,57 +1487,53 @@ The function reconstructs 3-dimensional points (in homogeneous coordinates) by u
14871487

14881488
:ocv:func:`reprojectImageTo3D`
14891489

1490-
Fisheye
1490+
fisheye
14911491
----------
14921492

1493-
.. ocv:class:: Fisheye
1493+
The methods in this namespace use a so-called fisheye camera model. ::
14941494

1495-
The methods in this class use a so-called fisheye camera model. ::
1496-
1497-
class Fisheye
1495+
namespace fisheye
14981496
{
1499-
public:
1500-
15011497
//! projects 3D points using fisheye model
1502-
static void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,
1498+
void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,
15031499
InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());
15041500

15051501
//! projects points using fisheye model
1506-
static void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,
1502+
void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,
15071503
InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());
15081504

15091505
//! distorts 2D points using fisheye model
1510-
static void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0);
1506+
void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0);
15111507

15121508
//! undistorts 2D points using fisheye model
1513-
static void undistortPoints(InputArray distorted, OutputArray undistorted,
1509+
void undistortPoints(InputArray distorted, OutputArray undistorted,
15141510
InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray());
15151511

15161512
//! computing undistortion and rectification maps for image transform by cv::remap()
15171513
//! If D is empty zero distortion is used, if R or P is empty identity matrixes are used
1518-
static void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P,
1514+
void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P,
15191515
const cv::Size& size, int m1type, OutputArray map1, OutputArray map2);
15201516

15211517
//! undistorts image, optionally changes resolution and camera matrix.
1522-
static void undistortImage(InputArray distorted, OutputArray undistorted,
1518+
void undistortImage(InputArray distorted, OutputArray undistorted,
15231519
InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size());
15241520

15251521
//! estimates new camera matrix for undistortion or rectification
1526-
static void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,
1522+
void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,
15271523
OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0);
15281524

15291525
//! performs camera calibaration
1530-
static double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size,
1526+
double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size,
15311527
InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0,
15321528
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));
15331529

15341530
//! stereo rectification estimation
1535-
static void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec,
1531+
void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec,
15361532
OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(),
15371533
double balance = 0.0, double fov_scale = 1.0);
15381534

15391535
//! performs stereo calibration
1540-
static double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,
1536+
double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,
15411537
InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize,
15421538
OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC,
15431539
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));
@@ -1594,13 +1590,13 @@ Finally, convertion into pixel coordinates: The final pixel coordinates vector [
15941590
u = f_x (x' + \alpha y') + c_x \\
15951591
v = f_y yy + c_y
15961592
1597-
Fisheye::projectPoints
1593+
fisheye::projectPoints
15981594
---------------------------
15991595
Projects points using fisheye model
16001596

1601-
.. ocv:function:: void Fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray())
1597+
.. ocv:function:: void fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray())
16021598
1603-
.. ocv:function:: void Fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray())
1599+
.. ocv:function:: void fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray())
16041600
16051601
:param objectPoints: Array of object points, 1xN/Nx1 3-channel (or ``vector<Point3f>`` ), where N is the number of points in the view.
16061602

@@ -1620,11 +1616,11 @@ Projects points using fisheye model
16201616

16211617
The function computes projections of 3D points to the image plane given intrinsic and extrinsic camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of image points coordinates (as functions of all the input parameters) with respect to the particular parameters, intrinsic and/or extrinsic.
16221618

1623-
Fisheye::distortPoints
1619+
fisheye::distortPoints
16241620
-------------------------
16251621
Distorts 2D points using fisheye model.
16261622

1627-
.. ocv:function:: void Fisheye::distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0)
1623+
.. ocv:function:: void fisheye::distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0)
16281624
16291625
:param undistorted: Array of object points, 1xN/Nx1 2-channel (or ``vector<Point2f>`` ), where N is the number of points in the view.
16301626

@@ -1636,11 +1632,11 @@ Distorts 2D points using fisheye model.
16361632

16371633
:param distorted: Output array of image points, 1xN/Nx1 2-channel, or ``vector<Point2f>`` .
16381634

1639-
Fisheye::undistortPoints
1635+
fisheye::undistortPoints
16401636
-----------------------------
16411637
Undistorts 2D points using fisheye model
16421638

1643-
.. ocv:function:: void Fisheye::undistortPoints(InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray())
1639+
.. ocv:function:: void fisheye::undistortPoints(InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray())
16441640
16451641
:param distorted: Array of object points, 1xN/Nx1 2-channel (or ``vector<Point2f>`` ), where N is the number of points in the view.
16461642

@@ -1655,11 +1651,11 @@ Undistorts 2D points using fisheye model
16551651
:param undistorted: Output array of image points, 1xN/Nx1 2-channel, or ``vector<Point2f>`` .
16561652

16571653

1658-
Fisheye::initUndistortRectifyMap
1654+
fisheye::initUndistortRectifyMap
16591655
-------------------------------------
16601656
Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero distortion is used, if R or P is empty identity matrixes are used.
16611657

1662-
.. ocv:function:: void Fisheye::initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P, const cv::Size& size, int m1type, OutputArray map1, OutputArray map2)
1658+
.. ocv:function:: void fisheye::initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P, const cv::Size& size, int m1type, OutputArray map1, OutputArray map2)
16631659
16641660
:param K: Camera matrix :math:`K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}`.
16651661

@@ -1677,11 +1673,11 @@ Computes undistortion and rectification maps for image transform by cv::remap().
16771673

16781674
:param map2: The second output map.
16791675

1680-
Fisheye::undistortImage
1676+
fisheye::undistortImage
16811677
-----------------------
16821678
Transforms an image to compensate for fisheye lens distortion.
16831679

1684-
.. ocv:function:: void Fisheye::undistortImage(InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size())
1680+
.. ocv:function:: void fisheye::undistortImage(InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size())
16851681
16861682
:param distorted: image with fisheye lens distortion.
16871683

@@ -1696,24 +1692,24 @@ Transforms an image to compensate for fisheye lens distortion.
16961692
The function transforms an image to compensate radial and tangential lens distortion.
16971693

16981694
The function is simply a combination of
1699-
:ocv:func:`Fisheye::initUndistortRectifyMap` (with unity ``R`` ) and
1695+
:ocv:func:`fisheye::initUndistortRectifyMap` (with unity ``R`` ) and
17001696
:ocv:func:`remap` (with bilinear interpolation). See the former function for details of the transformation being performed.
17011697

17021698
See below the results of undistortImage.
17031699
* a\) result of :ocv:func:`undistort` of perspective camera model (all possible coefficients (k_1, k_2, k_3, k_4, k_5, k_6) of distortion were optimized under calibration)
1704-
* b\) result of :ocv:func:`Fisheye::undistortImage` of fisheye camera model (all possible coefficients (k_1, k_2, k_3, k_4) of fisheye distortion were optimized under calibration)
1700+
* b\) result of :ocv:func:`fisheye::undistortImage` of fisheye camera model (all possible coefficients (k_1, k_2, k_3, k_4) of fisheye distortion were optimized under calibration)
17051701
* c\) original image was captured with fisheye lens
17061702

17071703
Pictures a) and b) almost the same. But if we consider points of image located far from the center of image, we can notice that on image a) these points are distorted.
17081704

17091705
.. image:: pics/fisheye_undistorted.jpg
17101706

17111707

1712-
Fisheye::estimateNewCameraMatrixForUndistortRectify
1708+
fisheye::estimateNewCameraMatrixForUndistortRectify
17131709
----------------------------------------------------------
17141710
Estimates new camera matrix for undistortion or rectification.
17151711

1716-
.. ocv:function:: void Fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0)
1712+
.. ocv:function:: void fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0)
17171713
17181714
:param K: Camera matrix :math:`K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}`.
17191715

@@ -1727,11 +1723,11 @@ Estimates new camera matrix for undistortion or rectification.
17271723

17281724
:param fov_scale: Divisor for new focal length.
17291725

1730-
Fisheye::stereoRectify
1726+
fisheye::stereoRectify
17311727
------------------------------
17321728
Stereo rectification for fisheye camera model
17331729

1734-
.. ocv:function:: void Fisheye::stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0)
1730+
.. ocv:function:: void fisheye::stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0)
17351731
17361732
:param K1: First camera matrix.
17371733

@@ -1773,19 +1769,19 @@ Stereo rectification for fisheye camera model
17731769

17741770

17751771

1776-
Fisheye::calibrate
1772+
fisheye::calibrate
17771773
----------------------------
17781774
Performs camera calibaration
17791775

1780-
.. ocv:function:: double Fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size, InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON))
1776+
.. ocv:function:: double fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size, InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON))
17811777
17821778
:param objectPoints: vector of vectors of calibration pattern points in the calibration pattern coordinate space.
17831779

17841780
:param imagePoints: vector of vectors of the projections of calibration pattern points. ``imagePoints.size()`` and ``objectPoints.size()`` and ``imagePoints[i].size()`` must be equal to ``objectPoints[i].size()`` for each ``i``.
17851781

17861782
:param image_size: Size of the image used only to initialize the intrinsic camera matrix.
17871783

1788-
:param K: Output 3x3 floating-point camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` . If ``Fisheye::CALIB_USE_INTRINSIC_GUESS``/ is specified, some or all of ``fx, fy, cx, cy`` must be initialized before calling the function.
1784+
:param K: Output 3x3 floating-point camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` . If ``fisheye::CALIB_USE_INTRINSIC_GUESS``/ is specified, some or all of ``fx, fy, cx, cy`` must be initialized before calling the function.
17891785

17901786
:param D: Output vector of distortion coefficients :math:`(k_1, k_2, k_3, k_4)`.
17911787

@@ -1795,32 +1791,32 @@ Performs camera calibaration
17951791

17961792
:param flags: Different flags that may be zero or a combination of the following values:
17971793

1798-
* **Fisheye::CALIB_USE_INTRINSIC_GUESS** ``cameraMatrix`` contains valid initial values of ``fx, fy, cx, cy`` that are optimized further. Otherwise, ``(cx, cy)`` is initially set to the image center ( ``imageSize`` is used), and focal distances are computed in a least-squares fashion.
1794+
* **fisheye::CALIB_USE_INTRINSIC_GUESS** ``cameraMatrix`` contains valid initial values of ``fx, fy, cx, cy`` that are optimized further. Otherwise, ``(cx, cy)`` is initially set to the image center ( ``imageSize`` is used), and focal distances are computed in a least-squares fashion.
17991795

1800-
* **Fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration of intrinsic optimization.
1796+
* **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration of intrinsic optimization.
18011797

1802-
* **Fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
1798+
* **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
18031799

1804-
* **Fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
1800+
* **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
18051801

1806-
* **Fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay zero.
1802+
* **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay zero.
18071803

18081804
:param criteria: Termination criteria for the iterative optimization algorithm.
18091805

18101806

1811-
Fisheye::stereoCalibrate
1807+
fisheye::stereoCalibrate
18121808
----------------------------
18131809
Performs stereo calibration
18141810

1815-
.. ocv:function:: double Fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON))
1811+
.. ocv:function:: double fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON))
18161812
18171813
:param objectPoints: Vector of vectors of the calibration pattern points.
18181814

18191815
:param imagePoints1: Vector of vectors of the projections of the calibration pattern points, observed by the first camera.
18201816

18211817
:param imagePoints2: Vector of vectors of the projections of the calibration pattern points, observed by the second camera.
18221818

1823-
:param K1: Input/output first camera matrix: :math:`\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}` , :math:`j = 0,\, 1` . If any of ``Fisheye::CALIB_USE_INTRINSIC_GUESS`` , ``Fisheye::CV_CALIB_FIX_INTRINSIC`` are specified, some or all of the matrix components must be initialized.
1819+
:param K1: Input/output first camera matrix: :math:`\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}` , :math:`j = 0,\, 1` . If any of ``fisheye::CALIB_USE_INTRINSIC_GUESS`` , ``fisheye::CV_CALIB_FIX_INTRINSIC`` are specified, some or all of the matrix components must be initialized.
18241820

18251821
:param D1: Input/output vector of distortion coefficients :math:`(k_1, k_2, k_3, k_4)` of 4 elements.
18261822

@@ -1836,17 +1832,17 @@ Performs stereo calibration
18361832

18371833
:param flags: Different flags that may be zero or a combination of the following values:
18381834

1839-
* **Fisheye::CV_CALIB_FIX_INTRINSIC** Fix ``K1, K2?`` and ``D1, D2?`` so that only ``R, T`` matrices are estimated.
1835+
* **fisheye::CV_CALIB_FIX_INTRINSIC** Fix ``K1, K2?`` and ``D1, D2?`` so that only ``R, T`` matrices are estimated.
18401836

1841-
* **Fisheye::CALIB_USE_INTRINSIC_GUESS** ``K1, K2`` contains valid initial values of ``fx, fy, cx, cy`` that are optimized further. Otherwise, ``(cx, cy)`` is initially set to the image center (``imageSize`` is used), and focal distances are computed in a least-squares fashion.
1837+
* **fisheye::CALIB_USE_INTRINSIC_GUESS** ``K1, K2`` contains valid initial values of ``fx, fy, cx, cy`` that are optimized further. Otherwise, ``(cx, cy)`` is initially set to the image center (``imageSize`` is used), and focal distances are computed in a least-squares fashion.
18421838

1843-
* **Fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration of intrinsic optimization.
1839+
* **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration of intrinsic optimization.
18441840

1845-
* **Fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
1841+
* **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
18461842

1847-
* **Fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
1843+
* **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
18481844

1849-
* **Fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay zero.
1845+
* **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay zero.
18501846

18511847
:param criteria: Termination criteria for the iterative optimization algorithm.
18521848

0 commit comments

Comments
 (0)