1 | initial version |
I have solved the problem.
As I thought, the problem was that, despite I compiled well the modified OpenCV4Android library, I was loading the library dinamically, these changes were not applied, then I was using the library that comes with OpenCV manager (for android).
The solution make the load static, this is, copy ${OpenCV4Android_folder}\OpenCV Library - 3.0.0-dev\lib\<target_arch>
to ${proyect_folder}\libs
.
Then make the library loading statically. Here an example:
private BaseLoaderCallback mOpenCVCallBack;
[...]
mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
//Hacer cosas si se ha cargado bien?
break;
default:
super.onManagerConnected(status);
break;
}
}
};
if (!OpenCVLoader.initDebug()){
//Handle error
}else{
mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
NOTE: This solutions is only valid for proyects that not use JNI, otherwise you must follow this tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html
2 | No.2 Revision |
I have solved the problem.
As I thought, the problem was that, despite I compiled well the modified OpenCV4Android library, I was loading the library dinamically, these changes were not applied, then I was using the library that comes with OpenCV manager (for android).
The solution make the load static, this is, copy
to ${OpenCV4Android_folder}\OpenCV Library - 3.0.0-dev\lib\<target_arch>${OpenCV4Android_folder}\lib\<target_arch>${proyect_folder}\libs
.
Then make the library loading statically. Here an example:
private BaseLoaderCallback mOpenCVCallBack;
[...]
mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
//Hacer cosas si se ha cargado bien?
break;
default:
super.onManagerConnected(status);
break;
}
}
};
if (!OpenCVLoader.initDebug()){
//Handle error
}else{
mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
NOTE: This solutions is only valid for proyects that not use JNI, otherwise you must follow this tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html
3 | No.3 Revision |
I have solved the problem.
As I thought, the problem was that, despite I compiled well the modified OpenCV4Android library, I was loading the library dinamically, these changes were not applied, then I was using the library that comes with OpenCV manager (for android).
The solution is make the load to be static, this is, copy ${OpenCV4Android_folder}\lib\<target_arch>
to ${proyect_folder}\libs
.
Then make the library loading statically. Here an example:
private BaseLoaderCallback mOpenCVCallBack;
[...]
mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
//Hacer cosas si se ha cargado bien?
break;
default:
super.onManagerConnected(status);
break;
}
}
};
if (!OpenCVLoader.initDebug()){
//Handle error
}else{
mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
NOTE: This solutions is only valid for proyects that not use JNI, otherwise you must follow this tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html