10-09-2012 02:42 AM
Hey,
I am looking for advice, I have 3 template images(A,BC) and i want to select the next state depending on whether my captured image matches image A, image B or image C. Any suggestions helpful, the code i am using to capture the image is attached.At the moment my cases are not complete and i only have a select function selecting between two images. I was wondering would i use an array to select between 3? and how would i go about this. thanks very much.
Damien
10-11-2012 10:24 AM
Hi Damien,
Thank you for your post and sorry for the late reply.
Just to clarify, are you having problems comparing 3 images instead of just 2, or are you having problems with what to do once the images have been compared?
If you are having problems comparing the images, this example link may be of some use to you: https://decibel.ni.com/content/docs/DOC-2088
You can use an array as you suggested, by replacing the “select” function in the default case of your case structure with this:
1 drop an “array constant” onto your block diagram
2 drag the different enums inside it
3 drop an “index array” on your block diagram
4 wire the output of the “array constant” to the array terminal of the index array function, wire the index terminal of the array constant to the decision making section of your code, wire the output of the index array to your shift register.
Also you could use a case structure instead of the selector and have the 3 cases A, B and C?
I hope this helps, please reply with any other questions you have.
Kind Regards ,
James
10-12-2012 05:33 AM
Hey,
Unfortunately there is a problem with the link. Could you send another link to this? Thanks
Damien
10-12-2012 05:40 AM
Hi Damien,
I have attached the vi that was in the initial link, does this work?
Kind Regards,
James
11-08-2012 10:25 AM
Hey J_Oneill
Apologies for the very late response to your post. My problem is i have three template images A,B,C and when i take a snapshot at the start of my application i want to identify from the live image which of the template images it matches with. Then once this is chosen i perform a number of tests on the device. But the tests i perform for A,B,C are completely different. I have looked at the vi you posted but i am looking for something different i want to perform an action based on which image it best mtches with.
I have attached a vi that i have started on but the section where it compares the images are not complete. I have attached two template pictures also. Any advice is greatly appreciated
Damien