AliceVision
Photogrammetric Computer Vision Framework
Public Member Functions | List of all members
aliceVision::sfmData::ImageInfo Class Reference

Public Member Functions

 ImageInfo (const std::string &imagePath="", std::size_t width=0, std::size_t height=0, const std::map< std::string, std::string > &metadata=std::map< std::string, std::string >())
 Image Constructor. More...
 
ImageInfoclone ()
 
bool operator== (const ImageInfo &other) const
 
bool operator!= (const ImageInfo &other) const
 
const std::string & getImagePath () const
 Get view image path. More...
 
std::size_t getWidth () const
 Get view image width. More...
 
std::size_t getHeight () const
 Get view image height. More...
 
std::pair< std::size_t, std::size_t > getImgSize () const
 Get view image size. More...
 
ExposureSetting getCameraExposureSetting () const
 Get the Camera Exposure Setting value. For the same scene, this value is linearly proportional to the amount of light captured by the camera according to the shooting parameters (shutter speed, f-number, iso).
 
double getEv () const
 Get the Exposure Value. EV is a number that represents a combination of a camera's shutter speed and f-number, such that all combinations that yield the same exposure have the same EV. It progresses in a linear sequence as camera exposure is changed in power-of-2 steps.
 
std::map< std::string, std::string >::const_iterator findMetadataIterator (const std::string &name) const
 Get an iterator on the map of metadata from a given name.
 
bool hasMetadata (const std::vector< std::string > &names) const
 Return true if the given metadata name exists. More...
 
bool hasGpsMetadata () const
 Return true if the metadata for longitude and latitude exist. It checks that all the tags from GPSExifTags exists. More...
 
bool hasDigitMetadata (const std::vector< std::string > &names, bool isPositive=true) const
 Return true if the given metadata name exists and is a digit. More...
 
const std::string & getMetadata (const std::vector< std::string > &names) const
 Get the metadata value as a string. More...
 
double readRealNumber (const std::string &str) const
 Read a floating point value from a string. It support an integer, a floating point value or a fraction. More...
 
double getDoubleMetadata (const std::vector< std::string > &names) const
 Get the metadata value as a double. More...
 
bool getDoubleMetadata (const std::vector< std::string > &names, double &val) const
 Get the metadata value as a double. More...
 
int getIntMetadata (const std::vector< std::string > &names) const
 Get the metadata value as an integer. More...
 
const std::string & getMetadataMake () const
 Get the corresponding "Make" metadata value. More...
 
const std::string & getMetadataModel () const
 Get the corresponding "Model" metadata value. More...
 
const std::string & getMetadataBodySerialNumber () const
 Get the corresponding "BodySerialNumber" metadata value. More...
 
const std::string & getMetadataLensModel () const
 Get the corresponding "LensModel" metadata value. More...
 
int getMetadataLensID () const
 Get the corresponding "LensID" metadata value. More...
 
const std::string & getMetadataLensSerialNumber () const
 Get the corresponding "LensSerialNumber" metadata value. More...
 
double getMetadataFocalLength () const
 Get the corresponding "FocalLength" metadata value. More...
 
double getMetadataShutter () const
 Get the corresponding "ExposureTime" (shutter) metadata value. More...
 
double getMetadataFNumber () const
 Get the corresponding "FNumber" (relative aperture) metadata value. More...
 
double getMetadataISO () const
 Get the corresponding "PhotographicSensitivity" (ISO) metadata value. More...
 
EEXIFOrientation getMetadataOrientation () const
 Get the corresponding "Orientation" metadata value. More...
 
Vec3 getGpsPositionFromMetadata () const
 Get the gps position in the absolute cartesian reference system. More...
 
void getGpsPositionWGS84FromMetadata (double &lat, double &lon, double &alt) const
 Get the gps position in the WGS84 reference system. More...
 
Vec3 getGpsPositionWGS84FromMetadata () const
 Get the gps position in the WGS84 reference system as a vector. More...
 
const std::string & getColorProfileFileName () const
 
const std::string & getRawColorInterpretation () const
 
const std::vector< int > getCameraMultiplicators () const
 
const bool getVignettingParams (std::vector< float > &v_vignParam) const
 
const bool getChromaticAberrationParams (std::vector< float > &v_caGParam, std::vector< float > &v_caBGParam, std::vector< float > &v_caRGParam) const
 
const bool hasMetadataDateTimeOriginal () const
 
const std::string & getMetadataDateTimeOriginal () const
 
int64_t getMetadataDateTimestamp () const
 
double getSensorWidth () const
 
double getSensorHeight () const
 
const std::map< std::string, std::string > & getMetadata () const
 Get the view metadata structure. More...
 
void setImagePath (const std::string &imagePath)
 Set the given view image path. More...
 
void setWidth (std::size_t width)
 Set the given view image width. More...
 
void setHeight (std::size_t height)
 Set the given view image height. More...
 
void setMetadata (const std::map< std::string, std::string > &metadata)
 Set view metadata. More...
 
void addMetadata (const std::string &key, const std::string &value)
 Add view metadata. More...
 
void addDCPMetadata (image::DCPProfile &dcpProf)
 Add DCP info in metadata. More...
 
void addVignettingMetadata (LensParam &lensParam)
 Add vignetting model parameters in metadata. More...
 
void addChromaticMetadata (LensParam &lensParam)
 Add chromatic model parameters in metadata. More...
 
int getSensorSize (const std::vector< sensorDB::Datasheet > &sensorDatabase, double &sensorWidth, double &sensorHeight, double &focalLengthmm, camera::EInitMode &intrinsicInitMode, bool verbose=false)
 Get sensor size by combining info in metadata and in sensor database. More...
 

Constructor & Destructor Documentation

◆ ImageInfo()

aliceVision::sfmData::ImageInfo::ImageInfo ( const std::string &  imagePath = "",
std::size_t  width = 0,
std::size_t  height = 0,
const std::map< std::string, std::string > &  metadata = std::map<std::string, std::string>() 
)
inline

Image Constructor.

Parameters
[in]imagePathThe image path on disk
[in]widthThe image width
[in]heightThe image height
[in]metadataThe image metadata

Member Function Documentation

◆ addChromaticMetadata()

void aliceVision::sfmData::ImageInfo::addChromaticMetadata ( LensParam lensParam)
inline

Add chromatic model parameters in metadata.

Parameters
[in]Thelens data extracted from a LCP file

◆ addDCPMetadata()

void aliceVision::sfmData::ImageInfo::addDCPMetadata ( image::DCPProfile dcpProf)
inline

Add DCP info in metadata.

Parameters
[in]dcpProfThe DCP color profile

◆ addMetadata()

void aliceVision::sfmData::ImageInfo::addMetadata ( const std::string &  key,
const std::string &  value 
)
inline

Add view metadata.

Parameters
[in]keyThe metadata key
[in]valueThe metadata value

◆ addVignettingMetadata()

void aliceVision::sfmData::ImageInfo::addVignettingMetadata ( LensParam lensParam)
inline

Add vignetting model parameters in metadata.

Parameters
[in]Thelens data extracted from a LCP file

◆ getDoubleMetadata() [1/2]

double aliceVision::sfmData::ImageInfo::getDoubleMetadata ( const std::vector< std::string > &  names) const

Get the metadata value as a double.

Parameters
[in]namesList of possible names for the metadata
Returns
the metadata value as a double or -1.0 if it does not exist

◆ getDoubleMetadata() [2/2]

bool aliceVision::sfmData::ImageInfo::getDoubleMetadata ( const std::vector< std::string > &  names,
double &  val 
) const

Get the metadata value as a double.

Parameters
[in]namesList of possible names for the metadata
[in]valData to be set with the metadata value
Returns
true if the metadata is found or false if it does not exist

◆ getGpsPositionFromMetadata()

Vec3 aliceVision::sfmData::ImageInfo::getGpsPositionFromMetadata ( ) const

Get the gps position in the absolute cartesian reference system.

Returns
The position x, y, z as a three dimensional vector.

◆ getGpsPositionWGS84FromMetadata() [1/2]

Vec3 aliceVision::sfmData::ImageInfo::getGpsPositionWGS84FromMetadata ( ) const

Get the gps position in the WGS84 reference system as a vector.

Returns
A three dimensional vector with latitude, longitude and altitude.

◆ getGpsPositionWGS84FromMetadata() [2/2]

void aliceVision::sfmData::ImageInfo::getGpsPositionWGS84FromMetadata ( double &  lat,
double &  lon,
double &  alt 
) const

Get the gps position in the WGS84 reference system.

Parameters
[out]latthe latitude
[out]lonthe longitude
[out]altthe altitude

◆ getHeight()

std::size_t aliceVision::sfmData::ImageInfo::getHeight ( ) const
inline

Get view image height.

Returns
image height

◆ getImagePath()

const std::string& aliceVision::sfmData::ImageInfo::getImagePath ( ) const
inline

Get view image path.

Returns
image path

◆ getImgSize()

std::pair<std::size_t, std::size_t> aliceVision::sfmData::ImageInfo::getImgSize ( ) const
inline

Get view image size.

Returns
image size

◆ getIntMetadata()

int aliceVision::sfmData::ImageInfo::getIntMetadata ( const std::vector< std::string > &  names) const

Get the metadata value as an integer.

Parameters
[in]namesList of possible names for the metadata
Returns
the metadata value as an integer or -1 if it does not exist

◆ getMetadata() [1/2]

const std::map<std::string, std::string>& aliceVision::sfmData::ImageInfo::getMetadata ( ) const
inline

Get the view metadata structure.

Returns
the view metadata

◆ getMetadata() [2/2]

const std::string & aliceVision::sfmData::ImageInfo::getMetadata ( const std::vector< std::string > &  names) const

Get the metadata value as a string.

Parameters
[in]namesList of possible names for the metadata
Returns
the metadata value as a string or an empty string if it does not exist

◆ getMetadataBodySerialNumber()

const std::string& aliceVision::sfmData::ImageInfo::getMetadataBodySerialNumber ( ) const
inline

Get the corresponding "BodySerialNumber" metadata value.

Returns
the metadata value string or "" if no corresponding value

◆ getMetadataFNumber()

double aliceVision::sfmData::ImageInfo::getMetadataFNumber ( ) const
inline

Get the corresponding "FNumber" (relative aperture) metadata value.

Returns
the metadata value float or -1 if no corresponding value

◆ getMetadataFocalLength()

double aliceVision::sfmData::ImageInfo::getMetadataFocalLength ( ) const

Get the corresponding "FocalLength" metadata value.

Returns
the metadata value float or -1 if no corresponding value

◆ getMetadataISO()

double aliceVision::sfmData::ImageInfo::getMetadataISO ( ) const
inline

Get the corresponding "PhotographicSensitivity" (ISO) metadata value.

Returns
the metadata value int or -1 if no corresponding value

◆ getMetadataLensID()

int aliceVision::sfmData::ImageInfo::getMetadataLensID ( ) const
inline

Get the corresponding "LensID" metadata value.

Returns
the metadata value -1 if no corresponding value

◆ getMetadataLensModel()

const std::string& aliceVision::sfmData::ImageInfo::getMetadataLensModel ( ) const
inline

Get the corresponding "LensModel" metadata value.

Returns
the metadata value string or "" if no corresponding value

◆ getMetadataLensSerialNumber()

const std::string& aliceVision::sfmData::ImageInfo::getMetadataLensSerialNumber ( ) const
inline

Get the corresponding "LensSerialNumber" metadata value.

Returns
the metadata value string or "" if no corresponding value

◆ getMetadataMake()

const std::string& aliceVision::sfmData::ImageInfo::getMetadataMake ( ) const
inline

Get the corresponding "Make" metadata value.

Returns
the metadata value string or "" if no corresponding value

◆ getMetadataModel()

const std::string& aliceVision::sfmData::ImageInfo::getMetadataModel ( ) const
inline

Get the corresponding "Model" metadata value.

Returns
the metadata value string or "" if no corresponding value

◆ getMetadataOrientation()

EEXIFOrientation aliceVision::sfmData::ImageInfo::getMetadataOrientation ( ) const
inline

Get the corresponding "Orientation" metadata value.

Returns
the enum EEXIFOrientation

◆ getMetadataShutter()

double aliceVision::sfmData::ImageInfo::getMetadataShutter ( ) const
inline

Get the corresponding "ExposureTime" (shutter) metadata value.

Returns
the metadata value float or -1 if no corresponding value

◆ getSensorSize()

int aliceVision::sfmData::ImageInfo::getSensorSize ( const std::vector< sensorDB::Datasheet > &  sensorDatabase,
double &  sensorWidth,
double &  sensorHeight,
double &  focalLengthmm,
camera::EInitMode &  intrinsicInitMode,
bool  verbose = false 
)

Get sensor size by combining info in metadata and in sensor database.

Parameters
[in]sensorDatabaseThe sensor database
[out]sensorWidthThe sensor width
[out]sensorHeightThe sensor height
[out]focalLengthmmThe focal length
[out]intrinsicInitModeThe intrinsic init mode
[in]verboseEnable verbosity
Returns
An Error or Warning code: 1 - Unknown sensor, 2 - No metadata, 3 - Unsure sensor, 4 - Computation from 35mm Focal

◆ getWidth()

std::size_t aliceVision::sfmData::ImageInfo::getWidth ( ) const
inline

Get view image width.

Returns
image width

◆ hasDigitMetadata()

bool aliceVision::sfmData::ImageInfo::hasDigitMetadata ( const std::vector< std::string > &  names,
bool  isPositive = true 
) const

Return true if the given metadata name exists and is a digit.

Parameters
[in]namesList of possible names for the metadata
[in]isPositivetrue if the metadata must be positive
Returns
true if the corresponding metadata value exists

◆ hasGpsMetadata()

bool aliceVision::sfmData::ImageInfo::hasGpsMetadata ( ) const

Return true if the metadata for longitude and latitude exist. It checks that all the tags from GPSExifTags exists.

Returns
true if GPS data is available

◆ hasMetadata()

bool aliceVision::sfmData::ImageInfo::hasMetadata ( const std::vector< std::string > &  names) const

Return true if the given metadata name exists.

Parameters
[in]namesList of possible names for the metadata
Returns
true if the corresponding metadata value exists

◆ readRealNumber()

double aliceVision::sfmData::ImageInfo::readRealNumber ( const std::string &  str) const

Read a floating point value from a string. It support an integer, a floating point value or a fraction.

Parameters
[in]strstring with the number to evaluate
Returns
the extracted floating point value or -1.0 if it fails to convert the string

◆ setHeight()

void aliceVision::sfmData::ImageInfo::setHeight ( std::size_t  height)
inline

Set the given view image height.

Parameters
[in]heightThe given view image height

◆ setImagePath()

void aliceVision::sfmData::ImageInfo::setImagePath ( const std::string &  imagePath)
inline

Set the given view image path.

Parameters
[in]imagePathThe given view image path

◆ setMetadata()

void aliceVision::sfmData::ImageInfo::setMetadata ( const std::map< std::string, std::string > &  metadata)
inline

Set view metadata.

Parameters
[in]metadataThe metadata map

◆ setWidth()

void aliceVision::sfmData::ImageInfo::setWidth ( std::size_t  width)
inline

Set the given view image width.

Parameters
[in]widthThe given view image width

The documentation for this class was generated from the following files: