当前位置:网站首页>opencv环境的搭建,并打开一个本地PC摄像头。
opencv环境的搭建,并打开一个本地PC摄像头。
2022-07-06 19:36:00 【全栈程序员站长】
大家好,又见面了,我是全栈君
1、opencv环境结构
推荐连结 http://www.cnblogs.com/Anykong/archive/2011/04/06/Anykong_OpenCV1.html
2、以下是基本測试,和打开摄像头程序:
我的測试是在win8 系统上。
#include <cv.h>
#include <highgui.h>
#if 0
//測试opencv环境数据
int main()
{
const char* filename = "g:\\test.jpg" ;//换成你自己的文件路径名!!请注意,双斜杠!!
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 //採集摄像头数据#include <cv.h>#include <cxcore.h>#include <highgui.h> int main( int argc, char** argv ){ //声明IplImage指针 IplImage* pFrame = NULL; //获取摄像头 CvCapture* pCapture = cvCreateCameraCapture(-1); //创建窗体 cvNamedWindow("video", 1); cvResizeWindow("video",300,300); //显示视屏 while(1) { pFrame=cvQueryFrame( pCapture ); if(!pFrame)break; cvShowImage("video",pFrame); char c=cvWaitKey(33); if(c==27)break; } cvReleaseCapture(&pCapture); cvDestroyWindow("video");}#endif
版权声明:本文博主原创文章,博客,未经同意不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116782.html原文链接:https://javaforall.cn
边栏推荐
- Django数据库(SQlite)基本入门使用教程
- How to verify accesstoken in oauth2 protocol
- 从 1.5 开始搭建一个微服务框架——日志追踪 traceId
- Redis入门完整教程:复制配置
- Simple bubble sort
- Use of tensorboard
- uniapp适配问题
- Shell 编程基础
- The so-called consumer Internet only matches and connects industry information, and does not change the industry itself
- 尚硅谷JVM-第一章 类加载子系统
猜你喜欢

杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】

Redis Getting started tutoriel complet: positionnement et optimisation des problèmes
![[secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]](/img/f0/79e7915ba3ef32aa21c4a1d5f486bd.jpg)
[secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]

又一百万量子比特!以色列光量子初创公司完成1500万美元融资

Summary of basic debugging steps of S120 driver

ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法

Redis introduction complete tutorial: replication principle

Leetcode 77: combination

Have fun | latest progress of "spacecraft program" activities
Django数据库(SQlite)基本入门使用教程
随机推荐
Number theory --- fast power, fast power inverse element
Matlb| economic scheduling with energy storage, opportunity constraints and robust optimization
The panel floating with the mouse in unity can adapt to the size of text content
Contribution of Writing Series
Data analysis from the perspective of control theory
[secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
Leetcode 77: combination
QT common Concepts-1
Summary of basic debugging steps of S120 driver
How-PIL-to-Tensor
尚硅谷JVM-第一章 类加载子系统
Household appliance industry under the "retail is king": what is the industry consensus?
如何分析粉丝兴趣?
c语言(字符串)如何把字符串中某个指定的字符删除?
What are the characteristics of the operation and maintenance management system
ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法
How does C language (string) delete a specified character in a string?
密码学系列之:在线证书状态协议OCSP详解
Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (time synchronization part)