Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

To increase the framerate of a Basler Cameralink Camera(A504K) with a Card Grabber PCIE-1429

Solved!
Go to solution

Hi,

I am using a monochrome Basler Cameralink Camera(A504K)of resolution 1280x1024 with a card grabber PCIE-1429 (x4 slot). The image acquisition is controlled through MAX  of LabVIEW version 11.0.1. The problem is that when I try to reduce the number of rows(more specifically Height) from 1024 to 32(say)in the acquisition window(of MAX), the frame rate of the camera should increase almost upto 16,000fps. But it is not going beyond 248fps. Can you suggest  me, why is it so happening, Or How to increase its frame rate? Also, below the image window there appeared something like: 1280x32    1X   8-bit image  9. What does 1X actually mean here?For your ready reference I am also attaching the image of the acquisation window.

 

Thanks!

0 Kudos
Message 1 of 21
(9,522 Views)
Solution
Accepted by topic author Romai

Hi Romai,

 

Changing the height of your image in MAX will not increase the frame rate of your acquisiton - the camera is still sending the same number of lines per frame, you've just told the software to stop reading them sooner.  The next frame still doesn't occur until the next FVAL edge.

 

The 1x at the bottom indicates that you are viewing the image at a magnification of 1x.  In MAX, you can zoom in and zoom out, and this indicator lets you know your current zoom level.

Message 2 of 21
(9,491 Views)

Dear Kellam,

 

Thanks for your reply. 

I got your point but do you have any idea about how to increase its frame rate?

 

 

 

 

Thanks!

0 Kudos
Message 3 of 21
(9,480 Views)

I don't have that camera, so I am unable to try things out.  From the camera datasheet (http://www.baslerweb.com/products/A500.html?model=303&language=en), the A504k is a 500fps camera.  You seem to be getting half of that as is.  There are a couple of things that might be happening.  First, the camera may just be set to send at a lower rate.  Many cameras have settings that can affect frame rate, including averaging and exposure time.  Second, I would try using the low level ring example in LabVIEW.  There is a chance that MAX is using a grab, and because the frame rate is so fast, MAX just ends up dropping every other frame.  A ring with a larger number of buffers can help address that.

 

Good luck.

0 Kudos
Message 4 of 21
(9,477 Views)

Hi,

 

have you solved your problem?

 

I have acA2000-340kc CameraLink cam with NI PCIe-1433 grabber and things do not work very well. After approx 900..1200 captured frames (regardless of the intitial settings in MAX) I get missing frames. I tried to play with image buffer size but no luck, it is not clear to me why after ~1000 frames I get 30-40% lost frames. I use IMAQ wizard set for continues grabbing. My machine has 32Gb ram, 8 cores of AMD FX 3.6GHz CPU should be no problem. I need to capture only 30 seconds of frames, cache it and then write to disk (no image processing or saving in real-time required).

 

Could you post your LV code?

 

regards,

 Alex

 

 

0 Kudos
Message 5 of 21
(9,414 Views)

Hi Alex,

 

I have the same camera and grabber, but I'm new in LabView work, so can I ask you if you use a standard VI "grab and save avi" for your work?

because, with standard settings the camera should record at 300fps, insted I always have between 50 and 70fps...

Thank you,

 

Anto

 

0 Kudos
Message 6 of 21
(9,117 Views)

Hi Anto,

 

things are more complicated in my case. The computer I/O and/or speed of the HDD do no let me to save large stream of frames at desired frame rate. Therefore, I do following:

1) send each frame into the queue; I had to reduce frame size to 720x512 instead of full resolution

2) since I have 8 cores on that machine, I created 4 tasks which do only one thing: take a frame from the queue and save it into the disk as fast as possible with no image processing

3) saving on the HDD is an issue, so each of 4 tasks save frames into the virtual 24Gb drive instead of the real HDD. Even SSD drive will not help you!

4) note, frames are saved in an uncompressed BMP format! If you attempt to save them as jpg then your CPU will spend crucial 2-10ms for compressing it.

 

With this implementation and camera (with specs of only 340fps) I managed to grab frames with peak 735fps rate. My point is that your bottleneck probably lies not in the method you use/call to save the frames, but in computer hardware and I/O. You have to accumulate frames in RAM or virtual drive and then save them without processing.

 

I still have some frame loses, it is approximately 1-2% of the frames are lost. I do not know why.  Some notes:

1)      to achieve as less as possible frame loss you have to minimize information you output on UI in real-time.

2)      Utilize multitasking!

3)      Put highest priority for your VI (check settings in properties)

4)      In theory the 64bit should perform a bit better than 32bit LabView, in my experience it is in opposite. I run 32bit LabView on 64bit Windows7 machine. This is strange…

5)      Unfortunately 32bit LV has limitation on RAM allocation (4Gb only) otherwise I would store all captured frames in RAM (32Gb) avoiding even usage of the virtual drive. I use 24Gb virtual drive. It is enough for me to capture frames for about 1-1.5 minutes @735fps.

6)      If you need any kind of real-time image processing (which I would like to have) then probably you need to purchase FPGA card and program it.

 

Actually, seem that LabView and VDM modules do not utilize computer hardware optimally. I would like to use the power of all cores and even GPU. The GPU can encode and process images, but LV has limited support of it.

 

The best option for lossless capturing, at least for me, is to find the time and write a C++ code which will do the job.

 

regards,

 Alexander

 

0 Kudos
Message 7 of 21
(9,111 Views)

Hi Alex,

 

thank you for your usefull notes. Yes, your case is more complicated then mine Smiley Surprised.

In my case, I just need the camera to aquire videos of 30seconds experiments at 300 fps, without any processing, just the raw avi that I can use then for correlation with sensors data. In my case I have 4 core with 8 GB of Ram and the 64bit system.

I use Pylon Viewer for now to store the right setting in the camera, disabling the sending of serial command of MAX, because in the camera file from NI are present only the base function. When I test the aquisition with the IMAQ VI Continous Aquisition, the frame rate seems right, 300.

But then, when I aquire a video (I'm using a modified version of the template "grab and save avi" for now, I've just started to use LV) of just 1/2 second in order to test the frame rate, I have just 50/60 frame each seconds.

I'll do more testing, but do you know of some template more suitable for my case that can help me?

Thank you very much,

 

Antonio 

0 Kudos
Message 8 of 21
(9,107 Views)

 

have you managed to save 300fps with IMAQ VI Continous Aquisition? Or you just counted them and got the numer 300?

 

 

I also started from the grab and save VI. And eventually this code evolved further in order to be able to save more fps. If only 0.5s is needed to store then keep them in RAM until the end of shooting.

 

I used following sequence subVIs: IMAQ init, IMAQ configure, IMAQ configure buffer (with 200 size), IMAQ occurance config, IMAQ start, IMAQ copy acquired buffer (in the loop waiting for the each ready to fetch frame and sending them to a queue), IMAQ stop and other de-initializing vis.

 

 

Think like this: seek time (to find just right sector only!) of your HDD is 2-5ms. Add to this [M]byte transfer time for a frame camera->PCI card, PCI card->memory and memory->HDD. In VI your case with desired 300fps you have only 3ms to (i) capture the frame and (ii) save it to HDD. The 50-60fps you get is the limit which is unlikely you can overcome by just direct dumping to HDD (I think I've got the similar values when I started). If you have a SSD or HDD with 64MB of cache then you may approach 100fps but only for the period of time until the cache is full. Losses will increase in time because eventually Windows will save or do "somehting big" occuping I/O bandwidth and CPU time.

 

The video streaming is even worse, I have not managed to save any video with high fps. Instead, I've written a converter which scans my virtual drive for all 30k-50k images and creates a video file at slow-motion mode (735fps slowed down to 25fps). To encode the video in real-time you realy need some kind a hardware-assisted encoding of you frame stream.

 

PS: disable (or uninstall completely) antivirus software and other things which may eat your I/O bandwidth. In my case I am disabling even the network card and file indexing. Good practice is also to have two HDDs: one for OS and programs, another one for frame dump. Disable indexing on a 2nd drive.

 

 

Please let me know how you solved your case. Also would be great to hear alternative solutions from folks. Mine approach is not the best one 😉

 

/Alexander

 

 

0 Kudos
Message 9 of 21
(9,095 Views)

No I didn't manage to save at 300fps, maybe I explained in the wrong way....

I configured the camera on Pylon and saved the setting in the camera, and disabled the serial command on the camera file, so I'm sure of the camera setting. In this way, when I run the Vision Acquisition Express and add an indicator to see the acquisition frame rate, the inidcator seems to indicate the right value. But then, when i try to save a two second video with both  "grab and save avi" and "grab and save to disk" I record - in the last test - only at 90fps.

 

I'll try to create something similar to the sequence you suggested: i think it will take some time for me, in case I will let you know..

Thanks,

 

Anto

 

 

0 Kudos
Message 10 of 21
(9,092 Views)