diff --git a/README.md b/README.md index d2df9d0..6b6218d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # HDevelop samples -This repository contains halcon code samples for Zivid SDK v2.11.1. For +This repository contains halcon code samples for Zivid SDK v2.12.0. For tested compatibility with earlier SDK versions, please check out [accompanying releases](https://github.com/zivid/zivid-halcon-samples/tree/master/../../releases). @@ -74,7 +74,8 @@ 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 Ubuntu 20.04, 22.04. +Zivid and HALCON are compatible with Windows 10 and 11, and Ubuntu +20.04, 22.04. ----- diff --git a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModel.hdev b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModel.hdev index a36c838..984b5fb 100644 --- a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModel.hdev +++ b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModel.hdev @@ -9,8 +9,8 @@ * It should be used together with the SurfaceMatchingFindModel.hdev where the model created by this program is utilized for surface-based 3D matching algorithm. * This example comes with HDR settings and other parameters which were used to create models of the following three objects: * Twinings tea box - * Pringles can (190 g) - * plastic Coca-Cola bottle (0.5 l) + * Pepsi can (0.3 l) + * plastic Coca-Cola bottle (2 l) * * 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 * GenICamTL interface. @@ -37,34 +37,33 @@ * Resetting any previous HDR settings set_framegrabber_param (AcqHandle, 'ResetAcquisitions', 1) - * Configuring HDR settings (Twinings tea box) - *set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - *set_framegrabber_param (AcqHandle, 'Aperture', 5.65) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - *set_framegrabber_param (AcqHandle, 'Aperture', 4.0) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - - * Configuring HDR settings (Pringles can) - *set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - *set_framegrabber_param (AcqHandle, 'Aperture', 4.36) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - *set_framegrabber_param (AcqHandle, 'Aperture', 2.0) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - - * Configuring HDR settings (Coca-Cola bottle) - *set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - *set_framegrabber_param (AcqHandle, 'Aperture', 6.16) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - *set_framegrabber_param (AcqHandle, 'Aperture', 3.08) - *set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - - * Configuring HDR settings (Your own object) + * Setting global settings + set_framegrabber_param (AcqHandle, 'Engine', 'omni') + set_framegrabber_param (AcqHandle, 'SamplingColor', 'rgb') + set_framegrabber_param (AcqHandle, 'SamplingPixel', 'blueSubsample2x2') + set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianSigma', 2.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalThreshold', 2.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseSuppressionEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRepairEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalThreshold', 10.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMaxNeighborDistance', 6) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMinArea', 600) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionCorrectionEnabled', 0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', 0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', 0.7) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', 1) + + * Configuring HDR settings set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - set_framegrabber_param (AcqHandle, 'Aperture', 10.37) + set_framegrabber_param (AcqHandle, 'Aperture', 2.64) set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 5.50) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 2.37) + set_framegrabber_param (AcqHandle, 'Aperture', 2.64) set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) * Capturing frame (HDR) diff --git a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModelFromFile.hdev b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModelFromFile.hdev index 974c7a2..54c4d8d 100644 --- a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModelFromFile.hdev +++ b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingCreateModelFromFile.hdev @@ -9,8 +9,8 @@ * It should be used together with the SurfaceMatchingFindModelFromFile.hdev where the model created by this program is utilized for surface-based 3D matching algorithm. * This example comes with models of three following objects: * Twinings tea box - * Pringles can (190 g) - * plastic Coca-Cola bottle (0.5 l) + * Pepsi can (0.3 l) + * plastic Coca-Cola bottle (2 l) * * 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 * GenICamTL interface. @@ -25,18 +25,18 @@ * Reading a 3D point cloud of the scene * Twinings tea box SurfaceModelFile:= 'TwiningsTeaBox' - * Pringles can - * SurfaceModelFile:= 'PringlesCan' + * Pepsi can + * SurfaceModelFile:= 'PepsiCan' * Coca-Cola bottle * SurfaceModelFile:= 'CocaColaBottle' import './../../../Procedures' get_zivid_sample_data_dir(ZividDataDir) ScenePath := ZividDataDir + '/ObjectMatching/' + SurfaceModelFile + '/Im1.ply' - * Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'. - Camera := 'Zivid One+' + * Specify the camera that point cloud was taken with; options are: 'Zivid 2' and 'Zivid 2+'. + Camera := 'Zivid 2+' * Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2' - SamplingPixel := 'all' + SamplingPixel := 'blueSubsample2x2' get_zivid_camera_width (Camera, SamplingPixel, MapWidth) read_object_model_3d (ScenePath, 'm', ['xyz_map_width'], MapWidth, ObjectModel3D_Scene, Status) diff --git a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModel.hdev b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModel.hdev index c9c1375..ebb77e0 100644 --- a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModel.hdev +++ b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModel.hdev @@ -9,8 +9,8 @@ * The model used for matching is created from a reference view of the object, see SurfaceMatchingCreateModel.hdev or SurfaceMatchingCreateModel.hdevFromFile. * The model is then searched for in a newly captured 3D point cloud. This example comes with models for the three following objects: * Twinings tea box - * Pringles can (190 g) - * plastic Coca-Cola bottle (0.5 l) + * Pepsi can (0.3 l) + * plastic Coca-Cola bottle (2 l) * * 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 * GenICamTL interface. @@ -23,8 +23,8 @@ * Specify the HALCON model for surface-based 3D matching * Existing Twinings tea box model SurfaceModelFile := 'TwiningsTeaBox' - * Existing Pringles can model - * SurfaceModelFile := 'PringlesCan' + * Existing Pepsi can model + * SurfaceModelFile := 'PepsiCan' * Existing Coca-Cola bottle model * SurfaceModelFile := 'CocaColaBottle' * Your own model created with the SurfaceMatchingCreateModel.hdev @@ -54,41 +54,34 @@ * Reseting any previous HDR settings set_framegrabber_param (AcqHandle, 'ResetAcquisitions', 1) + * Setting global settings + set_framegrabber_param (AcqHandle, 'Engine', 'omni') + set_framegrabber_param (AcqHandle, 'SamplingColor', 'rgb') + set_framegrabber_param (AcqHandle, 'SamplingPixel', 'blueSubsample2x2') + set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersSmoothingGaussianSigma', 2.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRemovalThreshold', 2.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseSuppressionEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersNoiseRepairEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersOutlierRemovalThreshold', 10.0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMaxNeighborDistance', 6) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersClusterRemovalMinArea', 600) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionCorrectionEnabled', 0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', 0) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', 0.7) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', 1) + * Configuring HDR settings - * Twinings tea box - if (SurfaceModelFile = 'TwiningsTeaBox') - set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - set_framegrabber_param (AcqHandle, 'Aperture', 5.50) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 4.00) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - endif - * Pringles can - if (SurfaceModelFile = 'PringlesCan') - set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - set_framegrabber_param (AcqHandle, 'Aperture', 4.36) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 2.37) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - endif - * Coca-Cola bottle - if (SurfaceModelFile = 'CocaColaBottle') - set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - set_framegrabber_param (AcqHandle, 'Aperture', 6.16) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 3.08) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - endif - * Your own model created with the SurfaceMatchingCreateModel.hdev - if (SurfaceModelFile = '') - set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) - set_framegrabber_param (AcqHandle, 'Aperture', 16.00) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 5.50) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - set_framegrabber_param (AcqHandle, 'Aperture', 2.37) - set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) - endif + set_framegrabber_param (AcqHandle, 'ExposureTime', 10000) + set_framegrabber_param (AcqHandle, 'Aperture', 2.64) + set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) + set_framegrabber_param (AcqHandle, 'Aperture', 2.64) + set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) * Loading the HALCON model for surface-based 3D matching if (MySurfaceModelFile) @@ -139,15 +132,15 @@ * RelSamplingDistance - point cloud downsampling (0 = no downsampling) * Twinings tea box if (SurfaceModelFile = 'TwiningsTeaBox') - RelSamplingDistance := 0.01 - endif - * Pringles can - if (SurfaceModelFile = 'PringlesCan') RelSamplingDistance := 0.03 endif + * Pepsi can + if (SurfaceModelFile = 'PepsiCan') + RelSamplingDistance := 0.01 + endif * Coca-Cola bottle if (SurfaceModelFile = 'CocaColaBottle') - RelSamplingDistance := 0.003 + RelSamplingDistance := 0.02 endif * Your own model created with the SurfaceMatchingCreateModel.hdev if (SurfaceModelFile = '') diff --git a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModelFromFile.hdev b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModelFromFile.hdev index 38465d6..0c7519e 100644 --- a/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModelFromFile.hdev +++ b/source/Applications/Advanced/ObjectMatching/SurfaceMatchingFindModelFromFile.hdev @@ -9,8 +9,8 @@ * 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 * captured 3D point cloud. This example comes with models for the three following objects: * Twinings tea box - * Pringles can (190 g) - * plastic Coca-Cola bottle (0.5 l) + * Pepsi can (0.3 l) + * plastic Coca-Cola bottle (2 l) * * 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 * GenICamTL interface. @@ -24,19 +24,19 @@ * Specify the object for surface-based 3D matching * Existing Twinings tea box model - SurfaceModelFile := 'TwiningsTeaBox' - * Existing Pringles can model - * SurfaceModelFile := 'PringlesCan' + * SurfaceModelFile := 'TwiningsTeaBox' + * Existing Pepsi can model + * SurfaceModelFile := 'PepsiCan' * Existing Coca-Cola bottle model - * SurfaceModelFile := 'CocaColaBottle' + SurfaceModelFile := 'CocaColaBottle' import './../../../Procedures' get_zivid_sample_data_dir(ZividDataDir) ScenePath := ZividDataDir + '/ObjectMatching/' + SurfaceModelFile - * Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'. - Camera := 'Zivid One+' + * Specify the camera that point cloud was taken with; options are: 'Zivid 2' and 'Zivid 2+'. + Camera := 'Zivid 2+' * Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2' - SamplingPixel := 'all' + SamplingPixel := 'blueSubsample2x2' get_zivid_camera_width (Camera, SamplingPixel, MapWidth) * Specify whether you want to use your own model created with the SurfaceMatchingCreateModelFromFile.hdev @@ -100,15 +100,15 @@ * RelSamplingDistance - point cloud downsampling (0 = no downsampling) * Twinings tea box if (SurfaceModelFile = 'TwiningsTeaBox') - RelSamplingDistance := 0.01 - endif - * Pringles can - if (SurfaceModelFile = 'PringlesCan') RelSamplingDistance := 0.03 endif + * Pepsi can + if (SurfaceModelFile = 'PepsiCan') + RelSamplingDistance := 0.01 + endif * Coca-Cola bottle if (SurfaceModelFile = 'CocaColaBottle') - RelSamplingDistance := 0.003 + RelSamplingDistance := 0.02 endif * KeyPointFraction - additional downsampling for the detection (1 = all points used) KeyPointFraction := 1 diff --git a/source/Applications/Basic/FileFormats/ReadPLY.hdev b/source/Applications/Basic/FileFormats/ReadPLY.hdev index ae45dcd..cd97c43 100644 --- a/source/Applications/Basic/FileFormats/ReadPLY.hdev +++ b/source/Applications/Basic/FileFormats/ReadPLY.hdev @@ -20,10 +20,10 @@ import './../../../Procedures' get_zivid_sample_data_dir(ZividDataDir) PointCloudFile := ZividDataDir + '/Zivid3D.ply' - * Specify the camera that point cloud was taken with; options are: 'Zivid One+', 'Zivid 2', and 'Zivid 2+'. - Camera := 'Zivid One+' + * Specify the camera that point cloud was taken with; options are: 'Zivid 2' and 'Zivid 2+'. + Camera := 'Zivid 2+' * Specify SamplingPixel that point cloud was taken with; options are: 'all', 'blueSubsample2x2', and 'redSubsample2x2' - SamplingPixel := 'all' + SamplingPixel := 'blueSubsample2x2' get_zivid_camera_width (Camera, SamplingPixel, MapWidth) read_object_model_3d (PointCloudFile, 'mm', ['xyz_map_width'], MapWidth, ObjectModel3D, Status) diff --git a/source/Camera/Basic/CaptureHDRCompleteSettings.hdev b/source/Camera/Basic/CaptureHDRCompleteSettings.hdev index 3d31a2a..3360804 100644 --- a/source/Camera/Basic/CaptureHDRCompleteSettings.hdev +++ b/source/Camera/Basic/CaptureHDRCompleteSettings.hdev @@ -65,7 +65,7 @@ set_framegrabber_param (AcqHandle, 'AddAcquisition', 1) * Setting global settings - set_framegrabber_param (AcqHandle, 'ExperimentalEngine', 'phase') + set_framegrabber_param (AcqHandle, 'Engine', 'phase') set_framegrabber_param (AcqHandle, 'SamplingColor', 'rgb') set_framegrabber_param (AcqHandle, 'SamplingPixel', 'all') set_framegrabber_param (AcqHandle, 'RegionOfInterestBoxEnabled', 1) @@ -99,9 +99,9 @@ set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionCorrectionStrength', 0.4) set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', 1) set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalThreshold', 0.5) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingEnabled', 1) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingHoleSize', 0.2) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingStrictness', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', 1) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', 0.2) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', 1) set_framegrabber_param (AcqHandle, 'ProcessingColorBalanceBlue', 1) set_framegrabber_param (AcqHandle, 'ProcessingColorBalanceGreen', 1) set_framegrabber_param (AcqHandle, 'ProcessingColorBalanceRed', 1) diff --git a/source/Procedures/get_zivid_camera_width.hdvp b/source/Procedures/get_zivid_camera_width.hdvp index f4de5e7..0bdbcc9 100644 --- a/source/Procedures/get_zivid_camera_width.hdvp +++ b/source/Procedures/get_zivid_camera_width.hdvp @@ -11,9 +11,7 @@ - if (Camera == 'Zivid One+') - Width := 1920 - elseif (Camera == 'Zivid 2') + if (Camera == 'Zivid 2') Width := 1944 elseif (Camera == 'Zivid 2+') Width := 2448 diff --git a/source/Procedures/get_zivid_model_folder_name.hdvp b/source/Procedures/get_zivid_model_folder_name.hdvp index 7e8f6ab..8350d31 100644 --- a/source/Procedures/get_zivid_model_folder_name.hdvp +++ b/source/Procedures/get_zivid_model_folder_name.hdvp @@ -11,9 +11,7 @@ tuple_split(DeviceModelName, ' ', Substrings) - if (Substrings[1] == 'One') - ZividFolder := 'zividOne' - elseif (Substrings[1] == '2') + if (Substrings[1] == '2') ZividFolder := 'zivid2' elseif (Substrings[1] == '2+') ZividFolder := 'zivid2Plus' diff --git a/source/Procedures/read_zivid_json_params.hdvp b/source/Procedures/read_zivid_json_params.hdvp index 3988d61..503c5c6 100644 --- a/source/Procedures/read_zivid_json_params.hdvp +++ b/source/Procedures/read_zivid_json_params.hdvp @@ -35,9 +35,8 @@ endfor * Engine - get_dict_tuple (Settings, 'Experimental', Experimental) - get_dict_tuple (Experimental, 'Engine', Engine) - set_framegrabber_param (AcqHandle, 'ExperimentalEngine', Engine) + get_dict_tuple (Settings, 'Engine', Engine) + set_framegrabber_param (AcqHandle, 'Engine', Engine) * Sampling get_dict_tuple (Settings, 'Sampling', Sampling) @@ -131,9 +130,8 @@ get_dict_tuple (Reflection, 'Removal', Removal) get_dict_tuple (Removal, 'Enabled', Enabled) set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalEnabled', Enabled) - get_dict_tuple (Removal, 'Experimental', Experimental) - get_dict_tuple (Experimental, 'Mode', Mode) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalExperimentalMode', Mode) + get_dict_tuple (Removal, 'Mode', Mode) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersReflectionRemovalMode', Mode) * Smoothing Filter get_dict_tuple (Filters, 'Smoothing', Smoothing) @@ -157,14 +155,15 @@ set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalEnabled', Enabled) set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalContrastDistortionRemovalThreshold', Threshold) - * Hole Filling Filter - get_dict_tuple (Experimental, 'HoleFilling', HoleFilling) - get_dict_tuple (HoleFilling, 'Enabled', Enabled) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingEnabled', Enabled) - get_dict_tuple (HoleFilling, 'HoleSize', HoleSize) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingHoleSize', HoleSize) - get_dict_tuple (HoleFilling, 'Strictness', Strictness) - set_framegrabber_param (AcqHandle, 'ProcessingFiltersExperimentalHoleFillingStrictness', Strictness) + * Hole Repair Filter + get_dict_tuple (Filters, 'Hole', Hole) + get_dict_tuple (Hole, 'Repair', Repair) + get_dict_tuple (Repair, 'Enabled', Enabled) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairEnabled', Enabled) + get_dict_tuple (Repair, 'HoleSize', HoleSize) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairHoleSize', HoleSize) + get_dict_tuple (Repair, 'Strictness', Strictness) + set_framegrabber_param (AcqHandle, 'ProcessingFiltersHoleRepairStrictness', Strictness) * Color Settings get_dict_tuple (Processing, 'Color', Color) diff --git a/source/SampleUtils/convert_intrinsics_opencv_to_halcon.py b/source/SampleUtils/convert_intrinsics_opencv_to_halcon.py index 002af3d..a30759d 100644 --- a/source/SampleUtils/convert_intrinsics_opencv_to_halcon.py +++ b/source/SampleUtils/convert_intrinsics_opencv_to_halcon.py @@ -20,6 +20,8 @@ GetCameraIntrinsics.cpp code sample from https://github.com/zivid/zivid-cpp-samples. An example YML file for this sample can be found under the main instructions for Zivid samples. +Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. + """ import argparse @@ -237,14 +239,6 @@ def from_file(cls, filepath: Path, model_name: str, sampling: str): if sampling in ["blueSubsample2x2", "redSubsample2x2"]: pixel_size *= 2 image_size = (image_size / 2).astype(np.int32) - elif model_name in [ - "zivid one", - "zivid one plus", - ]: - pixel_size = 5.86e-6 - image_size = np.array([np.int32(1920), np.int32(1200)]) - if sampling != "all": - raise ValueError(f"{sampling} is not supported for {model_name.title()}") return cls(pixel_size, image_size, intrinsics) @@ -270,13 +264,8 @@ def from_camera(cls, settings_path: Optional[Path] = None): if settings and settings.sampling.pixel in ["blueSubsample2x2", "redSubsample2x2"]: pixel_size *= 2 image_size = (image_size / 2).astype(np.int32) - elif "zividOne" in camera.info.model: - pixel_size = 5.86e-6 - image_size = np.array([np.int32(1920), np.int32(1200)]) - if settings and settings.sampling.pixel != "all": - raise ValueError(f"{settings.sampling.pixel} is not supported for {camera.info.model_name}") else: - raise RuntimeError("Unsupported camera model in this sample") + raise RuntimeError("Unsupported camera model") return cls(pixel_size, image_size, intrinsics) @@ -358,7 +347,7 @@ def _args() -> argparse.Namespace: parser.add_argument( "--model-name", type=str, - choices=["zivid one", "zivid one plus", "zivid 2", "zivid 2+"], + choices=["zivid 2", "zivid 2+"], required="--input-intrinsics" in sys.argv, help="Zivid camera model", )