Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

not getting 30 fps with camera...

Our pulnix camera has 15 and 30 fps ratings. According to MAX i'm only getting 24 fps, not the best, but I can live with it. Unfortunately, with my labview VI I am only getting 2 fps with snap, and 3-4 fps with grab! 
 
Am I being limited by the time required to write to disc?I feel the problem may be with the way I've coded my VI to save the files. I have the files saved in line with the number of iterations so they save 1.png, 2.png, 3.png. I do this because it makes it easy to automatically open the files and process them. If there is a better way to do this then let me know. 
0 Kudos
Message 1 of 5
(3,794 Views)
Hello kirkland4,
It does take a lot of time to write a file.  I have a few suggestions that I think will help.  When writing images to file, I usually suggest that you use a multi-buffer acquisition like a ring or a sequence.  This way you can have multiple images in memory at once rather than a single buffer space.  With this setup you can write the image in buffer 1 to disk while the framegrabber is passing data to the next buffer space.
 
As for the saving behavior, this is going to take time no matter where it happens, but to keep the file writing process from slowing down your acquisition loop it is benenficial to move this to a second loop.  I would recommend something like a Producer-Consumer architecture.  In the producer loop you can acquire your images and the consumer loop can write your image files.  I would recommend looking at LL Ring.vi example in the example finder, and for help with the Producer-Consumer architecture you can create a new vI from template.  The design is in the framework section and is called Producer/Consumer Design Pattern (Data).  You can pass the images with a queue.
 
Hope this helps!
Angela
Applications Engineer
0 Kudos
Message 2 of 5
(3,775 Views)
Hi,
I've had a quick glance at your VI. I think the principal thing is that
you should make the acquiring and processing in parallel, i.e. acquire
the new image while rotating, displaying and saving the previous one.
Still, I don't think you can make the whole processing in 24 FPS,
mainly because the rotation you are using is very slow. Unfortunately,
the vision module does not have a fast 90 degree rotation function. The
current routine carries out an arbitrary rotation, which is much slower
than an optimized 90° rotation (the only workaround I can think of is
write your own optimized routine in C and call it from a DLL).
Moreover, you left Bilinear Interpolation set to TRUE, which even more
slows the rotation process.

Vladimir

kirkland4 wrote:
> Our pulnix camera has 15 and 30 fps ratings. According to MAX i'm only getting 24 fps, not the best, but I can live with it. Unfortunately, with my labview VI I am only getting 2 fps with snap, and 3-4 fps with grab! 
>  
> Am I being limited by the time required to write to disc?I feel the problem may be with the way I've coded my VI to save the files. I have the files saved in line with the number of iterations so they save 1.png, 2.png, 3.png. I do this because it makes it easy to automatically open the files and process them. If there is a better way to do this then let me know. 
>
>
> imagegrab.vi:
> http://forums.ni.com/attachments/ni/200/10566/1/imagegrab.vi

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

can you guys please help me see this code in a PRODUCER-CONSUMER ARCHITECTURE?

I have never worked with that procedure before. Please help..

thank you

Best regards,
Krispiekream
0 Kudos
Message 4 of 5
(3,259 Views)

Producer/Consumer

 

 

But why cant you start a new thread?

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