User Manual

- 10 -
roi_conf.left_top_x = 10;
roi_conf.left_top_y = 10;
roi_conf.right_bottom_x = 30;
roi_conf.right_bottom_y = 20;
HPS3D_SetROIRegion(&handle, roi_conf);
HPS3D_SetROIEnable(&handle, roi_conf.roi_id, true);
(3) To configure the point cloud data output, you need to call the optical parameter enable
function HPS3D_SetOpticalEnable and the function HPS3D_SetPointCloudEn to enable point cloud
data output before setting the running mode. The data returned under single measurement and
continuous measurement is point cloud data. ,code show as below:
HPS3D_SetOpticalEnable(&handle, true);
HPS3D_SetPointCloudEn(true);
The point cloud data obtained by this SDK is ordered point cloud data. The point cloud data
format uses (x, y, z) space coordinates as point cloud data; provides the structure (in api.h), the
code is as follows:
/*point cloud data struct */
typedef
struct
{
float32_t x; /*x,y,z coordinates in space*/
float32_t y;
float32_t z;
}PerPointCloudDataTypeDef;
/*Ordered point cloud data*/
typedef
struct
{
PerPointCloudDataTypeDef point_data[MAX_PIX_NUM]; /*point cloud data */
uint16_t width; /*width,the number of points a row */
uint16_t height; /*height,line number */
uint32_t points; /*total points */
}PointCloudDataTypeDef;
Note
(1) The optical enable needs to be turned on before enabling the output point cloud data. Purpose:
To obtain the vertical di stance.
(2) In the data of the depth map, there are invalid points. Here, the invalid coordinates are also
given. The spatial coordinates (x, y, z) are: z = distance[] (the original invalid data value is retained. );
x, y is the position of z in the distance (that is, the position of the invalid point)
(3) In the return packet structure MeasureDataTypeDef type, the defined point cloud data packet
is the structure array PointCloudDataTypeDef, and the point cloud data converted for the depth
map data is stored in the array [0], and the point cloud for ROI data conversion. The data is stored
in the array in order.