Showing results for 
Search instead for 
Did you mean: 

IMAQ Match Geometric Pattern 2 VI not working

I am using Geometric matching VI for comparing images, but when I am trying to use images other than given in examples it is giving error of wrong image type. I am using a .png image with 8 bit depth. If anyone has ready-made example it will be helpful.


0 Kudos
Message 1 of 4

You have your own "ready-made example", which you say works.  If your code doesn't work, the problem is with your code.  We cannot tell you what is wrong if you don't attach your code (not a "picture" of it) and let us "see what you did".


Bob Schor

0 Kudos
Message 2 of 4

Thank you for your reply.

With ready-made example I wanted to say the example given by NI Vision. In the geometric matching example given, if I select any-other image other than selected by default the example is giving error.



Download All
0 Kudos
Message 3 of 4

Well, despite my request, you attached a picture of the (example) code that you used.  Fortunately, I didn't need to use it (it is difficult to get the "picture" to run on my PC!), but could simply use the Example that NI supplied.


Do you understand what this code does?  Somehow, I don't think so.  What are Sample 1 and Sample 2?  Is one supposed to be "the template", and the other "the image where you look for the template"?  Are you using the Example's Template and your Samples are being searched for that Template?  Did you read the Help for IMAQ Match Geometric Pattern 2, and do you understand what the inputs mean?  Do you realize that the Example is extremely limited, in that it searches for the Template image, differing only by its location on the Image and its possible rotation (but not a change in size) to be considered a match?  [Note Sample 1 and Sample 2 differ in size!].


As I'm sure you've discovered, LabVIEW Vision is a bit more complicated than LabVIEW + DAQmx, and has considerably less in the way of documentation and tutorials.  To make the Geometric Pattern Matching routines work, first acquire an Image that has multiple instances of a "recognizable Pattern" (like the test images used in the LabVIEW Example -- they all contained multiple images of a "part", all the same size, but with different orientations and non-overlapping placement in the composite Image), and you also had a "Template" that pretty-closely "matched" each of the images in the composite when positioned correctly.  That's what you need to get this function to work.


So try again.  Come up with a composite Image as a Test, and a Template that, if printed at the same resolution, would largely overlap each of your sub-images in the Composite.  Try that set.  If it works, fine.  If it doesn't, come back here with a .zip file containing your LabVIEW code (no pictures, but files with extension .vi, please), your Template, and your Composite Image.  We'd be happy to try your submitted code on your submitted images and make suggestions.


Bob Schor 



0 Kudos
Message 4 of 4