Ask Your Question

Javelin's profile - activity

2016-01-19 12:18:15 -0600 received badge  Student (source)
2015-07-08 13:32:29 -0600 commented question Pinhole calibration model reduces FOV, should i use Fisheye?

I tried it, but with strange results. If you want to help, I opened a new question here

2015-07-08 13:31:34 -0600 received badge  Editor (source)
2015-07-08 13:30:17 -0600 asked a question Bad behavior using cv::undistort with newCameraMatrix

I calibrated a wide angle camera (~120° horizontal, ~110° vertical) using the Pinhole camera model. The result is quite good but large areas of the image are discarded.

image description

So I'm trying to use the getOptimalNewCameraMatrix function (using alpha = 1) to calculate the newCameraMatrix and then pass it to cv::undistord, but the resulting frame is really distorted.

image description.

The code I use is:

    // Matrices calculation
    data.rms = calibrateCamera(objectPoints, imagePoints, data.size, data.cameraMatrix,
        data.distCoeffs, data.rvecs, data.tvecs, settings.calibFlags);

    if(!settings.cropCorrected) {
        Rect roi;
        data.newCameraMatrix = getOptimalNewCameraMatrix(data.cameraMatrix, data.distCoeffs, 
        data.size, 1, data.size, &roi, true);

    // Undistort
    cv::undistort(in, corrected, cameraMatrix, distCoeffs, newCameraMatrix);

This is simple but there is something not working. I have already tried to use roi to crop the inner area, in the hope that it would have been anyway bigger than without the additional matrix, but in fact it's not.

How can i resolve the situation?

2015-07-08 09:39:44 -0600 asked a question Pinhole calibration model reduces FOV, should i use Fisheye?

I have a wide angle camera, the specifications say it is around 150°, but to me seems more ~100° horizontal and ~80° vertical. Anyway, once calibrated these fields of view are reduced by ~20 degrees each.

This is true for both the values returned by cv::calibrationMatrixValues function and the rectified frames, in which relatively big external portions are cropped.

Is this behavior normal? If it is, can I avoid this problem using the newer Fisheye camera model? With Fisheye is it possible to know the measured FOVs? I cannot find something like fisheye::calibrationMatrixValues.

2015-07-06 08:51:35 -0600 asked a question Calculate pixel angle from the center having hFov and vFov

Once that I calibrated my camera and I know horizontal and vertical fields of view (through calibrationMatrixValues), is it possible to know the X and Y angles (from the center) of a particular pixel?

Suppose I have a camera with fields of view of 100° (h) and 80° (v) and a resolution of 500x400. The angle/pixel ratio is (0.2°, 0.2°). So the central pixel will be (0°, 0°), its left neighbor (-0.2°, 0), the topmost central pixel (0°, +80°) and so on.

Is actually this relation constant through all the image or there is a formula to perform this calculation? Is the obtained information reliable?

This is going to be the first step for triangulating objects in a multi camera environment.