My basic application is I get the data and process in gpu to display on the screen. Before I added in OpenCV code into the app in the native c++, it works fine and can display the images on the screen. After I added in the following api into the native code, the app crashes with signal 11 error. How can I fix that error? My log error is shown in the bottom.
JNIEXPORT jlong JNICALL Java_UsbCamera_nativeCreateObject
(JNIEnv * jenv, jclass, jstring jFileName, jint faceSize)
{
LOGD("Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeCreateObject enter");
const char* jnamestr = jenv->GetStringUTFChars(jFileName, NULL);
string stdFileName(jnamestr);
jlong result = 0;
LOGD(jnamestr);
try
{
DetectionBasedTracker::Parameters DetectorParams;
if (faceSize > 0)
DetectorParams.minObjectSize = faceSize;
result = (jlong)new DetectionBasedTracker(stdFileName, DetectorParams);
}
catch(cv::Exception& e)
{
LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGD("nativeCreateObject caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTracker.nativeCreateObject()");
return 0;
}
LOGD("Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeCreateObject exit");
return result;
}
LOG ERROR
01-02 08:19:17.960: I/DEBUG(2158): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 8a1a2080
01-02 08:19:17.960: I/DEBUG(2158): r0 8a1a2080 r1 ffffffff r2 e0000000 r3 ffffffff
01-02 08:19:17.960: I/DEBUG(2158): r4 ffffffff r5 ffffffff r6 ffffffff r7 ffffffff
01-02 08:19:17.960: I/DEBUG(2158): r8 00000002 r9 ffffffff 10 00000280 fp 000000ff
0 comments:
Post a Comment