Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

creation of multiple geometric template

Solved!
Go to solution

i have various templates and want to create a multiple geometric template file

i am unable to do it.

i have uploaded the templates

please help me with it

-$hiv@
Download All
0 Kudos
Message 1 of 17
(4,512 Views)

This example shows how to do it:

<LabVIEW>\examples\Vision\2. Functions\Geometric Matching\Learn Multiple Geometric Patterns Example.llb\Learn Multiple Geometric Patterns Example.vi

 

-Christophe

0 Kudos
Message 2 of 17
(4,507 Views)

i tried it sir,

in the same example i tried to give my templates to create a multiple geometric template

but it gives an error that the template is not a valid geometric template.

can u use the uploaded templates and let me know if it works

0 Kudos
Message 3 of 17
(4,490 Views)

i tried it sir,

in the same example i tried to give my templates to create a multiple geometric template

but it gives an error that the template is not a valid geometric template.

can u use the uploaded templates and let me know if it works

0 Kudos
Message 4 of 17
(4,488 Views)
Solution
Accepted by topic author $hiv@

Hi,

 

I was able to create a multiple geometric templates from the images you attached to the post.

To create a multiple template, you need to make sure that the files you select to add in the Learn Multiple Geometric Patterns Example are Feature Based Geometric Matching Templates.

To create them, prior to adding them to the example, use the Template Editor, that you can access from Start Menu>>Programs>>National Instruments>>Vision>>Template Editor

Select File>>New Template... then choose the option "Geometric Matching Template (Feature Based) from the list.

Select your template image, or the image you want to extract the template from and go through the different tabs to create the template.

Repeat for all templates you want to add to the multiple template file.

Once they are all created, you should be able to use the example to create it. I worked for me.

 

Best regards,

 

-Christophe

Message 5 of 17
(4,482 Views)

Thanku so much...

i actually created templates which are edge based,thats why i was unable to create the multiple template..

now using feature based,it worked for me

thanks for ur timely help 🙂

0 Kudos
Message 6 of 17
(4,477 Views)

Sir i have one more doubt

what is the difference between choosing the geometric template to be FEATURE BASED and EDGE BASED

I am unable to detect the pattern in feature based by using the same template that was used in edge based

please explain me why!!!

-$hiv@
0 Kudos
Message 7 of 17
(4,472 Views)

Both geometric matching techniques rely on curves extracted from image to perform the matching. The two geometric matching techniques differ in how the curve information is used to perform the matching. The edge-based geometric matching method computes the gradient value of the edge at each point along the curves found in the image and uses the gradient value and the position of the point from the center of the template to perform the matching. The feature-based geometric matching method extracts geometric features from the curves and uses these geometric features to perform the matching.

You can find more detailed information in the NI Vision Concepts Manual here:

http://zone.ni.com/reference/en-XX/help/372916L-01/nivisionconcepts/geometric_matching_technique/

The article also explain when it is better to use one versus the other.

I couldn't test the templates yesterday, because you did not attach a match image.

 

I might be wrong, but another thing I noticed is that it looks like you thresholded the images prior to extracting the templates. In general, algorithms that need to extract edges from images, such as geometric matching, will work better when you provide them with the grayscale image, as opposed with a thresholded image. The contour extraction will be more accurate. Also, the algorithm does not only use contour information, but also grayscale information of the image. By thresholding the image, one removes a lot of information that the algorithm can use.

 

On a last note, combining templates into one is only going to help with speed. If speed is not an issue in your application, you can still learn with Edge Based matching and match all template. If there is a match, the character/number you looked for is the right one.

 

Another solution might be to use a reverse technique, still using Edge Based matching that seems to work better in your case. We sometimes use it to solve classification applications similar to what you are trying to do:

Instead of learning multiple templates and trying to locate them in your image, take the opposite approach: create a synthetic image that contain your templates (all rotated 1s on one line... all rotated 5s on another line etc). Then if you can locate and extract the number (using blob analysis) on the original image, you can extract that region, learn it as a template, and look for it in the synthetic image. The line you find it indicates which digit it is.

Again, this technique might work if you can extract the digit you're trying to identify from the original image. Performance wise, it is only interesting if learning the extracted digit on the fly is faster than trying to match all the separate templates (learning takes more time than matching).

 

It looks like you're trying to perform OCR on the image. Again, if the text is always located at the same place and you can draw a region of interest around it, you can try the OCR algorithm and define different classes that have the same label for the different rotated digits.

 

I tried to give you different possible approaches. Hope that was not too confusing.

 

Best regards,

 

-Christophe

 

Message 8 of 17
(4,471 Views)

Thanks a lot christophe

i really understood the solution to my problem

i will try with the grayscale images rather than thresholding them

and more over the method u suggested gave me a clear cut idea and was not confusing

thanks once again 🙂

-$hiv@
0 Kudos
Message 9 of 17
(4,459 Views)

The reason why i went for thresholding is that,by using grayscale images,i couldnt detect the edges clearly from the image.

So i went for thresholding to detect the edges so that it will be easy to apply geometric matching.

-$hiv@
0 Kudos
Message 10 of 17
(4,456 Views)