LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Match Pattern 4 to Overlay Multiple Lines 2

Solved!
Go to solution

Hello NI community,

I am having a problem connecting the Match pattern to overlay Multiple Lines 2.

I want to track an object from a webcam video. 

In this help http://zone.ni.com/reference/en-XX/help/370281U-01/imaqvision/imaq_match_pattern_4/  it says the Matches(Pixels)(Bounding Box) should be connected to the Line End Points in the Overlay Multiple Lines. But I can't take the bouding box alone. I've tried unbundling the 1D array of clusters, but I can't do it. 

Any Help is appreciated. I can post an image of my code if requested.

Thank You,

Marwan Sabry

0 Kudos
Message 1 of 7
(4,248 Views)

What are you doing with line overlay? Do you want to display the overlay?

In case you need help on some part of code it would be better if you attach your work.

Show us your work..!

 

Note: If you have some trouble with object tracking you can directly go to example finder and there you can find a example of 'Object Tracking.vi' (Refer it to understand. Just make a copy of library VI and then modify the copied VI)

0 Kudos
Message 2 of 7
(4,216 Views)

What is not working with Overlay Multiple Lines 2?

-Is your Matches (pixel) output is non zero and you are getting matches?

-Since it's an 1d array of clusters, you have to index the array and then pass the Bounding Box to Line End Points input of Overlay Multiple Lines 2.

-Still not clear means post vi or snippet http://www.ni.com/tutorial/9330/en/

Thanks
uday
0 Kudos
Message 3 of 7
(4,206 Views)

@udka wrote:

What is not working with Overlay Multiple Lines 2?

-Is your Matches (pixel) output is non zero and you are getting matches?

-Since it's an 1d array of clusters, you have to index the array and then pass the Bounding Box to Line End Points input of Overlay Multiple Lines 2.

-Still not clear means post vi or snippet http://www.ni.com/tutorial/9330/en/


Snippet.JPG

Firstly, sorry for the late reply. Secondly, yes I am trying to show the overlay in a new image, but the code isn't yet complete, I have been stuck with connecting these 2 blocks.

Finally, As you said I have tried to create an index array and set the pointer to 4 which is supposed to be the Bounding Box, and it created an error when it was connected to the Overlay Multiple Lines. 

Have I accomplished it the wrong way ?

Thank You,

Marwan Sabry

0 Kudos
Message 4 of 7
(4,173 Views)

For anyone who is interested with this topic. I have found the solution, and it is very easy.

Solution.JPG

I have used an Array to Cluster Block, which is then connected to an Unbundle by Name block, which you can use any attribute as you like.

Thank you to all who replied to this topic.

Marwan Sabry

0 Kudos
Message 5 of 7
(4,166 Views)
Solution
Accepted by RavensFan
I'm sorry, it's an array of clusters.
- so you have to index with 0 for first match.
- unbundle with name to get bounding box then pass it to overlay vi.
Thanks
uday
0 Kudos
Message 6 of 7
(4,165 Views)

I think it's not correct solution.

-In the image you provided, you converted array to cluster

-The array elements will be each element for each object found in image.

-unbundled Matches(pixel)[4].Bounding Box means object four bounding box in matched objects.

-The above will be null if there are less than four matches.

-Either unbundle by name and select Matches(pixel)[0].Bounding Box to get first object bounding box.

-Else index array element by giving index 0, and unbundle by name and select bounding box.

Thanks
uday
0 Kudos
Message 7 of 7
(4,151 Views)