Open3D (C++ API)  0.18.0+6e910d9
PinholeCameraIntrinsic.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 
13 
14 namespace open3d {
15 namespace camera {
16 
27 };
28 
33 public:
37 
44  int height,
45  const Eigen::Matrix3d &intrinsic_matrix);
46 
52 
62  int width, int height, double fx, double fy, double cx, double cy);
63 
64  ~PinholeCameraIntrinsic() override;
65 
66 public:
76  int width, int height, double fx, double fy, double cx, double cy) {
77  width_ = width;
78  height_ = height;
79  intrinsic_matrix_.setIdentity();
80  intrinsic_matrix_(0, 0) = fx;
81  intrinsic_matrix_(1, 1) = fy;
82  intrinsic_matrix_(0, 2) = cx;
83  intrinsic_matrix_(1, 2) = cy;
84  }
85 
87  std::pair<double, double> GetFocalLength() const {
89  }
90 
93  std::pair<double, double> GetPrincipalPoint() const {
95  }
96 
98  double GetSkew() const { return intrinsic_matrix_(0, 1); }
99 
101  bool IsValid() const { return (width_ > 0 && height_ > 0); }
102 
103  bool ConvertToJsonValue(Json::Value &value) const override;
104  bool ConvertFromJsonValue(const Json::Value &value) override;
105 
106 public:
108  int width_ = -1;
110  int height_ = -1;
116  Eigen::Matrix3d intrinsic_matrix_;
117 };
118 } // namespace camera
119 } // namespace open3d
Contains the pinhole camera intrinsic parameters.
Definition: PinholeCameraIntrinsic.h:32
std::pair< double, double > GetPrincipalPoint() const
Definition: PinholeCameraIntrinsic.h:93
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: PinholeCameraIntrinsic.cpp:55
int width_
Width of the image.
Definition: PinholeCameraIntrinsic.h:108
std::pair< double, double > GetFocalLength() const
Returns the focal length in a tuple of X-axis and Y-axis focal lengths.
Definition: PinholeCameraIntrinsic.h:87
~PinholeCameraIntrinsic() override
Definition: PinholeCameraIntrinsic.cpp:43
PinholeCameraIntrinsic()
Default Constructor.
Definition: PinholeCameraIntrinsic.cpp:19
bool IsValid() const
Returns true iff both the width and height are greater than 0.
Definition: PinholeCameraIntrinsic.h:101
Eigen::Matrix3d intrinsic_matrix_
Definition: PinholeCameraIntrinsic.h:116
int height_
Height of the image.
Definition: PinholeCameraIntrinsic.h:110
bool ConvertToJsonValue(Json::Value &value) const override
Definition: PinholeCameraIntrinsic.cpp:45
double GetSkew() const
Returns the skew.
Definition: PinholeCameraIntrinsic.h:98
void SetIntrinsics(int width, int height, double fx, double fy, double cx, double cy)
Set camera intrinsic parameters.
Definition: PinholeCameraIntrinsic.h:75
Definition: IJsonConvertible.h:40
int width
Definition: FilePCD.cpp:52
int height
Definition: FilePCD.cpp:53
PinholeCameraIntrinsicParameters
Sets default camera intrinsic parameters for sensors.
Definition: PinholeCameraIntrinsic.h:20
@ PrimeSenseDefault
Default settings for PrimeSense camera sensor.
@ Kinect2DepthCameraDefault
Default settings for Kinect2 depth camera.
@ Kinect2ColorCameraDefault
Default settings for Kinect2 color camera.
OPEN3D_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:49
Definition: PinholeCameraIntrinsic.cpp:16