07-26-2016 04:22 PM
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
Solved! Go to Solution.
07-26-2016 11:31 PM - edited 07-26-2016 11:36 PM
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)
07-27-2016 12:23 AM
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/
07-29-2016 02:42 PM
@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/
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
07-29-2016 03:21 PM
For anyone who is interested with this topic. I have found the solution, and it is very easy.
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
07-29-2016 03:21 PM
07-30-2016 10:39 AM
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.