[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd/cvd camera.h
From: |
Dr. JJN |
Subject: |
[libcvd-members] libcvd/cvd camera.h |
Date: |
Tue, 03 Apr 2007 23:58:23 +0000 |
CVSROOT: /sources/libcvd
Module name: libcvd
Changes by: Dr. JJN <jjneubert> 07/04/03 23:58:23
Modified files:
cvd : camera.h
Log message:
added an inv camera derivative
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/camera.h?cvsroot=libcvd&r1=1.15&r2=1.16
Patches:
Index: camera.h
===================================================================
RCS file: /sources/libcvd/libcvd/cvd/camera.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- camera.h 11 Feb 2007 20:21:44 -0000 1.15
+++ camera.h 3 Apr 2007 23:58:23 -0000 1.16
@@ -178,6 +178,7 @@
inline TooN::Matrix<2,2> get_derivative() const;
inline TooN::Matrix<2,2> get_derivative(const TooN::Vector<2>& x) const;
+ inline TooN::Matrix<2,2> Camera::Quintic::get_inv_derivative() const;
/// Get the motion of a point with respect to each of the internal camera
parameters
inline TooN::Matrix<num_parameters,2> get_parameter_derivs() const ;
@@ -449,6 +450,30 @@
return result;
}
+
+TooN::Matrix<2,2> Camera::Quintic::get_inv_derivative() const {
+ TooN::Matrix<2,2> result;
+ double temp1=my_last_camframe*my_last_camframe;
+ double temp2=my_camera_parameters[5]*temp1;
+ double temp3=2.0*(my_camera_parameters[4]+2.0*temp2);
+
+ Identity(result,1+temp1*(my_camera_parameters[4]+temp2));
+
+ result[0][0] += my_last_camframe[1]*my_last_camframe[1]*temp3;
+ result[0][1] =-(temp3*my_last_camframe[0]*my_last_camframe[1]);
+
+ result[1][1] += my_last_camframe[0]*my_last_camframe[0]*temp3;
+ result[1][0] =-(temp3*my_last_camframe[0]*my_last_camframe[1]);
+
+ (result.T())[0] *= my_camera_parameters[1];
+ (result.T())[1] *= my_camera_parameters[0];
+
+ result /= (result[0][0]*result[1][1] - result[1][0]*result[0][1]);
+
+ return result;
+}
+
+
TooN::Matrix<2,2> Camera::Quintic::get_derivative(const TooN::Vector<2>& x)
const {
TooN::Matrix<2,2> result;
double temp1=x*x;
- [libcvd-members] libcvd/cvd camera.h,
Dr. JJN <=