RGB转jpg使用libjpeg库实现 | 您所在的位置:网站首页 › rgb怎么转换成jpg › RGB转jpg使用libjpeg库实现 |
近期在做一个在智能相机产品,关于人脸识别方面的,需要输出一张jpeg图片识别结果,需要YUV转RGB,RGB转JPG,其实libjpeg也可以直接以YUV输入源输出JPG图片的,涉及到通用性和不同编码器输出的YUV格式不一致,下面贴代码,从网上找了一些参考,调试过后没保存作者的url,抱歉,下面贴代码。
// // rgb2jpeg.h // libjpegTest // // Created by mawei on 15/10/2. // Copyright (c) 2015年 mawei. All rights reserved. // #ifndef __libjpegTest__rgb2jpeg__ #define __libjpegTest__rgb2jpeg__ #include int jpeginit(int image_width,int image_height,int quality); int rgb2jpeg(char * filename, unsigned char* rgbData); int jpeguninit(); #endif /* defined(__libjpegTest__rgb2jpeg__) */
// // rgb2jpeg.c // libjpegTest // // Created by mawei on 15/10/2. // Copyright (c) 2015年 mawei. All rights reserved. // #include #include "rgb |
CopyRight 2018-2019 实验室设备网 版权所有 |