Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Feature based geometric match stability issue

I am trying to use Feature and  Edge based pattern matching. 

With both methods I get the same problem of lack  of consistency in the match results.

 

In one image the score is ie 990 and in the next frame there is no recognition even if the threshold of score is set to zero.

The difference between the images is marginal. They were taken 16.7 ms apart with close to a stationary object. 

 

I do not get any errors, the occlusion is set to 1-20, rotation -70 70, and scale factor 90-110

LV 2012 Pro. WinXp 2.4Ghz quad. New drivers.

I attached three images: the tempate and the two cases of found and not foun pattern. 

 

Can someone suggest a reason for that? I was using regular pattern matching so far and and I am not used to weird results like that.

 

Download All
0 Kudos
Message 1 of 36
(4,224 Views)

It does seem a little odd to me too.  I tried it and got neither to match.  Perhaps the outer edges (along the top and bottom) don't have sharp enough contrast?  Perhaps the edges are not as sharp to the computer as they are to our eyes.

 

Have you considered filtering it?  Another alternative is to turn it into a binary image.

0 Kudos
Message 2 of 36
(4,207 Views)

It is pretty match either almost a perfect match (980+) or no match at all even with the score taken as low as 0. 

 

Those images already have very distinct edges so I didn't see the reason for filtering and due to their nature, going binary is not a good idea.

The template I uploaded is for feature matching but I also tried edge matching and got the same problem.

When I make the template using the template editor it finds the edges without any problems and these are  the same edges on every sample I tried.

Somehow when I tried to search for them it changes its mind.

 

The thing I do not understand at all is the lack of any false/true matches with lowering the minimum score.

0 Kudos
Message 3 of 36
(4,204 Views)

I am curious about this as well.  I will take this issue and bring some more resources to bear on it internally.  I will let you know what I find.

0 Kudos
Message 4 of 36
(4,199 Views)

I brought this up with a couple of other engineers, and we have some other suggestions.  Because of the nature of visions algorithms, their application is often more of an art than a science.  There could be any number of reasons the algorithm in its current state is not finding it. We did notice there was a lot of noise in the images, and if we look closely at the template area between the two found/not found photos, I can see a couple of features that are slightly distorted between the two.  The fix in this case is to try different things and see what does work.

 

Because of the high noise in the image, so we think some filtering may be useful.  Changing the contrast may also help to make the features more clear.  As far as the template, we could try different regions of the implant, instead of the interface.  Some regions may be more resistant to noise and easier for the algorithm to match.  Another thing to try could be multiple templates.  Often with several samples, it can get matches where it otherwise would not.

0 Kudos
Message 5 of 36
(4,183 Views)

Andrew, 

I appreciate your response. Please see mine.

 

Because of the nature of visions algorithms, their application is often more of an art than a science

I heard it dozens times 🙂 Yet I claim it is science.

 

We did notice there was a lot of noise in the images

As you can see these are low resolution X-ray images and that combined with a tiny bit of motion makes it what they are.

 

I can see a couple of features that are slightly distorted between the two

X-ray images by its nature, are projections of 3D objects and certain amount of distortion is normal. This is when the part of algorithm responsible for occlusion, scaling, rotation and the right choice of minimum score kicks in. The issue here is no minimum score that can force the recognition of the second image that is almost identical.

 

...so we think some filtering may be useful

Possibly. However, I am not going to use filters until I know why this or that methods works (or doesn't) with close to perfect conditions. The two images are the ones of the best I get. To my surprise it sometimes works with images that are far worse. Filtering or not does not explain the behavior of the software.

 

As far as the template, we could try different regions of the implant

Not quite sure what you mean by it. I can use the bottom or the top. The top is a very complicated 3d object with drastically changing projections= failure. Choosing smaller regions will only create a flood of false negatives. Yet I still do not know what is wrong with the current one. 

 

Another thing to try could be multiple templates

I use that method with pattern template matches (intensity based). I try to choose two  patterns that represent the same feature but are fairly distinct from each other in order to span the variety of conditions and projections. Yeah, it is a sort of art 😉 Yet I never choose two templates that are almost identical because its just does not make sense. 

 

As I mentioned, I am fairly familiar with LV intensity based methods and not that familiar with LV edge/feature matching. I was hoping to find out if maybe I am missing something about the method. For example, I need to set up certain parameter higher/lower and there are quite q few to set up in the edge/feature matching. From the math point of view it does not make sense that a small perturbation of an input parameter changes the solution drastically. It means that the solution is pretty much wrong. Even though, assuming that the solution falls far away from the true value and if you are willing to accept big errors, you should get at least  "an" answer.  

 

Here I take the minimum score all the way down to zero and the algorithm finds no similarity at all, null, zilch, which can only mean two things I am doing something very wrong or there is something wrong with the algorithm software. If you take two random images you can probably find a 1% or less similarity but not finding it at all is kind of uncommon.

 

Is there something more I could provide to investigate it? I am not looking for alternatives but suggestions why this method with my implementation fails so miserably. 

With all due respect, the suggestions provided are so general (and also good but not what I asked for) in its nature that are probably in the textbook of the machine vision technical support under (applies to all methods) 😉

 

 

 

Message 6 of 36
(4,182 Views)

In order to add more clarity, here are two additional pictures. One shows the original found,not found and template images side by side.

The other shows how the template editior sees the edges in both pictures also side by side (found and not found). I did not use all the edges in the template but I see a similarity of at least 1% and filters/multiple templates or noise have nothing to do with it.

 

Download All
0 Kudos
Message 7 of 36
(4,175 Views)

I see what you mean.  Thank you for the clarification.

 

I took your template and re-built it into one of my own, editing a couple of edges.  I included a picture of it in the editor, and the file itself.  I did this because using the template you supplied, I did not get any matches.  Perhaps the internet scrubbed the extra data from the png.  (The Template Editor actually embeds extra information into the image, as provided by the png format.)

 

I managed to get matches on both of your images, the lesser one being 978.  Perhaps there is something in the way the code is implemented that is causing it to not work well.  Have you looked at the examples?  I used the code found in the Example Finder, under:

 

Toolkits and Modules >> Vision >> Functions >> Geometric Matching Example.vi

 

I resized some front panel indicators and added an indicator to the output of the Geometric Matching VI, so I could see the score.  Otherwise, it is stock code. 

 

Does any of this help?  If not, let me know. I will be glad to do more, if needed.

0 Kudos
Message 8 of 36
(4,157 Views)

(files)

0 Kudos
Message 9 of 36
(4,156 Views)

And this is the indicator I added in the example, to see the score.

0 Kudos
Message 10 of 36
(4,155 Views)