I have tried to do what you mention. It is possible to generate the Data on the Phone. I used a Samsung Galaxy S5.
The Application took a Photo of the Camera and then through a Button it makes a JNICall to the genTexData.cpp (modified to work with android) which saves the iset, fset and fset3 file into the cache folder. (checked it with an InfoButton). The only Problem ist, that it takes up to 25 minutes with a big Image. I'm trying to optimize this but it is really hard without a proper api oder good Documentation about what is happening in the function.
I also though of using FAST and SIFT to generate the files which (should) be faster but I dont know if the Data generated out of them could fit the ARToolKit tracking.
If you get any better results or optimize it dont hesitate to answer. Here the JNICode I used:
extern "C"
JNIEXPORT jint JNICALL JNIFUNCTION_NATIVE(trainNFT(JNIEnv *env, jobject obj, jstring imagePath))
{
jint resultCode;
ReturnCode result;
//Get the native string from imagePath
const char* nativePath = env->GetStringUTFChars(imagePath, 0);
result = genTexData(nativePath);
switch(result)
{
case E_NO_ERROR:
resultCode = 0;
break;
case E_BAD_PARAMETER:
resultCode = 64;
break;
case E_INPUT_DATA_ERROR:
resultCode = 65;
break;
case E_USER_INPUT_CANCELLED:
resultCode = 66;
break;
case E_BACKGROUND_OPERATION_UNSUPPORTED:
resultCode = 69;
break;
case E_DATA_PROCESSING_ERROR:
resultCode = 70;
break;
case E_UNABLE_TO_DETACH_FROM_CONTROLLING_TERMINAL:
resultCode = 71;
break;
case E_COULDNT_READ_IMAGE_FROM_FILE:
resultCode = 73;
break;
case E_GENERIC_ERROR:
resultCode = 255;
break;
default:
resultCode = 42;
break;
}
env->ReleaseStringUTFChars(imagePath, nativePath);
return resultCode;
}
The jstring is the path to the cache-folder of the Application with the Imagename.
I modified genTexData that it does not ask for the Option parameters and set Default Values for the application. The only Parameter the Method takes, is the imagePath. It Returns a result code which is the Exitcode from the original. In the AndroidActivity it just checks the Result code and gives a corresponding Message to the User.
The Version isnt perfect yet, also I need to delete some exit codes which can't occur in this kind of genTexData (Background, Userinput). Also as I see it, to optimize the Generation it is needed to change other .c files (e.g. featureMap.c, featureSet.c)