C
C
calculator2122021-06-02 17:19:02
ubuntu
calculator212, 2021-06-02 17:19:02

Why is opencv splitting an image into parts?

then opencv, when capturing an image from a webcam, divides it into 2 parts, and it turns out that the lower part of the image is on top and the upper one is on the bottom?

60b793892f106694326474.png

#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;

int main(){

    VideoCapture vcap(0);

    if(!vcap.isOpened()){
        cout << "Error opening video stream" << endl;
        return -1;
    }

    namedWindow("Frame",cv::WINDOW_NORMAL);
    for(;;){

        Mat frame;
        vcap.read(frame);
        imshow( "Frame", frame );
        char c = (char)waitKey(33);
        if( c == 27 ) break;
    }
    return 0;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question