Skip to content

Commit

Permalink
Samples: Automatic updates to public repository
Browse files Browse the repository at this point in the history
Remember to do the following:
    1. Ensure that modified/deleted/new files are correct
    2. Make this commit message relevant for the changes
    3. Force push
    4. Delete branch after PR is merged

If this commit is an update from one SDK version to another,
make sure to create a release tag for previous version.
  • Loading branch information
csu-bot-zivid committed Sep 20, 2024
1 parent e183a19 commit 9e398fb
Show file tree
Hide file tree
Showing 13 changed files with 260 additions and 318 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HDevelop samples

This repository contains halcon code samples for Zivid SDK v2.13.1. For
This repository contains halcon code samples for Zivid SDK v2.11.1. For
tested compatibility with earlier SDK versions, please check out
[accompanying
releases](https://github.com/zivid/zivid-halcon-samples/tree/master/../../releases).
Expand Down Expand Up @@ -74,8 +74,7 @@ from the camera can be used.
If you want to use Zivid in HALCON, we provide a GenICam GenTL producer
that comes with the [Zivid Software](http://www.zivid.com/downloads).

Zivid and HALCON are compatible with Windows 10 and 11, and Ubuntu
20.04, 22.04, 24.04.
Zivid and HALCON are compatible with Windows 10 and Ubuntu 20.04, 22.04.

-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<c>* It should be used together with the SurfaceMatchingFindModel.hdev where the model created by this program is utilized for surface-based 3D matching algorithm.</c>
<c>* This example comes with HDR settings and other parameters which were used to create models of the following three objects:</c>
<c>* Twinings tea box</c>
<c>* Pepsi can (0.3 l)</c>
<c>* plastic Coca-Cola bottle (2 l)</c>
<c>* Pringles can (190 g)</c>
<c>* plastic Coca-Cola bottle (0.5 l)</c>
<c>*</c>
<c>* Please note that you first need to install Zivid Software and correctly set the environment variables. After this, you can access the camera with the HALCON</c>
<c>* GenICamTL interface.</c>
Expand All @@ -37,33 +37,34 @@
<c>* Resetting any previous HDR settings</c>
<l>set_framegrabber_param (AcqHandle, 'ResetAcquisitions', 1)</l>
<c/>
<c>* Setting global settings</c>
<l>set_framegrabber_param (AcqHandle, 'Engine', 'stripe')</l>
<l>set_framegrabber_param (AcqHandle, 'SamplingColor', 'rgb')</l>
<l>set_framegrabber_param (AcqHandle, 'SamplingPixel', 'blueSubsample2x2')</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianSigma', 2.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalThreshold', 2.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseSuppressionEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRepairEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalThreshold', 10.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMaxNeighborDistance', 6)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMinArea', 600)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionCorrectionEnabled', 0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', 0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', 0.7)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', 1)</l>
<c/>
<c>* Configuring HDR settings</c>
<c>* Configuring HDR settings (Twinings tea box)</c>
<l>*set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 5.65)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 4.0)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<c/>
<c>* Configuring HDR settings (Pringles can)</c>
<l>*set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 4.36)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 2.0)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<c/>
<c>* Configuring HDR settings (Coca-Cola bottle)</c>
<l>*set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 6.16)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>*set_framegrabber_param (AcqHandle, 'Aperture', 3.08)</l>
<l>*set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<c/>
<c>* Configuring HDR settings (Your own object)</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 2.64)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 10.37)</l>
<l>set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 2.64)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 5.50)</l>
<l>set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 2.37)</l>
<l>set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<c/>
<c>* Capturing frame (HDR)</c>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<c>* It should be used together with the SurfaceMatchingFindModelFromFile.hdev where the model created by this program is utilized for surface-based 3D matching algorithm.</c>
<c>* This example comes with models of three following objects:</c>
<c>* Twinings tea box</c>
<c>* Pepsi can (0.3 l)</c>
<c>* plastic Coca-Cola bottle (2 l)</c>
<c>* Pringles can (190 g)</c>
<c>* plastic Coca-Cola bottle (0.5 l)</c>
<c>*</c>
<c>* Please note that you first need to install Zivid Software and correctly set the environment variables. After this, you can access the camera with the HALCON</c>
<c>* GenICamTL interface.</c>
Expand All @@ -25,18 +25,18 @@
<c>* Reading a 3D point cloud of the scene</c>
<c>* Twinings tea box</c>
<l>SurfaceModelFile:= 'TwiningsTeaBox'</l>
<c>* Pepsi can</c>
<l>* SurfaceModelFile:= 'PepsiCan'</l>
<c>* Pringles can</c>
<l>* SurfaceModelFile:= 'PringlesCan'</l>
<c>* Coca-Cola bottle</c>
<l>* SurfaceModelFile:= 'CocaColaBottle'</l>
<c/>
<l>import './../../../Procedures'</l>
<l>get_zivid_sample_data_dir(ZividDataDir)</l>
<l>ScenePath := ZividDataDir + '/ObjectMatching/' + SurfaceModelFile + '/Im1.ply'</l>
<c>* Specify the camera that point cloud was taken with.</c>
<l>Camera := 'Zivid 2+'</l>
<c>* Specify SamplingPixel that point cloud was taken with.</c>
<l>SamplingPixel := 'blueSubsample2x2'</l>
<c>* Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'.</c>
<l>Camera := 'Zivid One+'</l>
<c>* Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2'</c>
<l>SamplingPixel := 'all'</l>
<l>get_zivid_camera_width (Camera, SamplingPixel, MapWidth)</l>
<l>read_object_model_3d (ScenePath, 'm', ['xyz_map_width'], MapWidth, ObjectModel3D_Scene, Status)</l>
<c/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<c>* The model used for matching is created from a reference view of the object, see SurfaceMatchingCreateModel.hdev or SurfaceMatchingCreateModel.hdevFromFile.</c>
<c>* The model is then searched for in a newly captured 3D point cloud. This example comes with models for the three following objects:</c>
<c>* Twinings tea box</c>
<c>* Pepsi can (0.3 l)</c>
<c>* plastic Coca-Cola bottle (2 l)</c>
<c>* Pringles can (190 g)</c>
<c>* plastic Coca-Cola bottle (0.5 l)</c>
<c>*</c>
<c>* Please note that you first need to install Zivid Software and correctly set the environment variables. After this, you can access the camera with the HALCON</c>
<c>* GenICamTL interface.</c>
Expand All @@ -23,8 +23,8 @@
<c>* Specify the HALCON model for surface-based 3D matching</c>
<c>* Existing Twinings tea box model</c>
<l>SurfaceModelFile := 'TwiningsTeaBox'</l>
<c>* Existing Pepsi can model</c>
<l>* SurfaceModelFile := 'PepsiCan'</l>
<c>* Existing Pringles can model</c>
<l>* SurfaceModelFile := 'PringlesCan'</l>
<c>* Existing Coca-Cola bottle model</c>
<l>* SurfaceModelFile := 'CocaColaBottle'</l>
<c>* Your own model created with the SurfaceMatchingCreateModel.hdev</c>
Expand Down Expand Up @@ -54,34 +54,41 @@
<c>* Reseting any previous HDR settings</c>
<l>set_framegrabber_param (AcqHandle, 'ResetAcquisitions', 1)</l>
<c/>
<c>* Setting global settings</c>
<l>set_framegrabber_param (AcqHandle, 'Engine', 'stripe')</l>
<l>set_framegrabber_param (AcqHandle, 'SamplingColor', 'rgb')</l>
<l>set_framegrabber_param (AcqHandle, 'SamplingPixel', 'blueSubsample2x2')</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianSigma', 2.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalThreshold', 2.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseSuppressionEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRepairEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalThreshold', 10.0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMaxNeighborDistance', 6)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMinArea', 600)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionCorrectionEnabled', 0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', 0)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', 0.7)</l>
<l>set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', 1)</l>
<c/>
<c>* Configuring HDR settings</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 2.64)</l>
<l>set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>set_framegrabber_param (AcqHandle, 'Aperture', 2.64)</l>
<l>set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<c>* Twinings tea box</c>
<l>if (SurfaceModelFile = 'TwiningsTeaBox')</l>
<l> set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 5.50)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 4.00)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>endif</l>
<c>* Pringles can</c>
<l>if (SurfaceModelFile = 'PringlesCan')</l>
<l> set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 4.36)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 2.37)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>endif</l>
<c>* Coca-Cola bottle</c>
<l>if (SurfaceModelFile = 'CocaColaBottle')</l>
<l> set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 6.16)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 3.08)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>endif</l>
<c>* Your own model created with the SurfaceMatchingCreateModel.hdev</c>
<l>if (SurfaceModelFile = '')</l>
<l> set_framegrabber_param (AcqHandle, 'ExposureTime', 10000)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 16.00)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 5.50)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l> set_framegrabber_param (AcqHandle, 'Aperture', 2.37)</l>
<l> set_framegrabber_param (AcqHandle, 'AddAcquisition', 1)</l>
<l>endif</l>
<c/>
<c>* Loading the HALCON model for surface-based 3D matching</c>
<l>if (MySurfaceModelFile)</l>
Expand Down Expand Up @@ -132,15 +139,15 @@
<c> * RelSamplingDistance - point cloud downsampling (0 = no downsampling)</c>
<c> * Twinings tea box</c>
<l> if (SurfaceModelFile = 'TwiningsTeaBox')</l>
<l> RelSamplingDistance := 0.03</l>
<l> endif</l>
<c> * Pepsi can</c>
<l> if (SurfaceModelFile = 'PepsiCan')</l>
<l> RelSamplingDistance := 0.01</l>
<l> endif</l>
<c> * Pringles can</c>
<l> if (SurfaceModelFile = 'PringlesCan')</l>
<l> RelSamplingDistance := 0.03</l>
<l> endif</l>
<c> * Coca-Cola bottle</c>
<l> if (SurfaceModelFile = 'CocaColaBottle')</l>
<l> RelSamplingDistance := 0.02</l>
<l> RelSamplingDistance := 0.003</l>
<l> endif</l>
<c> * Your own model created with the SurfaceMatchingCreateModel.hdev</c>
<l> if (SurfaceModelFile = '')</l>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<c>* The model used for matching is created from a reference view of the object, see SurfaceMatchingCreateModelFromFile.hdev. The model is then searched for in a newly</c>
<c>* captured 3D point cloud. This example comes with models for the three following objects:</c>
<c>* Twinings tea box</c>
<c>* Pepsi can (0.3 l)</c>
<c>* plastic Coca-Cola bottle (2 l)</c>
<c>* Pringles can (190 g)</c>
<c>* plastic Coca-Cola bottle (0.5 l)</c>
<c>*</c>
<c>* Please note that you first need to install Zivid Software and correctly set the environment variables. After this, you can access the camera with the HALCON</c>
<c>* GenICamTL interface.</c>
Expand All @@ -24,19 +24,19 @@
<c/>
<c>* Specify the object for surface-based 3D matching</c>
<c>* Existing Twinings tea box model</c>
<l>* SurfaceModelFile := 'TwiningsTeaBox'</l>
<c>* Existing Pepsi can model</c>
<l>* SurfaceModelFile := 'PepsiCan'</l>
<l>SurfaceModelFile := 'TwiningsTeaBox'</l>
<c>* Existing Pringles can model</c>
<l>* SurfaceModelFile := 'PringlesCan'</l>
<c>* Existing Coca-Cola bottle model</c>
<l>SurfaceModelFile := 'CocaColaBottle'</l>
<l>* SurfaceModelFile := 'CocaColaBottle'</l>
<c/>
<l>import './../../../Procedures'</l>
<l>get_zivid_sample_data_dir(ZividDataDir)</l>
<l>ScenePath := ZividDataDir + '/ObjectMatching/' + SurfaceModelFile</l>
<c>* Specify the camera that point cloud was taken with; options are: 'Zivid 2' and 'Zivid 2+'.</c>
<l>Camera := 'Zivid 2+'</l>
<c>* Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'.</c>
<l>Camera := 'Zivid One+'</l>
<c>* Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2'</c>
<l>SamplingPixel := 'blueSubsample2x2'</l>
<l>SamplingPixel := 'all'</l>
<l>get_zivid_camera_width (Camera, SamplingPixel, MapWidth)</l>
<c/>
<c>* Specify whether you want to use your own model created with the SurfaceMatchingCreateModelFromFile.hdev</c>
Expand Down Expand Up @@ -100,15 +100,15 @@
<c> * RelSamplingDistance - point cloud downsampling (0 = no downsampling)</c>
<c> * Twinings tea box</c>
<l> if (SurfaceModelFile = 'TwiningsTeaBox')</l>
<l> RelSamplingDistance := 0.03</l>
<l> endif</l>
<c> * Pepsi can</c>
<l> if (SurfaceModelFile = 'PepsiCan')</l>
<l> RelSamplingDistance := 0.01</l>
<l> endif</l>
<c> * Pringles can</c>
<l> if (SurfaceModelFile = 'PringlesCan')</l>
<l> RelSamplingDistance := 0.03</l>
<l> endif</l>
<c> * Coca-Cola bottle</c>
<l> if (SurfaceModelFile = 'CocaColaBottle')</l>
<l> RelSamplingDistance := 0.02</l>
<l> RelSamplingDistance := 0.003</l>
<l> endif</l>
<c> * KeyPointFraction - additional downsampling for the detection (1 = all points used)</c>
<l> KeyPointFraction := 1</l>
Expand Down
6 changes: 3 additions & 3 deletions source/Applications/Basic/FileFormats/ReadPLY.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<l>import './../../../Procedures'</l>
<l>get_zivid_sample_data_dir(ZividDataDir)</l>
<l>PointCloudFile := ZividDataDir + '/Zivid3D.ply'</l>
<c>* Specify the camera that point cloud was taken with; options are: 'Zivid 2' and 'Zivid 2+'.</c>
<l>Camera := 'Zivid 2+'</l>
<c>* Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'.</c>
<l>Camera := 'Zivid One+'</l>
<c>* Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2'</c>
<l>SamplingPixel := 'blueSubsample2x2'</l>
<l>SamplingPixel := 'all'</l>
<l>get_zivid_camera_width (Camera, SamplingPixel, MapWidth)</l>
<l>read_object_model_3d (PointCloudFile, 'mm', ['xyz_map_width'], MapWidth, ObjectModel3D, Status)</l>
<c/>
Expand Down
Loading

0 comments on commit 9e398fb

Please sign in to comment.