当前位置:网站首页>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
边栏推荐
- Redis入门完整教程:复制配置
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- input_delay
- 2022 spring recruitment begins, and a collection of 10000 word interview questions will help you
- Redis入门完整教程:RDB持久化
- cocos3——8.实现初学者指南
- [secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
- Oauth2协议中如何对accessToken进行校验
- Es6中Promise的使用
- centerX: 用中国特色社会主义的方式打开centernet
猜你喜欢
商城商品的知识图谱构建
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
Oauth2协议中如何对accessToken进行校验
Form validation of uniapp
你知道电子招标最突出的5大好处有哪些吗?
Left value, right value
Household appliance industry under the "retail is king": what is the industry consensus?
Unity使用MaskableGraphic画一条带箭头的线
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA
A complete tutorial for getting started with redis: RDB persistence
随机推荐
Oracle connection pool is not used for a long time, and the connection fails
The version control of 2021 version is missing. Handling method
换个姿势做运维!GOPS 2022 · 深圳站精彩内容抢先看!
如何分析粉丝兴趣?
商城商品的知识图谱构建
HDU ACM 4578 Transformation-&gt;段树-间隔的变化
Form validation of uniapp
左程云 递归+动态规划
Starting from 1.5, build a micro Service Framework -- log tracking traceid
Kubernetes源码分析(二)----资源Resource
「小样本深度学习图像识别」最新2022综述
[socket] ① overview of socket technology
A complete tutorial for getting started with redis: AOF persistence
ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法
Redis introduction complete tutorial: replication principle
Redis入门完整教程:问题定位与优化
Dotconnect for DB2 Data Provider
美国空军研究实验室《探索深度学习系统的脆弱性和稳健性》2022年最新85页技术报告
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
Error: could not find a version that satisfies the requirement xxxxx (from versions: none) solutions