#ifdef __JNI__ #ifndef __OCR_RESULT_UTILS_H__ #define __OCR_RESULT_UTILS_H__ #include #include "OcrStruct.h" class OcrResultUtils { public: OcrResultUtils(JNIEnv *env, OcrResult &ocrResult); ~OcrResultUtils(); jobject getJObject(); private: JNIEnv *jniEnv; jobject jOcrResult; jclass newJListClass(); jmethodID getListConstructor(jclass clazz); jobject getTextBlock(TextBlock &textBlock); jobject getTextBlocks(std::vector &textBlocks); jobject newJPoint(cv::Point &point); jobject newJBoxPoint(std::vector &boxPoint); jfloatArray newJScoreArray(std::vector &scores); }; #endif //__OCR_RESULT_UTILS_H__ #endif