Opencv--High-level GUI使用介绍
2012-11-10 22:01
471 查看
It provides easy interface to:
Create and manipulate windows that can display images and “remember” their content (no need to handle repaint events from OS).
Add trackbars to the windows, handle simple mouse events as well as keyboard commmands.
Read and write images to/from disk or memory.
Read video from camera or file and write video to a file.
User Interface
createTrackbar
getTrackbarPos
imshow
namedWindow
destroyWindow
destroyAllWindows
MoveWindow
ResizeWindow
SetMouseCallback
setTrackbarPos
waitKey
Reading and Writing Images and Video
imdecode
imencode
imread
imwrite
VideoCapture
VideoCapture::VideoCapture
VideoCapture::open
VideoCapture::isOpened
VideoCapture::release
VideoCapture::grab
VideoCapture::retrieve
VideoCapture::read
VideoCapture::get
VideoCapture::set
VideoWriter
VideoWriter::VideoWriter
ReleaseVideoWriter
VideoWriter::open
VideoWriter::isOpened
VideoWriter::write
Qt New Functions
setWindowProperty
getWindowProperty
fontQt
addText
displayOverlay
displayStatusBar
createOpenGLCallback
saveWindowParameters
loadWindowParameters
createButton
下面是一段自己整理的代码,功能:能够打开摄像头并保存成AVI视频格式
Create and manipulate windows that can display images and “remember” their content (no need to handle repaint events from OS).
Add trackbars to the windows, handle simple mouse events as well as keyboard commmands.
Read and write images to/from disk or memory.
Read video from camera or file and write video to a file.
User Interface
createTrackbar
getTrackbarPos
imshow
namedWindow
destroyWindow
destroyAllWindows
MoveWindow
ResizeWindow
SetMouseCallback
setTrackbarPos
waitKey
Reading and Writing Images and Video
imdecode
imencode
imread
imwrite
VideoCapture
VideoCapture::VideoCapture
VideoCapture::open
VideoCapture::isOpened
VideoCapture::release
VideoCapture::grab
VideoCapture::retrieve
VideoCapture::read
VideoCapture::get
VideoCapture::set
VideoWriter
VideoWriter::VideoWriter
ReleaseVideoWriter
VideoWriter::open
VideoWriter::isOpened
VideoWriter::write
Qt New Functions
setWindowProperty
getWindowProperty
fontQt
addText
displayOverlay
displayStatusBar
createOpenGLCallback
saveWindowParameters
loadWindowParameters
createButton
下面是一段自己整理的代码,功能:能够打开摄像头并保存成AVI视频格式
int main(int argc, char *argv[], char *window_name) { VideoCapture inputVideo(0); // Open input if ( !inputVideo.isOpened()) { cout << "Could not open the input video." << endl; return -1; } VideoWriter outputVideo; // Open the output Size S = Size((int) inputVideo.get(CV_CAP_PROP_FRAME_WIDTH), //Acquire input size (int) inputVideo.get(CV_CAP_PROP_FRAME_HEIGHT)); outputVideo.open("video.avi" , CV_FOURCC('X', 'V', 'I', 'D'), 25,S, true); if (!outputVideo.isOpened()) { cout << "Could not open the output video for write: " << endl; return -1; } cout << "Input frame resolution: Width=" << S.width << " Height=" << S.height<< endl; namedWindow("Video"); while(true) { Mat frame; inputVideo >>frame; imshow("Video",frame); outputVideo << frame; int key = cvWaitKey(25); //ESC 退出 if( key == 27 ) { break; } } inputVideo.release(); outputVideo.release(); }
相关文章推荐
- opencv学习—HighGUI部分函数介绍及例子
- 四、openCV学习笔记(High-level GUI and Media I/O)
- Java版opencv使用中的一些错误原因--Highgui.imread()读不进图片
- opencv4-highgui之视频的输入和输出以及滚动条
- OpenCV入门(五)--OpenCV中的HighGUI(1)
- opencv_highgui.lib(window_w32.obj) : error LNK2019: unresolved external symbol __imp__CreateToolbarE
- 【opencv学习笔记四】opencv3.4.0图形用户接口highgui函数解析
- Opencv—第四章细说highgui课后练习4-1
- opencv4-highgui之视频的输入和输出以及滚动条
- warning C4627: “#include "highgui.h"”: 在查找预编译头使用时跳
- OpenCV学习笔记08--细说HighGUI
- 本文介绍使用OpenCV-Python进行形态学处理
- OpenCV学习笔记18 OpenCV高级GUI和多媒体模块 HIGHGUI MODULE (二)
- 凡哥OpenCV基础入门教程(跳一跳专题)-CH1.3-通过HighGUI展示图片
- 【opencv 官方教程】翻译4 highgui module
- opencv c++函数 highgui模块 2 OpenCV的视频输入和相似度测量
- java中使用elastaicsearch6.2.0(RestHighLevelClient)
- opencv_highgui244.lib(opencv_highgui244.dll) : fatal error LNK1112: 模块计算机类型“x64”与目标计算机类型“X86”冲突
- Qt学习之四:使用Qt+OpenCV创建GUI应用
- OpenCV学习笔记17 OpenCV高级GUI和多媒体模块 HIGHGUI MODULE (一)