718c41634f
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
53 lines
1.0 KiB
Plaintext
53 lines
1.0 KiB
Plaintext
//
|
|
// This file is auto-generated. Please don't modify it!
|
|
//
|
|
|
|
#undef LOG_TAG
|
|
|
|
#include "opencv2/opencv_modules.hpp"
|
|
#ifdef HAVE_OPENCV_$M
|
|
|
|
#include <string>
|
|
|
|
#include "opencv2/$m.hpp"
|
|
|
|
$includes
|
|
|
|
#define LOG_TAG "org.opencv.$m"
|
|
#include "common.h"
|
|
|
|
using namespace cv;
|
|
|
|
/// throw java exception
|
|
#undef throwJavaException
|
|
#define throwJavaException throwJavaException_$m
|
|
static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method) {
|
|
std::string what = "unknown exception";
|
|
jclass je = 0;
|
|
|
|
if(e) {
|
|
std::string exception_type = "std::exception";
|
|
|
|
if(dynamic_cast<const cv::Exception*>(e)) {
|
|
exception_type = "cv::Exception";
|
|
je = env->FindClass("org/opencv/core/CvException");
|
|
}
|
|
|
|
what = exception_type + ": " + e->what();
|
|
}
|
|
|
|
if(!je) je = env->FindClass("java/lang/Exception");
|
|
env->ThrowNew(je, what.c_str());
|
|
|
|
LOGE("%s caught %s", method, what.c_str());
|
|
(void)method; // avoid "unused" warning
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
$code
|
|
|
|
} // extern "C"
|
|
|
|
#endif // HAVE_OPENCV_$M
|