camera-calibration

Obtaining world coordinates of an object from its image coordinates

一个人想着一个人 提交于 2019-12-01 12:06:44
问题 I have been following this documentation to use OpenCV. In the formula below, I have successfully calculated both the intrinsic as well as the extrinsic matrices(I have made use of the solvePnP() procedure to obtain these matrices). Since, the object is lying on the ground I have substituted Z = 0. Then, I just removed the third column of the extrinsic matrix and multiplied it with intrinsic matrix to obtain a 3X3 projection matrix. I took it's inverse, and multiplied it by image coordinates

OpenCV Issue with findChessboardCorners

泄露秘密 提交于 2019-12-01 03:58:38
问题 I also asked this on the OpenCV forum, am trying my luck elsewhere. I'm using OpenCV 3.0 in Visual Studio Professional 2013. So I'm trying to calibrate a camera using the tutorial code in calib3d and this tutorial. I keep getting the same error over and over (std::length_error at memory location) and I've traced it to where I try and add the corner vector given from findChessboardCorners to the image_points vector in the last line of my code. image_points.push_back(corners); In the debug

Python calibrate camera

狂风中的少年 提交于 2019-11-30 19:20:17
问题 I have the following image I1. I did not capture it. I downloaded it from Google I apply a known homography H to I1 to obtain the following image I2. I want to assume that a camera has taken this above shot of I2. I do not know the camera matrix of this camera and I want to find it. To find this camera matrix mtx , I am using the OpenCV camera calibration method: ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None,flags=cv2.CALIB_FIX_ASPECT

Undistorting/rectify images with OpenCV

廉价感情. 提交于 2019-11-30 16:08:41
I took the example of code for calibrating a camera and undistorting images from this book: shop.oreilly.com/product/9780596516130.do As far as I understood the usual camera calibration methods of OpenCV work perfectly for "normal" cameras. When it comes to Fisheye-Lenses though we have to use a vector of 8 calibration parameters instead of 5 and also the flag CV_CALIB_RATIONAL_MODEL in the method cvCalibrateCamera2 . At least, that's what it says in the OpenCV documentary So, when I use this on an array of images like this ( Sample images from OCamCalib ) I get the following results using

Understanding of openCV undistortion

╄→гoц情女王★ 提交于 2019-11-30 15:16:55
I'm receiving depth images of a tof camera via MATLAB . the delivered drivers of the tof camera to compute x,y,z coordinates out of the depth image are using openCV function, which are implemented in MATLAB via mex-files. But later on I can't use those drivers anymore nor use openCV functions, therefore I need to implement the 2d to 3d mapping on my own including the compensation of radial distortion. I already got hold of the camera parameters and the computation of the x,y,z coordinates of each pixel of the depth image is working. Until now I am solving the implicit equations of the

Why does the focal length in the camera intrinsics matrix have two dimensions?

走远了吗. 提交于 2019-11-30 11:02:34
问题 In the pinhole camera model there is only one focal length which is between the principal point and the camera center. However, after calculating the camera's intrinsic parameters, the matrix contains (fx, 0, offsetx, 0, 0, fy, offsety, 0, 0, 0, 1, 0) Is this because the pixels of the image sensor are not square in x and y? Thank you. 回答1: In short: yes. In order to make a mathematical model that can describe a camera with rectangular pixels, you have to introduce two separate focal lengths.

input arguments of python's cv2.calibrateCamera

北慕城南 提交于 2019-11-30 10:27:58
I get the following error when I try to calibrate camera using cv2.calibrateCamera: rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(pts3d, pts2d, self.imgsize, None, None) cv2.error: /home/sarkar/opencv/opencv/modules/calib3d/src/calibration.cpp:2976: error: (-210) objectPoints should contain vector of vectors of points of type Point3f in function collectCalibrationData I initially had nx3 and nx2 array for pts3d and pts2d. I then tried to reshape pts3d and pts2d in the following form as the function takes vectors of vector point3d (and correspondingly pts2d) as input: [1 x

OpenCV 2.3 camera calibration

天大地大妈咪最大 提交于 2019-11-30 09:56:46
I'm trying to use OpenCV 2.3 python bindings to calibrate a camera. I've used the data below in matlab and the calibration worked, but I can't seem to get it to work in OpenCV. The camera matrix I setup as an initial guess is very close to the answer calculated from the matlab toolbox. import cv2 import numpy as np obj_points = [[-9.7,3.0,4.5],[-11.1,0.5,3.1],[-8.5,0.9,2.4],[-5.8,4.4,2.7],[-4.8,1.5,0.2],[-6.7,-1.6,-0.4],[-8.7,-3.3,-0.6],[-4.3,-1.2,-2.4],[-12.4,-2.3,0.9], [-14.1,-3.8,-0.6],[-18.9,2.9,2.9],[-14.6,2.3,4.6],[-16.0,0.8,3.0],[-18.9,-0.1,0.3], [-16.3,-1.7,0.5],[-18.6,-2.7,-2.2]] img

How to understand KITTI camera calibration files?

与世无争的帅哥 提交于 2019-11-30 08:47:45
I am working on a KITTI dataset. I have downloaded the object data set (left and right) and camera calibration matrices of object set. I want to use the stereo information. But I don't how to obtain the Intrinsic Matrix and R|T Matrix of two cameras. And I don't understand what the calibration files meaning. The contents of the calibration files: P0: 7.070493000000e+02 0.000000000000e+00 6.040814000000e+02 0.000000000000e+00 0.000000000000e+00 7.070493000000e+02 1.805066000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P1: 7.070493000000e

OpenCV findChessboardCorners function is failing in a (apparently) simple scenario

こ雲淡風輕ζ 提交于 2019-11-30 08:45:42
问题 I'm trying to find the corners of a chessboard using OpenCV. The image I'm using contains two chessboards, but I'm interested only in a sub-region of one of those. The following image shows the original image. Using GIMP, I've then selected the area of interest and I've set all the other pixel to a default value. I haven't actually cropped the image because I've already calibrated the camera using this image size and I didn't want to change it. The operation should be equivalent to change the