Open GoogleCodeExporter opened 8 years ago
Hi,
even i am trying the same to find the coordinates of the screen for a
particular marker detected.
did u find anything, any progress would help me a lot.
- shashank
Original comment by shashank...@gmail.com
on 23 Aug 2011 at 6:25
[deleted comment]
if you don't mind delving into the C code using JNI, I found the coordinates
inside arDetectMarker.c
look for this line of code:
__android_log_print(ANDROID_LOG_INFO,"AR","cf[%d] = %g
id[%d]=%d",i,wmarker_info[i].cf,i,wmarker_info[i].id);
and add this one after it, recompile the code, and run the code:
__android_log_print(ANDROID_LOG_INFO,"POSITION","wmarker_info[%d].POSITION: Y =
%f; X = %f",i,wmarker_info[i].pos[0], wmarker_info[i].pos[1]);
__android_log_print(ANDROID_LOG_INFO,"POSITION","wmarker_info[%d].RELATIVE_POSITION: Y = %f; X = %f",i,wmarker_info[i].pos[0]/480.0, wmarker_info[i].pos[1]/320.0);
(where 480 and 320 are the screen dimensions)
To support logging, make sure you add #include <android/log.h> to the top of
the c file.
P.S if when building the code with ndk-builder you get some errors related to a
missing GLES/gl.h, make sure you add 'APP_PLATFORM := android-8' to
jni/Application.mk
good luck
Original comment by tomtema...@gmail.com
on 6 Apr 2012 at 9:02
I'm now developing this, and I can get 2D position of marker on screen.
If you were interested, please see "arToolkit.c" and "arToolkit.java" in below
repository:
https://github.com/nmatsui/AR_Speeker
Original comment by nobuyuki...@gmail.com
on 5 Jul 2012 at 9:53
Original issue reported on code.google.com by
j...@phonogram.co.jp
on 8 Aug 2011 at 8:37