LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get image data out of activex control (Euresys) by array pointer?

Hi all,

 

in a previous message I have asked for help on how to use the Euresys and Multicam ActiveX controls to get a camera image in Labview. We now have a working program that displays the live image on the control. Now we are stuck with the next step:

We acquire 4 images 2048x2048 in 12 bit (we use the BW16 image type) per second. What we want to do with the images (if processing time permits):

 

- Check with some image analysis functions whether there is an interesting object in the image (e.g. by comparing it to a reference image without objects and set

a threshold for how much the images need to differ) - there seem to be functions within Euresys to do this.

- If the image is "interesting" store it as an image file to disk. We would prefer a compressed image format like png. The euresys functions only support uncompressed TIFF for 16 bit images so we need to convert the image into a IMAQ image to save it. Now the problem is: 

 

How to get the image data out of the ActiveX object? The object has a function that returns one pixel per call. We tried to loop over all pixels but this took several minutes per image - no option!

The only other function of this ActiveX object to access data is returning a pointer - very likely to a SAFEARRAY within the object. Is there any easy and quick way to read this array into Labview?

Is it reasonable to do all this with the framerate and imagesize we are targeting for?

 

Thanks for your help!

 

Olaf

Message Edited by Olaf Stetzer on 02-06-2009 12:36 PM
0 Kudos
Message 1 of 5
(5,129 Views)

Olaf Stetzer wrote:

Hi all,

 

in a previous message I have asked for help on how to use the Euresys and Multicam ActiveX controls to get a camera image in Labview. We now have a working program that displays the live image on the control. Now we are stuck with the next step:

We acquire 4 images 2048x2048 in 12 bit (we use the BW16 image type) per second. What we want to do with the images (if processing time permits):

 

- Check with some image analysis functions whether there is an interesting object in the image (e.g. by comparing it to a reference image without objects and set

a threshold for how much the images need to differ) - there seem to be functions within Euresys to do this.

- If the image is "interesting" store it as an image file to disk. We would prefer a compressed image format like png. The euresys functions only support uncompressed TIFF for 16 bit images so we need to convert the image into a IMAQ image to save it. Now the problem is: 

 

How to get the image data out of the ActiveX object? The object has a function that returns one pixel per call. We tried to loop over all pixels but this took several minutes per image - no option!

The only other function of this ActiveX object to access data is returning a pointer - very likely to a SAFEARRAY within the object. Is there any easy and quick way to read this array into Labview?

Is it reasonable to do all this with the framerate and imagesize we are targeting for?

 

Thanks for your help!

 

Olaf

Message Edited by Olaf Stetzer on 02-06-2009 12:36 PM

If it is a pointer (uInt32 for instance) it is just that, a POINTER. It will point to a memory buffer that contains the data as it comes from the framegrabber. How to deal with that in LabVIEW? Well honestly not really directly. It can be done but is very cumbersome. LabVIEW itself doesn't know about pointers on a diagram level and consequently doesn't have functions to deal with them.

 

My approach would be to first create an IMAQ image which consists of the necessary size (row and columns) and a compatible image type. Then using the IMAG Get Image Pixel Pointer function get the internal pointer to that image from IMAQ.

 

Next would be to write a DLL exporting a C function that takes this IMAQ pointer, the Euresys pointer, extra information such as rowBytes, padding, rows and columns as well as datatype for both the IMAQ image and the Eurosys frame. In the function you would have to copy the data from the Euresys pointer into the IMAQ pointer but be aware that the format of those images could be different. Things that can and will vary:

1) row padding

2) pixel format

3) color encoding

 

A nice and laborous task for sure! Smiley Very Happy

 

PS: Someone from Euresys told me years ago that yes they did have LabVIEW VIs for their frame grabbers. Maybe that would be an easier path to follow? Smiley Wink

 

Rolf Kalbermatter

Message Edited by rolfk on 02-11-2009 10:34 AM
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(5,100 Views)

Hi Olaf,

 

let me know if you need further help. Some more detailed informationwould be appreciated, e.g. exact type of framegrabber, API documentation of Euresys ....

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 3 of 5
(5,086 Views)

Hi all,

 

thanks for both your answers. We are in Contact with the supplier of the hardware and they did not tell us anything about available Labview software that they could offer. We told them that we are working with Labview. The hardware setup we are using:

 

Camera: SVS-Vistek-4021-12b-S (a 12-bit grays-scale camera with 2048x2048 pixels. Yes, we need the 12 bit depth! 🙂

Framegrabber: Grablink Expert 2 (we need the trigger output to trigger a pulsed laser for the illumination)

 

The interface is cameralink. As far as I know it is a special maybe non-standard protocol which is used. The image is split in

two halfes and each half is transferred as an individual image. Both halves have to be merged together afterwards by the

software. The Euresys driver does this. So if the recommendation would be to use a NI framegrabber, it has to be compatible with 

this special protocol and as I mentioned above, we need the trigger output for the laser.

 

Without buying new hardware there seem to be three options:

 

1.  Get the image out of the ActiveX control into Labview, do processing and storage in Labview.

2. Kep everything in the Euresys framework, do the image analysis and storage there with EVision via ActiveX (but control the the process from within Labview).

3. Use The DLL interface of the driver instead of the ActiveX control. It might be more programming work but maybe it is easier to get

the image data transferred to Labview in a quick way. Do analysis and storage with IMAQ then.

 

There is a parallel thread which started with a slightly different topic (for this reason I created a new thread here):

http://forums.ni.com/ni/board/message?board.id=200&message.id=21693

 

Cheers,

 

Olaf

0 Kudos
Message 4 of 5
(5,063 Views)

Hi Olaf, I am also trying to acquire an image with Picolo Euresys: if it is possible, could you send me the VI to acquire video from Picolo? Or give me a help because I am involved in a very important task with this board.

 

Thanks,

 

Claudio

0 Kudos
Message 5 of 5
(4,054 Views)