bazar
1.3.1
|
Turns homographies into 2D poses from calibrated views. More...
#include <CamAugmentation.h>
Classes | |
struct | s_struct_homography |
Homography structure. | |
struct | s_struct_optimal |
The optimal structure. |
Public Member Functions | |
CamAugmentation () | |
Constructor of the CamAugmentation class. | |
~CamAugmentation () | |
Destructor of the CamAugmentation class. | |
void | AddHomography () |
Add an empty homography. | |
void | AddHomography (std::vector< CamCalibration::s_struct_points > p, CvMat *ready) |
Add a homography. | |
bool | Accomodate (int iter, double eps) |
Accomodates the given data. | |
void | Clear () |
Reset the internal structures. | |
CvMat * | GetProjectionMatrix (int c) |
Get the estimated projection matrix. | |
CvMat * | GetRefProjectionMatrix (int c) |
Get the world coordinate projection matrix for cam c2. | |
CvMat * | GetCamEyeMatrix (int c) |
return the rotation/translation matrix for camera c. | |
CvMat * | GetObjectToWorld () |
Returns the object current pose. | |
bool | LoadOptimalStructureFromFile (char *cam_c_file, char *cam_rt_file) |
Loads the calibration results from a file. | |
void | ClearAll () |
Friends | |
class | PoseObs |
Turns homographies into 2D poses from calibrated views.
Implements functions to estimate rotation and translation of a view for each of multiple cameras which was taken at the same time. Demands the calibration results of class CamCalibration.
Definition at line 25 of file CamAugmentation.h.
CamAugmentation::CamAugmentation | ( | ) |
Constructor of the CamAugmentation class.
Definition at line 80 of file CamAugmentation.cpp.
CamAugmentation::~CamAugmentation | ( | ) |
Destructor of the CamAugmentation class.
The class should be destroyed with the deconstructor after having done its job.
Definition at line 85 of file CamAugmentation.cpp.
References ClearAll().
bool CamAugmentation::Accomodate | ( | int | iter, |
double | eps | ||
) |
Accomodates the given data.
This function starts the non-linear Levenberg-Marquardt estimation progress with the given maximal number of iterations iter and the maximal accuracy eps. There are 6 parameters to determine: The rotation and translation parameters which transform a point from the given view coordinate system to the reference coordinate system which was determined by CamCalibration. Therefore this function is pretty fast. The output may be grabbed with GetProjectionMatrix().
Definition at line 498 of file CamAugmentation.cpp.
Referenced by main(), photo_idle(), and photometric_calibration().
void CamAugmentation::AddHomography | ( | ) |
Add an empty homography.
This adds an empty homography, if detection failed for a specific camera.
Definition at line 165 of file CamAugmentation.cpp.
Referenced by add_detected_homography(), photo_idle(), and photometric_calibration().
void CamAugmentation::AddHomography | ( | std::vector< CamCalibration::s_struct_points > | p, |
CvMat * | ready | ||
) |
Add a homography.
This adds a homography. Unlike in CamCalibration, this time homographies are added for each different camera view. The order of the cameras should always remain the same. Therefore, if you don't have data for a specific camera, use AddHomography() to add an empty homography. If you want to estimate another view and therefore reset the structures, use Clear(). For this function (AddHomography) you have to specify a vector of point correspondances and a matrix ready, specifying the homography.
Definition at line 173 of file CamAugmentation.cpp.
void CamAugmentation::Clear | ( | ) |
Reset the internal structures.
If you want to add a new view with new homographies for each camera, you need to clear the internal structures with the help of this function.
Definition at line 505 of file CamAugmentation.cpp.
Referenced by main(), photo_idle(), and photometric_calibration().
void CamAugmentation::ClearAll | ( | ) |
Definition at line 100 of file CamAugmentation.cpp.
Referenced by ~CamAugmentation().
CvMat * CamAugmentation::GetCamEyeMatrix | ( | int | c | ) |
return the rotation/translation matrix for camera c.
Definition at line 544 of file CamAugmentation.cpp.
CvMat * CamAugmentation::GetObjectToWorld | ( | ) |
Returns the object current pose.
Definition at line 557 of file CamAugmentation.cpp.
Referenced by augment_scene(), photo_draw(), photo_idle(), and photometric_calibration().
CvMat * CamAugmentation::GetProjectionMatrix | ( | int | c | ) |
Get the estimated projection matrix.
Returns the projection matrix estimate which results from Accomodate(). This projection matrix can be used to do any kind of augmentation, using OpenGL or DirectX, for example.
Definition at line 511 of file CamAugmentation.cpp.
References CamCalibration::Mat3x4Mul().
Referenced by augment_scene(), photo_draw(), and show_result().
CvMat * CamAugmentation::GetRefProjectionMatrix | ( | int | c | ) |
Get the world coordinate projection matrix for cam c2.
Returns the world projection matrix as calibrated.
Definition at line 528 of file CamAugmentation.cpp.
bool CamAugmentation::LoadOptimalStructureFromFile | ( | char * | cam_c_file, |
char * | cam_rt_file | ||
) |
Loads the calibration results from a file.
The following 2 files have to be provided, coming from CamCalibration
Has to be called before Homographies may be added and finally accomodation takes place.
Definition at line 108 of file CamAugmentation.cpp.
References cvmSet(), and CamCalibration::ExtractRotationTranslationFrom3x4Matrix().
Referenced by geom_calib_end(), geom_calib_start(), geometric_calibration(), main(), and photometric_calibration().
|
friend |
Definition at line 281 of file CamAugmentation.h.