LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with IMAQ Match Pattern 4

Hi!

I'm designing a program that reads in images from a folder on my computer and then matches them to a template which the user can choose to create or use from the folder associated with the original images. The user gives the Region of Interest and matching parameter information along with the original image and the template image to IMAQ Pattern Match 4. I got an error saying "incompatible image type" (-1074396077). I was confused by this error because I'm reading in my images as grayscale(U8) which is compatible with the pattern matching vi. I decided to use IMAQ cast Image 2 to make every image I had being used a grayscale(U8) to see if this would fix my problem. When I ran the program, my previous error didn't show up, but I got a different error saying, "invalid template descriptor" (-1074395247). I can't seem to figure out how to fix this error, or what the template descriptor is referring to specifically. 

 

I'm hoping to get this error figured out, so I can see if I'm getting correct values for the pixel position of where the match occurred on the image.

 

Below, I have attached my program along with some images to be used in it.

 

I'm hoping someone can help me understand why I was getting an error message telling me I had an incompatible image type even though they were grayscale(U8), and I'm hoping someone can help me figure out my invalid template descriptor error please. 

 

also, a little note:

There was another program which took a pictures using a camera and then pattern matched the images and templates created. The pattern matching worked well with the images from the camera and eventually, these images were saved into a folder which happens to be the folder I am grabbing them out of. I don't know if maybe the reason why my pattern matching isn't working has something to do with how these images were saved in the previous program(which was just a simple png extension), or what is different about these images which are being grabbed out of a folder instead of taken straight from the camera. I'm very lost as to why my program isn't working.

 

Best,

Boris

0 Kudos
Message 1 of 2
(1,209 Views)

Hi!

I'm designing a program that reads in images from a folder on my computer and then matches them to a template which the user can choose to create or use from the folder associated with the original images. The user gives the Region of Interest and matching parameter information along with the original image and the template image to IMAQ Pattern Match 4. I got an error saying "incompatible image type" (-1074396077). I was confused by this error because I'm reading in my images as grayscale(U8) which is compatible with the pattern matching vi. I decided to use IMAQ cast Image 2 to make every image I had being used a grayscale(U8) to see if this would fix my problem. When I ran the program, my previous error didn't show up, but I got a different error saying, "invalid template descriptor" (-1074395247). I can't seem to figure out how to fix this error, or what the template descriptor is referring to specifically. 

 

I'm hoping to get this error figured out, so I can see if I'm getting correct values for the pixel position of where the match occurred on the image.

 

Below, I have attached my program along with some images to be used in it.

 

I'm hoping someone can help me understand why I was getting an error message telling me I had an incompatible image type even though they were grayscale(U8), and I'm hoping someone can help me figure out my invalid template descriptor error please. 

 

also, a little note:

There was another program which took a pictures using a camera and then pattern matched the images and templates created. The pattern matching worked well with the images from the camera and eventually, these images were saved into a folder which happens to be the folder I am grabbing them out of. I don't know if maybe the reason why my pattern matching isn't working has something to do with how these images were saved in the previous program(which was just a simple png extension), or what is different about these images which are being grabbed out of a folder instead of taken straight from the camera. I'm very lost as to why my program isn't working.

 

Best,

Boris

0 Kudos
Message 2 of 2
(1,202 Views)