1 | initial version |
Just simply change your complete code to the C++ API. It will make everything run just fine.
Try this:
int main()
{
VideoCapture capture (0);
Mat src1, src2;
while (true)
{
capture >> scr1;
cvtColor(src1.clone(),src2,CV_BGR2GRAY);
imshow("TestWebCam", src1);
imshow("TestWebCam2", src2);
int key = waitKey(10);
if(key == 27)
{
break;
}
}
2 | No.2 Revision |
Just simply change your complete code to the C++ API. It will make everything run just fine.
Try this:
int main()
{
VideoCapture capture (0);
Mat src1, src2;
while (true)
{
capture >> scr1;
cvtColor(src1.clone(),src2,CV_BGR2GRAY);
imshow("TestWebCam", src1);
imshow("TestWebCam2", src2);
int key = waitKey(10);
if(key == 27)
{
break;
}
}
}