Ask Your Question

Revision history [back]

You are displaying the frames in one window... the first replaced by the second one, and you see just the second one ...

try with:

namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"
namedWindow("MyVideo2",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo2"

imshow("MyVideo", frame); //show the frame in "MyVideo" window
imshow("MyVideo2", frame2); //show the frame in "MyVideo2" window

You are displaying the frames in one window... the first replaced by the second one, and you see just the second one ...

try with:

namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"
namedWindow("MyVideo2",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo2"

imshow("MyVideo", frame); //show the frame in "MyVideo" window
imshow("MyVideo2", frame2); //show the frame in "MyVideo2" window

p.p. You are using some example for template and when make some of the checks, you are making them just for the first cam ... Try to understand every line of the code just for one cam and write yours code for two cams ;]

You are displaying the frames in one window... the first replaced by the second one, and you see just the second one ...

try with:

namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"
namedWindow("MyVideo2",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo2"

imshow("MyVideo", frame); //show the frame in "MyVideo" window
imshow("MyVideo2", frame2); //show the frame in "MyVideo2" window

p.p. You are using some example for template and when make some of the checks, you are making them just for the first cam ... Try to understand every line of the code just for one cam and write yours your own code for two cams ;]