当前位置:网站首页>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
边栏推荐
- HDU 4337 King Arthur&#39;s Knights 它输出一个哈密顿电路
- Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (filtering part)
- 杰理之FM 模式单声道或立体声选择设置【篇】
- Unity uses maskablegraphic to draw a line with an arrow
- Contribution of Writing Series
- Redis入门完整教程:客户端常见异常
- PSINS中19维组合导航模块sinsgps详解(初始赋值部分)
- Make (convert) ICO Icon
- Leetcode 77: combination
- Household appliance industry under the "retail is king": what is the industry consensus?
猜你喜欢
杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA
How to analyze fans' interests?
Error: could not find a version that satisfies the requirement xxxxx (from versions: none) solutions
PSINS中19维组合导航模块sinsgps详解(时间同步部分)
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?
Make (convert) ICO Icon
巴比特 | 元宇宙每日必读:IP授权是NFT的破圈之路吗?它的难点在哪里?Holder该如何选择合作平台?...
掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
上个厕所的功夫,就把定时任务的三种调度策略说得明明白白
随机推荐
Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!
Andrews - multimedia programming
房费制——登录优化
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?
应用程序启动速度的优化
Contribution of Writing Series
Kubernetes源码分析(二)----资源Resource
尚硅谷JVM-第一章 类加载子系统
Data analysis from the perspective of control theory
Codeforces Round #264 (Div. 2) C Gargari and Bishops 【暴力】
Redis入门完整教程:客户端案例分析
从控制理论的角度谈数据分析
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
Es6中Promise的使用
密码学系列之:在线证书状态协议OCSP详解
新标杆!智慧化社会治理
杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】
New benchmark! Intelligent social governance
Redis入门完整教程:客户端常见异常
How does C language (string) delete a specified character in a string?