当前位置:网站首页>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
边栏推荐
猜你喜欢

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

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

The whole process of knowledge map construction

A complete tutorial for getting started with redis: RDB persistence

巴比特 | 元宇宙每日必读:IP授权是NFT的破圈之路吗?它的难点在哪里?Holder该如何选择合作平台?...

uniapp适配问题

Form validation of uniapp

“零售为王”下的家电产业:什么是行业共识?

tensorboard的使用

尚硅谷JVM-第一章 类加载子系统
随机推荐
How to find file accessed / created just feed minutes ago
简单冒泡排序
Qt蓝牙:QBluetoothDeviceInfo
Oracle connection pool is not used for a long time, and the connection fails
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
迷失在MySQL的锁世界
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?
Examples of how to use dates in Oracle
Redis入门完整教程:RDB持久化
Cryptography series: detailed explanation of online certificate status protocol OCSP
Shell 编程基础
Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (time synchronization part)
左程云 递归+动态规划
杰理之播内置 flash 提示音控制播放暂停【篇】
Redis getting started complete tutorial: replication topology
Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
你知道电子招标最突出的5大好处有哪些吗?
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
QT Bluetooth: qbluetooth DeviceInfo
杰理之发射端在接收端关机之后假死机【篇】