8#include <RobotsIO/Camera/CameraDeprojectionMatrix.h>
13MatrixXd RobotsIO::Camera::deprojection_matrix(
const std::size_t& width,
const std::size_t& height,
const double& fx,
const double& fy,
const double& cx,
const double& cy)
15 MatrixXd deprojection_matrix(3, width * height);
18 for (std::size_t u = 0; u < width; u++)
20 for (std::size_t v = 0; v < height; v++)
22 deprojection_matrix(0, i) = (u - cx) / fx;
23 deprojection_matrix(1, i) = (v - cy) / fy;
24 deprojection_matrix(2, i) = 1.0;
30 return deprojection_matrix;
34Eigen::MatrixXd RobotsIO::Camera::deprojection_matrix(
const CameraParameters& parameters)
36 return RobotsIO::Camera::deprojection_matrix(parameters.width(), parameters.height(), parameters.fx(), parameters.fy(), parameters.cx(), parameters.cy());