EasyMVS
simple 3D reconstruction framework
Public Types | Public Member Functions | Protected Attributes | List of all members
CameraObject Class Referenceabstract

this is the base class of all types of cameras, the customized camera type should inherit this class, and implement the virtual methods in this class and OpenCV VideoCapture class. More...

#include <CameraObject.h>

Inheritance diagram for CameraObject:
Inheritance graph
[legend]
Collaboration diagram for CameraObject:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< CameraObject >
 shared pointer
 
- Public Types inherited from DataFlowObject
using Ptr = std::shared_ptr< DataFlowObject >
 the shared pointer type of DataFlowObject
 

Public Member Functions

 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...
 
- Public Member Functions inherited from DataFlowObject
 DataFlowObject ()
 Construct a new Data Flow Object object.
 
virtual ~DataFlowObject ()
 Destroy the Data Flow Object object.
 
- Public Member Functions inherited from MVSObject
 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...
 

Protected Attributes

std::string CameraName
 
cv::Size2i ImageSize
 

Additional Inherited Members

- Static Public Member Functions inherited from DataFlowObject
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)
 
- Protected Member Functions inherited from MVSObject
bool isDirExist (std::string path)
 check if the directory is exist. More...
 
bool mkdir (std::string path)
 create directory in given path. More...
 

Detailed Description

this is the base class of all types of cameras, the customized camera type should inherit this class, and implement the virtual methods in this class and OpenCV VideoCapture class.

Constructor & Destructor Documentation

◆ CameraObject() [1/2]

CameraObject::CameraObject ( )

Construct a new Camera Object object.

Parameters
CameraNamethe unique name of Camera

◆ CameraObject() [2/2]

CameraObject::CameraObject ( std::string  CameraName)

Construct a new Camera Object object.

Parameters
CameraNamecamera name

Member Function Documentation

◆ getCameraName()

std::string CameraObject::getCameraName ( )

Get the Camera Name.

Returns
std::string Camera name

◆ load()

bool CameraObject::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
fsthe json handler
Returns
true load successfully
false load failed or initialization falied.

Implements MVSObject.

Reimplemented in PinholeCamera.

◆ open()

bool CameraObject::open ( )
virtual

open the camera with the preloaded parameter

Returns
true
false

Reimplemented in PinholeImageReader.

◆ save()

bool CameraObject::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
fsthe json handler
Returns
true save successfully
false save failed

Implements MVSObject.

Reimplemented in PinholeCamera.

◆ type_name()

std::string CameraObject::type_name ( )
overridevirtual

get the typename.

Returns

Reimplemented from MVSObject.

Reimplemented in PinholeImageReader, and PinholeCamera.

◆ undistort()

virtual bool CameraObject::undistort ( const cv::Mat &  src,
cv::Mat &  dst 
)
pure virtual

Transforms an image to compensate for lens distortion. this is a pure virtual function, the real undistort algorithm should be implemented.

Parameters
srcInput (distorted) image.
dstOutput (corrected) image that has the same size and type as src.
Returns
true successfully undistort
false undistort failed

Implemented in PinholeCamera.


The documentation for this class was generated from the following files: