loadFromLocalImage(tracker1,Environment.getExternalStorageDirectory()+"/storyrobot/image/img.jpg");
private void loadFromLocalImage(ImageTracker tracker, String path)
{
ImageTarget target = new ImageTarget();
String jstr = "{\n"
+ " \"images\" :\n"
+ " [\n"
+ " {\n"
+ " \"image\" : \"" + path + "\",\n"
+ " \"name\" : \"" + path.substring(path.lastIndexOf("/")+1, path.indexOf(".")) + "\"\n"
+ " }\n"
+ " ]\n"
+ "}";
target.setup(jstr, StorageType.Absolute | StorageType.Json, "");
tracker.loadTarget(target, new FunctorOfVoidFromPointerOfTargetAndBool() {
@Override
public void invoke(Target target, boolean status) {
Log.i("HelloAR", String.format("load target (%b): %s (%d)", status, target.name(), target.runtimeID()));
}
});
}
这样有什么问题吗,为什么加载不到,这张图片有3M多大,请问是什么原因?