Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting a case based on an image

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

0 Kudos
Message 1 of 5
(3,608 Views)

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

0 Kudos
Message 2 of 5
(3,587 Views)

Hey,

 

Unfortunately there is a problem with the link. Could you send another link to this? Thanks

 

Damien

0 Kudos
Message 3 of 5
(3,569 Views)

Hi Damien,

 

I have attached the vi that was in the initial link, does this work?

 

Kind Regards,

James

0 Kudos
Message 4 of 5
(3,567 Views)

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

Download All
0 Kudos
Message 5 of 5
(3,492 Views)