30 const Eigen::Vector3f& point3d) {
31 if (std::isgreater(point3d[2], 0.f)) {
32 AERROR <<
"The input point (" << point3d
33 <<
") should be in front of the camera";
40 double x[3] = {point3d(1), point3d(0), -point3d(2)};
41 const double norm = sqrt(x[0] * x[0] + x[1] * x[1]);
43 Eigen::Vector2f projection;
44 if (norm < std::numeric_limits<double>::epsilon()) {
50 const double theta = atan(x[2] / norm);
53 const float u =
static_cast<float>(x[0] / norm * rho);
54 const float v =
static_cast<float>(x[1] / norm * rho);
71 size_t width,
size_t height,
const Eigen::VectorXf& params) {
72 if (params.size() < 9) {
73 AINFO <<
"Missing cam2world and world2cam model.";
77 uint32_t cam2world_order = uint32_t(params(8));
78 AINFO <<
"cam2world order: " << cam2world_order <<
", size: " << params.size()
81 if (params.size() < 9 + cam2world_order + 1) {
82 AINFO <<
"Incomplete cam2world model or missing world2cam model.";
86 uint32_t world2cam_order = uint32_t(params(9 + cam2world_order));
87 AINFO <<
"world2cam order: " << world2cam_order <<
", size: " << params.size()
90 if (params.size() < 9 + cam2world_order + 1 + world2cam_order) {
91 AINFO <<
"Incomplete world2cam model.";
111 for (
size_t i = 0; i < cam2world_order; ++i) {
112 cam2world_[
static_cast<uint32_t
>(i)] =
static_cast<double>(params(9 + i));
115 for (
size_t i = 0; i < world2cam_order; ++i) {
117 static_cast<double>(params(10 + cam2world_order + i));