• 大小: 55KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-10
  • 语言: 其他
  • 标签: v4l2  yuyv  RGB  JPEG  UDP  

资源简介

ARM Cortex-A8平台Linux下V4l2摄像头采集图片程序,实现yuyv转RGB,RGB转BMP保存,RGB缩放等功能。利用jpeglib实现RGB转JPEG,并且压缩结果保存至内存中,无需再用文件操作来保存JPEG图片,JPEG经UDP发送至远程服务器端。

资源截图

代码片段和文件信息

#include “v4l2_use.h“
#include “image_process.h“
#include 

extern unsigned char* dest_buffers;
extern unsigned char* rgb_buffers;

extern int numb;

long rgb_to_jpeg(const char *rgb char *jpeg)
{
long jpeg_size;
struct jpeg_compress_struct jcs;
struct jpeg_error_mgr jem;
JSAMPROW row_pointer[1];
int row_stride;

jcs.err = jpeg_std_error(&jem);
jpeg_create_compress(&jcs);

jpeg_mem_dest(&jcs jpeg &jpeg_size);//!!!!!!!!!!!!!!!!!!!!!

jcs.image_width = WIDTH;
jcs.image_height = HEIGHT;

jcs.input_components = 3;//1;
jcs.in_color_space = JCS_RGB;//JCS_GRAYSCALE;

jpeg_set_defaults(&jcs);
jpeg_set_quality(&jcs 180 TRUE);

jpeg_start_compress(&jcs TRUE);
row_stride =jcs.image_width * 3;

while(jcs.next_scanline < jcs.image

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-10-27 11:05  v4l2_demo\
     目录           0  2014-10-27 11:05  v4l2_demo\bin\
     文件       27573  2014-10-26 14:09  v4l2_demo\bin\mainapp
     目录           0  2014-10-27 11:05  v4l2_demo\image_process\
     文件        8218  2014-10-26 16:56  v4l2_demo\image_process\image_process.c
     文件          75  2014-10-19 12:26  v4l2_demo\image_process\Makefile
     目录           0  2014-10-27 11:05  v4l2_demo\include\
     文件         356  2014-10-18 09:51  v4l2_demo\include\debug.h
     文件        1075  2014-10-23 16:43  v4l2_demo\include\image_process.h
     文件        1616  2014-10-21 11:37  v4l2_demo\include\jconfig.h
     文件       14581  2014-10-21 11:37  v4l2_demo\include\jerror.h
     文件       12714  2014-10-21 11:37  v4l2_demo\include\jmorecfg.h
     文件       48475  2014-10-21 11:37  v4l2_demo\include\jpeglib.h
     文件         991  2014-10-18 10:27  v4l2_demo\include\lcd.h
     文件        2078  2014-10-26 14:01  v4l2_demo\include\v4l2_use.h
     目录           0  2014-10-27 11:05  v4l2_demo\lcd\
     文件        2374  2014-10-18 19:52  v4l2_demo\lcd\lcd.c
     文件          56  2014-10-19 12:14  v4l2_demo\lcd\Makefile
     目录           0  2014-10-27 11:05  v4l2_demo\main\
     文件         995  2014-10-26 14:22  v4l2_demo\main\main.c
     文件          58  2014-10-19 12:25  v4l2_demo\main\Makefile
     文件         483  2014-10-21 11:45  v4l2_demo\Makefile
     文件         245  2014-10-21 18:30  v4l2_demo\mk.sh
     目录           0  2014-10-27 11:05  v4l2_demo\obj\
     文件        6316  2014-10-26 13:59  v4l2_demo\obj\image_process.o
     文件        3396  2014-10-26 14:03  v4l2_demo\obj\lcd.o
     文件        2388  2014-10-26 14:09  v4l2_demo\obj\main.o
     文件          49  2014-10-19 12:26  v4l2_demo\obj\Makefile
     文件        8228  2014-10-26 14:09  v4l2_demo\obj\v4l2_use.o
     目录           0  2014-10-27 11:05  v4l2_demo\v4l2\
     文件          65  2014-10-19 12:14  v4l2_demo\v4l2\Makefile
............此处省略1个文件信息

评论

共有 条评论