Sample Program Descriptions
The sample programs are applicable to GenICam cameras, located at {Camport4 SDK download path}/camport4/sample/sample_genicam_sfnc, and include:
sample_read_calibration_data: reads camera calibration parameters.
sample_binocular_streamceStorage: displays left and right grayscale images with speckle patterns.
sample_parameters_depthrange: filters the depth map built on the set minimum and maximum depth thresholds, and displays the processed depth image in real time.
sample_parameters_exp_time: selects the color image format and display the color image after setting the exposure time.
sample_parameters_laser: sets laser brightness.
sample_rw_feature: reads or sets camera features via command lines.
sample_stream: selects a specified image format and resolution, and outputs the image data.
sample_ForceDeviceIP: forcibly sets the IP address of a network depth camera.
sample_trigger: selects the camera work mode and outputs image data.
sample_userset_ctl: demonstrates how to obtain the number of User Sets supported for selection and loading by the camera. It uses the User Set 0 (value 8) as an example to perform operations such as adding a description, saving, and reading the description.
sample_UserSetCurrent: iterates through the User Sets supported by the camera and determines whether each one is loaded.
sample_UserSetDefault: sets the default UserSet to be loaded after the camera is powered on.
sample_UserSetDescription: reads the description information of the UserSets supported by the camera.
sample_UserSetLoad: iterates through the User Sets currently supported by the camera and determines whether each User Set is loaded.
sample_UserSetSave: batches save the camera’s current complete parameter configuration to all user-defined configuration sets (UserSets) in the camera. The configurations will be persistently stored in the camera in file form.
sample_UserSetSelector: queries detailed information about the camera’s “User Set Selector” function and prints key information, such as supported configuration sets and their enumeration values. For example, the GM461-E1 currently reports support for 2 factory-default sets and 8 user-defined sets.
sample_get_rw_api: detects whether the camera’s TL version is Gige_2_1 or Gige_2_0 (the latter is non-GenICam compliant). Users can decide which set of APIs to invoke accordingly.
sample_file_iostream: reads the content from one User Set file and writes it to another.
sample_reconnect: handles data connection anomalies caused by factors such as environmental instability.
sample_event: demonstrates how to register a GenICam standard event callback and print the event content.
sample_watermark: demonstrates how to enable the image watermark feature and print watermark information.
sample_view_registration: demonstrates how to align the depth image with the color image.
sample_view_point3d: demonstrates how to acquire depth and color images, apply undistortion and alignment, convert them to a 3D point cloud, and display or save the point cloud.
sample_seqctrl: demonstrates how to configure sequencer control with different exposure settings.
sample_region_ctrl: demonstrates how to configure a depth Region and align the depth and color images for different Regions.
The sample programs are applicable to non-GenICam cameras, located at {Camport4 SDK download path}/camport4/sample/sample_v1, and include:
ListDevices: demonstrates how to list all the depth cameras that are connected to the host system.
DeviceStorage: demonstrates how to read from and write to the camera’s Custom Block Storage area (64KB) and the ISP Block Storage area (64KB).
DumpAllFeatures: demonstrates how to list the components and features supported by the depth camera, along with the read and write operations available for each feature.
ForceDeviceIP: demonstrates how to manually set the IP address for depth camera.
LoopDetect: demonstrates how to address data connection anomalies caused by unstable environmental factors.
NetStatistic: demonstrates how to calculate the packet loss rate of the network connection for the depth camera.
SimpleView_FetchFrame: demonstrates how to continuously capture and output image data when the depth camera is in continuous capture mode.
SimpleView_Callback: demonstrates how to capture image data in continuous capture mode and render it using OpenCV in a separate processing thread to prevent blocking.
SimpleView_FetchHisto: demonstrates how to retrieve the image brightness distribution histogram.
SimpleView_MultiDevice: demonstrates how to use multiple depth cameras to continuously capture and output image data.
SimpleView_Point3D: demonstrates how to acquire 3D point cloud data.
SimpleView_Registration: demonstrates how to obtain the intrinsic parameters, extrinsic parameters, depth map, and color image of the depth camera, and align the depth map with the color image.
SimpleView_TriggerDelay: demonstrates how to control the camera’s trigger delay.
SimpleView_TriggerMode0: demonstrates how to set the depth camera to trigger mode 0, allowing it to continuously capture and output images at the highest frame rate.
SimpleView_TriggerMode1: demonstrates how to set the depth camera to trigger mode 1, allowing it to acquire and output images upon receiving a trigger signal.
SimpleView_TriggerMode_M2S1: demonstrates how to set the master device (camera) to work in trigger mode 2, and multiple slave devices (cameras) to work in trigger mode 1, in order to achieve cascaded triggering among multiple depth cameras while capturing images simultaneously. Upon receiving a software trigger signal sent by the host computer, the master device outputs a trigger signal via the hardware TRIG_OUT interface, while simultaneously triggering itself to capture and output a depth map. After receiving the hardware trigger signal from the master device, the slave devices capture and output depth maps.
SimpleView_TriggerMode_M3S1: demonstrates how to set the master device (camera) to work in trigger mode 3, and multiple slave devices (cameras) to work in trigger mode 1, in order to achieve cascaded triggering of multiple depth cameras at the set frame rate while capturing images simultaneously. The master device outputs a trigger signal through the hardware TRIG_OUT interface at the set frame rate, while simultaneously triggering itself to capture and output a depth map. After receiving the hardware trigger signal from the master device, the slave devices capture and output depth maps.
SimpleView_SaveLoadConfig: demonstrates how to write a local JSON file into the camera’s Storage component and load the JSON file that has been written into the Storage component. Additionally, the program supports exporting the JSON file to the local system for checking and configuring parameters.
SimpleView_XYZ48: demonstrates how to parse and display depth maps in XYZ format.
SimpleView_Point3D_XYZ48: demonstrates how to acquire 3D point cloud data represented in xyz48 format.
SimpleView_OpenWithIP: demonstrates how to open the network depth camera with the specified IP address.
SimpleView_StreamAsync: demonstrates how to configure the camera to acquire streams and output image data asynchronously when the camera works in software trigger mode.
SimpleView_StreamAsync1: demonstrates how to configure the camera to acquire streams and output image data asynchronously when the camera works in continuous capture mode.
SimpleView_PixelsRegistration: demonstrates how to display the position of the depth map center on the color image.
SimpleView_TriggerMode22: demonstrates how to configure the V-series camera to mode 22, enabling synchronized acquisition of one depth frame and one flood IR image, and outputs the aligned left IR image with the depth image.
SimpleView_TransROI: demonstrates how to enable depth-image ROI transmission in free capture mode.