Hugintrunk
0.1
|
main database class More...
#include <LensDB.h>
Classes | |
class | Database |
Public Member Functions | |
LensDB () | |
constructor More... | |
virtual | ~LensDB () |
destructor More... | |
bool | GetCropFactor (const std::string &maker, const std::string &model, double &cropFactor) const |
returns the crop factor for the given camera (maker/model) More... | |
bool | GetProjection (const std::string &lens, BaseSrcPanoImage::Projection &projection) const |
returns the projection of the lens More... | |
bool | GetCrop (const std::string &lens, const double focal, const vigra::Size2D &imageSize, vigra::Rect2D &cropRect) const |
returns the crop of the lens the information for landscape and portrait images are stored separately More... | |
bool | GetFov (const std::string &lens, const double focal, double &fov) const |
returns the field of view of the lens the fov is always returned for a landscape image with aspect ratio 3:2 More... | |
bool | GetDistortion (const std::string &lens, const double focal, std::vector< double > &distortion) const |
returns the distortion parameters of the lens More... | |
bool | GetVignetting (const std::string &lens, const double focal, const double aperture, const double distance, std::vector< double > &vignetting) const |
returns the vignetting parameters of the lens More... | |
bool | GetTCA (const std::string &lens, const double focal, std::vector< double > &tca_red, std::vector< double > &tca_blue) const |
returns the tca distortion parameters of the lens More... | |
bool | GetLensNames (const bool distortion, const bool vignetting, const bool tca, LensList &lensList) const |
return a vector of lenses with selected database entries More... | |
bool | CleanUpDatabase () |
compress database by remove all entries and insert instead the average values More... | |
bool | RemoveLens (const std::string &lensname) |
remove all database entry which refers to given lens More... | |
bool | RemoveCamera (const std::string &maker, const std::string &model) |
remove all database entry which refers to given camera More... | |
bool | SaveCameraCrop (const std::string &maker, const std::string &model, const double cropfactor) |
save the camera with the given cropfactor into the database More... | |
bool | SaveEMoR (const std::string &maker, const std::string &model, const int iso, const std::vector< float > &emor, const int weight=10) |
save the camera with the given EMoR parameters into the database More... | |
bool | SaveLensProjection (const std::string &lens, const BaseSrcPanoImage::Projection projection) |
saves the projection for the lens in the database More... | |
bool | SaveLensCrop (const std::string &lens, const double focal, const vigra::Size2D &imageSize, const vigra::Rect2D &cropRect) |
saves the crop information of the lens in the database the information for landscape and portrait images are stored separately More... | |
bool | SaveLensFov (const std::string &lens, const double focal, const double fov, const int weight=10) |
saves the field of view of the lens the fov should always calculated for a landscape image with aspect ratio 3:2 More... | |
bool | SaveDistortion (const std::string &lens, const double focal, const std::vector< double > &distortion, const int weight=10) |
saves the distortion parameters of the lens in the database More... | |
bool | SaveVignetting (const std::string &lens, const double focal, const double aperture, const double distance, const std::vector< double > &vignetting, const int weight=10) |
saves the vignetting parameters of the lens More... | |
bool | SaveTCA (const std::string &lens, const double focal, const std::vector< double > &tca_red, const std::vector< double > &tca_blue, const int weight=10) |
saves the tca distortion parameters of the lens More... | |
std::string | GetDBFilename () const |
returns the filename of the lens database More... | |
bool | ExportToFile (const std::string &filename) |
export database to file More... | |
bool | ImportFromFile (const std::string &filename) |
import data from external file More... | |
Static Public Member Functions | |
static LensDB & | GetSingleton () |
returns the static LensDB instance More... | |
static void | Clean () |
cleanup the static LensDB instance, must be called at the end of the program More... | |
Private Member Functions | |
LensDB (const LensDB &) | |
LensDB & | operator= (const LensDB &) |
Private Attributes | |
Database * | m_db |
Static Private Attributes | |
static LensDB * | m_instance =NULL |
HuginBase::LensDB::LensDB::LensDB | ( | ) |
constructor
Definition at line 1972 of file LensDB.cpp.
References hugin_utils::GetUserAppDataDir(), and m_db.
Referenced by GetSingleton().
|
virtual |
|
private |
|
static |
cleanup the static LensDB instance, must be called at the end of the program
Definition at line 2010 of file LensDB.cpp.
References m_instance.
Referenced by main(), PTBatcherGUI::OnExit(), print_result(), huginApp::~huginApp(), and LensCalFrame::~LensCalFrame().
bool HuginBase::LensDB::LensDB::CleanUpDatabase | ( | ) |
compress database by remove all entries and insert instead the average values
Definition at line 2508 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::CleanUp(), and m_db.
bool HuginBase::LensDB::LensDB::ExportToFile | ( | const std::string & | filename | ) |
export database to file
Definition at line 2535 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::ExportToFile(), and m_db.
Referenced by main().
bool HuginBase::LensDB::LensDB::GetCrop | ( | const std::string & | lens, |
const double | focal, | ||
const vigra::Size2D & | imageSize, | ||
vigra::Rect2D & | cropRect | ||
) | const |
returns the crop of the lens the information for landscape and portrait images are stored separately
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the crop should be returned |
imageSize | size of the image for which the crop information is wanted |
cropRect | contains the crop information |
Definition at line 2073 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetLensCrop(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), m_db, and hugin_utils::roundi().
Referenced by ApplyLensDBParameters(), and HuginBase::SrcPanoImage::readProjectionFromDB().
bool HuginBase::LensDB::LensDB::GetCropFactor | ( | const std::string & | maker, |
const std::string & | model, | ||
double & | cropFactor | ||
) | const |
returns the crop factor for the given camera (maker/model)
maker | maker of the desired camera |
model | camera model |
cropFactor | contains the crop factor |
Definition at line 2031 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetCropFactor(), and m_db.
std::string HuginBase::LensDB::LensDB::GetDBFilename | ( | ) | const |
returns the filename of the lens database
Definition at line 2019 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetDBFilename(), and m_db.
Referenced by AboutDialog::GetSystemInformation(), and main().
bool HuginBase::LensDB::LensDB::GetDistortion | ( | const std::string & | lens, |
const double | focal, | ||
std::vector< double > & | distortion | ||
) | const |
returns the distortion parameters of the lens
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the distortion parameters should be returned |
distortion | stored the returned distortion parameters |
Definition at line 2162 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetDistortionData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.
Referenced by ApplyLensDBParameters(), HuginBase::SrcPanoImage::readDistortionFromDB(), and HuginBase::SrcPanoImage::readProjectionFromDB().
bool HuginBase::LensDB::LensDB::GetFov | ( | const std::string & | lens, |
const double | focal, | ||
double & | fov | ||
) | const |
returns the field of view of the lens the fov is always returned for a landscape image with aspect ratio 3:2
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the fov should be returned |
fov | stored the returned field of view |
Definition at line 2119 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetHFOV(), HFOV, HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.
Referenced by ApplyLensDBParameters(), and HuginBase::SrcPanoImage::readProjectionFromDB().
bool HuginBase::LensDB::LensDB::GetLensNames | ( | const bool | distortion, |
const bool | vignetting, | ||
const bool | tca, | ||
LensList & | lensList | ||
) | const |
return a vector of lenses with selected database entries
distortion | vector contains lenses with distortion data |
vignetting | vector contains lenses with vignetting data |
tca | vector contains lenses with tca data |
lensList | vector containing the lens names |
Definition at line 2419 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetLensNames(), and m_db.
bool HuginBase::LensDB::LensDB::GetProjection | ( | const std::string & | lens, |
BaseSrcPanoImage::Projection & | projection | ||
) | const |
returns the projection of the lens
lens | name of the lens, or for compact camera Maker|Model |
projection | contains the projection of the lens |
Definition at line 2040 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetLensProjection(), and m_db.
Referenced by ApplyLensDBParameters(), and HuginBase::SrcPanoImage::readProjectionFromDB().
|
static |
returns the static LensDB instance
Definition at line 2001 of file LensDB.cpp.
References LensDB(), and m_instance.
Referenced by ApplyLensDBParameters(), LoadLensDBDialog::FillLensList(), AboutDialog::GetSystemInformation(), main(), print_result(), HuginBase::SrcPanoImage::readCropfactorFromDB(), HuginBase::SrcPanoImage::readDistortionFromDB(), HuginBase::SrcPanoImage::readProjectionFromDB(), HuginBase::SrcPanoImage::readVignettingFromDB(), and SaveLensParameters().
bool HuginBase::LensDB::LensDB::GetTCA | ( | const std::string & | lens, |
const double | focal, | ||
std::vector< double > & | tca_red, | ||
std::vector< double > & | tca_blue | ||
) | const |
returns the tca distortion parameters of the lens
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the distortion parameters should be returned |
tca_red | stored the returned tca distortion parameters for red channel |
tca_blue | stored the returned tca distortion parameters for blue channel |
Definition at line 2366 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetTCAData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.
Referenced by main().
bool HuginBase::LensDB::LensDB::GetVignetting | ( | const std::string & | lens, |
const double | focal, | ||
const double | aperture, | ||
const double | distance, | ||
std::vector< double > & | vignetting | ||
) | const |
returns the vignetting parameters of the lens
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the vignetting parameters should be returned |
aperture | aperture, for which the vignetting parameters should be returned |
distance | distance, for which the vignetting parameters should be returned (currently ignored) |
vignetting | stored the returned vignetting |
Definition at line 2205 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::GetVignettingData(), HuginBase::LensDB::InterpolateValue(), HuginBase::LensDB::InterpolateValueTriangle(), HuginBase::LensDB::IsFocallengthNearRange(), and m_db.
Referenced by ApplyLensDBParameters(), and HuginBase::SrcPanoImage::readVignettingFromDB().
bool HuginBase::LensDB::LensDB::ImportFromFile | ( | const std::string & | filename | ) |
import data from external file
Definition at line 2544 of file LensDB.cpp.
References HuginBase::LensDB::LensDB::Database::ImportFromFile(), and m_db.
Referenced by main().
bool HuginBase::LensDB::LensDB::RemoveCamera | ( | const std::string & | maker, |
const std::string & | model | ||
) |
remove all database entry which refers to given camera
Definition at line 2526 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::RemoveCamera().
Referenced by main().
bool HuginBase::LensDB::LensDB::RemoveLens | ( | const std::string & | lensname | ) |
remove all database entry which refers to given lens
Definition at line 2517 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::RemoveLens().
Referenced by main().
bool HuginBase::LensDB::LensDB::SaveCameraCrop | ( | const std::string & | maker, |
const std::string & | model, | ||
const double | cropfactor | ||
) |
save the camera with the given cropfactor into the database
maker | camera maker to save |
model | camera model to save |
cropfactor | crop factor for given camera |
Definition at line 2429 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveCropFactor().
Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().
bool HuginBase::LensDB::LensDB::SaveDistortion | ( | const std::string & | lens, |
const double | focal, | ||
const std::vector< double > & | distortion, | ||
const int | weight = 10 |
||
) |
saves the distortion parameters of the lens in the database
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the distortion parameters should be saved |
distortion | distortion parameters which should be stored in database |
weight | weight factor for given values (0-100, default is 10) |
Definition at line 2481 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveDistortion().
Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().
bool HuginBase::LensDB::LensDB::SaveEMoR | ( | const std::string & | maker, |
const std::string & | model, | ||
const int | iso, | ||
const std::vector< float > & | emor, | ||
const int | weight = 10 |
||
) |
save the camera with the given EMoR parameters into the database
maker | camera maker to save |
model | camera model to save |
ISO | ISO settings for which the EMoR parameters applies |
emor | EMoR parameters to save |
weight | weight factor for given values (0-100, default is 10) |
Definition at line 2438 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveEMoR().
Referenced by HuginBase::LensDB::SaveLensDataFromPano().
bool HuginBase::LensDB::LensDB::SaveLensCrop | ( | const std::string & | lens, |
const double | focal, | ||
const vigra::Size2D & | imageSize, | ||
const vigra::Rect2D & | cropRect | ||
) |
saves the crop information of the lens in the database the information for landscape and portrait images are stored separately
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the crop should be saved |
imageSize | size of the image for which the crop information is saved |
cropRect | contains the crop information which should be saved |
Definition at line 2456 of file LensDB.cpp.
References m_db, HuginBase::LensDB::LensDB::Database::RemoveLensCrop(), and HuginBase::LensDB::LensDB::Database::SaveLensCrop().
Referenced by HuginBase::LensDB::SaveLensDataFromPano().
bool HuginBase::LensDB::LensDB::SaveLensFov | ( | const std::string & | lens, |
const double | focal, | ||
const double | fov, | ||
const int | weight = 10 |
||
) |
saves the field of view of the lens the fov should always calculated for a landscape image with aspect ratio 3:2
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the fov should be saved |
fov | field of view for storing |
weight | weight factor for given values (0-100, default is 10) |
Definition at line 2472 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveHFOV().
Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().
bool HuginBase::LensDB::LensDB::SaveLensProjection | ( | const std::string & | lens, |
const BaseSrcPanoImage::Projection | projection | ||
) |
saves the projection for the lens in the database
lens | name of the lens, or for compact camera Maker|Model |
projection | projection of the lens |
Definition at line 2447 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveLensProjection().
Referenced by HuginBase::LensDB::SaveLensDataFromPano().
bool HuginBase::LensDB::LensDB::SaveTCA | ( | const std::string & | lens, |
const double | focal, | ||
const std::vector< double > & | tca_red, | ||
const std::vector< double > & | tca_blue, | ||
const int | weight = 10 |
||
) |
saves the tca distortion parameters of the lens
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the distortion parameters should be saved |
tca_red | tca distortion parameters for red channel |
tca_blue | tca distortion parameters for blue channel |
weight | weight factor for given values (0-100, default is 10) |
Definition at line 2499 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveTCAData().
Referenced by print_result().
bool HuginBase::LensDB::LensDB::SaveVignetting | ( | const std::string & | lens, |
const double | focal, | ||
const double | aperture, | ||
const double | distance, | ||
const std::vector< double > & | vignetting, | ||
const int | weight = 10 |
||
) |
saves the vignetting parameters of the lens
lens | name of the lens, or for compact camera Maker|Model |
focal | focal length, for which the vignetting parameters should be saved |
aperture | aperture, for which the vignetting parameters should be saved |
distance | distance, for which the vignetting parameters should be saved |
vignetting | vignetting parameters which should be stored |
weight | weight factor for given values (0-100, default is 10) |
Definition at line 2490 of file LensDB.cpp.
References m_db, and HuginBase::LensDB::LensDB::Database::SaveVignetting().
Referenced by HuginBase::LensDB::SaveLensDataFromPano(), and SaveLensParameters().
|
private |
Definition at line 193 of file LensDB.h.
Referenced by CleanUpDatabase(), ExportToFile(), GetCrop(), GetCropFactor(), GetDBFilename(), GetDistortion(), GetFov(), GetLensNames(), GetProjection(), GetTCA(), GetVignetting(), ImportFromFile(), LensDB(), RemoveCamera(), RemoveLens(), SaveCameraCrop(), SaveDistortion(), SaveEMoR(), SaveLensCrop(), SaveLensFov(), SaveLensProjection(), SaveTCA(), SaveVignetting(), and ~LensDB().
|
staticprivate |
Definition at line 195 of file LensDB.h.
Referenced by Clean(), and GetSingleton().