5#ifndef __OPENCV_RGBD_INTRINSICS_HPP__
6#define __OPENCV_RGBD_INTRINSICS_HPP__
8#include "opencv2/core/matx.hpp"
24 fxinv = 1.f/intr.fx, fyinv = 1.f/intr.fy;
25 cx = intr.cx, cy = intr.cy;
30 T x = p.
z * (p.
x - cx) * fxinv;
31 T y = p.
z * (p.
y - cy) * fyinv;
35 float fxinv, fyinv, cx, cy;
41 inline Projector(
Intr intr) : fx(intr.fx), fy(intr.fy), cx(intr.cx), cy(intr.cy) { }
46 T x = fx*(p.
x*invz) + cx;
47 T y = fy*(p.
y*invz) + cy;
55 T x = fx*pixVec.
x + cx;
56 T y = fy*pixVec.
y + cy;
61 Intr() : fx(), fy(), cx(), cy() { }
62 Intr(
float _fx,
float _fy,
float _cx,
float _cy) : fx(_fx), fy(_fy), cx(_cx), cy(_cy) { }
63 Intr(
cv::Matx33f m) : fx(m(0, 0)), fy(m(1, 1)), cx(m(0, 2)), cy(m(1, 2)) { }
65 inline Intr scale(
int pyr)
const
67 float factor = (1.f /(1 << pyr));
68 return Intr(fx*factor, fy*factor, cx*factor, cy*factor);
70 inline Reprojector makeReprojector()
const {
return Reprojector(*
this); }
71 inline Projector makeProjector()
const {
return Projector(*
this); }
73 inline cv::Matx33f getMat()
const {
return Matx33f(fx, 0, cx, 0, fy, cy, 0, 0, 1); }
Template class for small matrices whose type and size are known at compilation time
Definition: matx.hpp:100
Template class for 3D points specified by its coordinates x, y and z.
Definition: core/types.hpp:240
_Tp z
z coordinate of the 3D point
Definition: core/types.hpp:267
_Tp x
x coordinate of the 3D point
Definition: core/types.hpp:265
_Tp y
y coordinate of the 3D point
Definition: core/types.hpp:266
Template class for 2D points specified by its coordinates x and y.
Definition: core/types.hpp:158
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: intrinsics.hpp:40
Camera intrinsics
Definition: intrinsics.hpp:20
Definition: intrinsics.hpp:16