#include <iostream>
#include <Base/Image/ImageIO.hh>
#include <Image/Camera.hh>
#include <Image/PlanarRectification.hh>
#include <Image/RectificationBase.hh>
#include <Utils/Param.hh>
#include <Utils/IOUtils.hh>
using namespace std;
using namespace BIAS;
int main(int argc, char* argv[])
{
"", 0, IOGrpID);
"", 0, IOGrpID);
"", 0, IOGrpID);
if(!IOUtils::ParseCommandLineEvalHelp(params, argc, argv))
return 0;
if(!IOUtils::LoadCamera<unsigned char>(leftCamName, camLeft, projLeft))
return -1;
if(!IOUtils::LoadCamera<unsigned char>(centerCamName, camCenter, projCenter))
return -1;
if(!IOUtils::LoadCamera<unsigned char>(rightCamName, camRight, projRight))
return -1;
poseCenter,
poseRight,
orientation);
sphericalBase.
Set(orientation, poseCenter.
GetC());
double minPhi, maxPhi, centerPhi, minTheta, maxTheta;
cerr<<
"sphericalBase "<<sphericalBase.
GetR()<<endl;
cerr<<
"CameraBase "<<projCenter.
GetR()<<endl;
minPhi, maxPhi,
centerPhi,
minTheta, maxTheta );
cerr<<"minPhi "<<minPhi<<", maxPhi "<<maxPhi<<endl;
cerr<<"centerPhi "<<centerPhi<<endl;
cerr<<"minTheta "<<minTheta<<", maxTheta "<<maxTheta<<endl;
double minSamplingStep;
minPhi+= 2.0*0.06;
maxPhi-= 5.0*0.06;
minTheta+= 0.06;
maxTheta-= 5.0*0.06;
minTheta, maxTheta,
2.0*minSamplingStep);
rectPPPLeft=rectPPPRight=rectPPPCenter;
rectPPPLeft.
SetQ(orientation);
rectPPPCenter.
SetQ(orientation);
rectPPPRight.
SetQ(orientation);
cerr<<"rectPPPC = "<<rectPPPCenter<<endl;
cerr<<"rectPPPLeft = "<<rectPPPLeft<<endl;
cerr<<"rectPPPRight = "<<rectPPPRight<<endl;
rectifierCenter, rectifierRight;
unsigned int targetWidth, targetHeight;
cerr<<targetWidth<<"x"<< targetHeight<<endl;
rectCamLeft.
Init(targetWidth, targetHeight,3);
rectCamRight.
Init(targetWidth, targetHeight,3);
rectCamCenter.
Init(targetWidth, targetHeight,3);
rectifierCenter.
Map(camCenter, rectCamCenter);
IOUtils::SaveCamera<unsigned char>("centerRect.mip",
rectCamCenter,
rectifierCenter.
Map(camLeft, rectCamLeft);
IOUtils::SaveCamera<unsigned char>("leftRect.mip",
rectCamLeft,
rectifierCenter.
Map(camRight, rectCamRight);
IOUtils::SaveCamera<unsigned char>("righRect.mip",
rectCamRight,
return 0;
}