Hi, in my app (which uses the imageTargets functionality) I have the pose matrix of a trackable being converted all the way to screen coordinates. The way I am doing this is:
1) Get cameraCalibration
const QCAR::CameraCalibration& cameraCalibration = QCAR::CameraDevice::getInstance().getCameraCalibration();
2) Getting the camera point
QCAR::Vec2F cameraPoint = QCAR::Tool::projectPoint(cameraCalibration, result->getPose(), QCAR::Vec3F(0, 0,0));
3) Converting "cameraPoint" to "screenPoint"
QCAR::Vec2F screenPoint = cameraPointToScreenPoint(cameraPoint);
Step 1 is outside the main 'for' loop in renderFrame. Steps 2 and 3 are done inside the 'for' loop. And the function 'cameraPointToScreenPoint' is a direct copy from y'alls FAQ section.
The problem is that on some devices the screen coordinates returned are not matched to the target being tracked. I have a View class that displays some information about the target being tracked that needs to be right on top of this. On a Motorola Droid 4, this works perfectly, but on an HTC Thunderbolt, the X/Y coordinates returned are off by an exact factor of 2 (I have to multiply the returned coordinates by 2 to get it to work on the HTC). I can't locate the cause of this problem.
Problem with getting screen coordinates of trackable
Hi, have you checked this article from our Knowledge Base section:
https://developer.vuforia.com/resources/dev-guide/screen-coordinates
Problem with getting screen coordinates of trackable
Yes I have. The section that applies directly to my needs in that article is the "Target space to screen space".
Problem with getting screen coordinates of trackable
Have you tried debugging it by adding some Logs to print out the values of the screen width/height and the video width/height ? That would help you understand what goes wrong and what are the differences between the devices showing different behaviours...
Problem with getting screen coordinates of trackable
I have been, but the log results are giving my large results or overflow values which indicates that I am seeing addresses in memory. However, I try dereferencing them "(int *)" which do not do anything (I should not have to dereferece non pointers).
Problem with getting screen coordinates of trackable
Hi, this line:
should work normally.
there is also a similar line of code (which works) in the ImageTargets sample:
Problem with getting screen coordinates of trackable
Hi AlessandroB,
is there new link? the link is no longer avaliable.
Problem with getting screen coordinates of trackable
This link shouws how to convert target coordinates to screen coordinates:
https://developer.vuforia.com/forum/faq/technical-how-can-i-project-target-point-screen