09-08-2010 01:43 PM
Hello
I am at the end of my project now and I need your help which has been so much useful until now.
I process an image in which I detect two coordinate X, Y of a point (center) and an angle. So 1 input and 3 outputs.
Now I need to to process my VI on several samples of the sme data, which means on several images so that I could have an averaged position of the center. And then I could use this averaged position as a point of reference.
If something can do that, let me know. I am using Labview 2009.
09-08-2010 02:00 PM
Provided you're getting numerical outputs for the X and Y positions this shouldn't be too hard with a subvi, a for or while loop, and some shift registers.
Pardon the text, but I'm currently using a labview build without IMAQ.
Set up your loop, grab your image, pass the image to a subvi that grabs your X and Y centres, get those results out.
Put 2 shift registers on your loop - initializing them to zero - pass the wire from a left shift register to an add, then add the X centre, then pass that result to the paired shift register. Do the same for the Y centre and its shift register. Once you're done in the loop, pass the iteration output - without indexing - out of the loop, add one, and divide each of the results of the shift registers by that - that'll give you the average X and Y positions of the centre.
09-08-2010 03:08 PM
That sounds great
I am just wondering: how that will take several images? My images are in a folder. I guess that the loop is supposed to do that but I just don't see how.
Anyway I am going to try
Thank u
09-08-2010 05:01 PM
If the images are in a folder, provided they have some common, incremental numbering scheme you can just input the starting file as a user input and then use string/path modification to read the next picture.
EG: User inputs "Pic2001020" and the program can then go and read "Pic2001021" in the next iteration of the loop, etc.
If they're of a variety of names, you can try using an array of strings as an input, and then auto-index that through the loop and use the string to define the path to load.
The exact technique you'll use to read the images in series in the loop will depend a lot on the setup you have. I know Matlab can pull files in the order they were created, I personally don't know if Labview has the same functionality.