gpt4 book ai didi

c++ - OpenCV C++ 错误 (cvCaptureFromCAM())

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:05 25 4
gpt4 key购买 nike

<分区>

我正在关注 OpenCV 库的网络教程,实际上在早期阶段遇到了问题。在“cvCaptureFromCAM(0)”函数的帮助下声明从网络摄像头捕获图片所需的变量之后。编译后它给了我: 错误:“p_capWebcam”未在此范围内声明

我已经看到很多关于“未在此范围内声明”错误的问题,但没有找到解决方案。

谢谢

#include <opencv/highgui.h>
#include <opencv/cxcore.h>
#include <opencv/cvaux.h>

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[]) {

CvSize size640x480 = cvSize(640, 480);

CvCapture* p_camWebcam;

IplImage* p_imgOriginal;
IplImage* p_imgProcessed;

CvMemStorage* p_strStorage;

CvSeq* p_seqCircles;

float* p_fltXYReadius;

int i;
char charCheckForEscKey;



p_camWebcam = cvCaptureFromCAM(0);

if(p_capWebcam == NULL) {
printf("error: capture is NULL \n");
getchar();
return(-1);
}
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com