资源简介
使用原始的RGB数据构造Opencv中的Mat对象。该资源使用Linux系统中的V4L2接口读取摄像头MJPEG图像数据,解码成RGB数据,再转换为Opencv中的Mat对象所使用的BGR格式
代码片段和文件信息
/****************************************************************************
# GspcaGui: Gspca/Spca5xx Grabber #
# Copyright (C) 2004 2005 2006 Michel Xhaard #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not write to the Free Software #
# Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA #
# #
****************************************************************************/
#include
#include
#include
#include “color.h“
static int *LutYr = NULL;
static int *LutYg = NULL;;
static int *LutYb = NULL;;
static int *LutVr = NULL;;
static int *LutVrY = NULL;;
static int *LutUb = NULL;;
static int *LutUbY = NULL;;
static int *LutRv = NULL;
static int *LutGu = NULL;
static int *LutGv = NULL;
static int *LutBu = NULL;
#if 0
#define RGB24_TO_Y(rgb) LutYr[(r)] + LutYg[(g)] + LutYb[(b)]
#define YR_TO_V(ry) LutVr[(r)] + LutVrY[(y)]
#define YB_TO_U(by) LutUb[(b)] + LutUbY[(y)]
#define R_FROMYV(yv) CLIP((y) + LutRv[(v)])
#define G_FROMYUV(yuv) CLIP((y) + LutGu[(u)] + LutGv[(v)])
#define B_FROMYU(yu) CLIP((y) + LutBu[(u)])
#endif
unsigned char
RGB24_TO_Y(unsigned char r unsigned char g unsigned char b)
{
return (LutYr[(r)] + LutYg[(g)] + LutYb[(b)]);
}
unsigned char
YR_TO_V(unsigned char r unsigned char y)
{
return (LutVr[(r)] + LutVrY[(y)]);
}
unsigned char
YB_TO_U(unsigned char b unsigned char y)
{
return (LutUb[(b)] + LutUbY[(y)]);
}
unsigned char
R_FROMYV(unsigned char y unsigned char v)
{
return CLIP((y) + LutRv[(v)]);
}
unsigned char
G_FROMYUV(unsigned char y unsigned char u unsigned char v)
{
return CLIP((y) + LutGu[(u)] + LutGv[(v)]);
}
unsigned char
B_FROMYU(unsigned char y unsigned char u)
{
return CLIP((y) + LutBu[(u)]);
}
void initLut(void)
{
int i;
#define Rcoef 299
#define Gcoef 587
#define Bcoef 114
#define Vrcoef 711 //656 //877
#define Ubcoef 560 //500 //493 564
#define CoefRv 1402
#define CoefGu 714 // 344
#define Co
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4012 2006-06-26 01:48 color.c
文件 416 2017-11-03 13:55 config.h
文件 6440 2017-11-28 20:08 convert.cpp
目录 0 2017-11-03 12:47 include\
文件 2978 2017-04-05 16:16 include\color.h
文件 424 2017-11-03 12:34 include\config.h
文件 535 2017-11-03 12:58 include\convert.h
文件 3250 2012-06-30 07:52 include\jinclude.h
文件 623 2017-03-31 20:07 include\pic_operation.h
文件 1068 2017-11-03 12:31 include\v4l2.h
文件 88883 2015-03-24 14:36 include\videodev2.h
文件 6516 2012-06-30 07:52 jdatasrc-tj.c
文件 1509 2017-11-28 20:02 main.cpp
文件 1000 2017-11-03 13:36 makefile
文件 900 2017-09-02 17:14 makefile.build
文件 8435 2017-11-03 13:26 v4l2.cpp
文件 956 2017-11-03 13:19 v4l2.h
- 上一篇:EDA电子琴设计
- 下一篇:stm32实时时钟,可以实现万年历
相关资源
- 嵌入式Linux系统移植开发-1基于Yocto构
- linux下的QT串口通信
- linux的外文文献
- 老段带你学-鸟哥的Linux私房菜基础+服
- opencv_createsamples.exe
- zw_linux0.11带注解源代码.zip
- 基于Linux平台的串口数据接收程序
- GrabCut-opencv源码注释
- ntpdate-4.2.8p12-1.x86_64.rpm
- 工程训练物料搬运小车OpenCV程序.rar
- 东北大学Linux实验报告及代码sk.zip
- understand5.952 for linux破解安装教程
- linux字符设备驱动代码,副实验报告很
- opencv处理图像88分块DCT变换和量化
- telnet-server-0.17-47.el6.x86_64.rpm和telnet-
- ST7701_854*480显示屏初始化参数
- 最新vivado2019版本,win和linux都有,安
- opencv实现背景分离
- opencv 车牌 字符识别
- Windows下基于Opencv+Qt的视频聊天客户端
- linux上实现多进程和多线程实现同步互
- linux下使用minicom连接开发板.doc
- ARM linux 和上位机windows10进行TCP/IP网络
- Linux系统下基于Qt的局域网即时通信系
- linux设备驱动详解视频宋宝华百度网盘
- linux 命令解释器
- linux下weblogic安装部署全套
- 全志A13移植Linux所用的配置文件.conf
- unoconv-0.5-1.el6.rf.noarch.rpmunoconv命令插件
- Linuxc 信号的使用
评论
共有 条评论