Bootstrap

opencv摄像头速度慢_opencv用网络摄像头怎么提高帧率,不知道为什么,我的视频播放速度特别慢,根本不是实时播放...

#include using namespace cv;

using namespace std;

Mat Srcimg, Grayimg, dstimg,c;

Mat a; // Canny 边缘检测相关变量

int b = 1; //同上

string imgPath="这个地方是我的网络摄像头的地址";

/*FileStorage fsWrite;

string FilePath = "mode.yaml";*/

static void on_Canny(int, void*);

int _tmain(int argc, _TCHAR* argv[])

{

/*bool n =0;*/

VideoCapture capture(imgPath); //调用摄像头

if (!capture.isOpened())

{

printf("can't open capture\n");

waitKey(0);

getchar();

return -1;

}

else

{

printf("you can open this!\n");

}

namedWindow("效果图",1);

capture >> c;

imshow("效果图", c);

while (1)

{

capture >> Srcimg; //逐帧显示,一直循环

imsh

;