BundlerFocalExtractor::BundlerFocalExtractor(const std::string& inputPath, const std::string& outputListPath, const std::string& outputFocalListPath)
: mDatabase("cameras.xml")
{
	open(inputPath);

	std::ofstream outputList(outputListPath.c_str());
	std::ofstream outputFocalList(outputFocalListPath.c_str());
	if (outputList.is_open() && outputFocalList.is_open())
	{
		for (unsigned int i=0; i<mPictures.size(); ++i)
		{
			const std::string& filename = mPictures[i];
			std::stringstream filepath;
			filepath << inputPath << filename;
			
			int width, height = 0;
			Jpeg::getDimension(filepath.str(), width, height);
			float focal = getFocal(filepath.str(), width, height);
			outputList << filename << std::endl;
			outputFocalList << filename << " 0 " << focal << std::endl;
		}
	}
	outputList.close();
	outputFocalList.close();
}
예제 #2
0
std::string PclCameraWrapper::toString()
{
    std::stringstream ss;
    ss << "[Camera] Position: " << getPos();
    ss << ", Up vector: " << getView();
    ss << ", Focal point: " << getFocal();
    ss << ", Clipping planes depth: " << getClip();
    ss << ", Fovy: " << getFovy();
    // Additional infos
    ss << "\n[Camera] Zoom factor" << zoomFactor();
    return ss.str();
}
예제 #3
0
double PclCameraWrapper::zoomFactor() const
{
    return (getFocal() - getPos()).length();
}