25 #ifndef INCLUDED_UndistortMeasurements_h_GUID_EBA50677_306F_4985_BC70_393C58140FE4 26 #define INCLUDED_UndistortMeasurements_h_GUID_EBA50677_306F_4985_BC70_393C58140FE4 44 inline LedMeasurementVec
47 LedMeasurementVec ret;
48 ret.resize(distortedMeasurements.size());
50 Eigen::Vector2d{camParams.focalLengthX(), camParams.focalLengthY()},
51 cvToVector(camParams.principalPoint()),
52 Eigen::Vector3d{camParams.k1(), camParams.k2(), camParams.k3()}};
53 auto ledUndistort = [&distortionModel](
LedMeasurement const &meas) {
55 Eigen::Vector2d undistorted = distortionModel.undistortPoint(
56 cvToVector(meas.loc).cast<
double>());
57 ret.
loc = vecToPoint(undistorted.cast<
float>());
60 std::transform(begin(distortedMeasurements), end(distortedMeasurements),
61 begin(ret), ledUndistort);
66 #endif // INCLUDED_UndistortMeasurements_h_GUID_EBA50677_306F_4985_BC70_393C58140FE4
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: CameraParameters.h:41
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
cv::Point2f loc
Location in image space - should be undistorted when passed to the Led class.
Definition: LedMeasurement.h:77
t_< detail::transform_< List, Fun >> transform
Given a list and an alias class, apply the alias class to each element in the list and return the res...
Definition: Transform.h:54
LedMeasurementVec undistortLeds(LedMeasurementVec const &distortedMeasurements, CameraParameters const &camParams)
Perform the undistortion of LED measurements.
Definition: UndistortMeasurements.h:45
Definition: LedMeasurement.h:41
Definition: CameraDistortionModel.h:39