25 #include <Geometry/ProjectionParametersPerspectiveDepth.hh>
26 #include <Utils/Param.hh>
27 #include <Utils/IOUtils.hh>
28 #include <Base/Common/FileHandling.hh>
42 main(
int argc,
char* argv[])
47 "input camera/image with params in the header",
"",
'i');
49 string* inputCameraNameList = params.
AddParamString(
"inputCamList",
50 "input cameras/images with params in the header",
"",
'l');
52 if (!IOUtils::ParseCommandLineEvalHelp(params, argc, argv))
60 if (!((*inputCameraName).compare(
"") == 0))
62 if (!IOUtils::LoadCamera(inputCameraName, inputCamera, proj))
70 BIASERR(
"expected parameters of type ProjectionParametersPerspectiveDepth!");
76 cout <<
"nothing to un-distort!\n";
82 BIASERR(
"something went wrong!");
88 string outputCameraName;
89 outputCameraName = FileHandling::Basename(*inputCameraName);
90 if (!IOUtils::SaveCamera(
"dud-" + outputCameraName +
".mip", inputCamera,
97 vector<string> imageList;
98 if (!((*inputCameraNameList).compare(
"") == 0))
100 if (Param::ParseListFile(*inputCameraNameList, imageList) != 0)
102 BIASERR(
"error parsing "<< (*inputCameraNameList) << endl);
107 cout <<
"loaded " << (*inputCameraNameList) << endl;
109 for (
unsigned int i = 0; i < imageList.size(); i++)
111 string inputCameraName = imageList[i];
112 if (!IOUtils::LoadCamera(inputCameraName, inputCamera, proj))
120 BIASERR(
"expected parameters of type ProjectionParametersPerspectiveDepth!");
126 cout <<
"nothing to un-distort!\n";
132 BIASERR(
"something went wrong!");
138 string outputCameraName;
139 outputCameraName = FileHandling::Basename(inputCameraName);
140 if (!IOUtils::SaveCamera(
"dud-" + outputCameraName +
".mip",
145 cout <<
"written: dud_" << outputCameraName << endl;
additional depth calibration parameters for a perspective depth camera to be used for ToF-(PMD) camer...
const ProjectionParametersBase * GetParameters(unsigned int cam=0) const
const parameter access function
void SetDepthDistortionToZero()
Sets depth distortion to 0.
This class hides the underlying projection model, like projection matrix, spherical camera...
This class Param provides generic support for parameters.
int UnDistortDepthMapIP(BIAS::Image< float > &depthMap, bool bIsInCartesianCoords=false)
Undistorts the passed depth map in place.
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
bool HasDepthDistortion() const
checks whether depth distortion is present
std::string * AddParamString(const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)