Class 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.
variable FlipVertical¶
Public Functions Documentation¶
function Camera¶
function GetCalibrationFilePath¶
Get the path to the camera calibration parameters.
Returns:
A constant reference to the camera calibration file path.
function GetCameraMatrix¶
Get the camera matrix.
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.
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.
Returns:
A reference to the current color frame image.
function GetCurrentFrame¶
Get the current grayscale (calibrated) frame from the camera.
Returns:
A reference to the current grayscale frame image.
function GetDistortionCoef¶
Get the distortion coefficients matrix.
Returns:
A constant reference to the distortion coefficient matrix.
function GetFov¶
Get the field of view (FOV) of the camera.
Returns:
A pair of floats representing the horizontal and vertical FOV of the camera.
function GetHeight¶
Get the calibrated height of the camera frame.
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.
Returns:
A grayscale image representing the captured and processed frame.
function GetRawCurrentFrame¶
Get the current raw (uncalibrated) frame from the camera.
Returns:
A reference to the current raw frame image.
function GetRawHeight¶
Get the raw (uncalibrated) height of the camera frame.
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.
Returns:
The raw width of the camera frame as an unsigned 32-bit integer.
function GetWidth¶
Get the calibrated width of the camera frame.
Returns:
The calibrated width of the camera frame as an unsigned 32-bit integer.
function IsOpened¶
Check if the camera is opened.
Returns:
True if the camera is opened, false otherwise.
function IsPhysicalAndParamWidthHeightMatched¶
Check if the physical and parameterized width and height match.
Returns:
True if the physical and parameterized width and height match, false otherwise.
function LoadCameraParams¶
Loads camera parameters from a configuration file.
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.
Parameters:
id
The id of the camera to open.
function UpdateCameraParamFromFile¶
Force to update the default camera param.
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.
function ~Camera¶
The documentation for this class was generated from the following file src/AIAC/Camera.h