Log in or register to post comments

Can I get the 2D coordinates of the detected mage target?

March 4, 2020 - 1:21am #2

Hi,

I wanted to know, if it is possible to get something like 4 corners of ther bounding box of the found image target in the video stream. So for example, if I want to track the following image

Can I get the 2d corner points of this image (red dots), when it it was found in the video stream?

AttachmentSize
Image icon imageCorners.png328.12 KB

Can I get the 2D coordinates of the detected mage target?

March 4, 2020 - 9:38am #1

Sure, I'd put an empty game object at each corner of the target and have them all as children.  Then use code something like this:

Vector3 screenPos = cam.WorldToScreenPoint(corner1.position);
Debug.Log("corner1 is " + screenPos.x + " pixels from the left");
Log in or register to post comments