LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Improve time processing acquiring images.

Hello to everyone:

First of all thanks  a lot for reading this post and being able to help.

 

I have an application where I have to process 4 images from a GigE camera in 0.5 seg.

 

What I do is: in one while I have a flat sequence where the steps are:

- Take first image

- 3 frame flat sequence to process the image.

 

In the next iteration while, take second image and proccess it... and until 4 image processed.

 

The problem is that the time is too short because I have to process 4 images in 0.5 seg.

 

So I have to reestructure my code.

Any idea how to do that?

 

Maybe put some wait until ms in the while loop.

 

Or maybe use a producer/consumer where the producer will be the while where I take just the 4 images and the consumer another while will process the images. And use a queue with the 4 images to send them from producer to consumer.

 

Because maybe is better to take first the 4 images and then process them so that no image is not lost on the way.

 

Any ideas?

 

Thanks a lot!

0 Kudos
Message 1 of 9
(2,964 Views)

Sharing original code will be helpful

 

Instead of using Flat Sequence, normal state machine architeture should work fine for your requirement

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 9
(2,959 Views)

Is it better a state machine or a producer/consumer for improving time?

0 Kudos
Message 3 of 9
(2,957 Views)

If you want to parralley acquire and also process the you can use Producer consumer else you can use state machine

In producer consumer make sure you are synchronizing the data properly between aquisition and processing

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 9
(2,953 Views)

I think it is better parallely because like this camera has not to wait until labview process the last image to take the next image.

 

Is it ppossible to do with queues?

0 Kudos
Message 5 of 9
(2,950 Views)
Here you go for start: http://www.ni.com/white-paper/3023/en/
Thanks
uday
0 Kudos
Message 6 of 9
(2,942 Views)

Thanks a lot!

 

Do you know where can I find information about queus in labview?

0 Kudos
Message 7 of 9
(2,923 Views)

 

 

 

 

 

 

Simple Queue Example  you can find in NI Example itselfQueue Example.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 9
(2,921 Views)

Please post your code.  From your comments and questions, I'm guessing that your code is probably "mis-organized" and you are doing things in a very inefficient manner.  However, without knowing what you are doing, it's very difficult to say "Don't do that, do this instead".

 

For example, you mention using a flat sequence.  Flat sequences are almost never needed in modern LabVIEW (i.e. any version released in the last two decades) -- good Data Flow principles (including making proper use of the Error Line) can suffice.

 

There are a number of Design Patterns that can enhance parallelism, but we need to see what you are trying to do before making recommendations.

 

Attach your VI(s).  If you have your work organized in a LabVIEW Project, then compress the folder containing the Project and attach the resulting .ZIP file, instead (so we'll have all of your sub-VIs, too -- you do use sub-VI's, don't you?).

 

Bob Schor

0 Kudos
Message 9 of 9
(2,902 Views)