From: Matt L. <mat...@ki...> - 2012-04-09 20:00:58
|
All, I seem to keep running into issues related to the fact that vpgl_calibration_matrix is over parameterized. The problem is that vpgl_calibration_matrix is internally represented by 6 parameters but only has 5 DOF. The redundant ones are focal_length, x_scale, and y_scale, which I feel should really be focal_length, and pixel_aspect_ratio. A common problem that arises because one constructor is vpgl_calibration_matrix(focal_length, principle_point, x_scale=1, y_scale=1, skew=0); and the other is vpgl_calibration_matrix(vnl_double_3x3 K); In the constructor from a matrix, the focal_length is set to 1 and x_scale=K(0,0) and y_scale=K(1,1). So consider the following: double focal_length = 1000.0 vgl_point_2d<double> pp(640,480); vpgl_calibration_matrix<double> K(focal_length, pp); vpgl_calibration_matrix<double> K2(K.get_matrix()); vcl_cout << "focal length = " << K2.focal_length(); The above prints "focal length = 1", but I would expect 1000. In practice this happens because we often write the camera to a file as a matrix and then read it back in. Does anyone have a good reason to keep the x_scale and y_scale? Can I replace this with pixel_aspect_ratio? Thanks, Matt |