04-30-2015 08:24 AM
Hello everyone,
I have an experimental setup, which consists of a projector and a camera. I control the camera snapshot timing with LabVIEW VIs from the manufacturer. The projector is installed as an additional screen, so I can use WindDraw VIs from Vision to update the outputted projector image.
During one cycle of my program (duration: 2seconds) I want to take an image with the camera of a default projector image (0.4s) and then set a different image (for 1.6s).
My problem is that the camera does not take the snapshot immediately when issued (apparently there is some overhead, so I need to include wait times) and during the exposure, the projector image changes. I could increase the cycle length, but I would prefer to keep the measurement frequency high. Especially I would not like to increase the cycle length due to slow VIs.
In addition the output image is refreshed later than I anticipated. I read up on that and found that the LV GUI is not updated in real time.
So I wonder:
1) Is there an example VI that illustrates how control a stroboscopic setup?
2) Can I use LabVIEW for image refreshing or should I reprogram the image output with OpenGL?
Previously I have used Matlab for a similar purpose and did not encounter such problems. I would really like to stick with LabVIEW though, as the interface is more intuitive for users.
Kind regards,
Jan
04-30-2015 04:40 PM
I'm sorry, but I don't quite understand what you are trying to do. Let me rephrase what I think it is, and you correct me if I am wrong.
I'm assuming that the Projector hardware outputs an image that is not, itself, readily available to LabVIEW, but must be acquired/captured by the Camera. I'm also assuming that LabVIEW "triggers" both the Projector and the Camera, and that the real question is how to synchronize the Output (Projector) and Input (Camera) so that all of the images are captured properly.
If this is the question and experimental situation, it seems to me that you want a 2-second loop that starts the Projector. Within this loop, you wait some amount of time and then Snap a picture. If you use something like a Timed Loop or a Notifier to run the main loop, you should (Famous Last Words) be able to put an appropriate Delay between Output and Input inside the loop to keep O and I "in synch".
Bob Schor
05-04-2015 07:39 AM
I'm sorry my description was ambiguous. Thank you for trying to make sense of it.
Right now I can do the above steps. However, part 1 is not 0.4s but 1.5s (due to safety "waits" before and after the camera takes a picture).
This has two reasons:
So, is there a way to update the LabVIEW output image window faster? For example by not using LabVIEW output window but an OpenGL window?
Also is there some way to synchronize camera and projector tbetter? Including wait times prolongs the cycle length, where I ideally would like the cycle length to be as short as possible.
Thank you very much for your time 🙂
05-04-2015 09:01 PM
I think this should be doable, but because it (I think) shouuld be two parallel tasks. I think if we can get the "Display" part working properly, getting the (synchronized) images will be relatively straight-forward.
So here is the question -- can you write a VI that runs your Projector to make the picture, repeating every 2 seconds, that you need? It should be easy (using Picture controls and functions) to make at least the Uniform Image of a Gray Scale, and might not be so hard to make the gradient gray scale (but I'm not sure what you want).
Concentrate on making an image that looks like the (two) image(s) that you want. Even if it is way too slow, if we have a better idea of what you want, we might be able to suggest ways to get it "faster".
Once we've got dis Production cycle working properly, it should be relatively simple to write a Consumer that simply does a "Snap" and takes a single image once per cycle.
Post some stuff here (attach a zipped VI or a full snippet) and we'll go from there.
Bob Schor