Stereo Camera Code: Both are on but only one capture window
Hello, I am trying out some projects to learn how to program and in addition gain some knowledge about computer vision. I am currently in the stage of setting up the stereo vision but am only getting one capture window... the code is below. I want two windows open with a recording from the different camera. Any help is appreciated!!
#include "opencv\cv.h";
#include "opencv2\highgui\highgui.hpp";
#include "opencv2\imgproc\imgproc.hpp";
#include <iostream>;
using namespace cv;
using namespace std;
int main()
{
VideoCapture stream1(0); //camera 1
VideoCapture stream2(1); // camera 2
if (!stream1.isOpened()) { //check if video device 0 has been initialised
cout << "cannot open camera";
};
if (!stream2.isOpened()) { //check if video device 1 has been initialised
cout << "cannot open camera";
};
for (;;){
Mat cameraFrame1;
Mat cameraFrame2;
stream1.read(cameraFrame1);
stream2.read(cameraFrame2);
imshow("RedCamera 1", cameraFrame1);
imshow("BlackCamera 2", cameraFrame2);
if (waitKey(30) >= 0) break;
}
return 0;
}
please triple-check the opencv libs your program is linking. do not use debug libs with a release build, or the other way round.
"gibberrish" strings are mostly a result of linking to different models of the c++stdlib.
yes you are right berak... I added the files to a global property sheet and not to the debug sheet... have fixed issue and works perfect... Thank you for getting me pointed in the right direction!!!!