Difference between Cvb.SharedImg and Cvb.Image.IMG

Thank you for the answer @Sebastian, @parsd, and ‘illusive’. All your answers were really helpful.

At the end I succeeded in creating a duplication of the original image, captured by the camera, using the function: Image.CreateDuplicateImageEx. and I’m also able to access linearly GetLinearAccess.

In my program I used SharedImg object to load the camera driver and then G2Wait and Grab image.
All works fine, but in a separate task I want to process the image, because in case the processing function takes really long time, I don’t want to block the main thread that is acquiring data.

Therefore I decided to used Image.CreateDuplicateImageEx. to create a duplication of the image, acquired by the camera, and to use the duplicated image to process (eg. GetLinearAccess and other stuff).
In this way the main thread that acquired image from the camera, does not have to wait for the processing function to complete.
To avoid memory leak I also have to release the duplicated image after the processing part it has been completed.

I do not release the camera object during acquisition, but I only dispose the camera object when the acquisition has stopped.

Is it correct what I have implemented?

Thank you in advance.

3 Likes