37 for (
int i=0;
i<3;
i++)
38 for (
int j=0;
j<3;
j++)
51 m[0][0] = 1;
m[0][1] = 0;
m[0][2] = 0;
52 m[1][0] = 0;
m[1][1] = 1;
m[1][2] = 0;
53 m[2][0] = 0;
m[2][1] = 0;
m[2][2] = 1;
83Matrix3::void SetRotationPT(
double Yaw,
double Pitch,
double Roll )
150 yawm.m[2][0] = 0.0;
yawm.m[2][1] = 0.0;
yawm.m[2][2] = 1.0;
175 m[0][0] = 1.0;
m[0][1] = 0.0;
m[0][2] = 0.0;
176 m[1][0] = 0.0;
m[1][1] =
cos(a);
m[1][2] =
sin(a);
177 m[2][0] = 0.0;
m[2][1] =-
m[1][2];
m[2][2] =
m[1][1];
182 m[0][0] =
cos(a);
m[0][1] = 0.0;
m[0][2] =-
sin(a);
183 m[1][0] = 0.0;
m[1][1] = 1.0;
m[1][2] = 0.0;
184 m[2][0] =-
m[0][2];
m[2][1] = 0.0;
m[2][2] =
m[0][0];
189 m[0][0] =
cos(a);
m[0][1] =
sin(a);
m[0][2] = 0.0;
190 m[1][0] =-
m[0][1];
m[1][1] =
m[0][0];
m[1][2] = 0.0;
191 m[2][0] = 0.0;
m[2][1] = 0.0;
m[2][2] = 1.0;
197 for (
int i=0;
i<3;
i++)
198 for (
int j=0;
j<3;
j++)
207 Result.
m[0][0] =
m[0][0] *
ot.m[0][0] +
m[0][1] *
ot.m[1][0] +
m[0][2] *
ot.m[2][0];
208 Result.m[0][1] =
m[0][0] *
ot.m[0][1] +
m[0][1] *
ot.m[1][1] +
m[0][2] *
ot.m[2][1];
209 Result.m[0][2] =
m[0][0] *
ot.m[0][2] +
m[0][1] *
ot.m[1][2] +
m[0][2] *
ot.m[2][2];
211 Result.m[1][0] =
m[1][0] *
ot.m[0][0] +
m[1][1] *
ot.m[1][0] +
m[1][2] *
ot.m[2][0];
212 Result.m[1][1] =
m[1][0] *
ot.m[0][1] +
m[1][1] *
ot.m[1][1] +
m[1][2] *
ot.m[2][1];
213 Result.m[1][2] =
m[1][0] *
ot.m[0][2] +
m[1][1] *
ot.m[1][2] +
m[1][2] *
ot.m[2][2];
215 Result.m[2][0] =
m[2][0] *
ot.m[0][0] +
m[2][1] *
ot.m[1][0] +
m[2][2] *
ot.m[2][0];
216 Result.m[2][1] =
m[2][0] *
ot.m[0][1] +
m[2][1] *
ot.m[1][1] +
m[2][2] *
ot.m[2][1];
217 Result.m[2][2] =
m[2][0] *
ot.m[0][2] +
m[2][1] *
ot.m[1][2] +
m[2][2] *
ot.m[2][2];
224 for (
int i=0;
i<3;
i++)
225 for (
int j=0;
j<3;
j++)
232 for (
int i=0;
i<3;
i++)
233 for (
int j=0;
j<3;
j++)
241 Result.
m[0][0] =
m[0][0] *
ot.m[0][0] +
m[0][1] *
ot.m[1][0] +
m[0][2] *
ot.m[2][0];
242 Result.m[0][1] =
m[0][0] *
ot.m[0][1] +
m[0][1] *
ot.m[1][1] +
m[0][2] *
ot.m[2][1];
243 Result.m[0][2] =
m[0][0] *
ot.m[0][2] +
m[0][1] *
ot.m[1][2] +
m[0][2] *
ot.m[2][2];
245 Result.m[1][0] =
m[1][0] *
ot.m[0][0] +
m[1][1] *
ot.m[1][0] +
m[1][2] *
ot.m[2][0];
246 Result.m[1][1] =
m[1][0] *
ot.m[0][1] +
m[1][1] *
ot.m[1][1] +
m[1][2] *
ot.m[2][1];
247 Result.m[1][2] =
m[1][0] *
ot.m[0][2] +
m[1][1] *
ot.m[1][2] +
m[1][2] *
ot.m[2][2];
249 Result.m[2][0] =
m[2][0] *
ot.m[0][0] +
m[2][1] *
ot.m[1][0] +
m[2][2] *
ot.m[2][0];
250 Result.m[2][1] =
m[2][0] *
ot.m[0][1] +
m[2][1] *
ot.m[1][1] +
m[2][2] *
ot.m[2][1];
251 Result.m[2][2] =
m[2][0] *
ot.m[0][2] +
m[2][1] *
ot.m[1][2] +
m[2][2] *
ot.m[2][2];
282 o <<
"[ " <<
m[0][0] <<
"\t" <<
m[0][1] <<
"\t" <<
m[0][2] << std::endl
283 <<
" " <<
m[1][0] <<
"\t" <<
m[1][1] <<
"\t" <<
m[1][2] << std::endl
284 <<
" " <<
m[2][0] <<
"\t" <<
m[2][1] <<
"\t" <<
m[2][2] << std::endl;
general : Matrix3 is a class for handling 3x3 Matrix manipulation.
Matrix3 & operator=(const Matrix3 &ot)
copy operator
void SetIdentity()
Set the identity matrix.
void operator/=(double s)
operator *=
void SetRotationPT(double yaw, double pitch, double roll)
set rotation in panotools style, code adapted from Panotools-Script by Bruno Postle
Matrix3 operator*(const Matrix3 &ot) const
multiplication with another matrix
void SetRotationZ(double a)
Matrix3()
default constructor : initialise to zero
void SetRotation(double Yaw, double Pitch, double Roll)
Set the matrice to rotation using yaw, pitch, roll angle.
void operator*=(double s)
operator *=
Matrix3 Inverse() const
return inverse if it exists, otherwise identity
double Determinant() const
get the determinant
double m[3][3]
we define the Matrix3 as 3 colums of 3 rows
void SetRotationY(double a)
void SetRotationX(double a)
set the matrice to rotation around X
void GetRotationPT(double &Yaw, double &Pitch, double &Roll)
GetRotation in panotools style.
void Print(std::ostream &o) const
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.