当前位置:网站首页>Opencv environment, and open a local PC camera.
Opencv environment, and open a local PC camera.
2022-07-07 03:11:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack
1、opencv Environmental structure
Recommended links http://www.cnblogs.com/Anykong/archive/2011/04/06/Anykong_OpenCV1.html
2、 Here's the basic test , And open the camera program :
My test is in win8 On the system .
#include <cv.h>
#include <highgui.h>
#if 0
// Testing opencv Environmental data
int main()
{
const char* filename = "g:\\test.jpg" ;// Change to your own file pathname !! Please note that , Double slash !!
const char* wndname = "http://blog.csdn.net/moc062066" ; IplImage* pImage = cvLoadImage(filename,CV_LOAD_IMAGE_COLOR) ; cvNamedWindow(wndname,CV_WINDOW_AUTOSIZE); cvShowImage(wndname,pImage); cvWaitKey(0); cvReleaseImage(&pImage); cvDestroyWindow(wndname); return 0; } #else // Collect camera data #include <cv.h>#include <cxcore.h>#include <highgui.h> int main( int argc, char** argv ){ // Statement IplImage The pointer IplImage* pFrame = NULL; // Get the camera CvCapture* pCapture = cvCreateCameraCapture(-1); // Create a form cvNamedWindow("video", 1); cvResizeWindow("video",300,300); // Display video while(1) { pFrame=cvQueryFrame( pCapture ); if(!pFrame)break; cvShowImage("video",pFrame); char c=cvWaitKey(33); if(c==27)break; } cvReleaseCapture(&pCapture); cvDestroyWindow("video");}#endif
Copyright notice : This article is the original article of the blogger , Blog , Do not reprint without permission .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116782.html Link to the original text :https://javaforall.cn
边栏推荐
- Oauth2协议中如何对accessToken进行校验
- 惯导标定国内外研究现状小结(删减版)
- Left value, right value
- IDEA重启后无法创建Servlet文件的解决方案
- 【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
- 杰理之播内置 flash 提示音控制播放暂停【篇】
- Install redis from zero
- How-PIL-to-Tensor
- Le tube MOS réalise le circuit de commutation automatique de l'alimentation principale et de l'alimentation auxiliaire, et la chute de tension "zéro", courant statique 20ua
- netperf 而网络性能测量
猜你喜欢
The annual salary of general test is 15W, and the annual salary of test and development is 30w+. What is the difference between the two?
Unity使用MaskableGraphic画一条带箭头的线
Hazel engine learning (V)
从零安装Redis
[cpk-ra6m4 development board environment construction based on RT thread studio]
Install redis from zero
Don't you know the relationship between JSP and servlet?
How to verify accesstoken in oauth2 protocol
Redis入門完整教程:問題定比特與優化
A complete tutorial for getting started with redis: RDB persistence
随机推荐
硬件之OC、OD、推挽解释
惯导标定国内外研究现状小结(删减版)
房费制——登录优化
Redis introduction complete tutorial: replication principle
Analysis of USB network card sending and receiving data
Redis入门完整教程:AOF持久化
Static proxy of proxy mode
Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (initial assignment part)
从控制理论的角度谈数据分析
Introduction to ins/gps integrated navigation type
Matlab Error (Matrix dimensions must agree)
How-PIL-to-Tensor
掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
Oracle connection pool is not used for a long time, and the connection fails
杰理之发射端在接收端关机之后假死机【篇】
Es6中Promise的使用
oracle连接池长时间不使用连接失效问题
How does C language (string) delete a specified character in a string?
2022 information security engineer examination outline
「小样本深度学习图像识别」最新2022综述