This is a long standing issue with the design of vpgl_calibration_matrix.  I’d be happy to see it corrected.


On Jul 31, 2014, at 8:21 AM, Joseph Mundy <> wrote:

Sounds good to me!
From: Pete Carr [] 
Sent: Thursday, July 31, 2014 8:18 AM
Subject: [Vxl-maintainers] Revise vpgl_calibration_matrix
Hello Maintainers,
The current implementation of vpgl_calibration_matrix has an unintuitive interface and often leads to spurious errors. For instance, the following test fails:
vpgl_calibration_matrix<double> K1( 1000, vgl_point_2d<double>(320,240));
vpgl_calibration_matrix<double> K2( K1.get_matrix() );
TEST_NEAR( "Equiv Focal Length", K1.focal_length(), K2.focal_length(), 1e-2 );
The reason for the failure is that vpgl_calibration_matrix is over parameterized: it has two scale parameters (one for the x direction, and a second for the y direction) instead of a single aspect ratio parameter. For these sorts of tests to pass, focal_length must be multiplied by either the x_scale or the y_scale before any comparisons are made.  Since these parameters are not needed for square pixels, it's a rather cumbersome step which I (and presumably others) forget.
I propose the following fix:
1. Replace x_scale and y_scale with a single aspect_ratio parameter.
2. Deprecate x_scale and y_scale methods, and internally compensate so that x_scale = 1.
3. Implement new aspect_ratio getter/setter and constructor.
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
Vxl-maintainers mailing list