Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Match Color Pattern

I've created a VI (with the help of Vision Assistant) that uses an "IMAQ Match Color Pattern" subVI. When I provide a single still image, the match is successful and the coordinates of the match are displayed as expected.

I'm facing two problems though...
 
1) I can't seem to overlay/ highlight a successful match. When I connect the 'Bounding Box' output of "IMAQ Match Color Pattern" to the 'Line End Points' input of "IMAQ Overlay Multiple Lines", I get this error:

"Error -1074395318 occurred at IMAQ Overlay Lines
You supplied an insufficient number of points to perform this operation."
 
 

2) When I modified the VI to extract still frames from a video (AVI file) and fed those frames to the subVI using a for-loop, no matches were made. I've played with the subVI's minimum match score without success. Is this a timing issue? I'm currently using 'wait' to slowdown iterations of the for-loop.


Thanks in advance for your help.
Message 1 of 12
(6,577 Views)
Instead of using overlay multiple lines use overlay rectangle. I suppose you want to overlay the match found right? Also attach a few images so that i too can work on that and suggest something.
0 Kudos
Message 2 of 12
(6,559 Views)

Thanks for the response (I'm the one who posted the original question, didn't realize I was logged into someone else's account).

 

Yes, I hope to overlay the match found. I'd opted to try "IMAQ Overlay Multiple Lines" because it accepts the

matches->bounding box output of "IMAQ Match Color Pattern" directly but I'll try overlaying a rectangle instead.

 

As far as the other problem goes (no matches being found when supplied with frames from an AVI video), any ideas?

 

I've attached block diagram and front panel images - thanks again. 

Download All
0 Kudos
Message 3 of 12
(6,548 Views)

Hi Alan,

 

Would you mind attaching a few images that you are trying to find the color match pattern within?

 

Thanks, 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 4 of 12
(6,537 Views)

Hi Chancenator,

 

I was actually the one who posted the original question (I logged-out of Alan's account right before submitting the post but it still showed-up as him).

 

I've attached an image (screen shot of a frame from the AVI). The fish (silhouette in the middle of the image) is being tracked in this case. The rectangular template I used for match color pattern includes half the fish's body and some green space surrounding it (almost all frames were matched when I tested within Vision Assistant before exporting the VI). Please let me know if you have any questions. 

 

Thanks a lot.

0 Kudos
Message 5 of 12
(6,531 Views)

Try this

 

paaat.JPG

Message 6 of 12
(6,504 Views)

Thanks Muks, that pretty much worked with a small modification:

 

 

Overlay Rectangle.jpg

 

Where can I learn more about what all the Bounding Box data refers to? I ask because when I used,

 

Bounding Box[0].x

Bounding Box[0].y

Bounding Box[3].x

Bounding Box[3].y

 

the resulting rectangle seemed to be identical in size and shape to the match template but overlaid in the wrong place. 

 

Thanks. 

0 Kudos
Message 7 of 12
(6,489 Views)
To define a rectangle (for overlaying or extracting) you require 4 points (Top,Left  and bottom,right) which is why 0 and 2 are taken from the bounding box. If solved mark the post which helped as the solution.
0 Kudos
Message 8 of 12
(6,466 Views)
You have to define the cluster size as 4 in "Array to cluster". Maybe that wouldve shown you a broken wire.
0 Kudos
Message 9 of 12
(6,462 Views)

Hi Muks, I was just wondering if you have any thoughts on the second problem that I mentioned (Match Color Pattern working for a single image but not working for a sequence of frames extracted from an AVI).

 

Thanks.

0 Kudos
Message 10 of 12
(6,307 Views)