Show / Hide Table of Contents

Class Cv2.FishEye

The methods in this class use a so-called fisheye camera model.

Inheritance
System.Object
Cv2.FishEye
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public static class FishEye

Methods

| Improve this Doc View Source

Calibrate(IEnumerable<Mat>, IEnumerable<Mat>, Size, InputOutputArray, InputOutputArray, out IEnumerable<Mat>, out IEnumerable<Mat>, FishEyeCalibrationFlags, Nullable<TermCriteria>)

Performs camera calibaration

Declaration
public static double Calibrate(IEnumerable<Mat> objectPoints, IEnumerable<Mat> imagePoints, Size imageSize, InputOutputArray k, InputOutputArray d, out IEnumerable<Mat> rvecs, out IEnumerable<Mat> tvecs, FishEyeCalibrationFlags flags = FishEyeCalibrationFlags.None, TermCriteria? criteria = null)
Parameters
Type Name Description
IEnumerable<Mat> objectPoints

vector of vectors of calibration pattern points in the calibration pattern coordinate space.

IEnumerable<Mat> 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.

OpenCvSharp.Size imageSize

Size of the image used only to initialize the intrinsic camera matrix.

InputOutputArray k

Output 3x3 floating-point camera matrix

InputOutputArray d

Output vector of distortion coefficients (k_1, k_2, k_3, k_4).

IEnumerable<Mat> rvecs

Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. That is, each k-th rotation vector together with the corresponding k-th translation vector(see the next output parameter description) brings the calibration pattern from the model coordinate space(in which object points are specified) to the world coordinate space, that is, a real position of the calibration pattern in the k-th pattern view(k= 0.. * M * -1).

IEnumerable<Mat> tvecs

Output vector of translation vectors estimated for each pattern view.

FishEyeCalibrationFlags flags

Different flags that may be zero or a combination of flag values

System.Nullable<OpenCvSharp.TermCriteria> criteria

Termination criteria for the iterative optimization algorithm.

Returns
Type Description
System.Double
| Improve this Doc View Source

DistortPoints(InputArray, OutputArray, InputArray, InputArray, Double)

Distorts 2D points using fisheye model.

Declaration
public static void DistortPoints(InputArray undistorted, OutputArray distorted, InputArray k, InputArray d, double alpha = 0)
Parameters
Type Name Description
InputArray undistorted

Array of object points, 1xN/Nx1 2-channel (or vector<Point2f> ), where N is the number of points in the view.

OutputArray distorted

Output array of image points, 1xN/Nx1 2-channel, or vector<Point2f> .

InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients

System.Double alpha

The skew coefficient.

| Improve this Doc View Source

EstimateNewCameraMatrixForUndistortRectify(InputArray, InputArray, Size, InputArray, OutputArray, Double, Size, Double)

Estimates new camera matrix for undistortion or rectification.

Declaration
public static void EstimateNewCameraMatrixForUndistortRectify(InputArray k, InputArray d, Size imageSize, InputArray r, OutputArray p, double balance = 0, Size newSize = default(Size), double fovScale = 1)
Parameters
Type Name Description
InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients (k_1, k_2, k_3, k_4).

OpenCvSharp.Size imageSize
InputArray r

Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 1-channel or 1x1 3-channel

OutputArray p

New camera matrix (3x3) or new projection matrix (3x4)

System.Double balance

Sets the new focal length in range between the min focal length and the max focal length.Balance is in range of[0, 1].

OpenCvSharp.Size newSize
System.Double fovScale

Divisor for new focal length.

| Improve this Doc View Source

InitUndistortRectifyMap(InputArray, InputArray, InputArray, InputArray, Size, Int32, OutputArray, OutputArray)

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.

Declaration
public static void InitUndistortRectifyMap(InputArray k, InputArray d, InputArray r, InputArray p, Size size, int m1type, OutputArray map1, OutputArray map2)
Parameters
Type Name Description
InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients (k_1, k_2, k_3, k_4).

InputArray r

Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 1-channel or 1x1 3-channel

InputArray p

New camera matrix (3x3) or new projection matrix (3x4)

OpenCvSharp.Size size

Undistorted image size.

System.Int32 m1type

Type of the first output map that can be CV_32FC1 or CV_16SC2 . See convertMaps() for details.

OutputArray map1

The first output map.

OutputArray map2

The second output map.

| Improve this Doc View Source

ProjectPoints(InputArray, OutputArray, InputArray, InputArray, InputArray, InputArray, Double, OutputArray)

Projects points using fisheye model.

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.

Declaration
public static void ProjectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, InputArray k, InputArray d, double alpha = 0, OutputArray jacobian = null)
Parameters
Type Name Description
InputArray objectPoints

Array of object points, 1xN/Nx1 3-channel (or vector<Point3f> ), where N is the number of points in the view.

OutputArray imagePoints

Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or vector<Point2f>.

InputArray rvec
InputArray tvec
InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients

System.Double alpha

The skew coefficient.

OutputArray jacobian

Optional output 2Nx15 jacobian matrix of derivatives of image points with respect to components of the focal lengths, coordinates of the principal point, distortion coefficients, rotation vector, translation vector, and the skew.In the old interface different components of the jacobian are returned via different output parameters.

| Improve this Doc View Source

StereoCalibrate(IEnumerable<Mat>, IEnumerable<Mat>, IEnumerable<Mat>, InputOutputArray, InputOutputArray, InputOutputArray, InputOutputArray, Size, OutputArray, OutputArray, FishEyeCalibrationFlags, Nullable<TermCriteria>)

Performs stereo calibration

Declaration
public static double StereoCalibrate(IEnumerable<Mat> objectPoints, IEnumerable<Mat> imagePoints1, IEnumerable<Mat> imagePoints2, InputOutputArray k1, InputOutputArray d1, InputOutputArray k2, InputOutputArray d2, Size imageSize, OutputArray r, OutputArray t, FishEyeCalibrationFlags flags = FishEyeCalibrationFlags.FixIntrinsic, TermCriteria? criteria = null)
Parameters
Type Name Description
IEnumerable<Mat> objectPoints

Vector of vectors of the calibration pattern points.

IEnumerable<Mat> imagePoints1

Vector of vectors of the projections of the calibration pattern points, observed by the first camera.

IEnumerable<Mat> imagePoints2

Vector of vectors of the projections of the calibration pattern points, observed by the second camera.

InputOutputArray k1

Input/output first camera matrix

InputOutputArray d1

Input/output vector of distortion coefficients (k_1, k_2, k_3, k_4) of 4 elements.

InputOutputArray k2

Input/output second camera matrix. The parameter is similar to K1 .

InputOutputArray d2

Input/output lens distortion coefficients for the second camera. The parameter is similar to D1.

OpenCvSharp.Size imageSize

Size of the image used only to initialize intrinsic camera matrix.

OutputArray r

Output rotation matrix between the 1st and the 2nd camera coordinate systems.

OutputArray t

Output translation vector between the coordinate systems of the cameras.

FishEyeCalibrationFlags flags

Different flags that may be zero or a combination of the FishEyeCalibrationFlags values

System.Nullable<OpenCvSharp.TermCriteria> criteria

Termination criteria for the iterative optimization algorithm.

Returns
Type Description
System.Double
| Improve this Doc View Source

StereoRectify(InputArray, InputArray, InputArray, InputArray, Size, InputArray, InputArray, OutputArray, OutputArray, OutputArray, OutputArray, OutputArray, FishEyeCalibrationFlags, Size, Double, Double)

Stereo rectification for fisheye camera model

Declaration
public static void StereoRectify(InputArray k1, InputArray d1, InputArray k2, InputArray d2, Size imageSize, InputArray r, InputArray tvec, OutputArray r1, OutputArray r2, OutputArray p1, OutputArray p2, OutputArray q, FishEyeCalibrationFlags flags, Size newImageSize = default(Size), double balance = 0, double fovScale = 1)
Parameters
Type Name Description
InputArray k1

First camera matrix.

InputArray d1

First camera distortion parameters.

InputArray k2

Second camera matrix.

InputArray d2

Second camera distortion parameters.

OpenCvSharp.Size imageSize

Size of the image used for stereo calibration.

InputArray r

Rotation matrix between the coordinate systems of the first and the second cameras.

InputArray tvec

Translation vector between coordinate systems of the cameras.

OutputArray r1

Output 3x3 rectification transform (rotation matrix) for the first camera.

OutputArray r2

Output 3x3 rectification transform (rotation matrix) for the second camera.

OutputArray p1

Output 3x4 projection matrix in the new (rectified) coordinate systems for the first camera.

OutputArray p2

Output 3x4 projection matrix in the new (rectified) coordinate systems for the second camera.

OutputArray q

Output 4x4 disparity-to-depth mapping matrix (see reprojectImageTo3D ).

FishEyeCalibrationFlags flags

Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views.And if the flag is not set, the function may still shift the images in the horizontal or vertical direction(depending on the orientation of epipolar lines) to maximize the useful image area.

OpenCvSharp.Size newImageSize

New image resolution after rectification. The same size should be passed to initUndistortRectifyMap(see the stereo_calib.cpp sample in OpenCV samples directory). When(0,0) is passed(default), it is set to the original imageSize.Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion.

System.Double balance

Sets the new focal length in range between the min focal length and the max focal length.Balance is in range of[0, 1].

System.Double fovScale

Divisor for new focal length.

| Improve this Doc View Source

UndistortImage(InputArray, OutputArray, InputArray, InputArray, InputArray, Size)

Transforms an image to compensate for fisheye lens distortion.

Declaration
public static void UndistortImage(InputArray distorted, OutputArray undistorted, InputArray k, InputArray d, InputArray knew = null, Size newSize = default(Size))
Parameters
Type Name Description
InputArray distorted

image with fisheye lens distortion.

OutputArray undistorted

Output image with compensated fisheye lens distortion.

InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients (k_1, k_2, k_3, k_4).

InputArray knew

Camera matrix of the distorted image. By default, it is the identity matrix but you may additionally scale and shift the result by using a different matrix.

OpenCvSharp.Size newSize
| Improve this Doc View Source

UndistortPoints(InputArray, OutputArray, InputArray, InputArray, InputArray, InputArray)

Undistorts 2D points using fisheye model

Declaration
public static void UndistortPoints(InputArray distorted, OutputArray undistorted, InputArray k, InputArray d, InputArray r = null, InputArray p = null)
Parameters
Type Name Description
InputArray distorted

Array of object points, 1xN/Nx1 2-channel (or vector<Point2f> ), where N is the number of points in the view.

OutputArray undistorted

Output array of image points, 1xN/Nx1 2-channel, or vector>Point2f> .

InputArray k

Camera matrix

InputArray d

Input vector of distortion coefficients (k_1, k_2, k_3, k_4).

InputArray r

Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 1-channel or 1x1 3-channel

InputArray p

New camera matrix (3x3) or new projection matrix (3x4)

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX