Skip to content

C++ Examples

The C++ examples are located in a folder under the installation directory:

Windows: /RVCSDK/examples/C++

Linux: /opt/RVC/examples/C++

The categories and functions of the examples are summarized below. Click the name of the example to view the corresponding example code.

Basic

Demonstrate the basic flow of image acquisition and how to capture and save different types of data.

  • QuickCaptureX1: Basic flow of monocular mode image capture.

  • QuickCaptureX2: Basic flow of binocular mode image capture.

  • CaptureGigE: Basic flow of GigE scanner image capture.

  • CaptureUSB: Basic flow of USB scanner image capture.

  • LaserCameraCapture: Basic flow of laser scanner image capture.

  • CaptureInContinueMode: Capture 10 times continuously in monocular mode, saving point cloud and 2D image.

  • X1Capture2D: Set 2D exposure in monocular mode, capture and save 2D image.

  • X2Capture2D: Set 2D exposure in binocular mode, capture and save the 2D image acquired by the left camera.

  • GetDepthImage: Capture in monocular mode, save point cloud, 2D image and depth image.

  • GetNormalMap: Capture, save 2D image and point cloud with normal vector.

  • SaveColorPointMap: Capture and save point cloud with color data.

  • GetValidPointMap: Get the valid points in the point cloud after capturing and save the valid point cloud.

Parameter Settings

RVC SDK provides four ways to set parameters. In practical applications, it is recommended to complete the parameter adjustment in RVCManager software to write the parameters to the scanner, and then directly call the parameters stored in the scanner in the SDK (i.e., Method 3), or load the parameters from the configuration file (i.e., Method 4).

Methods Brief
Method 1 Use the system default parameters and modify them.
Method 2 Load the parameters stored in the scanner and modify them.
Method 3 Use the parameters stored in the scanner directly.
Method 4 Load parameters from configuration file.

The descriptions and code snippets of the different methods are detailed in the example files.

  • CaptureOptionsX1: Print capture parameters in monocular mode, the four ways of passing parameters are described, and the in-scanner parameters are called for capturing.

  • CaptureOptionsX2: Print capture parameters in binocular mode, the four ways of passing parameters are described, and the in-scanner parameters are called for capturing.

  • SaveLoadCaptureOptions: Read and modify the capture parameters in the scanner, store the modified parameters in the scanner and print them.

  • SaveLoadCameraSetting: Export and import capture parameters in .json format.

  • AdjustCaptureParameter: Explanation of capture parameters in monocular mode, modify capture parameters, capture, save point cloud and 2D image.

  • CaptureByX2: Modify capture parameters in binocular mode, capture, save point cloud and 2D image.

Functions

Demonstrate the setting methods and functions of smoothing, denoising, ROI, HDR and other parameters.

  • AdjustCaptureMode: Set capture mode (Normal/Fast).

  • GetDownsamplePointMap: Set downsampling distance of point cloud.

  • GetSmoothPointMap: Set point cloud smoothing level (Off/Weak/Medium/Strong).

  • GetConfidenceMap: Set the confidence denoising threshold, capture and save the point cloud and 2D image, select a point in the image, print the confidence value of this point.

  • GetNoiseRemovalPointMap: Set the clustering denoising parameters (Clustering Denoising Distance Threshold, Clustering Denoising Effective Points).

  • GetBilateralFilteredPointMap: Set bilateral filtering parameters (Bilateral Filtering Kernal Size, Bilateral Filtering Depth Sigma, Bilateral Filtering Space Sigma).

  • GetZFilteredPointMap: Set Z-Truncate parameters (Z-Truncate Upper Limit, Z-Truncate Lower Limit).

  • SetROI: Set ROI (Region of Interest), capture, save point cloud and 2D image in this region.

  • X1HDR: Set HDR parameters in monocular mode.

  • X2HDR: Set HDR parameters in binocular mode.

Auto Adjustment

For some parameters, RVC SDK provides auto parameter setting function, which can automatically set the capture parameters according to the image information in a given area to optimize the capturing effect.

  • GetAutoNoiseRemovalSetting: Automatically adjust clustering denoising parameters (Cluster Denoising Distance Threshold, Cluster Denoising Effective Points).

  • X1AutoSetParam: In monocular mode, set a ROI area, automatically adjust some parameters (Exposure2D, Exposure3D, Brightness, Light Contrast) according to the given ROI area, print the adjusted parameters, capture, save the point cloud and 2D image.

  • X2AutoSetParam: In binocular mode, set a ROI area, automatically adjust some parameters (Exposure2D, Exposure3D, Brightness, Light Contrast) according to the given ROI area, print the adjusted parameters, capture, save the point cloud and the 2D image acquired by the left camera.

  • X1AutoHdrSetParam: In monocular mode, set a ROI area, automatically adjust the HDR parameters (HDR Extra Times and 3D exposure time for each exposure) according to the given ROI area, print the adjusted parameters, capture, save the point cloud and 2D image.

  • X2AutoHdrSetParam: In binocular mode, set a ROI area, automatically adjust the HDR parameters (HDR Extra Times and 3D exposure time for each exposure) according to the given ROI area, print the adjusted parameters, capture, save the point cloud and 2D image acquired by the left camera.

Calibration Board Recognition

Coordinate System Transformation

  • X1SetTransformation: In monocular mode, set the customer coordinate system through the transformation matrix, transform the point cloud from the original coordinate system to the customer coordinate system.

  • X2SetTransformation: In binocular mode, set the customer coordinate system through the transformation matrix, transform the point cloud from the original coordinate system to the customer coordinate system.

Camera Parameters

Data Type Conversion and Processing