center_get.cpp 877 字节
#include <stdio.h>
#include "./center_get.h"
#include <unistd.h>

#include "../opcv_Interface.h"

#include <iostream>
#include "version_choose.h"

#if ALLWINNER_CEDAR == VERSION_SWITCH_ON
#include "../opencv2/opencv.hpp"
extern "C" {
//using namespace cv;

static int center_get_num = 0;

int center_GetY(unsigned char* frame_data, int width, int height)
{
    // cv::Mat frame(height + height / 2, width, CV_8UC1, const_cast<unsigned char*>(frame_data));
    // cv::cvtColor(frame, frame, cv::COLOR_YUV2BGR_NV21); // 转换为BGR格式

    // int y = get_center_y(frame);

    // // 保存帧为图像文件
    // // center_get_num++;
    // // if (center_get_num%5==0)
    // // {
    // //     std::string filename = "/root/sdcard/frame" + std::to_string(center_get_num) + ".jpg";
    // //     cv::imwrite(filename, frame);
    // // }
    
    // return y;
}

}


#endif