nn::camera::CTR::GetStereoCameraCalibrationMatrix Function
void GetStereoCameraCalibrationMatrix(
nn::math::MTX34 * pDst,
const StereoCameraCalibrationData & cal,
const f32 translationUnit,
const bool isIncludeParallax = true
);
| Name | Description | |
|---|---|---|
| out | pDst | Specifies the location where the correction matrix is stored. |
| in | cal | Specifies the calibration data. |
| in | translationUnit | Specifies the unit of translation in 3D space. Specify a value that is equal to the ratio between the sizes of the VGA image and screen image multiplied by the amount of movement to translate the camera image by one pixel. |
| in | isIncludeParallax | Whether the horizontal translation includes the parallax in the measurement chart. |
Calculates a correction matrix used to make the left camera image match the right camera image in 3D space.
The output matrix is used to move the left camera image. This matrix is simply a three-dimensional extension of a two-dimensional matrix that expands and shrinks images, rotates around the light axis, and performs horizontal and vertical translations; it does not include three-dimensional transformations, such as rotations about the horizontal and vertical axes.
The translation distance needed for correction will differ depending on the size of the image, the size of the object, and such graphics settings as the perspective. If you use nn::camera::SetSize to set the image size to other than VGA (640 x 480), the camera will shrink the image internally, causing the subject to appear smaller. The amount of translation needed for correction will then be reduced by this amount. The amount of translation needed will also vary, depending on whether you display the image pixel by pixel, or display it after scaling. Specify the argument translationUnit as the translation distance required to move the camera image by one pixel, multiplied by the ratio of the size of a VGA image to the size of the image you wish to display.
For example, let us assume that you are displaying a VGA image pixel by pixel, and you have configured your graphics so that the translation distance needed to move that image by one pixel is 1.0f. In this case, specify translationUnit as 1.0f. Next, let us assume that you will change the image size to 512 x 384. If you do not stretch the image using texture mapping, the subject will be 0.8 times the size of a VGA image (512 / 640). This will reduce the amount of translation needed for correction, so specify translationUnit as 1.0f x 0.8f = 0.8f. Note that if you enlarge the object, and display the subject in the same way as you display a VGA image pixel by pixel before applying the correction matrix, then translationUnit will be 1.0f. Conversely, if you enlarge the object after applying the correction matrix, then translationUnit will be 0.8f because you will be enlarging the image after translation.
translationUnit parameter.
CONFIDENTIAL