Halcon Platform
Download and Install Halcon
Download the Halcon (Windows version) installation package from the Halcon Percipio website and install Halcon according to the official documentation.
Important
The installation package Image Acquisition Interfaces must be installed. If there are no special requirements, it is recommended to check all installation packages and install them.
Set Up USB Camera Environment
If you use a USB camera, complete Set Up USB Camera Environment before proceeding.
Download Halcon SDK
Choose any of the following methods to download the Camport3_Halcon_gentl SDK:
Access https://gitee.com/percipioxyz/camport_gentl.git using a browser and download the Camport3_Halcon_gentl SDK.
Use the git command to obtain a local copy: Open the terminal, switch to the working directory where the SDK should be stored, and enter the
git clonecommand to clone the remote repository.git clone https://gitee.com/percipioxyz/camport_gentl.git
Choose any of the following methods to download the Camport3_Halcon_gentl SDK:
Access https://github.com/percipioxyz/camport_gentl.git using a browser and download the Camport3_Halcon_gentl SDK.
Use the git command to obtain a local copy: Open the terminal, switch to the working directory where the SDK should be stored, and enter the
git clonecommand to clone the remote repository.git clone https://github.com/percipioxyz/camport_gentl.git
The directory structure of the camport_gentl SDK is shown below:
📦 camport_gentl
├── 📁 win_x64
│ └── percipio.cti # GenTL Producer implementation file for Windows x64 (loaded by Halcon)
│
├── 📁 ubuntu_x64
│ └── percipio.cti # GenTL Producer implementation file for Ubuntu x64
│
├── 📁 halcon_samples
│ ├── check_status.hdev # Halcon sample: device status check
│ ├── fetchframe.hdev # Halcon sample: single camera image acquisition
│ ├── fetchframe_2cameras.hdev # Halcon sample: dual camera image acquisition
│ ├── fetchframe_RGBD.hdev # Halcon sample: RGBD data acquisition
│ ├── genicamtl_parameters.hdev # Halcon sample: GenTL/GenICam parameter access
│ └── triggermode1.hdev # Halcon sample: trigger mode acquisition
│
├── README.md # Repository description, supported platforms, and usage
└── Release.log # Release notes and changelog
halcon_samples Directory
It stores sample programs for user programming reference.
check_status.hdev: Displays the camera connection status.fetchframe.hdev: Captures image data from one depth camera.fetchframe_2cameras.hdev: Configures two depth cameras to capture and output image data simultaneously.fetchframe_RGBD.hdev: Captures depth maps that are registered to color.genicamtl_parameters.hdev: Lists the parameters supported by Percipio cameras.triggermode1.hdev: Sets the depth camera to mode 1. The camera captures and outputs image data after receiving a software trigger command or a hardware trigger signal.
ubuntu_x64 Directory
percipio.cti: The GenTL Producer implementation file for the Linux system.
win_x64 Directory
percipio.cti: The GenTL Producer implementation file for the Windows system.
Configure Environment Variables
Enter the environment variables page and create a new environment variable. The variable name is GENICAM_GENTL64_PATH, and the variable value is the storage path of percipio.cti: for Windows systems, it is the path under the win_x64 directory; for Ubuntu systems, it is the path under the ubuntu_x64 directory. After rebooting the computer, the configuration will take effect.
Configure Environment Variables
View Camera Features
Double-click the
genicamtl_parameters.hdevfile in thesamplesfolder.Modify the serial number of the camera to be opened in the program window, and click the run button.
Specify the camera serial number before “open_framegrabber”. Take ‘PercipioTL_DEV_207000155512’ as an example below.
Device := 'PercipioTL_DEV_207000155512' open_framegrabber ('GenICamTL', 1, 1, 0, 0, 0, 0, 'default', -1, 'default', -1, 'false', 'default', 'Device', -1, -1, AcqHandle)
Open the target component before “get_framegrabber_param”. Only then will the program list all the features of that component. Take the Left IR component as an example below.
* For non-GenICam cameras, use the following code to open the Left IR component set_framegrabber_param(AcqHandle, 'SourceSelector', 'Source_LeftIR') set_framegrabber_param(AcqHandle, 'ComponentEnable', 1)
* For GenICam cameras, use the following code to open the Left component set_framegrabber_param(AcqHandle, 'SourceSelector', 'Left') set_framegrabber_param(AcqHandle, 'ComponentEnable', 1)
Note
For camera definitions, see Non-GenICam Cameras and GenICam Cameras.
The parameter file
parameters_info.datwill be generated in the same directory as thegenicamtl_parameters.hdevfile.
Open the
parameters_info.datfile, and view the list of supported features for the camera. For details on the parameter descriptions and parameter reading & writing methods, see
.
Run the Sample Program
Enter the serial number of the camera to be opened in the program window.
Here, ‘PercipioTL_DEV_207000155512’ is provided as an example, please replace it with the serial number on your target camera before running.
* Enter the camera serial number (replace it with the serial number on your target camera) Device := 'PercipioTL_DEV_207000155512' * Open the camera via the GenICam protocol open_framegrabber ('GenICamTL', 1, 1, 0, 0, 0, 0, 'default', -1, 'default', -1, 'false', 'default', Device, -1, -1, AcqHandle)
click the “Run” button to execute the
fetchframe.hdevsample program.View the running results.