#include <Base/Common/W32Compat.hh>
#include <Base/Geometry/HomgPoint2D.hh>
#include <Geometry/Conic2D.hh>
#include <Base/Image/Image.hh>
#include <Base/Image/ImageIO.hh>
#include <Geometry/Quadric3D.hh>
#include <Geometry/PMatrix.hh>
using namespace BIAS;
using namespace std;
#define RADIUS 50.0
int main()
{
cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ExampleConic $$$$$$$$$$$$$$$$$$$$$$"
<< endl;
for (unsigned int i=0; i<15; i++) {
C2[0] -= 25.0;
cout << "Circle center is now at "<<C2<<endl;
else cout << "No Intersection !"<<endl;
char filename[1000];
sprintf(filename,"testimage%03d",i);
}
Cov[0][0] = 100;
Cov[1][1] = 64;
#ifdef BIASASSERT_ISACTIVE
int resPCA =
#endif
BIASASSERT(resPCA == 0);
cout <<"Singular values of Cov are "<<S<<endl;
tmp = VT;
for (unsigned int l=0; l<3; l++) {
G[l] += sqrt(S[0]) * G_0[l] * GAUSS3D_CONFIDENCE_99_PERCENT;
H[l] += sqrt(S[1]) * H_0[l] * GAUSS3D_CONFIDENCE_99_PERCENT;
I[l] += sqrt(S[2]) * I_0[l] * GAUSS3D_CONFIDENCE_99_PERCENT;
}
Quadric3D TestQ(QC, Cov, GAUSS3D_CONFIDENCE_99_PERCENT );
cout << "Quadric is "<< TestQ << endl;
cout <<
"Conic is "<<(TestC.
IsEllipse()?
"an ":
"no ")
<< "ellipse: "<< TestC << endl;
for (int u=0; u<4; u++) {
switch (u) {
case 0:pPoint = &QC;break;
case 1:pPoint = &G; break;
case 2:pPoint = &H; break;
case 3:pPoint = &I; break;
default:BIASERR("Debug loop out of range !");
}
Projection = P_current * (*pPoint);
cout <<"Computing point on quadric ! Location is "<<Location
<<", pointindex[u] is "<<u<<endl;;
if (Location>DBL_EPSILON) {
BIASERR("Covariance ellipsoid projection: Point["<<u<< "] not in"
<<" projection area !"<<endl<<(*pPoint)<<" -> "
<< Projection<<endl<<" Location is "<<Location
<<", Conic is "<<TestC
<<", Covariance matrix is "<< Cov
<<" sigmas are "<<S[0]<<" "<<S[1]<<" "<<S[2]<<endl
<<"Ellipsoid center is at "<< QC);
double dAngle, radius_a, radius_b;
BIASERR("Ellipse at "<<Center<<" with "<<radius_a<<"/"<<radius_b
<<" rotated by "<<dAngle/M_PI*180.0
<<" degrees counterclockwise.");
} else {
BIASERR("Error retrieving explicit ellipse parameters.");
}
} else {
BIASERR("Projection is NO ellipse !");
}
}
}
return 0;
}