multiple windows are opening with arbitrary name ..even i had gave named to window "myvideo"

asked 2016-09-14 10:23:04 -0600

updated 2016-09-14 10:47:56 -0600

LBerger gravatar image
#include "opencv2/highgui/highgui.hpp"
#include <iostream>

using namespace cv;
using namespace std;

int main()
{

VideoCapture cap(0);

if ( !cap.isOpened() )
     namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); 
while(1)
{
    Mat frame;

    bool bSuccess = cap.read(frame); 

     if (!bSuccess) break;

    imshow("MyVideo", frame); 

    if(waitKey(30) == 27)break;

}
edit retag flag offensive close merge delete

Comments

lines :

if ( !cap.isOpened() )
     namedWindow("MyVideo",CV_WINDOW_AUTOSIZE);

I don't understand. I don't see any problem in your code

LBerger gravatar imageLBerger ( 2016-09-14 10:51:55 -0600 )edit

please double check, if you accidentally use opencv release libs in debug build, or vice versa.

berak gravatar imageberak ( 2016-09-15 01:14:12 -0600 )edit