int main()
{
/*
cout << "Hello World!" << endl;
Mat rgb = imread("/home/ubuntu/rgb320.jpg");
Mat nv12;
Mat rgb2;
cvtColor(rgb, nv12, COLOR_RGB2YUV_I420);
//imwrite("/home/ubuntu/nv12.yuv",nv12,0);
FILE* f = fopen("/home/ubuntu/nv12,yuv","wb+");
fwrite(nv12.data,1,rgb.rows*rgb.cols*3/2,f);
cvtColor(nv12, rgb2, COLOR_YUV2RGB_I420);
imwrite("/home/ubuntu/rgb2.png",rgb2);
return 0;
*/
Mat yuvNV12;
Mat gbr24;
//1.read nv12 file to nv12 mat
FILE* f = fopen("/home/ubuntu/rgb320.yuv","r");
char buff[960000];
memset(buff,0,960000);
fread(buff,1,180*320*3/2,f);
yuvNV12.create(180*3/2,320,CV_8UC1);
memcpy(yuvNV12.data,buff,320*180*3/2);
//2.cvt nv12 mat to rgb24 mat
cvtColor(yuvNV12,gbr24, COLOR_YUV2RGB_I420);
//fwrite(yuvNV12.data,1,gbr24.rows*gbr24.cols*3/2,f);
//3.
imwrite("/home/ubuntu/rgb320_new.jpg",gbr24);
fflush(f);
fclose(f);
}
mysql 查询分数第二名所有人 SQL mysql查询第三名
CREATE TABLE t_testscore( pk_id INT PRIMARY KEY, c_name VARCHAR(50) , c_score INT, c_class INT )DEFAULT CHARSET=utf8;
INSERT INTO t_testscore VALUES (1, '张三6', 66, 1),(2, '张三5', 65, 1),(3
将 json 标注文件转化为 YOLO 所需要的 txt 数据格式
YOLO需要的标注数据是每个图片一个 txt 文件json 标注数据文件内容包含:name:图片文件名category:类别idbbox:目标框信息xyrb格式,分别指[左上角x坐标,左上角y坐标,右下角x坐标,右下角y坐标]score:预测的分数如下格式[