基于Dragonboard 410c android系统实现人的眼球识别功能
时间:02-17
来源:互联网
点击:
="line" id="LC147">
{
="line" id="LC148">
LOGD("nativeSetFaceSize catched unknown exception");
="line" id="LC149">
jclass je = jenv->FindClass("java/lang/Exception");
="line" id="LC150">
jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
="line" id="LC151">
}
="line" id="LC152">
}
="line">
="line">
="line" id="LC155">
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeDetect
="line" id="LC156">
(JNIEnv * jenv, jclass, jlong thiz, jlong imageGray, jlong faces)
="line" id="LC157">
{
="line" id="LC158">
try
="line" id="LC159">
{
="line" id="LC160">
vector<Rect> RectFaces;
="line" id="LC161">
((DetectionBasedTracker*)thiz)->process(*((Mat*)imageGray));
="line" id="LC162">
((DetectionBasedTracker*)thiz)->getObjects(RectFaces);
="line" id="LC163">
vector_Rect_to_Mat(RectFaces, *((Mat*)faces));
="line" id="LC164">
}
="line" id="LC165">
catch(cv::Exception e)
="line" id="LC166">
{
="line" id="LC167">
LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
="line" id="LC168">
jclass je = jenv->FindClass("org/opencv/core/CvException");
="line" id="LC169">
if(!je)
="line" id="LC170">
je = jenv->FindClass("java/lang/Exception");
="line" id="LC171">
jenv->ThrowNew(je, e.what());
="line" id="LC172">
}
="line" id="LC173">
catch (...)
="line" id="LC174">
{
="line" id="LC175">
LOGD("nativeDetect catched unknown exception");
="line" id="LC176">
jclass je = jenv->FindClass("java/lang/Exception");
="line" id="LC177">
jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
="line" id="LC178">
}
="line" id="LC179">
}
="line">
四 例程共享:
下载地址:http://pan.baidu.com/s/1jIGz3dO
DragonBoard 410c 眼球识别 Android 相关文章: