目录
c++ opencv部分
#include <jni.h>
#include <opencv2/opencv.hpp>
extern "C" {
JNIEXPORT void JNICALL Java_com_tencent_blazefacencnn_BlazeFaceNcnn_encode(JNIEnv *env,jobject thiz, jobject instance, jint facing) {
for(int i=0;i<50;i++) {
string path =
"/storage/emulated/0/Android/data/com.tencent.blazefacencnn/files/" + to_string(i) +
".jpg";
cv::Mat rgb_o = cv::imread(path.c_str());
cv::Mat rgb;
cv::cvtColor(rgb_o, rgb, cv::COLOR_RGB2BGR);
if (!rgb.empty()) {
cv::Mat yuv;
cv::cvtColor(rgb, yu