Log in or register to post comments

Placing a 2d image for each trackable detected??

February 7, 2011 - 7:35pm #1

Hi all

My requirement is that in the camera frame whatever trackables have been identified some screen coordinates(x,y) for each of them should be returned to the android code so that I can place one 2d bitmap for each of them...

Any idea how can I get some approximate x,y coordinate(may be centre of each trackable identified in frame) from the qualcomm code and then return it to the android code so that i can place one 2d bitmap on those x,y coordinates...

I know the problem is not too difficult...If i have time i can figure it out but Iam running short of time:( ...So please need help!!

Re: Placing a 2d image for each trackable detected??

February 8, 2011 - 5:46am #4

Thanks a lot kim you seem to be a life saver for me at this point of time:p:)when Iam coming up with different different queries.

Re: Placing a 2d image for each trackable detected??

February 8, 2011 - 5:22am #3

There is a projectPoint method in the Tool.h file that is just for this purpose. See the following code snippet:

const QCAR::Tracker& tracker = QCAR::Tracker::getInstance();
const QCAR::CameraCalibration& cameraCalibration = tracker.getCameraCalibration();
QCAR::Vec2F screenPoint = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F(0, 0, 0));
LOG("screen point: %f, %f", screenPoint.data[0], screenPoint.data[1]);

This should map the center of the trackable (0, 0, 0) to screen coordinates.

- Kim

Re: Placing a 2d image for each trackable detected??

February 8, 2011 - 3:09am #2

I did something similar to that.
My solution was to render a 2D plane in native and apply the bitmap image as a texture on that plane.
No need to get co-ords.

Log in or register to post comments