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