Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Improving pattern matching for similar images or where parts vary in appearance

Hello,

 

Can someone offer me some advice on pattern matching, and whether I am going about the right way of doing it?

 

I've been asked to modify a piece of test equipment to detect a new addition to the parts that the equipment is used to identify. Due to the fact that these new parts are entirely different to the old parts I can't use the old identification technique that someone wote (about 10 years ago).

 

In the attached zip file are typical images of the parts that I need to detect (Data\Template Images and Data\Example Images). Unfortunately I can't do much with the images or lighting at the moment. This is a dedicated piece of test equipment that is currently in use and I can't go changing anything hardware related because it will break the current process. I can change the camera settings in max because they can reversed easily.

 

It may or may not be the best technique, but I've attempted a pattern match technique that extracts a relevant portion of the image (either the text or the circles) and compares it against  a series of templates and identifies the highest scoring template. (Pattern match against image IMAQdx.vi in the project).

 

It kind of works..... but it's not bullet proof.

 

Here is what I have found, and issues I am struggling with:

 

1) Running a templates as a source image against the other template images returns more than one match (I'd prefer it to be a singular match)  or an incorrect match entirely.

2) As with the template images, running various production pieces through  yields incorrect matches from time to time.

3) Part to part variation in the image captured is quite high (see Example Images folder). These images are of the same type of part and are typical of what will be passed through the test equioment. This is due to the machining finish and finishing process applied to the part. There isn't a lot I can do with this unfortuantely.

 

I guess my first question is: am I going in the right direction with pattern matching, or is there a better way of doing this?


Assuming I am going in the right direction, what can I do to captured image/ template image to post process it to improve identification?  I'm aware of  various processes and filters etc that can be applied, but don't have enough experience to know what to do to give the pattern matching a good chance of success.

 

Thanks


Andy

 

 

 

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

Hi Andy,

 

It would appear that you have forgotten to attach the zip file. Without seeing the sample image, it is difficult to advise.

 

It would be useful to know:

  • Will the parts scale or rotation be kept constant?
  • Do you have access to NI Vision Assistant?

 

 

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

Oops.... the forum crashed after I had finished typing and hit the submit button. I copied the text before submitting  the form so pasted it back in again, but forgot to add the zip file...

 

To answer your Q's:

 

1) The scale won't change, but the part may move by up to 5 degrees.

 

2) I do have access to vision assistant.

 

Thanks


Andy

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

No problem. I would suggest doing some testing using Vision Assistant to tweak your design. You could use Pattern or Geometric matching.

 

Example image.PNG

 

I just tried using Vision Assistant with your sampled image and found that it was best to first use a 'Lookup Table' in the 'Greyscale' tab to increase the contrast and therefore make the edges more prominent. I then used Geometric Matching to create a template image from one of the sample images provided and it can then pick up whether the object is present and its location. This can then be converted into LabVIEW code in the 'Tools' menu.

 

I've attached the files so you can try for yourself. I would recommend having a look over it and then starting from scratch so that you can perfect the algorithm.

 

Best of luck!

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

Thanks for taking the time to reply.

 

That's interesting, I hadn't considered geometric matching before because it didn't seem relevant to what I was doing.

 

Playing with the assistant tool I'm thinking I can extract the edges for either the circles or  text (depending on what I am looking at) and use those to identify what part has been put under.


I'll have a play and get back to you.


Thanks

Andy

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