Monado OpenXR Runtime
|
Provides cached, precomputed access to normalized image coordinates from original, distorted ones. More...
#include <tracking/t_calibration_opencv.hpp>
Public Member Functions | |
NormalizedCoordsCache (cv::Size size, const cv::Matx33d &intrinsics, const cv::Matx< double, 5, 1 > &distortion) | |
Set up the precomputed cache for a given camera. More... | |
NormalizedCoordsCache (cv::Size size, const cv::Matx33d &intrinsics, const cv::Matx< double, 5, 1 > &distortion, const cv::Matx33d &rectification, const cv::Matx33d &new_camera_matrix) | |
Set up the precomputed cache for a given camera (overload for rectification and new camera matrix) More... | |
NormalizedCoordsCache (cv::Size size, const cv::Matx33d &intrinsics, const cv::Matx< double, 5, 1 > &distortion, const cv::Matx33d &rectification, const cv::Matx< double, 3, 4 > &new_projection_matrix) | |
Set up the precomputed cache for a given camera. More... | |
NormalizedCoordsCache (cv::Size size, const cv::Mat &intrinsics, const cv::Mat &distortion) | |
Set up the precomputed cache for a given camera. More... | |
cv::Vec2f | getNormalizedImageCoords (cv::Point2f origCoords) const |
Get normalized, undistorted coordinates from a point in the original (distorted, etc.) image. More... | |
cv::Vec3f | getNormalizedVector (cv::Point2f origCoords) const |
Get normalized vector in the camera-space direction corresponding to the original (distorted, etc.) image coordinates. More... | |
Provides cached, precomputed access to normalized image coordinates from original, distorted ones.
Populates internal structures using cv::undistortPoints() and performs subpixel sampling to interpolate for each query. Essentially, this class lets you perform cv::undistortPoints() while caching the initial setup work required for that function.
NormalizedCoordsCache::NormalizedCoordsCache | ( | cv::Size | size, |
const cv::Matx33d & | intrinsics, | ||
const cv::Matx< double, 5, 1 > & | distortion | ||
) |
Set up the precomputed cache for a given camera.
size | Size of the image in pixels |
intrinsics | Camera intrinsics matrix |
distortion | Distortion coefficients |
This overload applies no rectification (R
) and uses a normalized/identity new camera matrix (P
).
NormalizedCoordsCache::NormalizedCoordsCache | ( | cv::Size | size, |
const cv::Matx33d & | intrinsics, | ||
const cv::Matx< double, 5, 1 > & | distortion, | ||
const cv::Matx33d & | rectification, | ||
const cv::Matx33d & | new_camera_matrix | ||
) |
Set up the precomputed cache for a given camera (overload for rectification and new camera matrix)
size | Size of the image in pixels |
intrinsics | Camera intrinsics matrix |
distortion | Distortion coefficients |
rectification | Rectification matrix - corresponds to parameter R to cv::undistortPoints(). |
new_camera_matrix | A 3x3 new camera matrix - corresponds to parameter P to cv::undistortPoints(). |
NormalizedCoordsCache::NormalizedCoordsCache | ( | cv::Size | size, |
const cv::Matx33d & | intrinsics, | ||
const cv::Matx< double, 5, 1 > & | distortion, | ||
const cv::Matx33d & | rectification, | ||
const cv::Matx< double, 3, 4 > & | new_projection_matrix | ||
) |
Set up the precomputed cache for a given camera.
(overload for rectification and new projection matrix)
size | Size of the image in pixels |
intrinsics | Camera intrinsics matrix |
distortion | Distortion coefficients |
rectification | Rectification matrix - corresponds to parameter R to cv::undistortPoints(). |
new_projection_matrix | A 3x4 new projection matrix - corresponds to parameter P to cv::undistortPoints(). |
NormalizedCoordsCache::NormalizedCoordsCache | ( | cv::Size | size, |
const cv::Mat & | intrinsics, | ||
const cv::Mat & | distortion | ||
) |
Set up the precomputed cache for a given camera.
Less-strongly-typed overload.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This overload applies no rectification (R
) and uses a normalized/identity new camera matrix (P
).
cv::Vec2f NormalizedCoordsCache::getNormalizedImageCoords | ( | cv::Point2f | origCoords | ) | const |
Get normalized, undistorted coordinates from a point in the original (distorted, etc.) image.
origCoords | Image coordinates in original image |
cv::Vec3f NormalizedCoordsCache::getNormalizedVector | ( | cv::Point2f | origCoords | ) | const |
Get normalized vector in the camera-space direction corresponding to the original (distorted, etc.) image coordinates.
Note that the Z component will be negative by convention.