Log in or register to post comments

How to find the Coordinates of the projected image target on background screen?

October 17, 2017 - 9:20am #1

Hi there, 

The problem is simple,

In vuforia AR the camera keeps "shooting" a plane that renders the video feedback from device's (smart phone) camera.

If the camera "gets" the image target somewhere inside the feedback video, it renders the 3d augmentation in front of the image target of the video (not quit in front of it - but where we have set it relatively with the image target).

Anyway,

Is there any way / method / script that can inform us about the exact position (coordinates) of the image target that is on the plane (/ screen / video) ?

Thanx

How to find the Coordinates of the projected image target on background screen?

May 8, 2020 - 10:52pm #8

Wiils wrote:

dpizzle wrote:

Hmm, that link doesnt have anything to do with touch input.  It transforms a world space coordiante (x,y,z)  to  screen space (x,y) which is what I thought you needed.  You feed in the image target transform and get back where it exists on the screen.  

Did a quick test and it seems to do what you need, but maybe I'm misunderstanding.  See attached image.

Oh and you'll have to divide by screen width and height and flip the y axis by subtracting 1-y coord.

 

 

 

i am trying to get image target position relative to screen in Android,this picture seems good to me,could you tell me how to transform a world space coordiante (x,y,z)  to  screen space (x,y) ?Is there a method i can use in Vuforia Android?

Any reply will be grateful~~

Hey here is the video explaining the basics of what you wanted https://www.youtube.com/watch?v=7QomGnOyQoY .. 

but i wanted to know how you are extracting the position of image target ? i know it has transform component to retrieve its coordinates in 3d space but how i can get width and height of image target in real time (what i actually want is that i want to extract image target as 2D-image and convert it into a texture realtime) ? provided if i am scanning the target at an angle and target appears to be skewed in camera ?.

How to find the Coordinates of the projected image target on background screen?

March 11, 2020 - 7:19am #7

dpizzle wrote:

Hmm, that link doesnt have anything to do with touch input.  It transforms a world space coordiante (x,y,z)  to  screen space (x,y) which is what I thought you needed.  You feed in the image target transform and get back where it exists on the screen.  

Did a quick test and it seems to do what you need, but maybe I'm misunderstanding.  See attached image.

Oh and you'll have to divide by screen width and height and flip the y axis by subtracting 1-y coord.

 

 

 

i am trying to get image target position relative to screen in Android,this picture seems good to me,could you tell me how to transform a world space coordiante (x,y,z)  to  screen space (x,y) ?Is there a method i can use in Vuforia Android?

Any reply will be grateful~~

How to find the Coordinates of the projected image target on background screen?

October 19, 2017 - 10:04am #6

Also, Region Capture source incorporates some code that is similar to what you are doing.  https://github.com/maximrouf/RegionCapture

Whether it helps, not sure, didn't quite understand your use case, but browse through it and you might find something useful.  Good luck.

 

How to find the Coordinates of the projected image target on background screen?

October 19, 2017 - 7:16am #5

Thank you for that, I get it.

What I really wanted was the image target 's coordinates, as it appears in the background video, on the background plane.

Never the less, Screen is always parallel with the background plane and I just though that I can add an empty object at the center of my image target and right in to it (same depth) and take its "screen space" coordinates that are about the same with the coordinates I am looking for.

The second part is matrix translation cause of the screen coordinates system, I assume, so it is as I described.

Don't know if this trick takes extra "computer" resources, but still is the only and best idea, for what I want.

Thanx again dpizzle

How to find the Coordinates of the projected image target on background screen?

October 18, 2017 - 8:47am #4

Hmm, that link doesnt have anything to do with touch input.  It transforms a world space coordiante (x,y,z)  to  screen space (x,y) which is what I thought you needed.  You feed in the image target transform and get back where it exists on the screen.  

Did a quick test and it seems to do what you need, but maybe I'm misunderstanding.  See attached image.

Oh and you'll have to divide by screen width and height and flip the y axis by subtracting 1-y coord.

 

 

AttachmentSize
Image icon Untitled-1.jpg99.39 KB

How to find the Coordinates of the projected image target on background screen?

October 18, 2017 - 8:21am #3

No, no, no...

Not for touch input. As you can see on uploaded image I want the position of the distinguished image-target on the input video frame.

Lets say I run a vuforia app. and think that screen measurement where upper left corner is (0,0) and down right corner is (1,1)

I am moving my phone and scanning my room, but I don't target on image target so there is no augmentation happening

1. Camera is does not see image target --> I get: pos==(NULL, NULL)

I keep moving my phone and scanning my room towards the image target I have printed

2. Camera captures image target at the upper left corner of the screen --> I get pos==(0.1, 0.1)

keep moving the phone and still have the printed image target in my picture/frame

3. Camera captures image target at the middle of the screen --> I get pos==(0.5, 0.5)

keep moving the phone

4. Camera captures image target at upper right of the screen --> I get pos==(0.1, 0.9)

.............

 

How do I get this position?

AttachmentSize
Image icon Untitled.jpg44.72 KB

How to find the Coordinates of the projected image target on background screen?

October 17, 2017 - 9:38am #2

I think this more of a Unity problem than a Vuforia one.  Would this work for your situation?

https://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html

Log in or register to post comments