Android Studio NDK OpenCV: c++ code can't work with Mat -
this question has answer here:
- passing cv:mat android jni 1 answer
i included opencv native code in app in android studio. , wrote test function:
jniexport jint jnicall java_com_atapy_wisetrend3_mainactivity_search(jnienv *env, jclass type, cv::mat image,cv::mat croppedimage) { croppedimage = image; return 1; }
but when call function search, execution of calling function in java stops without errors. in logcat have message:
"fatal signal 11 (sigsegv) @ 0x11c00041 (code=1), thread 16754 (tapy.wisetrend3)".
if erase line "croppedimage = image"
function succeeds , returns 1. happens operations mat.
what mean?
i'm not sure trying do. cv::mat
wrapper of actual mat.data
. usually, 1 doesn't want direct assignment image=croppedimage
, specially when passed argument.
if want copy image data, croppedimage.copyto(image)
way go.
Comments
Post a Comment