shows usage of calibrated pyramid
- Author
- MIP
- Date
- 2007
#include <Base/Geometry/KMatrix.hh>
#include <Geometry/ProjectionParametersPerspective.hh>
#include <Image/CalibratedPyramid.hh>
#include <vector>
using namespace BIAS;
using namespace std;
{
K[0][0] = K[1][1] = focal;
K[0][2] = 320.0; K[1][2] = 240.0;
DynamicCast<ProjectionParametersBase>(projpersp);
BIASASSERT(proj);
return proj;
}
{
im->FillImageWithXValue();
const double focal = 800.0;
cp.Init(ci);
}
void TestInit()
{
im.FillImageWithXValue();
const int x = 42, y = 42;
unsigned char val = im.GetImageDataArray()[y][x];
const unsigned size = 2;
const double factor = 4.0;
cp.Init(ci, size, factor);
if (cp.IsEmpty()) { BIASABORT; }
if (cp.Size()!=size) { BIASABORT; }
if (!
Equal(cp.GetRescaleFactor(), factor)) { BIASABORT; }
unsigned char mval = cp[0].image->GetImageDataArray()[y][x];
if (val != mval) { BIASABORT; }
}
void TestSTL()
{
vector<CalibratedPyramid<unsigned char> > vcp(3);
GetCalibratedPyramid(cp);
vcp[1] = cp;
}
int main(int argc, char *argv[])
{
TestInit();
TestSTL();
return 0;
}