Ask Your Question

Revision history [back]

open ip camera probm 2

namedWindow("FaceDetRec", WINDOW_NORMAL);
setWindowProperty("FaceDetRec", WND_PROP_FULLSCREEN, WINDOW_FULLSCREEN);

Mat frame = Mat(720, 1280, CV_8UC3);

while (1) {

    Mat temp;

    bool bSuccess = cap.read(temp); // read a new frame from video

    if (!bSuccess) //if not success, break loop
    {
        destroyAllWindows();
        MessageBox(hWnd, TEXT("Frame not captured !"), TEXT("FaceRecFFTW_Class4 -> Message:"), MB_OK);
        break;
    }

    {
        Rect ROI(512, 288, 1280, 720);  //  temp image: (2304, 1296)
        temp(ROI).copyTo(frame);
    }

    imshow("FaceDetRec", frame);

    if (waitKey(1) == 27) //wait for 'esc' key press for 1ms. If 'esc' key is pressed, break loop
    {
        destroyAllWindows();
        break;
    }
}

...imshow() does not stretch 720x1280 image to FULLSCREEN window(FaceDetRec) 900x1600, just create new window with the same name 720x1280 and show image inside ???????????

    OpenCV ver 3.4.6      compiler VS2019