39 std::vector<int> coord_idx;
43 if (img.getExifMake().empty() || img.getExifModel().empty())
47 double roll = img.getExifOrientation();
48 if (roll == 90 || roll == 270 ) {
49 coord_idx.push_back(2);
51 coord_idx.push_back(1);
57 unsigned int nrOfVariableImages=0;
66 for(
unsigned int j=0; j<i; j++)
68 if(img.YawisLinkedWith(panorama.
getImage(j)))
84 for (
int j=0; j<3; j++) {
85 for (
int k=0; k<3; k++) {
86 cov.
m[j][k] += mat.
m[j][coord_idx[i]] * mat.
m[k][coord_idx[i]];
90 cov /= nrOfVariableImages;
103 DEBUG_DEBUG(
"Eigenvectors & eigenvalues:" << std::endl
104 <<
"V = " << eigvectors << std::endl
105 <<
"D = [" << eigval[0] <<
", " << eigval[1] <<
", " << eigval[2] <<
" ]"
106 <<
"idx = [" << eigvalIdx[0] <<
", " << eigvalIdx[1] <<
", " << eigvalIdx[2] <<
" ]");
110 up.
x = eigvectors.
m[eigvalIdx[2]][0];
111 up.
y = eigvectors.
m[eigvalIdx[2]][1];
112 up.
z = eigvectors.
m[eigvalIdx[2]][2];
118 double rotAngle = acos(up.
Dot(
Vector3(0,0,1)));
119 if (rotAngle >
M_PI/2) {
double Dot(const Vector3 &v) const
dot product
double m[3][3]
we define the Matrix3 as 3 colums of 3 rows
virtual const VariableMap getImageVariables(unsigned int imgNr) const =0
get variables of an image
general : Matrix3 is a class for handling 3x3 Matrix manipulation.
const Map::mapped_type & const_map_get(const Map &m, const typename Map::key_type &key)
void SetRotationPT(double yaw, double pitch, double roll)
set rotation in panotools style, code adapted from Panotools-Script by Bruno Postle ...
bool Normalize()
Normalize.
Matrix3 GetRotationAroundU(const Vector3 &U, double Angle)
return the rotation matrix around vector U : checked
static Matrix3 calcStraighteningRotation(const PanoramaData &panorama)
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
Vector3 Cross(const Vector3 &v) const
cross product
bool readEXIF()
try to fill out information about the image, by examining the exif data
lu decomposition and linear LMS solver
general : Vector3 is a class for handling 3D Vectors manipulation.
virtual SrcPanoImage getSrcImage(unsigned imgNr) const =0
get a complete description of a source image
double x
x,y,z coordinates, 0 at the initialisation
virtual std::size_t getNrOfImages() const =0
number of images.
All variables of a source image.
void eig_jacobi(int n, double a[3][3], double v[3][3], double *d, int *ind, int *maxsweep, int *maxannil, double *epsilon)
Implements jacobi eigenvalue/vector algorithm on a symmetric matrix stored as a 2 dimensional matrix ...