12-14-2014 09:01 AM
Hi All,
I am using IMAQ to grab and save high freq and high resolution images. I have an image indicator directly from "Image Grab Acquire". So, the image indicator is displaying every single images at a very high frequency too. We have to display frames, but not necessarily every single one (enough so the operator can see what's going on). So, I am wondering how I can display, say every other images (such as all odd/even number of images), or jump over two and display the third?
Any help will be appreciated!
Thanks!
Wenlong
Solved! Go to Solution.
12-14-2014 01:29 PM
Seeing your code to "grab and save high freq and high resolution images directly from Image Grab Acquire" would certainly help us give answers appropriate to your question. If you are saving every image (to disk), you need to move it from the camera to the "write" function. One way to lower the display rate would be to display every third, fifth, tenth (you get the point) image -- I do this all the time. That's what to do, but to help you with how to do it, we need to know what you are currently doing. Attach your code.
Bob Schor
12-14-2014 03:06 PM
Hi Bob,
Thanks for your response! I have attached the code I am using here.It is directly from the examples. Please kindly advise me how to display every third, fifth, tenth image.
Thanks again!
Wenlong
12-14-2014 08:03 PM
Here are some general comments.
This looks like an NI Demo routine, so I'm guessing that you don't have a lot of experience with Vision processing. If you've got a lot of other LabVIEW experience, you should be able to make the leap to vision, once you get the idea of how buffers work. Unfortunately, there's not as much in the way of tutorials and white papers on Vision as on other LabVIEW topics.
So to your question -- how to display every Nth image. Here's the key loop (which is lifted directly from your code):
As menioned above, this routine is "clocked" by the Extract Buffer function. What you do to display every N'th image is to put the Image control inside something like a Case statement that "fires" every Nth time.
Here's an "Nth" version of the above loop (some details omitted) --
We still drive the loop filling every buffer with a frame. But we then use the Integer Divide function to select the Nth image (those that have a remainder of 0 when i is divided by Nth) and wire the "image" line (it doesn't really hold an image) to the "Image" control, with the other case being "Default" (so all other valeus go there) and with nothing inside. Thus every Nth time through this loop, the output of Extract Buffer is wire to an Image (and displayed), the other N-1 times the wire goes nowhere.
Bob Schor
12-14-2014 08:41 PM
Hi Bob,
Thank you so much! This is exactly what I need.
Per your questions, I am using Basler Aca 2040-180km cameras.
You are right. I don't have much image processing experience using LabVIEW. So, I don't quite understand what that means when you said the "clock" thing.
If you can explain more on that, I will appreciate it.
Best,
Wenlong
12-15-2014 12:34 AM
When you call Extract Buffer and give the "next" buffer number, the frame grabber "waits" until it has a full frame and then executes. LabVIEW works by a principle called Data Flow -- something like a While loop will run "as fast as it can", with the proviso that nothing can proceed until all of its inputs are present, and no output is asserted (on a function) until the function finishes. So because Extract Buffer is inside the While loop, the loop cannot "loop" until Extract Buffer "does its thing" once. If your camera is running at 180fps, this means that the loop runs every 6 milliseconds (approximately). Note that while Extract Buffer is "waiting" for the frame to be acquired (which may take 5 of the 6 milliseconds), your PC (and LabVIEW code) is free to be doing other things, as long as they are not inside the same While loop. That is, other loops placed "in parallel" with this While loop and not linked "serially" with it (say by having the Error line out of the first loop be an input to the second loop) will be able to make use of this "free time" to execute code in parallel. Indeed, if you have a multi-core PC, LabVIEW will try to utilize different cores so that parallel loops execute on separate cores, truly in parallel.
BS