实例介绍
为什么美颜摄像这么简单的功能,OpenCV这个开源项目网上很少有代码呢?对于在windows平台下,生成h264视频流也比价麻烦,没有现成的api可以使用,需要借助MinGw编译libx264,或者ffmpeg才能使用。 最近有个小需求,要推送直播视频流,我在网上查了一下有live555或者用librtmp来推送,但是前者还需要修改源代码,也挺麻烦的,现在先做到了下面几个步骤: 1.OpenCV捕捉摄像头的图像 2.进行识别需要美颜的部分(人脸识别,肤色识别) 3.进行美颜(提升亮度,直方图均衡,滤波) 4.生成YUV视频 5.生成h264
【实例截图】
【核心代码】
16359647387668576160.rar
└── live_beautiful_camera_streaming
├── Debug
│ ├── live_beautiful_camera_streaming.exe
│ ├── live_beautiful_camera_streaming.ilk
│ └── live_beautiful_camera_streaming.pdb
├── ipch
│ └── live_beautiful_camera_streaming-155bc383
│ └── live_beautiful_camera_streaming-e7f592d.ipch
├── live_beautiful_camera_streaming
│ ├── Debug
│ │ ├── cl.command.1.tlog
│ │ ├── CL.read.1.tlog
│ │ ├── CL.write.1.tlog
│ │ ├── link.10560-cvtres.read.1.tlog
│ │ ├── link.10560-cvtres.write.1.tlog
│ │ ├── link.10560.read.1.tlog
│ │ ├── link.10560.write.1.tlog
│ │ ├── link.10696-cvtres.read.1.tlog
│ │ ├── link.10696-cvtres.write.1.tlog
│ │ ├── link.10696.read.1.tlog
│ │ ├── link.10696.write.1.tlog
│ │ ├── link.10992-cvtres.read.1.tlog
│ │ ├── link.10992-cvtres.write.1.tlog
│ │ ├── link.10992.read.1.tlog
│ │ ├── link.10992.write.1.tlog
│ │ ├── link.11216-cvtres.read.1.tlog
│ │ ├── link.11216-cvtres.write.1.tlog
│ │ ├── link.11216.read.1.tlog
│ │ ├── link.11216.write.1.tlog
│ │ ├── link.11240-cvtres.read.1.tlog
│ │ ├── link.11240-cvtres.write.1.tlog
│ │ ├── link.11240.read.1.tlog
│ │ ├── link.11240.write.1.tlog
│ │ ├── link.3000-cvtres.read.1.tlog
│ │ ├── link.3000-cvtres.write.1.tlog
│ │ ├── link.3000.read.1.tlog
│ │ ├── link.3000.write.1.tlog
│ │ ├── link.3320-cvtres.read.1.tlog
│ │ ├── link.3320-cvtres.write.1.tlog
│ │ ├── link.3320.read.1.tlog
│ │ ├── link.3320.write.1.tlog
│ │ ├── link.4044-cvtres.read.1.tlog
│ │ ├── link.4044-cvtres.write.1.tlog
│ │ ├── link.4044.read.1.tlog
│ │ ├── link.4044.write.1.tlog
│ │ ├── link.6348-cvtres.read.1.tlog
│ │ ├── link.6348-cvtres.write.1.tlog
│ │ ├── link.6348.read.1.tlog
│ │ ├── link.6348.write.1.tlog
│ │ ├── link.8488-cvtres.read.1.tlog
│ │ ├── link.8488-cvtres.write.1.tlog
│ │ ├── link.8488.read.1.tlog
│ │ ├── link.8488.write.1.tlog
│ │ ├── link.8920-cvtres.read.1.tlog
│ │ ├── link.8920-cvtres.write.1.tlog
│ │ ├── link.8920.read.1.tlog
│ │ ├── link.8920.write.1.tlog
│ │ ├── link.9148-cvtres.read.1.tlog
│ │ ├── link.9148-cvtres.write.1.tlog
│ │ ├── link.9148.read.1.tlog
│ │ ├── link.9148.write.1.tlog
│ │ ├── link.9928-cvtres.read.1.tlog
│ │ ├── link.9928-cvtres.write.1.tlog
│ │ ├── link.9928.read.1.tlog
│ │ ├── link.9928.write.1.tlog
│ │ ├── link.9952-cvtres.read.1.tlog
│ │ ├── link.9952-cvtres.write.1.tlog
│ │ ├── link.9952.read.1.tlog
│ │ ├── link.9952.write.1.tlog
│ │ ├── link.command.1.tlog
│ │ ├── link-cvtres.read.1.tlog
│ │ ├── link-cvtres.write.1.tlog
│ │ ├── link.read.1.tlog
│ │ ├── link.write.1.tlog
│ │ ├── live_beautiful_camera_streaming.exe.embed.manifest
│ │ ├── live_beautiful_camera_streaming.exe.embed.manifest.res
│ │ ├── live_beautiful_camera_streaming.exe.intermediate.manifest
│ │ ├── live_beautiful_camera_streaming.lastbuildstate
│ │ ├── live_beautiful_camera_streaming.log
│ │ ├── live_beautiful_camera_streaming_manifest.rc
│ │ ├── live_beautiful_camera_streaming.obj
│ │ ├── live_beautiful_camera_streaming.pch
│ │ ├── live_beautiful_camera_streaming.vcxprojResolveAssemblyReference.cache
│ │ ├── live_beautiful_camera_streaming.write.1.tlog
│ │ ├── mt.command.1.tlog
│ │ ├── mt.read.1.tlog
│ │ ├── mt.write.1.tlog
│ │ ├── My_Enhance.obj
│ │ ├── MyEnhance.obj
│ │ ├── My_face_detetion.obj
│ │ ├── My_Yuv_to_H264.obj
│ │ ├── rc.command.1.tlog
│ │ ├── rc.read.1.tlog
│ │ ├── rc.write.1.tlog
│ │ ├── stdafx.obj
│ │ ├── vc100.idb
│ │ └── vc100.pdb
│ ├── haarcascade_frontalface_alt.xml
│ ├── libx264-132.dll
│ ├── libx264-132.lib
│ ├── live_beautiful_camera_streaming.cpp
│ ├── live_beautiful_camera_streaming.vcxproj
│ ├── live_beautiful_camera_streaming.vcxproj.filters
│ ├── live_beautiful_camera_streaming.vcxproj.user
│ ├── My_Enhance.cpp
│ ├── My_Enhance.h
│ ├── My_face_detection.h
│ ├── My_face_detetion.cpp
│ ├── My_Yuv_to_H264.cpp
│ ├── My_Yuv_to_H264.h
│ ├── pthreadGC2.dll
│ ├── ReadMe.txt
│ ├── Release
│ │ ├── cl.command.1.tlog
│ │ ├── CL.read.1.tlog
│ │ ├── CL.write.1.tlog
│ │ ├── link.command.1.tlog
│ │ ├── link.read.1.tlog
│ │ ├── link.write.1.tlog
│ │ ├── live_beautiful_camera_streaming.exe.intermediate.manifest
│ │ ├── live_beautiful_camera_streaming.lastbuildstate
│ │ ├── live_beautiful_camera_streaming.log
│ │ ├── live_beautiful_camera_streaming.obj
│ │ ├── live_beautiful_camera_streaming.pch
│ │ ├── live_beautiful_camera_streaming.vcxprojResolveAssemblyReference.cache
│ │ ├── live_beautiful_camera_streaming.write.1.tlog
│ │ ├── mt.command.1.tlog
│ │ ├── mt.read.1.tlog
│ │ ├── mt.write.1.tlog
│ │ ├── My_Enhance.obj
│ │ ├── My_face_detetion.obj
│ │ ├── My_Yuv_to_H264.obj
│ │ ├── stdafx.obj
│ │ └── vc100.pdb
│ ├── result.h264
│ ├── result.yuv
│ ├── stdafx.cpp
│ ├── stdafx.h
│ ├── targetver.h
│ ├── test.h264
│ ├── x264_config.h
│ ├── x264.h
│ └── x64
│ └── Debug
│ ├── cl.command.1.tlog
│ ├── CL.read.1.tlog
│ ├── CL.write.1.tlog
│ ├── link.816-cvtres.read.1.tlog
│ ├── link.816-cvtres.write.1.tlog
│ ├── link.816.read.1.tlog
│ ├── link.816.write.1.tlog
│ ├── link.command.1.tlog
│ ├── link-cvtres.read.1.tlog
│ ├── link-cvtres.write.1.tlog
│ ├── link.read.1.tlog
│ ├── link.write.1.tlog
│ ├── live_beautiful_camera_streaming.exe.embed.manifest
│ ├── live_beautiful_camera_streaming.exe.embed.manifest.res
│ ├── live_beautiful_camera_streaming.exe.intermediate.manifest
│ ├── live_beautiful_camera_streaming.lastbuildstate
│ ├── live_beautiful_camera_streaming.log
│ ├── live_beautiful_camera_streaming_manifest.rc
│ ├── live_beautiful_camera_streaming.obj
│ ├── live_beautiful_camera_streaming.pch
│ ├── live_beautiful_camera_streaming.vcxprojResolveAssemblyReference.cache
│ ├── live_beautiful_camera_streaming.write.1.tlog
│ ├── mt.command.1.tlog
│ ├── mt.read.1.tlog
│ ├── mt.write.1.tlog
│ ├── rc.command.1.tlog
│ ├── rc.read.1.tlog
│ ├── rc.write.1.tlog
│ ├── stdafx.obj
│ ├── vc100.idb
│ └── vc100.pdb
├── live_beautiful_camera_streaming.sdf
├── live_beautiful_camera_streaming.sln
├── live_beautiful_camera_streaming.suo
├── Release
│ ├── live_beautiful_camera_streaming.exe
│ └── live_beautiful_camera_streaming.pdb
└── x64
└── Debug
├── live_beautiful_camera_streaming.exe
├── live_beautiful_camera_streaming.ilk
└── live_beautiful_camera_streaming.pdb
12 directories, 174 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论