I started working on a project with Halcon and initially I used HDevelop 21.11 Progress version.
Recently I imported the code to C# using MVTec.HalconDotNet NuGet package but I'm having issues when connecting to the camera with OpenFramegrabber, while the same code works fine in HDevelop.
This is the C# code that it's giving me issues:
HOperatorSet.OpenFramegrabber("DirectShow", 1, 1, 0, 0, 0, 0, "default", 8, "rgb", -1, "false", "[1] RGB8 (3088x2076)", "[1] UI588xCP-M_4103243856", -1, 1, out HTuple AcqHandle);
// HalconDotNet.HOperatorException
Full exception message:
HalconDotNet.HOperatorException: 'HALCON error #5302: Image acquisition: wrong device in operator open_framegrabber'
and this is the code in HDevelop:
open_framegrabber ('DirectShow',1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', '[1] RGB8 (3088x2076)', '[1] UI588xCP-M_4103243856', -1, 1, AcqHandle)
I already tried playing around with the parameters on the C# code but the issue persist.
The device is detected by InfoFramegrabber and the output is
{["[0] PC Camera", "[1] UI588xCP-M_4103243856"]}
but the InfoFramegrabber command with info_boards only return info about device:0 (the PC Camera) in C# while on HDevelop it returns both the devices.
NuGet package version: 21110.0.0
HDevelop version: 21.11 Progress
I would highly recommend using the uEye interface for HALCON, so the complete camera parameter set is available. Otherwise, the settings you can adjust are limited in DirectShow interface.
Unfortunately, the uEye interface doesn't come with the HALCON installation anymore (compared to the past). Therefore, you must install it manually performing the following steps:
Since uEye SDK 4.96.1 the following steps are optional, cause the installer also moves the files to the correct destination:
C:\Program Files\IDS\uEye) and navigate to\interfaces\HALCON\x64\13.0or in older versions (<4.95)\OtherDrivers\HALCON\13.0C:\Program Files\MVTec\HALCON-21.11-Progress) and the folder "examples" toC:\Users\Public\Documents\MVTec\HALCON-21.11-ProgressAfter completing these steps, the camera should be accessible via name 'uEye' in
open_framegrabber()and default parameters.