Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Instability in pattern matching


@Klemen wrote:

Labview 2013 (or rather NI Vision Development Module 2013) supports pyramid based matching.

 

http://digital.ni.com/public.nsf/allkb/5091CD6F91BC88D786257B97006C690D

 

Best regards,

K


ok thanksSmiley Happy

0 Kudos
Message 81 of 117
(1,575 Views)

So, we can easily see that GM takes 466,414 ms (average)

than Pattern Matching must take 2111,39ms - 466,414ms = 1644,976ms (! not 651,227ms - average)

 

 

I measure in my program processing times, too. There is no way that PM takes under 1 sec.

 

I think it must be a CAR for performance meter formating, too.


 

Which version are you using? Your image is not very clear

0 Kudos
Message 82 of 117
(1,574 Views)

Hello Klemen,

I see that you sometimes use OpenCV, too. ( https://decibel.ni.com/content/blogs/kl3m3n )

 

We used actually first time NI Vision (actually NI Vision for .NET). But we are considering now using another product at least for pattern matching.

 

Do you know an OpenCV example that show us how to use OpenCV with NI Vision (especially Pattern Matching)?

 

 

 

0 Kudos
Message 83 of 117
(1,573 Views)

Hello muks, i'm using NI Vision 2013 SP1 (tha latest). If you download image (PM_grayscalevalue_03_performance.jpg) and than use an image viewer you can easily read the values.

0 Kudos
Message 84 of 117
(1,568 Views)

Hello Brad, my question was, if there is a CAR about GPM. Is there?

 

Brad, you wrote: " I did notice that in the PM step if I turn on rotation it finds all the objects except the one I learned (which seems wrong, so I will CAR this), " . what about GPM? My first question in this topic was about GPM. I'm absolut sure that there is a problem with GPM.

    
(1) Rif.: Instability in pattern matching
‎06-24-2014 02:55 PM

Sorry, my bad. I should give more information about it. I mean, your suggestion" minimum aperture and increase the lighting intensity".
For example, i have two pictures. for the first one get i with geometric pattern matching score 980. For the second picture, without anything changes, 0 score.

(2)  Rif.: Instability in pattern matching
‎06-24-2014 03:43 PM

Here are the two images and template file. Template file is a little bit big because it has:

- Pattern Match
- Geometric matching edge based
- Geometric matching feature based
- Golden template with mask


The difference between the first and the second picture is just that i take the second picture 3 seconds after i take the first picture. I didn't changed anything. Positions and angles of the objects are same.
Attachments:
Attachment img001.png ‏1512 KB
Attachment img002.png ‏1512 KB
Attachment template002.png ‏4103 KB

 

 

0 Kudos
Message 85 of 117
(1,549 Views)

@desalando wrote:

Hello Klemen,

I see that you sometimes use OpenCV, too. ( https://decibel.ni.com/content/blogs/kl3m3n )

 

We used actually first time NI Vision (actually NI Vision for .NET). But we are considering now using another product at least for pattern matching.

 

Do you know an OpenCV example that show us how to use OpenCV with NI Vision (especially Pattern Matching)?

 

 

 


 

Hello,

 

You can find the pattern matching example in OpenCV. You can combine this with image pyramids to achieve downsampling, as in Labview.

 

http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html#tem...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 86 of 117
(1,533 Views)

Do you know if the two implementation of PM (LV and OpCV) bring to the same results? I think they both use the normalized cross-correlation.

0 Kudos
Message 87 of 117
(1,526 Views)

@FM82 wrote:

Do you know if the two implementation of PM (LV and OpCV) bring to the same results? I think they both use the normalized cross-correlation.


OpenCV has some additional metrics for similarity calculations (check the OpenCV webpage), but the algorithm also uses normalized correlation, yes. I don't know about results, since I have never (yet) used OpenCV's template matching.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 88 of 117
(1,522 Views)

Here are my performance numbers:

Performance.png

On your OS, the decimal point is represented with a comma, so I think that may be causing the confusion. My GPM takes 243ms and PM takes 1,011ms. The top level summary matches up closely with the sum of the individual step times. In your earlier post you said:

"Average values for:

Geometric Matching: 466,414 ms

Pattern Matching: (?) 651,227 ms

 

This can't be right, because if you read first lines: "An estimation of the time required by NI Vision Assistant to perform the inspection on the current image is: 2111 ms or 0,47 parts/s"

 

Average Inspection Time: 2111,39 ms"

 

So, we can easily see that GM takes 466,414 ms (average)

 than Pattern Matching must take 2111,39ms - 466,414ms = 1644,976ms (! not 651,227ms - average)"

 

It looks like your PM take 1651.227 ms (the first 1 got cut off) and GPM takes 466.414ms, so that closely adds up to 2111.39ms or about 2 seconds. Just replace the comma with decimal points and I think this will clear up the confusion.

 

As for all the troubles you are having. I tried your two images again and your template and all 4 objects are found without problems using GPM in 243ms on my machine for both images. If this algorithm doesn't work for some of your images, please post those images and your template so we can investigate. Again, I would not recommend using the Low Discrepancy Sampling algorithm for PM for this image or the Feature Based algorithm for GPM, so if you use the GPM Edge Based algorithm or PM Pyramid based algorithm (although this can be much slower for large images where rotation is required) I think you will be much more successful. Please send us the images if these algorithms are not reliable for you.

 

Hope this helps,

Brad

Message 89 of 117
(1,508 Views)

Hello Brad,on your machine as a matter of fact takes GM about 1 sec.  (at least 4 times slower than GPM !)

 

About performance meter cell formatting: i wrote before that I thing there is a problem with performance meter formatting. We can only see there just 12 character. When a value over "999,999 ms" or "999.999" is , we see just this part.Cell widths are constant so man can't change the width . For example on screenshot an user can not see clearly if there is "1" left of the ".011.232 ms"

 

 

0 Kudos
Message 90 of 117
(1,504 Views)