RVC  1.15.0
a product by RVBUST.
RVC::X2 Struct Reference

X2 struct. More...

#include <RVC.h>

Classes

struct  CalculationCallBackInfo
 X2 CalculationCallBackInfo. More...
 
struct  CaptureOptions
 Capture options. More...
 
struct  CollectionCallBackInfo
 X2 CollectionCallBackInfo. More...
 
struct  CustomTransformOptions
 Options when setting custom transformation. More...
 
struct  FixedLineScanCallBackInfo
 Callback information structure for fixed-line scan mode. More...
 

Public Types

typedef void(* CollectionCallBackPtr) (X2::CollectionCallBackInfo, X2::CaptureOptions, UserPtr)
 X2 CallBackPtr.
 
typedef void(* CalculationCallBackPtr) (X2::CalculationCallBackInfo, X2::CaptureOptions, UserPtr)
 
typedef void(* FixedLineScanCallBackPtr) (X2::FixedLineScanCallBackInfo, UserPtr)
 

Public Member Functions

bool IsValid ()
 Check X2 is valid or not before use X2. More...
 
bool Open ()
 Open X2 before you use it. More...
 
void Close ()
 Close X2 after you Open it.
 
bool IsOpen ()
 Check X2 is open or not. More...
 
bool IsPhysicallyConnected ()
 Check X2 is physically connected or not. More...
 
bool OpenProtectiveCover ()
 Open ProtectiveCover. More...
 
bool OpenProtectiveCoverAsync ()
 Open ProtectiveCover Async. More...
 
bool CloseProtectiveCover ()
 Close ProtectiveCover. More...
 
bool CloseProtectiveCoverAsync ()
 Close ProtectiveCover Async. More...
 
bool ResetProtectiveCover ()
 Reset ProtectiveCover. More...
 
bool GetProtectiveCoverStatus (ProtectiveCoverStatus &status)
 Get Status of ProtectiveCover. More...
 
bool SetCollectionCallBack (X2::CollectionCallBackPtr cb, UserPtr ctx)
 Provide a callback to RVC system and it will be called when collection finished. More...
 
bool SetCalculationCallBack (X2::CalculationCallBackPtr cb, UserPtr ctx)
 Provide a callback to RVC system and it will be called when calculation finished. More...
 
bool Capture (const CaptureOptions &opts)
 Capture one point map and one image.This function will save capture options into camera. More...
 
bool Capture ()
 Capture one point map and one image.This function will load capture options from camera. More...
 
bool StartFixedLineScan (const CaptureOptions &opts)
 Start capture fixed line scan. Only support CaptureMode_FixedLineScan mode. This function will save capture options into camera. Need to call the StopFixedLineScan interface to manually stop. More...
 
bool StartFixedLineScan ()
 Start capture fixed line scan. Only support CaptureMode_FixedLineScan mode. Need to call the StopFixedLineScan interface to manually stop. More...
 
PointMap GetFixedLineScanPointMap ()
 Get fixed line scan point map. More...
 
bool GetFixedLineScanPointMap (PointMap &point_map)
 Get fixed line scan point map. More...
 
bool StopFixedLineScan ()
 Stop capture fixed line scan. More...
 
bool Capture2D (const CameraID cid, const CaptureOptions &opts)
 
bool Capture2D (const CameraID cid)
 
bool SetBandwidth (float percent)
 Set the camera band width ratio. More...
 
bool GetBandwidth (float &percent)
 Get the camera band width ratio. More...
 
bool SetCustomTransformation (const CustomTransformOptions &opts)
 Set the Transformation of output point cloud. More...
 
bool GetCustomTransformation (CustomTransformOptions &opts)
 Get the Custom Transformation object. More...
 
PointMap GetPointMap ()
 Get the Point Map object. More...
 
Image GetImage (const CameraID cid)
 Get the Image object. More...
 
DepthMap GetDepthMap ()
 Get the DepthMap object. More...
 
ConfidenceMap GetConfidenceMap ()
 Get the Confidence Map object. More...
 
CorrespondMap GetCorrespondMap ()
 Get the Correspond Map object. More...
 
bool GetExtrinsicMatrix (const CameraID cid, float *matrix)
 Get the extrinsic matrix (transformation from calibration board to specified camera) More...
 
bool GetIntrinsicParameters (const CameraID cid, float *instrinsicMatrix, float *distortion)
 Get intrinsic and distortion parameters of the specified camera. More...
 
bool GetProjectorTemperature (float &temperature)
 GetProjectorTemperature. More...
 
bool GetCameraTemperature (const CameraID cid, CameraTempSelector seletor, float &temperature)
 GetCameraTemperature. More...
 
bool AutoWhiteBalance (int wb_times=10, const CaptureOptions &opts=CaptureOptions(), const RVC::ROI &roi=RVC::ROI())
 Only Color Camera can use this function. This function can get suitable white balance paramters. More...
 
bool GetExposureTimeRange (int *min_value, int *max_value)
 Get the Exposure Time Range. More...
 
bool GetGainRange (float *min_value, float *max_value)
 Get the Gain Range. More...
 
bool GetGammaRange (float *min_value, float *max_value)
 Get the Gamma Range. More...
 
bool SaveEncodedImagesData (const char *addr)
 Save encoded map in txt. More...
 
bool SaveCaptureOptionParameters (const X2::CaptureOptions &opts)
 Save capture option parameters. More...
 
bool LoadCaptureOptionParameters (X2::CaptureOptions &opts)
 Get capture option parameters. More...
 
bool GetAutoCaptureSetting (CaptureOptions &opts, const ROI &roi=ROI())
 Get auto capture setting. Exposure_time_2d, exposure_time_3d, projector_brightness, light_contrast_threshold will be adjusted automatically. automatically. More...
 
bool GetAutoHdrCaptureSetting (CaptureOptions &opts, const ROI &roi)
 adjust 3D capturing parameters More...
 
bool GetAutoNoiseRemovalSetting (CaptureOptions &opts)
 Automatically calculates and applies the optimal point cloud noise removal parameters. More...
 
bool LoadSettingFromFile (const char *filename)
 Load camera setting from local file . More...
 
bool SaveSettingToFile (const char *filename)
 Save camera setting to local file. More...
 
bool CheckRoi (ROI roi)
 Check whether the parameters of ROI meet the requirements. More...
 
ROI AutoAdjustRoi (ROI roi=ROI())
 Automatically correct the parameters of ROI. You need to correct ROI before Capture/Captrue2D. More...
 
bool GetRoiRange (ROIRange &range)
 Get the range of ROI.
 
bool GetCameraResolution (Size &resolution)
 Get Camera Resolution. More...
 
Mesh GetMesh ()
 Get the Mesh object. More...
 
bool SetFixedLineScanCallback (const X2::FixedLineScanCallBackPtr cb, UserPtr ctx)
 Registers callback for point cloud results in fixed line scan mode. More...
 
bool GetTimestamp (uint64_t &timestamp)
 Retrieves the camera timestamp in microseconds (us) More...
 
bool ResetTimestamp ()
 Resets the camera timestamp to zero. More...
 
bool GetAuto2DExposureTime (CaptureOptions &opts, const ROI &roi=ROI())
 Get auto 2d exposure time automatically. More...
 
bool SetCurrentUserSet (const int &id)
 Set Current User Set by id. The user can utilize a total of 10 parameters groups to quickly adjust camera settings for different 3d imaging scenarios. More...
 
bool GetCurrentUserSet (int &id)
 Get Current User Set's id. More...
 
bool SetUserSetName (const int &id, const char *name)
 Set User Set's name with id. The user can briefly describe the usage scenario of this parameters groups by using a name. More...
 
bool GetUserSetName (const int &id, char *name)
 Get Current User Set's name with id. More...
 

Static Public Member Functions

static X2 Create (const Device &d)
 Create a RVC X Camera before you use x2. More...
 
static void Destroy (X2 &x)
 Release all X2 resources after you use X2. More...
 

Public Attributes

Handle m_handle
 

Detailed Description

X2 struct.

Member Function Documentation

◆ AutoAdjustRoi()

ROI RVC::X2::AutoAdjustRoi ( ROI  roi = ROI())

Automatically correct the parameters of ROI. You need to correct ROI before Capture/Captrue2D.

Parameters
roi[in] If you want to get a maximum ROI, you can pass in the default value.
Returns
ROI Corrected ROI.

◆ AutoWhiteBalance()

bool RVC::X2::AutoWhiteBalance ( int  wb_times = 10,
const CaptureOptions opts = CaptureOptions(),
const RVC::ROI roi = RVC::ROI() 
)

Only Color Camera can use this function. This function can get suitable white balance paramters.

Parameters
wb_timeshow many images used for calculate the white balance paramters
optscapture options. exposure_time_2d, gain_2d, gamma_2d will be used. use_projector_capturing_2d_image == true, brightness will be used too.
roiauto white balance will be operated here
Returns
true
false

◆ Capture() [1/2]

bool RVC::X2::Capture ( const CaptureOptions opts)

Capture one point map and one image.This function will save capture options into camera.

Parameters
optsCaptureOptions
Returns
true Success
false Failed

◆ Capture() [2/2]

bool RVC::X2::Capture ( )

Capture one point map and one image.This function will load capture options from camera.

Returns
true Success
false Failed

◆ Capture2D() [1/2]

bool RVC::X2::Capture2D ( const CameraID  cid,
const CaptureOptions opts 
)
Parameters
cidCapture one image. This function will save capture options into camera. You can use GetImage() to obtain 2D imgae
optsCaptureOptions
Returns
true Success
false Failed

◆ Capture2D() [2/2]

bool RVC::X2::Capture2D ( const CameraID  cid)
Parameters
cidCapture one image. This function will load capture options from camera. You can use GetImage() to obtain 2D imgae
Returns
true Success
false Failed

◆ CheckRoi()

bool RVC::X2::CheckRoi ( ROI  roi)

Check whether the parameters of ROI meet the requirements.

Parameters
roi[in] .
Returns
true
false

◆ CloseProtectiveCover()

bool RVC::X2::CloseProtectiveCover ( )

Close ProtectiveCover.

Returns
true if success
false if failed

◆ CloseProtectiveCoverAsync()

bool RVC::X2::CloseProtectiveCoverAsync ( )

Close ProtectiveCover Async.

Returns
true if success
false if failed

◆ Create()

static X2 RVC::X2::Create ( const Device d)
static

Create a RVC X Camera before you use x2.

Parameters
dOne RVC X Camera
Returns
X2 RVC X object

◆ Destroy()

static void RVC::X2::Destroy ( X2 x)
static

Release all X2 resources after you use X2.

Parameters
xRVC X2 object to be released

◆ GetAuto2DExposureTime()

bool RVC::X2::GetAuto2DExposureTime ( CaptureOptions opts,
const ROI roi = ROI() 
)

Get auto 2d exposure time automatically.

Parameters
opts[in]
roi[in]
Returns
true
false

◆ GetAutoCaptureSetting()

bool RVC::X2::GetAutoCaptureSetting ( CaptureOptions opts,
const ROI roi = ROI() 
)

Get auto capture setting. Exposure_time_2d, exposure_time_3d, projector_brightness, light_contrast_threshold will be adjusted automatically. automatically.

Parameters
opts
Returns
CaptureOptions

◆ GetAutoHdrCaptureSetting()

bool RVC::X2::GetAutoHdrCaptureSetting ( CaptureOptions opts,
const ROI roi 
)

adjust 3D capturing parameters

Parameters
opts[in,out] capture options. if hdr_exposure_times > 1, hdr_exposure_times and hdr_exposuretime_content will be adjusted. If hdr_exposure_times equals to 1, exposure_time_3d will be adjusted.
roi[in] if width or height equal to 0, all image will be used.
Returns
true
false

◆ GetAutoNoiseRemovalSetting()

bool RVC::X2::GetAutoNoiseRemovalSetting ( CaptureOptions opts)

Automatically calculates and applies the optimal point cloud noise removal parameters.

WARNING: This is a time-consuming operation as it triggers actual camera captures. This function evaluates the current scene to determine the best cluster-based noise removal settings and applies them to the current point cloud.

Parameters
[in,out]optsCapture options. Upon successful execution, the following parameters inside this struct will be modified and overwritten:
  • opts.noise_removal_distance
  • opts.noise_removal_point_number
Returns
true The automatic noise removal parameters were successfully calculated and applied.
false The operation failed (e.g., camera not ready or capture failed).

◆ GetBandwidth()

bool RVC::X2::GetBandwidth ( float &  percent)

Get the camera band width ratio.

Parameters
percentBand width ratio
Returns
true Success
false Failed

◆ GetCameraResolution()

bool RVC::X2::GetCameraResolution ( Size resolution)

Get Camera Resolution.

Parameters
resolution
Returns
true
false

◆ GetCameraTemperature()

bool RVC::X2::GetCameraTemperature ( const CameraID  cid,
CameraTempSelector  seletor,
float &  temperature 
)

GetCameraTemperature.

Note
TODO:
Parameters
cid
seletor
&temperature
Return values

◆ GetConfidenceMap()

ConfidenceMap RVC::X2::GetConfidenceMap ( )

Get the Confidence Map object.

Returns
ConfidenceMap

◆ GetCorrespondMap()

CorrespondMap RVC::X2::GetCorrespondMap ( )

Get the Correspond Map object.

Returns
Correspond

◆ GetCurrentUserSet()

bool RVC::X2::GetCurrentUserSet ( int &  id)

Get Current User Set's id.

Parameters
id[out] 0~9
Returns
true
false

◆ GetCustomTransformation()

bool RVC::X2::GetCustomTransformation ( CustomTransformOptions opts)

Get the Custom Transformation object.

Parameters
opts
Returns
true
false

◆ GetDepthMap()

DepthMap RVC::X2::GetDepthMap ( )

Get the DepthMap object.

Returns
DepthMap A DepthMap

◆ GetExposureTimeRange()

bool RVC::X2::GetExposureTimeRange ( int *  min_value,
int *  max_value 
)

Get the Exposure Time Range.

Parameters
min_valueexposure time minimum value
max_valueexposure time maxinum value
Returns
true Success
false Failed

◆ GetExtrinsicMatrix()

bool RVC::X2::GetExtrinsicMatrix ( const CameraID  cid,
float *  matrix 
)

Get the extrinsic matrix (transformation from calibration board to specified camera)

Parameters
cid[in] Camera selection option. Available values: {CameraID_Left, CameraID_Right, CameraID_Extra}
matrix[out] 4x4 transformation matrix stored as a 16-element array in row-major order. The matrix represents the transformation from the calibration board coordinate system to the specified camera coordinate system. Format: [R11, R12, R13, T1, R21, R22, R23, T2, R31, R32, R33, T3, 0, 0, 0, 1] Where R is the 3x3 rotation matrix and T is the 3x1 translation vector.
Returns
true Success
false Failed

◆ GetFixedLineScanPointMap() [1/2]

PointMap RVC::X2::GetFixedLineScanPointMap ( )

Get fixed line scan point map.

Returns
PointMap

◆ GetFixedLineScanPointMap() [2/2]

bool RVC::X2::GetFixedLineScanPointMap ( PointMap point_map)

Get fixed line scan point map.

Returns
true Success
false Failed

◆ GetGainRange()

bool RVC::X2::GetGainRange ( float *  min_value,
float *  max_value 
)

Get the Gain Range.

Parameters
min_valuegain minimum value
max_valuegain minimum value
Returns
true Success
false Failed

◆ GetGammaRange()

bool RVC::X2::GetGammaRange ( float *  min_value,
float *  max_value 
)

Get the Gamma Range.

Parameters
min_valuegamma minimum value
max_valuegamma minimum value
Returns
true Success
false Failed

◆ GetImage()

Image RVC::X2::GetImage ( const CameraID  cid)

Get the Image object.

Returns
Image

◆ GetIntrinsicParameters()

bool RVC::X2::GetIntrinsicParameters ( const CameraID  cid,
float *  instrinsicMatrix,
float *  distortion 
)

Get intrinsic and distortion parameters of the specified camera.

Parameters
cid[in] Camera selection option. Available values: {CameraID_Left, CameraID_Right, CameraID_Extra}
instrinsicMatrix[out] Output intrinsic matrix. This is a 9-element array storing a 3x3 matrix in row-major order: [fx, 0, cx, 0, fy, cy, 0, 0, 1]
  • fx, fy: Focal lengths in x and y directions (in pixels)
  • cx, cy: Principal point coordinates (in pixels)
distortion[out] Output distortion coefficients. This is a 5-element array containing: [k1, k2, k3, p1, p2]
  • k1, k2, k3: Radial distortion coefficients
  • p1, p2: Tangential distortion coefficients Note: This order is different from OpenCV's default order (k1,k2,p1,p2,k3).
Returns
true if successful
false if failed

◆ GetMesh()

Mesh RVC::X2::GetMesh ( )

Get the Mesh object.

Returns
Mesh A Mesh

◆ GetPointMap()

PointMap RVC::X2::GetPointMap ( )

Get the Point Map object.

Returns
PointMap

◆ GetProjectorTemperature()

bool RVC::X2::GetProjectorTemperature ( float &  temperature)

GetProjectorTemperature.

Parameters
&temperature
Returns
true Success
false Failed

◆ GetProtectiveCoverStatus()

bool RVC::X2::GetProtectiveCoverStatus ( ProtectiveCoverStatus status)

Get Status of ProtectiveCover.

Returns
ProtectiveCoverStatus

◆ GetTimestamp()

bool RVC::X2::GetTimestamp ( uint64_t &  timestamp)

Retrieves the camera timestamp in microseconds (us)

Parameters
[out]timestampReference to store the retrieved timestamp value in microseconds (us)
Returns
bool True if the timestamp was successfully retrieved, false otherwise

◆ GetUserSetName()

bool RVC::X2::GetUserSetName ( const int &  id,
char *  name 
)

Get Current User Set's name with id.

Parameters
id[in]
name[out]
Returns
true
false

◆ IsOpen()

bool RVC::X2::IsOpen ( )

Check X2 is open or not.

Returns
true Is open
false Not open

◆ IsPhysicallyConnected()

bool RVC::X2::IsPhysicallyConnected ( )

Check X2 is physically connected or not.

Returns
true Is physically connected
false Not physically connected

◆ IsValid()

bool RVC::X2::IsValid ( )

Check X2 is valid or not before use X2.

Returns
true Available
false Not available

◆ LoadCaptureOptionParameters()

bool RVC::X2::LoadCaptureOptionParameters ( X2::CaptureOptions opts)

Get capture option parameters.

Parameters
optsCaptureOptions
Returns
true Success
false Failed

◆ LoadSettingFromFile()

bool RVC::X2::LoadSettingFromFile ( const char *  filename)

Load camera setting from local file .

Parameters
filename[in]
Returns
true the content of file is correctly .
false the content of file is not correctly .

◆ Open()

bool RVC::X2::Open ( )

Open X2 before you use it.

Returns
true Success
false Failed

◆ OpenProtectiveCover()

bool RVC::X2::OpenProtectiveCover ( )

Open ProtectiveCover.

Returns
true if success
false if failed

◆ OpenProtectiveCoverAsync()

bool RVC::X2::OpenProtectiveCoverAsync ( )

Open ProtectiveCover Async.

Returns
true if success
false if failed

◆ ResetProtectiveCover()

bool RVC::X2::ResetProtectiveCover ( )

Reset ProtectiveCover.

Returns
true if success
false if failed

◆ ResetTimestamp()

bool RVC::X2::ResetTimestamp ( )

Resets the camera timestamp to zero.

Resets the internal camera timestamp value to 0 microseconds(us). This function is primarily used for synchronization with user clocks or external timing references, allowing the camera's internal time base to be aligned with user-defined timing requirements or to initiate a new timing cycle based on user control.

Returns
bool True if the timestamp was successfully reset to zero, false otherwise

◆ SaveCaptureOptionParameters()

bool RVC::X2::SaveCaptureOptionParameters ( const X2::CaptureOptions opts)

Save capture option parameters.

Parameters
optsCaptureOptions
Returns
true Success
false Failed

◆ SaveEncodedImagesData()

bool RVC::X2::SaveEncodedImagesData ( const char *  addr)

Save encoded map in txt.

Returns
true
false

◆ SaveSettingToFile()

bool RVC::X2::SaveSettingToFile ( const char *  filename)

Save camera setting to local file.

Parameters
filename[in]
Returns
true Successfully written to the file.
false Failed write to file.

◆ SetBandwidth()

bool RVC::X2::SetBandwidth ( float  percent)

Set the camera band width ratio.

Parameters
percentBand width ratio
Returns
true Success
false Failed

◆ SetCalculationCallBack()

bool RVC::X2::SetCalculationCallBack ( X2::CalculationCallBackPtr  cb,
UserPtr  ctx 
)

Provide a callback to RVC system and it will be called when calculation finished.

Parameters
cbThe callback
ctxThe user-pointer
Returns
true when succeed to set
false when failed to set

◆ SetCollectionCallBack()

bool RVC::X2::SetCollectionCallBack ( X2::CollectionCallBackPtr  cb,
UserPtr  ctx 
)

Provide a callback to RVC system and it will be called when collection finished.

Parameters
cbThe callback
ctxThe user-pointer
Returns
true when succeed to set
false when failed to set

◆ SetCurrentUserSet()

bool RVC::X2::SetCurrentUserSet ( const int &  id)

Set Current User Set by id. The user can utilize a total of 10 parameters groups to quickly adjust camera settings for different 3d imaging scenarios.

Parameters
id[in] 0~9
Returns
true
false

◆ SetCustomTransformation()

bool RVC::X2::SetCustomTransformation ( const CustomTransformOptions opts)

Set the Transformation of output point cloud.

Parameters
optsCustom Transform Options
Returns
true
false

◆ SetFixedLineScanCallback()

bool RVC::X2::SetFixedLineScanCallback ( const X2::FixedLineScanCallBackPtr  cb,
UserPtr  ctx 
)

Registers callback for point cloud results in fixed line scan mode.

Invoked for each completed line scan when using hardware-triggered or fixed-rate triggered mode.

Must be called before StartFixedLineScan().

Parameters
cbCallback function.
ctxUser context pointer. Must remain valid during scanning.
Returns
true if registration succeeded, false otherwise.
Note
Use with CaptureMode_FixedLineScan and TriggerMode_HardWare or TriggerMode_FixedRate.
Callback must be thread-safe (invoked from multiple threads).

◆ SetUserSetName()

bool RVC::X2::SetUserSetName ( const int &  id,
const char *  name 
)

Set User Set's name with id. The user can briefly describe the usage scenario of this parameters groups by using a name.

Parameters
id[in]
name[in]
Returns
true
false

◆ StartFixedLineScan() [1/2]

bool RVC::X2::StartFixedLineScan ( const CaptureOptions opts)

Start capture fixed line scan. Only support CaptureMode_FixedLineScan mode. This function will save capture options into camera. Need to call the StopFixedLineScan interface to manually stop.

Parameters
optsCaptureOptions
Returns
true Success
false Failed

◆ StartFixedLineScan() [2/2]

bool RVC::X2::StartFixedLineScan ( )

Start capture fixed line scan. Only support CaptureMode_FixedLineScan mode. Need to call the StopFixedLineScan interface to manually stop.

Returns
true Success
false Failed

◆ StopFixedLineScan()

bool RVC::X2::StopFixedLineScan ( )

Stop capture fixed line scan.

Returns
true Success
false Failed

The documentation for this struct was generated from the following file: