当前位置:网站首页>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
边栏推荐
- “零售为王”下的家电产业:什么是行业共识?
- Household appliance industry under the "retail is king": what is the industry consensus?
- Static proxy of proxy mode
- Redis getting started complete tutorial: replication topology
- Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (time synchronization part)
- Kubernetes source code analysis (II) -- resource
- Redis入门完整教程:AOF持久化
- The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing
- 【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
- [socket] ① overview of socket technology
猜你喜欢

tensorboard的使用

Redis introduction complete tutorial: replication principle

硬件之OC、OD、推挽解释

Redis入门完整教程:AOF持久化

How-PIL-to-Tensor

A complete tutorial for getting started with redis: AOF persistence

Don't you know the relationship between JSP and servlet?

Cloud Mail . NET Edition

【2022国赛模拟】多边形——计算几何、二分答案、倍增

2022 spring recruitment begins, and a collection of 10000 word interview questions will help you
随机推荐
OC, OD, push-pull explanation of hardware
New benchmark! Intelligent social governance
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
Left value, right value
Software testing -- common assertions of JMeter interface testing
Another million qubits! Israel optical quantum start-up company completed $15million financing
SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]
Redis入门完整教程:复制拓扑
Redis入门完整教程:复制配置
The whole process of knowledge map construction
c语言(字符串)如何把字符串中某个指定的字符删除?
Es6中Promise的使用
Metaforce force meta universe fossage 2.0 smart contract system development (source code deployment)
商城商品的知识图谱构建
Make (convert) ICO Icon
Redis入门完整教程:客户端常见异常
杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
C language string sorting
IDEA重启后无法创建Servlet文件的解决方案