FlowEngine 7.530
Photogrammetry Software Development Kit
Loading...
Searching...
No Matches
FlowEngine::CameraInterface Class Referenceabstract

Stores a camera object to feed the Structure from Motion parameters. More...

#include <CameraInterface.h>

Inheritance diagram for FlowEngine::CameraInterface:
FlowEngine::NamedObjectInterface

Public Member Functions

virtual FLE_DLL ~CameraInterface ()=default
 Default virtual destructor.
 
virtual FLE_DLL bool isReconstructed () const =0
 
virtual FLE_DLL ReconstructionID reconstructionId () const =0
 
virtual FLE_DLL Result loadImage (ConstStringBuffer filePath)=0
 
virtual FLE_DLL Result loadMask (ConstStringBuffer filePath, const SettingsInterface &settings)=0
 
virtual FLE_DLL void resetMask ()=0
 Resets the mask of this camera.
 
virtual FLE_DLL Result loadPreviousFrame (ConstStringBuffer filePath)=0
 
virtual FLE_DLL Result loadPivotFrame (ConstStringBuffer filePath)=0
 
virtual FLE_DLL Result getImageFilePath (StringBuffer outImageFilePath) const =0
 
virtual FLE_DLL Size getImageFilePathLength () const =0
 
virtual FLE_DLL Result getPPM (Buffer< double > outPPM) const =0
 
virtual FLE_DLL Result getR (Buffer< double > outR) const =0
 
virtual FLE_DLL Result getT (Point3 &outTranslation) const =0
 
virtual FLE_DLL void getCameraCalibration (CameraCalibrationInterface &outCameraCalibration) const =0
 
virtual FLE_DLL void getDimensions (int &outWidth, int &outHeight) const =0
 
virtual FLE_DLL void setCameraCalibration (const CameraCalibrationInterface &cameraCalibration)=0
 
virtual FLE_DLL Result setPPM (ConstBuffer< double > ppm)=0
 
virtual FLE_DLL Result setR (ConstBuffer< double > rot)=0
 
virtual FLE_DLL Result setT (ConstBuffer< double > translation)=0
 
virtual FLE_DLL Result orientWithControlPointConstraints (ConstBuffer< ControlPointConstraintInterface * > controlPoints, bool adjustInternalParameters, bool adjustRadialDistortion)=0
 
virtual FLE_DLL Result projectPoint (const Point3 &point, Point2 &outImageCoords) const =0
 
virtual FLE_DLL Result computeGroundSampleDistance (double &outMin, double &outMax, double &outMean) const =0
 
virtual FLE_DLL Result loadFromXmp (ConstStringBuffer filePath)=0
 
virtual FLE_DLL Result saveToXmp (ConstStringBuffer filePath) const =0
 
virtual FLE_DLL Result saveUndistortedImage (ConstStringBuffer filePath, Size width=0, Size height=0, Size channelBitDepth=0) const =0
 
virtual FLE_DLL Result generateSTMap (Image &inOutImage) const =0
 
- Public Member Functions inherited from FlowEngine::NamedObjectInterface
virtual FLE_DLL ~NamedObjectInterface ()=default
 Default virtual destructor.
 
virtual FLE_DLL Size getNameLength () const =0
 
virtual FLE_DLL Result getName (StringBuffer outName) const =0
 
virtual FLE_DLL Result setName (ConstStringBuffer name)=0
 

Detailed Description

Stores a camera object to feed the Structure from Motion parameters.

Every camera is bounded to an image and possibly a mask file.

Constructor & Destructor Documentation

◆ ~CameraInterface()

virtual FLE_DLL FlowEngine::CameraInterface::~CameraInterface ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ computeGroundSampleDistance()

virtual FLE_DLL Result FlowEngine::CameraInterface::computeGroundSampleDistance ( double &  outMin,
double &  outMax,
double &  outMean 
) const
pure virtual

Calculates this camera ground sample distance (GSD) statistics. Computation is done based on its relative sparse point cloud.

Parameters
[out]outMinthe minimum GSD of this camera.
[out]outMaxthe maximum GSD of this camera.
[out]outMeanthe mean GSD of this camera.
Precondition
the camera must have been processed with one of the following functions:
  • FlowEngine::computeStructureAndMotion
  • FlowEngine::computeStructureAndMotionConstrained
  • FlowEngine::computeSparsePointCloudFromKnownPPM
  • FlowEngine::performBundleAdjustment
Returns
One of the following result codes:
Note
This feature is not available in the free version of the SDK.

◆ generateSTMap()

virtual FLE_DLL Result FlowEngine::CameraInterface::generateSTMap ( Image inOutImage) const
pure virtual

Generates a distortion map based on the dimensions of this camera image and its camera calibration. Colours in the red and green channel describe the way the individual pixels are warped to apply or remove lens distortion from an image. Blue channel is zero. Values are in the [0.0, 1.0] range.

Precondition
This camera must have a valid CameraCalibration object assigned.
Parameters
[in,out]inOutImagea buffer that will receive the ST-Map data. The buffer must be big enough to receive a 3-channel float image of the same dimensions of this camera's image.
Returns
One of the following result codes:

◆ getCameraCalibration()

virtual FLE_DLL void FlowEngine::CameraInterface::getCameraCalibration ( CameraCalibrationInterface outCameraCalibration) const
pure virtual

Returns the camera calibration associated with this camera.

Parameters
[in,out]outCameraCalibrationa valid CameraCalibration object that receives the data

◆ getDimensions()

virtual FLE_DLL void FlowEngine::CameraInterface::getDimensions ( int &  outWidth,
int &  outHeight 
) const
pure virtual

Returns the camera image dimensions.

Parameters
[in,out]outWidththe width in pixels
[in,out]outHeightthe height in pixels

◆ getImageFilePath()

virtual FLE_DLL Result FlowEngine::CameraInterface::getImageFilePath ( StringBuffer  outImageFilePath) const
pure virtual

Returns the camera image file path

Parameters
[in,out]outImageFilePathbuffer that receives the UTF-8 encoded path to the image file. The buffer must be at least getImageFilePathLength() long

◆ getImageFilePathLength()

virtual FLE_DLL Size FlowEngine::CameraInterface::getImageFilePathLength ( ) const
pure virtual

Returns the camera image file path length

Returns
the number of characters required to hold the image file path string (excluding the termination character)

◆ getPPM()

virtual FLE_DLL Result FlowEngine::CameraInterface::getPPM ( Buffer< double >  outPPM) const
pure virtual

Returns the camera projection matrix (PPM) composed as A * [R t] (3x4). This function is not available in the free version of the SDK.

Parameters
[out]outPPMbuffer that receives ppm matrix elements in row-major order. The buffer must be at least 12 elements big.

◆ getR()

virtual FLE_DLL Result FlowEngine::CameraInterface::getR ( Buffer< double >  outR) const
pure virtual

Returns the camera rotation R (3x3). This function is not available in the free version of the SDK.

Parameters
[out]outRbuffer that receives rotation matrix elements in row-major order. The buffer must be at least 9 elements big.

◆ getT()

virtual FLE_DLL Result FlowEngine::CameraInterface::getT ( Point3 outTranslation) const
pure virtual

Returns the camera translation. This function is not available in the free version of the SDK.

Parameters
[out]outTranslationthe camera translation

◆ isReconstructed()

virtual FLE_DLL bool FlowEngine::CameraInterface::isReconstructed ( ) const
pure virtual

Check if the cameras has a valid reconstruction

Returns
true if the camera is reconstructed (i.e. sees some points)

◆ loadFromXmp()

virtual FLE_DLL Result FlowEngine::CameraInterface::loadFromXmp ( ConstStringBuffer  filePath)
pure virtual

Loads camera parameters from an XMP file.

Parameters
[in]filePathstring buffer that contains the UTF-8 file path
Returns

◆ loadImage()

virtual FLE_DLL Result FlowEngine::CameraInterface::loadImage ( ConstStringBuffer  filePath)
pure virtual

Loads an image from disk. The camera source image file path is updated accordingly.

Parameters
[in]filePathstring buffer containing the UTF-8 encoded path to the image file.
Returns
One of the following result codes:

◆ loadMask()

virtual FLE_DLL Result FlowEngine::CameraInterface::loadMask ( ConstStringBuffer  filePath,
const SettingsInterface settings 
)
pure virtual

Set and load the mask from file. The mask can be a .bim or image file. The mask must be of the same size as the input image size.

Parameters
[in]filePathUTF-8 encoded path to the mask file
[in]settingsthe settings that will be queried for configuration parameters.

◆ loadPivotFrame()

virtual FLE_DLL Result FlowEngine::CameraInterface::loadPivotFrame ( ConstStringBuffer  filePath)
pure virtual

Set the previous frame path and load the image (used by FlowEngineInterface::adaptMeshWithOpticalFlow)

Parameters
[in]filePathstring buffer containing the UTF-8 encoded path to the image file. This (along with the previous frame) will make the camera object suitable for optical flow computation FlowEngineInterface::adaptMeshWithOpticalFlow.
Returns
One of the following result codes:

◆ loadPreviousFrame()

virtual FLE_DLL Result FlowEngine::CameraInterface::loadPreviousFrame ( ConstStringBuffer  filePath)
pure virtual

Set the previous frame path and load the image (used by FlowEngineInterface::adaptMeshWithOpticalFlow)

Parameters
[in]filePathstring buffer containing the UTF-8 encoded path to the image file. This (along with the pivot frame) will make the camera object suitable for optical flow computation FlowEngineInterface::adaptMeshWithOpticalFlow.
Returns
One of the following result codes:

◆ orientWithControlPointConstraints()

virtual FLE_DLL Result FlowEngine::CameraInterface::orientWithControlPointConstraints ( ConstBuffer< ControlPointConstraintInterface * >  controlPoints,
bool  adjustInternalParameters,
bool  adjustRadialDistortion 
)
pure virtual

Orients the camera given a set of control points.

Parameters
[in]controlPointsa buffer of control points that will be used for adjustment. They must have a valid world position.
[in]adjustInternalParametersadjust the internal parameters (focal, principal point and radial distortion).
[in]adjustRadialDistortionadjust the radial distortion.
Precondition
this camera must have a valid camera calibration.
Returns
One of the following result codes:

◆ projectPoint()

virtual FLE_DLL Result FlowEngine::CameraInterface::projectPoint ( const Point3 point,
Point2 outImageCoords 
) const
pure virtual

Projects a point in the image plane using the current camera parameters.

Parameters
[in]point3D point containing x-y-z.
[out]outImageCoords2D image coordinates x-y in the image.
Returns
One of the following result codes:

◆ reconstructionId()

virtual FLE_DLL ReconstructionID FlowEngine::CameraInterface::reconstructionId ( ) const
pure virtual
Returns
the reconstruction id of this camera
Note
The reconstruction id is an identification number unique amongst a set of reconstructed cameras. Suitable to use in maps to keep track of cameras (e.g.: when querying for visibility information)
Precondition
a camera must have been processed with one of the following functions:
  • FlowEngine::computeStructureAndMotion
  • FlowEngine::computeStructureAndMotionConstrained
  • FlowEngine::computeSparsePointCloudFromKnownPPM
  • FlowEngine::performBundleAdjustment

◆ resetMask()

virtual FLE_DLL void FlowEngine::CameraInterface::resetMask ( )
pure virtual

Resets the mask of this camera.

◆ saveToXmp()

virtual FLE_DLL Result FlowEngine::CameraInterface::saveToXmp ( ConstStringBuffer  filePath) const
pure virtual

Saves the camera parameters to an XMP file.

Parameters
[in]filePathstring buffer that contains the UTF-8 file path.
Returns
One of the following result codes:
Note
This function is not available in the free version of the SDK.

◆ saveUndistortedImage()

virtual FLE_DLL Result FlowEngine::CameraInterface::saveUndistortedImage ( ConstStringBuffer  filePath,
Size  width = 0,
Size  height = 0,
Size  channelBitDepth = 0 
) const
pure virtual

Save the undistorted version of this camera image to the specified file path.

Parameters
[in]filePathstring buffer that contains the UTF-8 encoded path to save the image to. Can be any extension supported by ImageMagick.
[in]width(optional) the output image width. When left to default (zero), the output image will keep the original width.
[in]height(optional) the output image height. When left to default (zero), the output image will keep the original height.
[in]channelBitDepth(optional) the output image bitdepth. When left to default (zero), it will be automatically choosen from the format.
Precondition
  • a successful call to loadImage (directly or via a FlowEngine::CameraLoaderInterface).
  • a valid camera calibration associated to this camera.
Returns
One of the following result codes:
Note
This feature is not available in the free version of the SDK.

◆ setCameraCalibration()

virtual FLE_DLL void FlowEngine::CameraInterface::setCameraCalibration ( const CameraCalibrationInterface cameraCalibration)
pure virtual

Set the camera calibration associated with this camera

Parameters
[in]cameraCalibrationa valid CameraCalibration object

◆ setPPM()

virtual FLE_DLL Result FlowEngine::CameraInterface::setPPM ( ConstBuffer< double >  ppm)
pure virtual

Set the camera extrinsic parameters Rotation and translation are extracted with the given ppm

Parameters
[in]ppma 12 element buffer of doubles. Data is read in row-major order

◆ setR()

virtual FLE_DLL Result FlowEngine::CameraInterface::setR ( ConstBuffer< double >  rot)
pure virtual

Set the camera Rotation R matrix

Parameters
[in]rota 9 element buffer of doubles. Data is read in row-major order

◆ setT()

virtual FLE_DLL Result FlowEngine::CameraInterface::setT ( ConstBuffer< double >  translation)
pure virtual

Set the camera translation t vector

Parameters
[in]translationa 3 element buffer of doubles. Data is read in row-major order