求助,opencv3.0运行人脸检测程序出错

2024-12-12 12:26:59
推荐回答(1个)
回答1:

opencv3.0运行人脸检测程序出错
换一个表达,,我之前也是这样,,换一个就好了;;;用
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/ml/ml.hpp"

using namespace std;
using namespace cv;

int main(int argc,char *argv[])
{
int cameraNumber=0;
if (argc>1)
cameraNumber =atoi(argv[1]);
VideoCapture camera;
camera.open (cameraNumber );
if (!camera .isOpened ())
{
cerr<<"ERROPR"<exit(1);
}

while(true)
{
Mat cameraFrame;
camera >>cameraFrame ;
if (cameraFrame .empty ())
{
cerr<<"ERROR1"<exit(1);
}

imshow("woqu",cameraFrame );
char key=cv::waitKey (1000);
if (key==27)
{
break;
}

}
}