this is the base class of all pinhole cameras, which is the common camera type. this class implement the common pinhole camera module, which include classic 3x3 camera intrinsic matrix, and distortion module the detailed information of this camera module can be found in OpenCV document "Camera Calibration and 3D Reconstruction" part
More...
#include <CameraObject.h>
|
| PinholeCamera (const cv::Mat1d &CameraMatrix=cv::Mat1d(), const cv::Mat1d &DistCoeff=cv::Mat1d()) |
| Construct a new Pinhole Camera object. More...
|
|
virtual | ~PinholeCamera () |
| Destroy the Pinhole Camera object.
|
|
virtual bool | undistort (const cv::Mat &src, cv::Mat &dst) override |
| Transforms an image to compensate for lens distortion. this is a pure virtual function, the real undistort algorithm should be implemented. More...
|
|
std::tuple< cv::Mat1d, cv::Mat1d > | getCameraParameters () |
| Get the Camera Parameters. More...
|
|
bool | updateCameraMatrix (const cv::Mat1d &CameraMatrix) |
| set the new camera intrinsic matrix More...
|
|
bool | updateDistCoeff (const cv::Mat1d &DistCoeff) |
|
virtual std::string | type_name () override |
| get the typename. More...
|
|
virtual bool | save (JsonNode &fs) override |
| save data and settings to file More...
|
|
virtual bool | load (JsonNode &fs) override |
| load data and settings from file More...
|
|
| CameraObject () |
| Construct a new Camera Object object. More...
|
|
| CameraObject (std::string CameraName) |
| Construct a new Camera Object object. More...
|
|
virtual | ~CameraObject () |
| Destroy the Camera Object object.
|
|
std::string | getCameraName () |
| Get the Camera Name. More...
|
|
virtual bool | undistort (const cv::Mat &src, cv::Mat &dst)=0 |
| Transforms an image to compensate for lens distortion. this is a pure virtual function, the real undistort algorithm should be implemented. More...
|
|
virtual bool | open () |
| open the camera with the preloaded parameter More...
|
|
bool | save (JsonNode &fs) override |
| save data and settings to file More...
|
|
bool | load (JsonNode &fs) override |
| load data and settings from file More...
|
|
virtual std::string | type_name () override |
| get the typename. More...
|
|
| DataFlowObject () |
| Construct a new Data Flow Object object.
|
|
virtual | ~DataFlowObject () |
| Destroy the Data Flow Object object.
|
|
| MVSObject () |
| Construct a new MVSObject object.
|
|
virtual | ~MVSObject () |
| Destroy the MVSObject object.
|
|
virtual bool | save (JsonNode &fs)=0 |
| save data and settings to file More...
|
|
virtual bool | load (JsonNode &fs)=0 |
| load data and settings from file More...
|
|
virtual std::string | type_name () |
| get the typename. More...
|
|
|
static Ptr | Create (const cv::Mat1d &CameraMatrix=cv::Mat1d(), const cv::Mat1d &DistCoeff=cv::Mat1d()) |
| Creates PinholeCamera object. More...
|
|
static void | cvMat2Sophus (const cv::Mat1d &Mat, Sophus::SE3d &Pose) |
| create shared pointer of DataFlowObject, do NOT use this method directly, use the Create() method in derived class. More...
|
|
static void | Sophus2cvMat (const Sophus::SE3d &pose, cv::Mat1d &Mat) |
|
static cv::Mat1d | Rt2T (const cv::Mat1d &R, const cv::Mat1d &t) |
|
static std::tuple< cv::Mat1d, cv::Mat1d > | T2Rt (const cv::Mat1d &T) |
|
|
cv::Mat1d | CameraMatrix |
| Camera Intrinsic Matrix.
|
|
cv::Mat1d | DistCoeff |
| Camera Distortion Parameters.
|
|
std::string | CameraName |
|
cv::Size2i | ImageSize |
|
|
bool | isDirExist (std::string path) |
| check if the directory is exist. More...
|
|
bool | mkdir (std::string path) |
| create directory in given path. More...
|
|
this is the base class of all pinhole cameras, which is the common camera type. this class implement the common pinhole camera module, which include classic 3x3 camera intrinsic matrix, and distortion module the detailed information of this camera module can be found in OpenCV document "Camera Calibration and 3D Reconstruction" part
◆ PinholeCamera()
PinholeCamera::PinholeCamera |
( |
const cv::Mat1d & |
CameraMatrix = cv::Mat1d() , |
|
|
const cv::Mat1d & |
DistCoeff = cv::Mat1d() |
|
) |
| |
Construct a new Pinhole Camera object.
- Parameters
-
CameraName | the unique name of Camera |
CameraMatrix | the 3x3 camera intrinsic matrix |
DistCoeff | the camera distortion parameters |
◆ Create()
PinholeCamera::Ptr PinholeCamera::Create |
( |
const cv::Mat1d & |
CameraMatrix = cv::Mat1d() , |
|
|
const cv::Mat1d & |
DistCoeff = cv::Mat1d() |
|
) |
| |
|
static |
Creates PinholeCamera object.
- Parameters
-
CameraName | the unique name of Camera |
CameraMatrix | the 3x3 camera intrinsic matrix |
DistCoeff | the camera distortion parameters |
- Returns
- Ptr the shared pointer of PinholeCamera class
◆ getCameraParameters()
std::tuple< cv::Mat1d, cv::Mat1d > PinholeCamera::getCameraParameters |
( |
| ) |
|
Get the Camera Parameters.
- Returns
- std::tuple<cv::Mat1d, cv::Mat1d> Camera intrinsic matrix and distortion parameters
◆ load()
bool PinholeCamera::load |
( |
JsonNode & |
fs | ) |
|
|
overridevirtual |
load data and settings from file
this method will load data such as keypoints, descriptors, translation matrices in DataFlowObject and its sub-classes from the given JsonNode instance. or will load parameters and settings in WorkFlowObject and its sub-classes to the given JsonNode instance, and automatically initialize the WorkFlow with these parameters
- Parameters
-
- Returns
- true load successfully
-
false load failed or initialization falied.
Reimplemented from CameraObject.
Reimplemented in PinholeImageReader.
◆ save()
bool PinholeCamera::save |
( |
JsonNode & |
fs | ) |
|
|
overridevirtual |
save data and settings to file
this method will save data such as keypoints, descriptors, translation matrices in DataFlowObject and its sub-classes to the given JsonNode instance, or will save parameters and settings in WorkFlowObject and its sub-classes to the given JsonNode instance.
- Parameters
-
- Returns
- true save successfully
-
false save failed
Reimplemented from CameraObject.
Reimplemented in PinholeImageReader.
◆ type_name()
std::string PinholeCamera::type_name |
( |
| ) |
|
|
overridevirtual |
◆ undistort()
bool PinholeCamera::undistort |
( |
const cv::Mat & |
src, |
|
|
cv::Mat & |
dst |
|
) |
| |
|
overridevirtual |
Transforms an image to compensate for lens distortion. this is a pure virtual function, the real undistort algorithm should be implemented.
- Parameters
-
src | Input (distorted) image. |
dst | Output (corrected) image that has the same size and type as src. |
- Returns
- true successfully undistort
-
false undistort failed
Implements CameraObject.
◆ updateCameraMatrix()
bool PinholeCamera::updateCameraMatrix |
( |
const cv::Mat1d & |
CameraMatrix | ) |
|
set the new camera intrinsic matrix
- Parameters
-
CameraMatrix | new camera intrinsic matrix |
- Returns
- true update
-
false update failed
◆ updateDistCoeff()
bool PinholeCamera::updateDistCoeff |
( |
const cv::Mat1d & |
DistCoeff | ) |
|
- Parameters
-
DistCoeff | set the new camera distortion parameters |
- Returns
- true
-
false
The documentation for this class was generated from the following files:
- C:/Users/ZhouZishun/Documents/Workspace/EasyMVS/core/common/CameraObject.h
- C:/Users/ZhouZishun/Documents/Workspace/EasyMVS/core/common/CameraObject.cpp