zivid / zivid-halcon-samples

HALCON code samples for Zivid
https://zivid.com
BSD 3-Clause "New" or "Revised" License
13 stars 6 forks source link

Grabbing Zivid data in halcon takes at least 2.5 sec more then the Zivid studio #59

Closed HM102 closed 1 year ago

HM102 commented 1 year ago

I am using the provided code to grab the zivid data:

info_framegrabber ('GenICamTL','device', Information, Devices)
get_first_available_zivid_device (Devices, Device)
open_framegrabber ('GenICamTL',1, 1, 0, 0, 0, 0, 'progressive', -1, 'default', -1, 'false', 'default', Device, 0, 0, AcqHandle)

This code takes at least 2.5 sec more the the zivid studio.

Is there an option or parameter in the framegrabber to make it faster?

SatjaSivcev commented 1 year ago

It is expected that the first time you connect to a camera takes time; see from our Changelog (for SDK 2.7): _* The connection time to the camera is increased, due to initialization of the compute pipeline:

Also, we know there is some overhead when using GenICam for Halcon. You could be right that it is consistently 2.5 seconds slower to connect to a camera in GenICam compared to SDK/Studio. It could also be that it is not consistent; in general, in SDK/Studio, it takes 10-20 seconds depending on the PC, and on the same PC it could be +/- 2-3 seconds around the average connection time.

In general, we recommend using .hdev (via GenICam) for development, but C++ or C# (Zivid SDK + Halcon SDK) for deployment/production. This is because using Zivid SDK+Halcon SDK is faster and also because not all Zivid SDK features are exposed via GenICam (for example CaptureAssistant and Capture2D).

CaptureHalconViaZivid examples C++: https://github.com/zivid/zivid-cpp-samples/blob/master/source/Camera/Advanced/CaptureHalconViaZivid/CaptureHalconViaZivid.cpp C#: https://github.com/zivid/zivid-csharp-samples/blob/master/source/Camera/Advanced/CaptureHalconViaZivid/CaptureHalconViaZivid.cs