Public Member Functions
sal3d::Metric::Config Class Reference

Configuration associated with a camera/laser set used to convert acquired data to 3D data. More...

#include <Common.hpp>

List of all members.

Public Member Functions

 Config (float factorU, float factorV, float factorG)
 Creates a metric config assuming a linear relation between pixels and metric coordinates.
 Config (const sal3d_metric_config &metricConfig)
 Creates a C++ Config object that holds a C sal3d_metric_config.
 Config (const Config &mc)
 Copy constructor.
Configoperator= (const Config &mc)
 Assignment operator.
 Config (const std::string &filename)
 Creates a new Config from a file.
 Config (const std::vector< float > &conf)
 Creates a new Config from a vector of floats.
 ~Config ()
 Destructor.
std::vector< float > accuracyMean () const
 Returns the mean accuracy of the calibration in x, y and z.
std::vector< float > accuracyStdDev () const
 Returns the stddev accuracy of the calibration in x, y and z.
const sal3d_metric_config & c_metric_config () const
 Returns the pointer to the internal C metric config.
std::vector< float > patternMisorientation () const
 Returns the detected pattern misorientation in the calibration.
void saveToFile (const std::string &fileName) const
 Saves the Config to a file.
std::vector< float > serialise () const
 Serialises the Config object to a vector of floats.
Point3D toPoint3D (float u, float v, float g) const
 Converts a range map point to a Point3D.
LensDistortion::Model getLensDistortionModel () const
 Get the lens distortion model associated with this configuration.

Detailed Description

Configuration associated with a camera/laser set used to convert acquired data to 3D data.

These objects have the information needed to convert Profile or RangeMap values (u, v and g) to 3D metric coordinates (X, Y and Z).

It can be obtained through calibration, with the functions provided in the Metric namespace, or it can be created based on three proportionality factors (for u, v and g). Of course, when using a Config created from factors, one cannot correct the perspective distortion effects.

The usual workflow is then to create a COP object from a RangeMap or a Frame, algthough single points can also be transformed through the method toPoint3D() provided in this class.

There are also a set of quality parameters that define how good a calibration was. They can be retrieved with accuracyMean(), accuracyStdDev() and patternMisorientation(). Some of them are only meaningful with the linear calibration, the details are specified in each method.


Constructor & Destructor Documentation

sal3d::Metric::Config::Config ( float  factorU,
float  factorV,
float  factorG 
) [inline]

Creates a metric config assuming a linear relation between pixels and metric coordinates.

Parameters:
[in]factorUThis factor specifies the distance between profiles in metric units.
[in]factorVThis factor specifies the distance between two contiguous pixels in a profile in metric units.
[in]factorGFactor applied to each pixel value to obtain the Z coordinate, i.e., the height of a point ends up being factorG times the g value of the pixel.
sal3d::Metric::Config::Config ( const sal3d_metric_config &  metricConfig) [inline, explicit]

Creates a C++ Config object that holds a C sal3d_metric_config.

The new C++ Config object will get the ownership of the C metricConfig, which means that you should not call sal3d_metric_config_release() to this metricConfig, otherwise it would be called twice.

Parameters:
[in]metricConfigThe C sal3d_metric_config to use to create this object.
Exceptions:
sal3d::ErrorOn error
sal3d::Metric::Config::Config ( const Config mc) [inline]

Copy constructor.

Parameters:
[in]mcThe Config to copy from.
Exceptions:
sal3d::ErrorOn error
sal3d::Metric::Config::Config ( const std::string &  filename) [inline, explicit]

Creates a new Config from a file.

Parameters:
[in]filenameThe name of the file to use to load the Config.
Exceptions:
sal3d::ErrorOn error
sal3d::Metric::Config::Config ( const std::vector< float > &  conf) [inline, explicit]

Creates a new Config from a vector of floats.

This is used to create a Config object from a vector of floats retrieved from serialisation.

Parameters:
[in]confVector of floats that represents a Config object.
Exceptions:
sal3d::ErrorOn error

Member Function Documentation

std::vector<float> sal3d::Metric::Config::accuracyMean ( ) const [inline]

Returns the mean accuracy of the calibration in x, y and z.

The mean accuracy of the calibration, together with the standard deviation of the accuracy, give an idea of the errors expected for scanned objects similar in size to the calibration pattern.

All x, y and z mean accuracies are given in metric units.

Warning:
The mean accuracy in x is only meaningful for the linear calibration.
Returns:
The mean accuracy of the calibration in x, y, and z, in order of the elements of the vector.
std::vector<float> sal3d::Metric::Config::accuracyStdDev ( ) const [inline]

Returns the stddev accuracy of the calibration in x, y and z.

The accuracy standard deviation of the calibration, together with the mean of the accuracy, give an idea of the errors expected for scanned objects similar in size to the calibration pattern.

All x, y and z standard deviations are given in metric units.

Warning:
The standard deviation in x is only meaningful for the linear calibration.
Returns:
The accuracy standard deviations of the calibration in x, y, and z, in order of the elements of the vector.
const sal3d_metric_config& sal3d::Metric::Config::c_metric_config ( ) const [inline]

Returns the pointer to the internal C metric config.

Warning:
Never call sal3d_metric_release() with the pointer returned by this function or the application will fail.
Returns:
The pointer to sal3d's metric config C interface.

Referenced by sal3d::COP::COP(), and sal3d::COP::fillRow().

Get the lens distortion model associated with this configuration.

This functions returns the lens distortion model that is associated with the metric configuration, which was (optionally) fed to the calibration function.

Returns:
The lens distortion model.
Config& sal3d::Metric::Config::operator= ( const Config mc) [inline]

Assignment operator.

Parameters:
[in]mcThe Config to copy to this object.
Returns:
A reference to this object.
Exceptions:
sal3d::ErrorOn error
std::vector<float> sal3d::Metric::Config::patternMisorientation ( ) const [inline]

Returns the detected pattern misorientation in the calibration.

The good results of a calibration depend on how well the pattern is oriented along the motion vector. This method returns the difference in v and g coordinates between a point of the front of the pattern, and a point of the back of the pattern. The nearer they are to zero, the better results the calibration should report.

Both v and g deviations are given in original v and g units.

Warning:
This measure is only meaningful for the linear calibration. As the static one only involves one pattern, it is not possible to extract such information.
Returns:
The deviation in v and g coordinates between a front pattern point, and a bottom pattern point.
void sal3d::Metric::Config::saveToFile ( const std::string &  fileName) const [inline]

Saves the Config to a file.

Parameters:
[in]fileNameThe name of the file to store the config.
Exceptions:
sal3d::ErrorOn error
std::vector<float> sal3d::Metric::Config::serialise ( ) const [inline]

Serialises the Config object to a vector of floats.

This vector fully represents the Config object and can be used to create another one if required.

See also:
Config(const std::vector<float> &conf)
Returns:
vector of floats representing the Config object
Point3D sal3d::Metric::Config::toPoint3D ( float  u,
float  v,
float  g 
) const [inline]

Converts a range map point to a Point3D.

Given the position of a point in the rangemap and its value, this method returns the corresponding point with metric coordinates.

Parameters:
[in]uThe range map's u coordinate. Although it will usually be an integer, we allow subcell resolution.
[in]vThe range map's v coordinate. Although it will usually be an integer, we allow subcell resolution.
[in]gThe range map's g value.
Returns:
The point 3d after converting (u, v, g) to 3D space (X, Y, Z).

References sal3d::Point3D::c_point_3d().


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