Skip to content

Class AIAC::Camera

ClassList > AIAC > Camera

Public Attributes

Type Name
bool FlipHorizontal = = false
Flag indicating if the captured image should be flipped.
bool FlipVertical = = false

Public Functions

Type Name
Camera ()
const std::string GetCalibrationFilePath () const
Get the path to the camera calibration parameters.
const cv::Mat GetCameraMatrix ()
Get the camera matrix.
AIAC::Image & GetCenterCroppedCurrentFrame (float ratioX=0.6f, float ratioY=0.75f)
Get the raw current frame, but borders are set to black according to the specified ratio.
AIAC::Image & GetColorCurrentFrame ()
Get the current color (calibrated) frame from the camera.
AIAC::Image & GetCurrentFrame ()
Get the current grayscale (calibrated) frame from the camera.
const cv::Mat GetDistortionCoef ()
Get the distortion coefficients matrix.
const std::pair< float, float > GetFov () const
Get the field of view (FOV) of the camera.
const uint32_t GetHeight () const
Get the calibrated height of the camera frame.
const AIAC::Image GetNextFrame ()
Capture and preprocess the next frame from the camera.
AIAC::Image & GetRawCurrentFrame ()
Get the current raw (uncalibrated) frame from the camera.
const uint32_t GetRawHeight () const
Get the raw (uncalibrated) height of the camera frame.
const uint32_t GetRawWidth () const
Get the raw (uncalibrated) width of the camera frame.
const uint32_t GetWidth () const
Get the calibrated width of the camera frame.
bool IsOpened () const
Check if the camera is opened.
bool IsPhysicalAndParamWidthHeightMatched () const
Check if the physical and parameterized width and height match.
bool LoadCameraParams (const std::string & filePath)
Loads camera parameters from a configuration file.
void Open (int id)
Open the camera with the specified id.
void UpdateCameraParamFromFile (const std::string & filePath)
Force to update the default camera param.
void UpdateCameraParamFromSlamMap (const int paramWidth, const int paramHeight, const cv::Mat & cameraMatrix)
Update the camera parameters from the SLAM-generated map.
void UpdateFov ()
Update the field of view (FOV) values based on camera parameters.
~Camera ()

Public Attributes Documentation

variable FlipHorizontal

Flag indicating if the captured image should be flipped.

bool AIAC::Camera::FlipHorizontal;


variable FlipVertical

bool AIAC::Camera::FlipVertical;

Public Functions Documentation

function Camera

AIAC::Camera::Camera () 

function GetCalibrationFilePath

Get the path to the camera calibration parameters.

inline const std::string AIAC::Camera::GetCalibrationFilePath () const

Returns:

A constant reference to the camera calibration file path.


function GetCameraMatrix

Get the camera matrix.

inline const cv::Mat AIAC::Camera::GetCameraMatrix () 

Returns:

A constant reference to the camera matrix.


function GetCenterCroppedCurrentFrame

Get the raw current frame, but borders are set to black according to the specified ratio.

AIAC::Image & AIAC::Camera::GetCenterCroppedCurrentFrame (
    float ratioX=0.6f,
    float ratioY=0.75f
) 

Parameters:

  • ratioX How much of % the width of the image is kept. (default: 0.75, i.e. 75%).
  • ratioY How much of % the height of the image is kept. (default: 0.9, i.e. 90%).

Returns:

A reference to the center-cropped current frame image.


function GetColorCurrentFrame

Get the current color (calibrated) frame from the camera.

inline AIAC::Image & AIAC::Camera::GetColorCurrentFrame () 

Returns:

A reference to the current color frame image.


function GetCurrentFrame

Get the current grayscale (calibrated) frame from the camera.

inline AIAC::Image & AIAC::Camera::GetCurrentFrame () 

Returns:

A reference to the current grayscale frame image.


function GetDistortionCoef

Get the distortion coefficients matrix.

inline const cv::Mat AIAC::Camera::GetDistortionCoef () 

Returns:

A constant reference to the distortion coefficient matrix.


function GetFov

Get the field of view (FOV) of the camera.

inline const std::pair< float, float > AIAC::Camera::GetFov () const

Returns:

A pair of floats representing the horizontal and vertical FOV of the camera.


function GetHeight

Get the calibrated height of the camera frame.

inline const uint32_t AIAC::Camera::GetHeight () const

Returns:

The calibrated height of the camera frame as an unsigned 32-bit integer.


function GetNextFrame

Capture and preprocess the next frame from the camera.

const AIAC::Image AIAC::Camera::GetNextFrame () 

Returns:

A grayscale image representing the captured and processed frame.


function GetRawCurrentFrame

Get the current raw (uncalibrated) frame from the camera.

inline AIAC::Image & AIAC::Camera::GetRawCurrentFrame () 

Returns:

A reference to the current raw frame image.


function GetRawHeight

Get the raw (uncalibrated) height of the camera frame.

inline const uint32_t AIAC::Camera::GetRawHeight () const

Returns:

The raw height of the camera frame as an unsigned 32-bit integer.


function GetRawWidth

Get the raw (uncalibrated) width of the camera frame.

inline const uint32_t AIAC::Camera::GetRawWidth () const

Returns:

The raw width of the camera frame as an unsigned 32-bit integer.


function GetWidth

Get the calibrated width of the camera frame.

inline const uint32_t AIAC::Camera::GetWidth () const

Returns:

The calibrated width of the camera frame as an unsigned 32-bit integer.


function IsOpened

Check if the camera is opened.

inline bool AIAC::Camera::IsOpened () const

Returns:

True if the camera is opened, false otherwise.


function IsPhysicalAndParamWidthHeightMatched

Check if the physical and parameterized width and height match.

inline bool AIAC::Camera::IsPhysicalAndParamWidthHeightMatched () const

Returns:

True if the physical and parameterized width and height match, false otherwise.


function LoadCameraParams

Loads camera parameters from a configuration file.

bool AIAC::Camera::LoadCameraParams (
    const std::string & filePath
) 

Parameters:

  • filePath The path to the camera parameter configuration file.

Returns:

True if the camera parameters are loaded successfully, false otherwise.


function Open

Open the camera with the specified id.

void AIAC::Camera::Open (
    int id
) 

Parameters:

  • id The id of the camera to open.

function UpdateCameraParamFromFile

Force to update the default camera param.

void AIAC::Camera::UpdateCameraParamFromFile (
    const std::string & filePath
) 

Parameters:

  • filePath The path to the camera param file.

function UpdateCameraParamFromSlamMap

Update the camera parameters from the SLAM-generated map.

void AIAC::Camera::UpdateCameraParamFromSlamMap (
    const int paramWidth,
    const int paramHeight,
    const cv::Mat & cameraMatrix
) 

Parameters:

  • paramWidth Image width for camera calibration.
  • paramHeight Image height for camera calibration.
  • cameraMatrix The camera matrix

function UpdateFov

Update the field of view (FOV) values based on camera parameters.

inline void AIAC::Camera::UpdateFov () 


function ~Camera

inline AIAC::Camera::~Camera () 


The documentation for this class was generated from the following file src/AIAC/Camera.h