Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

High speed real time image acquisition using RT desktop

Hi there, Just wondering how I can increase frame rate (or in better words decrease loop execution time) in my image acquisition and processing VIs shown in the two screen shuts that I’ve posted. I am using LabVIEW real-time operating system to run the target VI on a RT desktop machine. Image acquisition part is basically one of LabVIEW examples (LL Ring), and the processing part, as can be seen in the screen shuts, is just a simple edge detection in a linear 8k pixel grayscale image.  The highest frame rate that I can grab and process using these VIs is a bit less than 1.5k fps, but I need to somehow double this speed.

Here are some specifications of the image acquisition and processing system:

 

-                   -        DALSA line-scan camera P2-23-80k40 (9.3 kHz, 8k pixels)-                   -        NI PCIe-1430 frame grabber board-         LabVIEW 8.6-         LabVIEW Real-Time Operating System 8.6.1 -         Real-Time Desktop/Target PC (2.66GHz CPU (Core 2), 2GB RAM, 160GB HDD)-         Host PC (2.66GHz CPU (Core 2), 3.2GB RAM, 300GB HDD)-         Communication is through a 100 Mbps LAN 

Any comments on this would be most appreciated.Thanks,Mostafa
Download All
0 Kudos
Message 1 of 5
(3,982 Views)

I would start by removing or commenting out the analysis portion of the code and seeing what the frame rate is.  If the frame rate goes way up, the bottleneck is the analysis.  If the frame rate stays about the same, it is the acquisition. 

 

I get the impression that you are acquiring a single line at a time.  You might get a better acquisition rate if you acquire multiple lines per frame.  You could use an internal loop to analyze each line of a multi-line frame.

 

Let us know which one is the bottleneck, and we can go from there.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 5
(3,980 Views)
Thanks for your reply Bruce! I removed the processing part and it could grab a bit more than 7k fps.
0 Kudos
Message 3 of 5
(3,969 Views)

Congratulations!  You have determined that the analysis is what is slowing you down.  Next step... Look at the CPU usage while the program with analysis is running.  If one CPU is barely being used, your program would probably benefit from some multiprocessor tricks.  One trick is to get your analysis and your acquisition to run in parallel.  You will have to use multiple buffers to prevent your images from being overwritten, but it could be worth the effort.

 

FYI, you should set the line rate to a fixed value that you know you can read with getting behind, then use "Buffer Number" instead of "Next Buffer" during acquisition.  "Next Buffer" always waits for the next buffer to be completely acquired, which can slow down your acquisition rate and skips buffers.  "Buffer Number" makes sure you read and analyze every buffer acquired.

 

You might want to study your analysis and see if you can get the results you need using faster tools.  For example, Simple Edge is much faster than standard edge detection and works well if you have high contrast images.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(3,964 Views)
Thanks again Bruce! I checked the CPU usage, both CPUs are used while acquisition and processing VI is run, but always main load is on one of them. Here are some examples of the CPU load share between the two CPUs: @ 500 fps    CPU 0: 8%                    CPU 1: 20%@ 1000 fps  CPU 0: 13%                    CPU 1: 39%@ 1500 fps  CPU 0: 21%                    CPU 1: 57%@ 2000 fps  CPU 0: 25%                     CPU 1: 73% Also regarding your second and third comments, if you mean in the existing VI with acquisition and processing in series, I have already been using “Buffer Number” and “Simple Edge” (in general, tools with minimum processing time), but I am a beginner in LabVIEW, so if you have any comments on the tools in my VIs (shown in the screenshots posted before), please let me know. Really appreciate your time,Mostafa
0 Kudos
Message 5 of 5
(3,928 Views)