[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libcvd-members] libcvd/cvd camera.h
From: |
Ethan Eade |
Subject: |
[Libcvd-members] libcvd/cvd camera.h |
Date: |
Tue, 16 May 2006 13:26:02 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Branch:
Changes by: Ethan Eade <address@hidden> 06/05/16 13:26:02
Modified files:
cvd : camera.h
Log message:
Added project_vector and unproject_vector to quintic camera, and
get_derivative(Vector<2>) for getting the derivative at a point.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/libcvd/cvd/camera.h.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: libcvd/cvd/camera.h
diff -u libcvd/cvd/camera.h:1.13 libcvd/cvd/camera.h:1.14
--- libcvd/cvd/camera.h:1.13 Thu Mar 16 14:04:30 2006
+++ libcvd/cvd/camera.h Tue May 16 13:26:02 2006
@@ -147,6 +147,16 @@
/// Fast linear projection for working out what's there
inline TooN::Vector<2> linearproject(const TooN::Vector<2>& camframe,
double scale=1) const ;
/// Project from Euclidean camera frame to image plane
+
+ inline TooN::Vector<2> project_vector(const TooN::Vector<2>& d) const {
+ return diagmult(my_camera_parameters.slice<0,2>(), d);
+ }
+ inline TooN::Vector<2> unproject_vector(const TooN::Vector<2>& d) const
{
+ TooN::Vector<2> v;
+ v[0] = d[0]/my_camera_parameters[0];
+ v[1] = d[1]/my_camera_parameters[1];
+ return v;
+ }
inline TooN::Vector<2> project(const TooN::Vector<2>& camframe) const;
/// Project from image plane to a Euclidean camera
inline TooN::Vector<2> unproject(const TooN::Vector<2>& imframe) const;
@@ -154,6 +164,7 @@
/// Get the derivative of image frame wrt camera frame at the last
computed projection
/// in the form \f$ \begin{bmatrix} \frac{\partial \text{im1}}{\partial
\text{cam1}} & \frac{\partial \text{im1}}{\partial \text{cam2}} \\
\frac{\partial \text{im2}}{\partial \text{cam1}} & \frac{\partial
\text{im2}}{\partial \text{cam2}} \end{bmatrix} \f$
inline TooN::Matrix<2,2> get_derivative() const;
+ inline TooN::Matrix<2,2> get_derivative(const TooN::Vector<2>& x) 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 ;
@@ -401,6 +412,17 @@
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;
+ double temp2=my_camera_parameters[5]*temp1;
+ Identity(result,1+temp1*(my_camera_parameters[4]+temp2));
+ result += (2*(my_camera_parameters[4]+2*temp2)*x.as_col()) * x.as_row();
+ result[0] *= my_camera_parameters[0];
+ result[1] *= my_camera_parameters[1];
+ return result;
+}
+
TooN::Matrix<Camera::Quintic::num_parameters,2>
Camera::Quintic::get_parameter_derivs() const {
TooN::Matrix<num_parameters,2> result;
double r2 = my_last_camframe * my_last_camframe;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Libcvd-members] libcvd/cvd camera.h,
Ethan Eade <=