Monado OpenXR Runtime
|
Provides cached, precomputed normalized image coordinates from original, distorted ones. More...
#include <tracking/t_calibration_opencv.hpp>
Public Member Functions | |
NormalizedCoordsCache (cv::Size size, t_camera_distortion_model distortion_model, cv::InputArray intrinsics, cv::InputArray distortion, cv::InputArray rectification=cv::noArray(), cv::InputArray new_camera_or_projection_matrix=cv::noArray()) | |
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 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.
xrt::auxiliary::tracking::NormalizedCoordsCache::NormalizedCoordsCache | ( | cv::Size | size, |
t_camera_distortion_model | distortion_model, | ||
cv::InputArray | intrinsics, | ||
cv::InputArray | distortion, | ||
cv::InputArray | rectification = cv::noArray() , |
||
cv::InputArray | new_camera_or_projection_matrix = cv::noArray() |
||
) |
Set up the precomputed cache for a given camera.
size | Size of the image in pixels |
distortion_model | Model used with distortion |
intrinsics | Camera intrinsics matrix |
distortion | Distortion coefficients |
rectification | Rectification matrix - corresponds to parameter R to cv::undistortPoints(). |
new_camera_or_projection_matrix | A new 3x3 camera matrix or 3x4 projection matrix - corresponds to parameter P to cv::undistortPoints(). |
References xrt::auxiliary::tracking::generateInputCoordsAndReserveOutputCoords(), and xrt::auxiliary::tracking::populateCacheMats().
cv::Vec2f xrt::auxiliary::tracking::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 xrt::auxiliary::tracking::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.