Unwanted autocrop in video feed

asked 2019-07-29 03:20:32 -0600

Vizier87 gravatar image

Hi guys,

I'm using a specialized camera which runs from the uEye Cockpit. The feed looks like follows:

alt text

The top is the original feed, and the one below is the feed from OpenCV (I'm using v3.0.0).

Can this be rectified? I want the feed to be similar to the top.

I'm using just a simple camera feed code as follows:

#include <opencv2\highgui.hpp>
#include <opencv2\videoio.hpp>
#include <opencv2\imgcodecs.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/opencv.hpp>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <math.h>
//#include <stdafx.h>


//ADD this to disable OpenCL explicitly
#include <opencv2\core\ocl.hpp>

// make sure you use the OpenCV namespace
using namespace cv;
using namespace std;

int main()
{
    // Disable OpenCL explicitly here
    cout << CV_VERSION ;

    ocl::setUseOpenCL(false);
    VideoCapture capture(0);
    Mat current_frame;


    capture >> current_frame;

    while (1) {
        capture >> current_frame;
        if (current_frame.empty()) break;
        imshow("Normal", current_frame);
        int key = waitKey(33) && 0xFF;
        if (key == 27) break;
    }
    return 0;

}
edit retag flag offensive close merge delete

Comments

I'm using v3.0.0

please update it to latest 3.4.7 or 4.1.1, even. a lot has changed with the VideoCapture code in the last 3 years (!)

after that, try again with OPENCV_VIDEOIO_DEBUG=1 set in your environment (so you see, wat backends are available / used on your machine), and try various flags for VideoCapture capture(0, CAP_XXXX); (i.e. DSHOW might have better driver support for your hw, than MSMF or such)

berak gravatar imageberak ( 2019-07-29 04:28:43 -0600 )edit

Thanks berak. Will update soon.

Vizier87 gravatar imageVizier87 ( 2019-07-29 21:28:17 -0600 )edit