32 : offset_(
NULL), width_(0), height_(0), overscan_(0.0), threads_(1) {
38 height_(
from.height_),
39 overscan_(
from.overscan_),
40 threads_(
from.threads_) {
42 offset_ =
new Offset[width_ * height_];
43 memcpy(offset_,
from.offset_,
sizeof(
Offset) * width_ * height_);
64 : image_width_(0), image_height_(0), K_(
Mat3::Identity()) {
68 : image_width_(
from.image_width_),
69 image_height_(
from.image_height_),
71 distort_(
from.distort_),
72 undistort_(
from.undistort_) {
110 double* normalized_x,
111 double* normalized_y)
const {
119 double* image_y)
const {
176 double* image_y)
const {
194 double* normalized_x,
195 double* normalized_y)
const {
215 packed_intrinsics->SetK1(
k1());
216 packed_intrinsics->SetK2(
k2());
217 packed_intrinsics->SetK3(
k3());
219 packed_intrinsics->SetP1(
p1());
220 packed_intrinsics->SetP2(
p2());
228 packed_intrinsics.GetK2(),
229 packed_intrinsics.GetK3());
255 double* image_y)
const {
270 double* normalized_x,
271 double* normalized_y)
const {
287 packed_intrinsics->SetK1(
k1());
288 packed_intrinsics->SetK2(
k2());
295 SetDistortion(packed_intrinsics.GetK1(), packed_intrinsics.GetK2());
318 double* image_y)
const {
335 double* normalized_x,
336 double* normalized_y)
const {
354 packed_intrinsics->SetK1(
k1());
355 packed_intrinsics->SetK2(
k2());
361 SetDistortion(packed_intrinsics.GetK1(), packed_intrinsics.GetK2());
397 double* image_y)
const {
416 double* normalized_x,
417 double* normalized_y)
const {
437 packed_intrinsics->SetK1(
k1());
438 packed_intrinsics->SetK2(
k2());
439 packed_intrinsics->SetK3(
k3());
440 packed_intrinsics->SetK4(
k4());
442 packed_intrinsics->SetP1(
p1());
443 packed_intrinsics->SetP2(
p2());
450 packed_intrinsics.GetK2(),
451 packed_intrinsics.GetK3(),
452 packed_intrinsics.GetK4());
468 #define PRINT_NONZERO_COEFFICIENT(intrinsics, coeff) \
470 if (intrinsics->coeff() != 0.0) { \
471 os << " " #coeff "=" << intrinsics->coeff(); \
512 default:
LOG(FATAL) <<
"Unknown distortion model.";
515 #undef PRINT_NONZERO_COEFFICIENT
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
void ApplyIntrinsics(double normalized_x, double normalized_y, double *image_x, double *image_y) const override
virtual void Unpack(const PackedIntrinsics &packed_intrinsics) override
virtual void Pack(PackedIntrinsics *packed_intrinsics) const override
void SetRadialDistortion(double k1, double k2, double k3, double k4)
void SetTangentialDistortion(double p1, double p2)
void InvertIntrinsics(double image_x, double image_y, double *normalized_x, double *normalized_y) const override
void SetPrincipalPoint(double cx, double cy)
double principal_point_y() const
void SetFocalLength(double focal_x, double focal_y)
void NormalizedToImageSpace(double normalized_x, double normalized_y, double *image_x, double *image_y) const
virtual void Unpack(const PackedIntrinsics &packed_intrinsics)
virtual void Pack(PackedIntrinsics *packed_intrinsics) const
void SetImageSize(int width, int height)
double principal_point_x() const
double focal_length_x() const
void SetK(const Mat3 new_k)
double focal_length() const
void SetThreads(int threads)
double focal_length_y() const
virtual DistortionModelType GetDistortionModelType() const =0
void ImageSpaceToNormalized(double image_x, double image_y, double *normalized_x, double *normalized_y) const
virtual void Unpack(const PackedIntrinsics &packed_intrinsics) override
DivisionCameraIntrinsics()
virtual void Pack(PackedIntrinsics *packed_intrinsics) const override
void InvertIntrinsics(double image_x, double image_y, double *normalized_x, double *normalized_y) const override
void ApplyIntrinsics(double normalized_x, double normalized_y, double *image_x, double *image_y) const override
void SetDistortion(double k1, double k2)
virtual void Pack(PackedIntrinsics *packed_intrinsics) const override
void InvertIntrinsics(double image_x, double image_y, double *normalized_x, double *normalized_y) const override
virtual void Unpack(const PackedIntrinsics &packed_intrinsics) override
void SetDistortion(double k1, double k2)
void ApplyIntrinsics(double normalized_x, double normalized_y, double *image_x, double *image_y) const override
double GetPrincipalPointY() const
void SetFocalLength(double focal_length)
double GetFocalLength() const
double GetPrincipalPointX() const
void SetPrincipalPoint(double x, double y)
virtual void Pack(PackedIntrinsics *packed_intrinsics) const override
void InvertIntrinsics(double image_x, double image_y, double *normalized_x, double *normalized_y) const override
void SetTangentialDistortion(double p1, double p2)
virtual void Unpack(const PackedIntrinsics &packed_intrinsics) override
PolynomialCameraIntrinsics()
void SetRadialDistortion(double k1, double k2, double k3)
void ApplyIntrinsics(double normalized_x, double normalized_y, double *image_x, double *image_y) const override
void SetThreads(int threads)
#define PRINT_NONZERO_COEFFICIENT(intrinsics, coeff)
ListBase threads
list of all thread for every CPUDevice in cpudevices a thread exists.
void InvertNukeDistortionModel(const T &focal_length_x, const T &focal_length_y, const T &principal_point_x, const T &principal_point_y, const int image_width, const int image_height, const T &k1, const T &k2, const T &image_x, const T &image_y, T *normalized_x, T *normalized_y)
std::ostream & operator<<(std::ostream &os, const CameraIntrinsics &intrinsics)
A human-readable representation of the camera intrinsic parameters.
void InvertPolynomialDistortionModel(const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y, const double k1, const double k2, const double k3, const double p1, const double p2, const double image_x, const double image_y, double *normalized_x, double *normalized_y)
void ApplyPolynomialDistortionModel(const T &focal_length_x, const T &focal_length_y, const T &principal_point_x, const T &principal_point_y, const T &k1, const T &k2, const T &k3, const T &p1, const T &p2, const T &normalized_x, const T &normalized_y, T *image_x, T *image_y)
Eigen::Matrix< double, 3, 3 > Mat3
void ApplyDivisionDistortionModel(const T &focal_length_x, const T &focal_length_y, const T &principal_point_x, const T &principal_point_y, const T &k1, const T &k2, const T &normalized_x, const T &normalized_y, T *image_x, T *image_y)
void ApplyNukeDistortionModel(const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y, const int image_width, const int image_height, const double k1, const double k2, const double normalized_x, const double normalized_y, double *image_x, double *image_y)
void InvertBrownDistortionModel(const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y, const double k1, const double k2, const double k3, const double k4, const double p1, const double p2, const double image_x, const double image_y, double *normalized_x, double *normalized_y)
void InvertDivisionDistortionModel(const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y, const double k1, const double k2, const double image_x, const double image_y, double *normalized_x, double *normalized_y)
@ DISTORTION_MODEL_POLYNOMIAL
@ DISTORTION_MODEL_DIVISION
void ApplyBrownDistortionModel(const T &focal_length_x, const T &focal_length_y, const T &principal_point_x, const T &principal_point_y, const T &k1, const T &k2, const T &k3, const T &k4, const T &p1, const T &p2, const T &normalized_x, const T &normalized_y, T *image_x, T *image_y)