Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I acquire small high speed images via CameraLink?

      I need to acquire a large number of small high-frame-rate images using a PCI-1427 CameraLink frame grabber. I need to grab 8 seconds or more of images as small as 80 x 4 pixels (h x v) at frame rates up to 36 kHz. The problem is the overhead required for allocation of tens or even a hundred thousand IMAQ buffers, as would be required in the Sequence examples from NI. The overhead for setting up 20,000 buffers is 128 seconds on a relatively new PC. This works, but the setup overhead is prohibitive for longer acquisitions. I thought of using a ring buffer, but I doubt I can extract images from the ring quickly enough to avoid dropped images. 
  I got around a similar situation with a different camera that used RS422 parallel output with a PCI-1424 frame grabber, by allocating large buffers with a vertical height which each contained many small frames. That has not worked so far with CameraLink; If the camera configuration contains more lines than a single frame, I get a timeout error when trying a snap with Measurement and Automation Explorer.
       This is similar to the application of a line scan camera, although each frame is at least 4 lines rather than 1 line. I see at <http://zone.ni.com/devzone/cda/epd/p/id/4328> that NI discusses a Variable Height Acquisition mode for line scan cameras. The LL VHA RIng.vi example supplied with NI-IMAQ does not appear to work with the PCI-1427 which apparently does not support VHA mode. Is the PCIe-1427 the correct card for what I want to do?

Thanks for any ideas or assistance.
-Charles Lasnier 
Message 1 of 5
(4,114 Views)

If you have fixed acquisition time I would like to recommend to allocate one big buffer instead of lot of small (in your case 80 x (4* 36000 * 😎 pixels), then drop small images into big one with Image to Image function. Should be fast enough on the modern PC.

 

Andrey.

 

Message Edited by Andrey Dmitriev on 07-22-2009 11:44 AM
0 Kudos
Message 2 of 5
(4,097 Views)

Thank you Andrey, I'd like to try that. Do you mean for instance, I should acquire the images in a ring using small buffers and shuffle them off one at a time to the large image buffer? And that this is faster than converting each image to a subarray? (I did not mention these are 14-bit images.) It looks like ImagetoImage is not included with NI-IMAQ so I need IMAQ Vision.

 

-Charles Lasnier 

0 Kudos
Message 3 of 5
(4,086 Views)

One thing I can offer is you probably can reuse the allocated buffers. I mean, it'll take a long time the first time, but then you'll be able to pass them back into a sequence over and over again. That'll cut down on successive time use.

 

I don't think VHA is appropriate for this application.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 4 of 5
(4,073 Views)

   I have found a work-around for this issue. I used the NI Camera File Generator to make a new camera file and chose line scan instead of area scan. I picked a vertical size of 5000 lines, which in my case would be 1000 times the actual number of lines in a camera frame. The frame grabber now ignores the frame valid signal and puts lines into the image buffer until it is full, then starts on the next buffer. No lines are dropped. After acquisition is complete, I extract the data into a large m x n array where n is the horizontal size of the image and m is 5000*number of buffers. I trim off the partial frames at the top and bottom, then reform the array into j x k x n where j is the number of complete frames, and k is the vertical size of one frame. This approach reduces the number of image buffers required by 1000, which makes the create and configure much faster.

   This works easily for my camera because the top line of every frame is a header containing camera settings, so I can tell where a frame begins, to know how many lines to trim off to eliminate the partial frames at the start and end.

0 Kudos
Message 5 of 5
(3,927 Views)