Documentation

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

cameraIntrinsics class

Object for storing intrinsic camera parameters

Syntax

``intrinsics = cameraIntrinsics(focalLength,principalPoint,imageSize)``
``intrinsics = cameraIntrinsics(___,Name,Value)``

Description

````intrinsics = cameraIntrinsics(focalLength,principalPoint,imageSize)` returns a camera intrinsics object that contains the focal length specified as [fx,fy], and the camera's principal point specified as [cx, cy]. See `cameraParameters` for more details.```
````intrinsics = cameraIntrinsics(___,Name,Value)` uses additional options specified by one or more `Name,Value` pair arguments, using any of the preceding syntaxes.```

Input Arguments

expand all

Camera focal length, specified as a two-element vector, [fx, fy].

`${f}_{x}=F×sx$`
`${f}_{y}=F×sy$`

• F is the focal length in world units, typically millimeters

• [sx, sy] are the number of pixels per world unit in the x and y direction respectively

• fx and fy are in pixels

Optical center of camera, specified as a two-element vector, [cx,cy], in pixels.

Image size produced by the camera, specified as a two-element vector, [mrows,ncols].

Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside single quotes (`' '`). You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example:

expand all

Radial lens distortion, specified as the comma-separated pair consisting of `RadialDistortion` and a two-element vector, [k1,k2], or a three-element vector, [k1,k2,k3]. k1,k2, and k3 are radial distortion coefficients. Radial distortion occurs when light rays bend more near the edges of a lens than they do at its optical center. The smaller the lens, the greater the distortion.

Radial distortion occurs when light rays bend more near the edges of a lens than they do at its optical center. The smaller the lens, the greater the distortion.

The camera parameters object calculates the radial distorted location of a point. You can denote the distorted points as (xdistorted, ydistorted), as follows:

xdistorted = x(1 + k1*r2 + k2*r4 + k3*r6)

ydistorted= y(1 + k1*r2 + k2*r4 + k3*r6)

 x, y = undistorted pixel locations k1, k2, and k3 = radial distortion coefficients of the lens r2 = x2 + y2
Typically, two coefficients are sufficient. For severe distortion, you can include k3. The undistorted pixel locations appear in normalized image coordinates, with the origin at the optical center. The coordinates are expressed in world units.

Tangential distortion coefficients, specified as the comma-separated pair consisting of '`TangentialDistortion`' and a 2-element vector, [p1,p2]. Tangential distortion occurs when the lens and the image plane are not parallel.

The camera parameters object calculates the tangential distorted location of a point. You can denote the distorted points as (xdistorted, ydistorted), as follows:

xdistorted = x + [2 * p1 * x * y + p2 * (r2 + 2 * x2)]

ydistorted = y + [p1 * (r2 + 2*y2) + 2 * p2 * x * y]

 x, y = undistorted pixel locations p1 and p2 = tangential distortion coefficients of the lens r2 = x2 + y2
The undistorted pixel locations appear in normalized image coordinates, with the origin at the optical center. The coordinates are expressed in world units.

Camera axes skew, specified as the comma-separated pair consisting of '`skew`' and an angle. If the x and the y axes are exactly perpendicular, then the skew must be `0`.

Properties

expand all

Focal length in x and y, stored as a 2-element vector [fx, fy] in pixels.

 fx = F * sx fy = F * sy
where, F is the focal length in world units, typically in millimeters, and [sx, sy] are the number of pixels per world unit in the x and y direction respectively. Thus, fx and fy are in pixels.

Optical center of camera, stored as a two-element vector [cx,cy] in pixels. The vector contains the coordinates of the optical center of the camera.

Image size produced by the camera, stored as a two-element vector, [mrows,ncols].

Radial lens distortion, stored as the comma-separated pair consisting of `RadialDistortion` and a two-element vector, [k1,k2], or a three-element vector, [k1,k2,k3]. k1,k2, and k3 are radial distortion coefficients. Radial distortion occurs when light rays bend more near the edges of a lens than they do at its optical center. The smaller the lens, the greater the distortion.

Radial distortion occurs when light rays bend more near the edges of a lens than they do at its optical center. The smaller the lens, the greater the distortion.

The camera parameters object calculates the radial distorted location of a point. You can denote the distorted points as (xdistorted, ydistorted), as follows:

xdistorted = x(1 + k1*r2 + k2*r4 + k3*r6)

ydistorted= y(1 + k1*r2 + k2*r4 + k3*r6)

 x, y = undistorted pixel locations k1, k2, and k3 = radial distortion coefficients of the lens r2 = x2 + y2
Typically, two coefficients are sufficient. For severe distortion, you can include k3. The undistorted pixel locations appear in normalized image coordinates, with the origin at the optical center. The coordinates are expressed in world units.

Tangential distortion coefficients, stored as the comma-separated pair consisting of '`TangentialDistortion`' and a 2-element vector, [p1,p2]. Tangential distortion occurs when the lens and the image plane are not parallel.

The camera parameters object calculates the tangential distorted location of a point. You can denote the distorted points as (xdistorted, ydistorted), as follows:

xdistorted = x + [2 * p1 * x * y + p2 * (r2 + 2 * x2)]

ydistorted = y + [p1 * (r2 + 2*y2) + 2 * p2 * x * y]

 x, y = undistorted pixel locations p1 and p2 = tangential distortion coefficients of the lens r2 = x2 + y2
The undistorted pixel locations appear in normalized image coordinates, with the origin at the optical center. The coordinates are expressed in world units.

Camera axes skew, stored as the comma-separated pair consisting of '`skew`' and an angle. If the x and the y axes are exactly perpendicular, then the skew must be `0`.

Projection matrix, stored as the comma-separated pair consisting of '`IntrinsicMatrix`' and a 3-by-3 matrix. For the matrix format, the object uses the following format:

`$\left[\begin{array}{ccc}{f}_{x}& 0& 0\\ s& {f}_{y}& 0\\ {c}_{x}& {c}_{y}& 1\end{array}\right]$`
The coordinates [cx cy] represent the optical center (the principal point), in pixels. When the x and y axis are exactly perpendicular, the skew parameter, s, equals `0`.
 fx = F*sx fy = F*sy
 F, is the focal length in world units, typically expressed in millimeters. [sx, sy] are the number of pixels per world unit in the x and y direction respectively. fx and fy are expressed in pixels.

Output Arguments

expand all

Intrinsic camera parameters, returned as an object. The intrinsics object stores information about a camera’s intrinsic calibration parameters, including lens distortion.

Examples

expand all

Define camera parameters without lens distortion or skew.

Specify the focal length and principal point in pixels.

``` focalLength = [800, 800]; principalPoint = [320, 240]; imageSize = [480, 640]; ```

Create a camera intrinsics object.

```intrinsics = cameraIntrinsics(focalLength,principalPoint,imageSize) ```
```intrinsics = cameraIntrinsics with properties: FocalLength: [800 800] PrincipalPoint: [320 240] ImageSize: [480 640] RadialDistortion: [0 0] TangentialDistortion: [0 0] Skew: 0 IntrinsicMatrix: [3×3 double] ```