C++ (Linux)
Sample Program Overview
The C++ (Linux) sample programs include:
ConnectByIpAddress.cpp: Opens a network camera using its IP address.DepthToColorRegistration.cpp: Aligns the depth images with color images output by the camera.DepthToPointCloud.cpp: Aligns depth images with point cloud images output by the camera.DumpAllFeatures.cpp: Lists all features supported by the camera.DumpDeviceInfo.cpp: Lists camera information.FetchFrame.cpp: Configures the camera to operate in continuous capture mode and capture depth images.ListDevices.cpp: Lists all cameras connected to the computer.ReadWriteFeatures.cpp: Demonstrates reading and writing of the camera features.SetIpAddress.cpp: Sets camera IP to static.SetUndistortion.cpp: Configures the camera to operate in software trigger mode. Upon receiving a software trigger command, the camera captures and outputs a distortion-corrected left grayscale image and an uncorrected color image. All output images are automatically saved to the same directory as the executable. Simultaneously, the terminal displays and compares their distortion parameters.SoftTrigger.cpp: Configures the camera to operate in software trigger mode; after receiving a software trigger command, the camera captures and outputs a depth image.UserSetSelector.cpp: Selects a camera user set.
Compilation and Execution
Copy the SDK files to a folder with read & write permissions, using the desktop as an example:
cp -r /opt/Percipio_SDK/ /home/<username>/Desktop/
Compile the sample programs.
cd /home/<USERNAME>/Desktop/Percipio_SDK/API/cpp/example/ mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make
Note
For Release build (recommended): -DCMAKE_BUILD_TYPE=Release
For Debug build: -DCMAKE_BUILD_TYPE=Debug
Run the program.
ls ./FetchFrame -sn <CAMERA_SERIAL_NUMBER>