07-24-2013 09:43 AM
Hi guys,
Does anyone know if it's possible to acquire images in Vision Builder from a folder rather than actually selecting the file.
I m asking because the Images in the folder I m going to use are going to change, and I wonder if rather than changing everytime manually the images from the "acquire Image" step I ccould more simply acquire a folder and then which ever image is in this folder, the isnpection will run through anyway.
Or where is the source of the analysed Image in LabView from an inspection migrated from VBAI (my whole project is rather on LabView than VBAI, but the inspection I am using on LabView to analyse the Image is from VBAI)
Thanks for your help
Xavier Baines
07-24-2013 10:30 AM
You could do it with a Run LabVIEW step as shown in the attached example...Just press the top run button in VBAI 2012 to see how the Run LabVIEW step can cycle through a folder of images.
We hope to add this feature in the next release of VBAI (later this year).
Hope this helps and thanks for the suggestion.
Brad
07-24-2013 10:49 AM
Dear Brad,
This seems great, but the reason I ask, is that when I migrate the inspection to LabView, I can't figure out on the VI where the image is selected. I can't find it's origin, otherwise I would have just changed it right away to a folder and cycle through this folder even if the images are changed.
Can you convert an inspection to LabView? because otherwise using a simple "acquiring image" step in VBAI and converting it to a VI, maybe you could help me locate the origin of the source of the image in LabView and from there insert the previous coding you posted, and from there I should be able to run the VI acquiring the images from the folder I would like.
Best regards and thanks for your help Brad
07-24-2013 11:41 AM
The reason I was hesitant to help with how to disect the generated code is because it's complicated. What are you trying to do? If you are just doing image processing, you could use Vision Assistant with a simple VI (similar to the one I posted to cycle trhough a folder of images with files that change). Are you actually doing more complex I/O, or communication in your VBAI inspection? If so, another option is to use the LabVIEW API to launch a local VBAI Engine, open the inspection, and you can set a shared image variable from LV before you run each iteration of your inspection. One big advatage to using the API is that if you need to change your inspection, you do it in VBAI with the normal inspection, and your LV code will use the updated inspection the next time you open it (make sure to close ther inspection from VBAI before trying to use it in LV with the API). If you need to make changes and you have migrated your inspection to LabVIEW, you will need to migrate again, and this could result in having to rewrite your customizations to reintegrate it back into your LabVIEW application.
If none of these sound appealing and you really want to use the generated LabVIEW code, I would recommend you put the Simulate Acquisition step in it's own state, so it's easy to replace the generated code for that state with a simple VI (similar to what I sent you), that outputs the next dynamic image from a folder and puts it in the shift register with the image and the subsequent states will use that image for their processing.
Hope this helps,
Brad
07-24-2013 12:23 PM
07-24-2013 12:42 PM
So it sounds like using the Express VI for Vision Assistant (which makes it easy to modify your algorithm by double clickin on the VI), and the Express VI for Vision Acquisition (which allows you to do a Snap and pass in the image path, and you can use a VI similar to what I sent to get the latest image path for a dynamic folder), would work well for you. Check out the Express VIs on the last row/column of the vision palette. Using VBAI for what you want to do is way overly complicated.
Hope this helps,
Brad
07-24-2013 12:46 PM
07-30-2013 10:54 AM
07-30-2013 12:19 PM - edited 07-30-2013 12:23 PM
Maybe I wasn't clear. Use a simple VI like the attached to just scan for new images in the folder and use Vision Assistant Express VI to process the images.
07-30-2013 12:50 PM