C++
Sample list
샘플에는 Camera 및 Applications 의 두 가지 주요 범주가 있습니다. Camera 카테고리의 샘플은 카메라 사용 방법에 초점을 맞춥니다. Applications 카테고리의 샘플은 3D 포인트 클라우드, 2D 이미지 또는 카메라의 기타 데이터와 같이 카메라에서 생성된 데이터를 사용합니다. 이 샘플은 카메라의 데이터를 사용하는 방법을 보여줍니다.
Camera
Basic
Capture - Capture point clouds, with color, from the Zivid camera.
Capture2D - Capture 2D images from the Zivid camera.
CaptureAssistant - Capture Assistant to capture point clouds, with color, from the Zivid camera.
CaptureFromFileCamera - Capture point clouds, with color, with the Zivid file camera.
CaptureHDR - Capture HDR point clouds, with color, from the Zivid camera.
CaptureHDRCompleteSettings - Capture point clouds, with color, from the Zivid camera with fully configured settings.
CaptureWithSettingsFromYML - Capture point clouds, with color, from the Zivid camera, with settings from YML file.
Advanced
AllocateMemoryForPointCloudData - Two methods to copy point cloud data from GPU memory to CPU memory, to be consumed by OpenCV.
Capture2DAnd3D - Capture 2D and 3D separately with the Zivid camera.
CaptureHalconViaGenICam - Capture and save a point cloud, with colors, using GenICam interface and Halcon C++ SDK.
CaptureHalconViaZivid - Capture a point cloud, with colors, using Zivid SDK, transform it to a Halcon point cloud and save it using Halcon C++ SDK.
CaptureHDRLoop - Cover the same dynamic range in a scene with different acquisition settings to optimize for quality, speed, or to find a compromise.
CaptureHDRPrintNormals - Capture Zivid point clouds, compute normals and print a subset.
MultiCameraCaptureInParallel - Capture point clouds with multiple cameras in parallel.
MultiCameraCaptureSequentially - Capture point clouds with multiple cameras sequentially.
MultiCameraCaptureSequentiallyWithInterleavedProcessing - Capture point clouds with multiple cameras sequentially with interleaved processing.
InfoUtilOther
AutomaticNetworkConfigurationForCameras - Automatically set the IP addresses of any number of cameras to be in the same subnet as the provided IP address of the network interface.
CameraInfo - List connected cameras and print camera version and state information for each connected camera.
CameraUserData - Store user data on the Zivid camera.
CaptureWithDiagnostics - Capture point clouds, with color, from the Zivid camera, with settings from YML file and diagnostics enabled.
FirmwareUpdater - Update firmware on the Zivid camera.
FrameInfo - Read frame info from the Zivid camera.
GetCameraIntrinsics - Read intrinsic parameters from the Zivid camera (OpenCV model) or estimate them from the point cloud.
NetworkConfiguration - Uses Zivid API to change the IP address of the Zivid camera.
SettingsInfo - Read settings info from the Zivid camera.
Warmup - Short example of a basic way to warm up the camera with specified time and capture cycle.
ZividBenchmark - Zividbenchmark is a sample that will test the average speed of different operations on your computer.
Maintenance
CorrectCameraInField - Correct the dimension trueness of a Zivid camera.
ResetCameraInField - Reset infield correction on a camera.
VerifyCameraInField - Check the dimension trueness of a Zivid camera.
VerifyCameraInFieldFromZDF - Check the dimension trueness of a Zivid camera from a ZDF file.
Applications
Basic
Visualization
CaptureFromFileCameraVis3D - Capture point clouds, with color, with the Zivid file camera and visualize them.
CaptureHDRVisNormals - Capture Zivid point clouds, with color and normals, and visualize it in 3D and as a normal map.
CaptureVis3D - Capture point clouds, with color, from the Zivid camera, and visualize it.
CaptureWritePCLVis3D - Capture point clouds, with color, from the Zivid camera, save it to PCD file format, and visualize it.
ProjectImageStartAndStop - Start the Image Projection and Stop it.
ReadAndProjectImage - Read a 2D image from file and project it using the camera projector.
ReadPCLVis3D - Read point cloud from PCL file and visualize it.
FileFormats
ReadIterateZDF - Read point cloud data from a ZDF file, iterate through it, and extract individual points.
Advanced
CaptureUndistort2D - Use camera intrinsics to undistort a 2D image.
CreateDepthMap - Convert point cloud from a ZDF file to OpenCV format, extract depth map and visualize it.
Downsample - Downsample point cloud from a ZDF file.
GammaCorrection - Capture 2D image with gamma correction.
HandEyeCalibration - Perform Hand-Eye calibration.
MaskPointCloud - Mask point cloud from a ZDF file and convert to PCL format, extract depth map and visualize it.
ProjectAndFindMarker - Show a marker using the projector, capture a set of 2D images to find the marker coordinates (2D and 3D).
ReprojectPoints - Illuminate checkerboard (Zivid Calibration Board) corners by getting checkerboard pose
ROIBoxViaArucoMarker - Filter the point cloud based on a ROI box given relative to the ArUco marker on a Zivid Calibration Board.
ROIBoxViaCheckerboard - Filter the point cloud based on a ROI box given relative to the Zivid Calibration Board.
TransformPointCloudFromMillimetersToMeters - Transform point cloud data from millimeters to meters.
TransformPointCloudViaArucoMarker - Transform a point cloud from camera to ArUco marker coordinate frame by estimating the marker’s pose from the point cloud.
TransformPointCloudViaCheckerboard - Transform a point cloud from camera to checkerboard (Zivid Calibration Board) coordinate frame by getting checkerboard pose from the API.
HandEyeCalibration
PoseConversions - Convert to/from Transformation Matrix (Rotation Matrix + Translation Vector)
UtilizeHandEyeCalibration - Transform single data point or entire point cloud from camera to robot base reference frame using Hand-Eye calibration
MultiCamera
MultiCameraCalibration - Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from connected cameras.
MultiCameraCalibrationFromZDF - Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from a ZDF files.
StitchByTransformation - Use transformation matrices from Multi-Camera calibration to transform point clouds into single coordinate frame, from connected cameras.
StitchByTransformationFromZDF - Use transformation matrices from Multi-Camera calibration to transform point clouds into single coordinate frame, from a ZDF files.
Instructions
Windows
키보드에서 Win + R 키를 눌러 명령 프롬프트를 시작한 다음 cmd
을 입력하고 Enter 를 누르세요.
리포지토리를 복제할 위치로 이동한 후 다음 명령을 실행합니다.
git clone https://github.com/zivid/zivid-cpp-samples
CMake로 샘플 솔루션을 구성하고 Visual Studio에서 열어 빌드를 실행합니다. 자세한 내용은 Configure C++ Samples With CMake and Build Them in Visual Studio in Windows 를 참조하십시오.
Ubuntu
키보드에서 Ctrl + Alt + T 키를 눌러 터미널을 엽니다.
리포지토리를 복제할 위치로 이동한 후 다음 명령을 실행합니다.
git clone https://github.com/zivid/zivid-cpp-samples
cd zivid-cpp-samples
프로젝트 빌드:
mkdir build
cd build
cmake <options, see below> ../source
make -j
일부 샘플은 외부 라이브러리, 특히 Eigen 3, OpenCV, PCL 또는 HALCON에 의존합니다. 설치하지 않으려면 다음 옵션을 각각 전달하여 샘플에 따라 샘플을 비활성화할 수 있습니다. cmake : -DUSE_EIGEN3=OFF
, -DUSE_OPENCV=OFF
, -DUSE_PCL=OFF
, -DUSE_HALCON=OFF
.
사용하려는 경우:
Eigen 3: Eigen3 설치 루트 경로인
<path>
를 활용하여-DEIGEN3_INCLUDE_DIR=<path>
설정합니다. (Eigen/Core, Eigen/Dense 등이 포함된 폴더).PCL 및 OpenCV: 시스템에 최신 버전이 설치되어 있으면 제대로 작동합니다. 그렇지 않은 경우 각각의
PCLConfig.cmake
와OpenCVConfig.cmake
을 포함하는 경로<path>
를-DPCL_DIR=<path>
/-DOpenCV_DIR=<path>
에 설정합니다.HALCON: 시스템에 최신 버전이 설치되어 있으면 제대로 작동합니다.
이제 샘플을 다음과 같이 빌드 디렉토리에서 실행할 수 있습니다.
./CaptureFromFileCameraVis3D