LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Images in folder using Recursive VI Help

Hello,

 

I am new to labview and need some help. As you can see in my images attached, I have this VI and i have the folder (ImageFiles) that has around 300 images that I want one by one run through this module and have the area for each one output and from there sent to a text file. I am having trouble inputting the images from the recursive VI and not sure what to do. So the goal is for each image, one by one, to enter and then processed and then color segmented (based on if it is green or red) and then the run through the measurements and have the results be output and then in one file have the measurements of all my images. Any help would be appreiciated. Thank you.

Download All
0 Kudos
Message 1 of 11
(3,256 Views)

Use the "All files in Dir" output instead. The one you connected is just the folder name.

 

2016-02-22 15_17_02-lht_sofc.lvlib_lht_sofc.vi Block Diagram on ABT.lvproj_My Computer rev. 352 _.png

Message 2 of 11
(3,227 Views)

You can use a For loop to go through all the files in a directory and check if they have the correct extension.

 

Find PNG Files.png

0 Kudos
Message 3 of 11
(3,223 Views)

Im sorry if this is a dumb question, but youre telling me to connect the All files in directory to the loop? So far I have the path of the folder connected to the folder path in the VI and now I am lost on where to connect the all files in directory. I tried wiring that to the IMAQ Readfile but I got an error.

0 Kudos
Message 4 of 11
(3,203 Views)

You want all of the PNG files (which is the indicator I put in my snippet) wired into the For loop. Make sure indexing is enabled so that it will take in one element of the array with each iteration. Leave the "N" number of iterations input empty and it will go through the entire array.

0 Kudos
Message 5 of 11
(3,186 Views)

There's one wire between the recursive file list and your for loop.

 

that wire should be connected to the output I said above instead of the one you connected.

Message 6 of 11
(3,156 Views)

So I did what you said and it runs through all my images but in my results module the value of the mean keeps getting replaced by the one before. Anyway to save each value instead of getting replaced?

0 Kudos
Message 7 of 11
(3,140 Views)

The purple wire should be connected to the frame of the For Loop to keep every values after each iteration, it will create an auto-indexing tunel at which you may create an indicator by right-clicking on it, and "create indicator". It will show all your images after the For Loop completes.

Message 8 of 11
(3,124 Views)

So attached is what I got now, which has your suggestion with the all files to dir working for me, which I thank you very much for. Youve helped me alot. What I am confused about, which I apologize if I am bothering you, is the purple wire you are referring to. The values from the results (measure 1) is what I want exported and those are attached to pink wires. Is that what you are referring to?

0 Kudos
Message 9 of 11
(3,114 Views)

use this vi but attention to mark that I show in image 

tick.jpg

0 Kudos
Message 10 of 11
(3,090 Views)