AURobotServers  4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
UCalibrationMarkSets Class Reference

#include <ucalibrate.h>

Public Member Functions

void clear ()
 
int countSetsWith (unsigned int codeValue)
 
bool doEstimateCameraParameters (UCamPar *oldEstimate, bool debug)
 
bool doEstimateCameraParametersBinary (UCamPar *oldEstimate, bool debug, unsigned long setsToUse, bool alsoFocalLength, bool alsoK1, bool alsoK2)
 
bool doEstimateCameraParametersCarpet (UCamPar *oldEstimate, bool debug)
 
UPosition getCalibrationChartPosition ()
 
UCamPargetCamPar ()
 
UCalibrationMarkSetgetNewSet ()
 
int getSavedSets ()
 
UCalibrationMarkSetgetSet (int setNumber)
 
UCalibrationMarkSetgetThisSet (unsigned int codeValue, int nth)
 
bool saveNewSet (UCalibrationMarkSet *frameSet)
 
void setCalibrationChartPosition (UPosition newChartPos)
 
void setCameraParameters (float hx, float hy, float k1, float k2, float f, float resFactor, char *name)
 
void setCameraParameters (UCamPar *camPar)
 
void toLog (const char *info, int significance, UTime *timestamp=NULL)
 
 UCalibrationMarkSets ()
 
 ~UCalibrationMarkSets ()
 

Private Member Functions

float evaluatek1PixError (UCalibrationMarkSet *cset[], unsigned int sets_used, const float hx, const float hy, const float k1min, float k1max, float *k1e, int steps1, const float k2min, float k2max, float *k2e, int steps2, const float c, float pixSize, bool alsoK1, bool alsoK2)
 
float evaluatek2PixError (UCalibrationMarkSet *cset[], unsigned int sets_used, const float hx, const float hy, const float k1, const float k2min, float k2max, float *k2e, int steps, const float c, float pixSize, bool alsoK2)
 
float evaluatePixError (UCalibrationMarkSet *cset[], unsigned int sets_used, const float hx, const float hy, const float k1, const float k2, const float c, float pixSize)
 

Private Attributes

UPosition chartPos
 
UCamParEst estCamPar
 
UCalibrationMarkSet set [MAX_CALIBRATION_SETS_SAVED]
 
int setCnt
 

Detailed Description

Class to hold calibration mark sets for a number of images (or for a number of barcode frames). For each frame the position of all frame positions are saved for calibrtion purposes or for calculation of camera or barcode position.

Constructor & Destructor Documentation

UCalibrationMarkSets::UCalibrationMarkSets ( )

Constructor

UCalibrationMarkSets::~UCalibrationMarkSets ( )
inline

Destructor

Member Function Documentation

void UCalibrationMarkSets::clear ( void  )

initialize flags.

int UCalibrationMarkSets::countSetsWith ( unsigned int  codeValue)

Returns count of data sets with this barcode value.

bool UCalibrationMarkSets::doEstimateCameraParameters ( UCamPar oldEstimate,
bool  debug 
)

Calculate camera internal parameters. Assume that each set has an associated chart position. Make an parameter least square estimate based in 4 corners in each (of 5) dataset. With the new estimate make a new position estimate for each set, then verify error size, to exit if error is minimum. REturns false if no result.

References UCalibrationMarkSet::evaluateChartPosRot(), UCalibrationMarkSet::geterrorInPixels(), UCalibrationMark::ix, UCalibrationMark::iy, UCalibrationMarkSet::mark, UCalibrationMarkSet::markCnt, UCalibrationMarkSet::pixSize, UCalibrationMarkSet::posBarcode, UCalibrationMarkSet::rotBarcode, UCalibrationMark::rx, UCalibrationMark::ry, UPosition::set(), and UCalibrationComponents::toLog().

bool UCalibrationMarkSets::doEstimateCameraParametersBinary ( UCamPar oldEstimate,
bool  debug,
unsigned long  setsToUse,
bool  alsoFocalLength,
bool  alsoK1,
bool  alsoK2 
)
bool UCalibrationMarkSets::doEstimateCameraParametersCarpet ( UCamPar oldEstimate,
bool  debug 
)
float UCalibrationMarkSets::evaluatek1PixError ( UCalibrationMarkSet cset[],
unsigned int  sets_used,
const float  hx,
const float  hy,
const float  k1min,
float  k1max,
float *  k1e,
int  steps1,
const float  k2min,
float  k2max,
float *  k2e,
int  steps2,
const float  c,
float  pixSize,
bool  alsoK1,
bool  alsoK2 
)
private

Estimate k1 and k2 parameters within the provided limits using binary search. Returns pixel error on best estimate and estimated parameters in 'k1e' and 'k2e' parameter.

References UCalibrationComponents::toLog().

float UCalibrationMarkSets::evaluatek2PixError ( UCalibrationMarkSet cset[],
unsigned int  sets_used,
const float  hx,
const float  hy,
const float  k1,
const float  k2min,
float  k2max,
float *  k2e,
int  steps,
const float  c,
float  pixSize,
bool  alsoK2 
)
private

Estimate k2 parameter within the provided limits using a binary search. Returns pixel error on best estimate and estimated parameter in 'k2e' parameter.

float UCalibrationMarkSets::evaluatePixError ( UCalibrationMarkSet cset[],
unsigned int  sets_used,
const float  hx,
const float  hy,
const float  k1,
const float  k2,
const float  c,
float  pixSize 
)
private

Evaluate position and rotation of each guidemark with this set of parameters and return the average pixel error.

References UCalibrationMarkSet::evaluateChartPosRot(), UCalibrationMarkSet::geterrorInPixels(), UCalibrationMarkSet::posBarcode, and UCalibrationMarkSet::rotBarcode.

UPosition UCalibrationMarkSets::getCalibrationChartPosition ( )
inline

Get calibration chart position

UCamPar* UCalibrationMarkSets::getCamPar ( )
inline

Get pointer to camera parameters used in estimation process.

References UCalibXYStat::clear().

UCalibrationMarkSet * UCalibrationMarkSets::getNewSet ( )

Get new calibration mark set - if any more space.

References UCalibrationMarkSet::clear(), MAX_CALIBRATION_SETS_SAVED, and mini().

int UCalibrationMarkSets::getSavedSets ( )

Get number of (valid) saved sets

UCalibrationMarkSet * UCalibrationMarkSets::getSet ( int  setNumber)

Get pointer to calibration set. Returns NULL if not within range present count.

UCalibrationMarkSet * UCalibrationMarkSets::getThisSet ( unsigned int  codeValue,
int  nth 
)

Get a pointer to the n'th set with this barcode value. first set with this code has number 0. Returns NULL if it do not exist.

bool UCalibrationMarkSets::saveNewSet ( UCalibrationMarkSet frameSet)

Save this barcode position set for later camera parameter estimation purpose. If no more space for sets or set is not valid, then return false.

References UCalibrationMarkSet::barcodeValid, and UCalibrationMarkSet::valid.

void UCalibrationMarkSets::setCalibrationChartPosition ( UPosition  newChartPos)
inline

Set new calibration chart position

void UCalibrationMarkSets::setCameraParameters ( float  hx,
float  hy,
float  k1,
float  k2,
float  f,
float  resFactor,
char *  name 
)
inline

Set camera parameters

void UCalibrationMarkSets::setCameraParameters ( UCamPar camPar)
inline

Set camera parameters from copy

void UCalibrationMarkSets::toLog ( const char *  info,
int  significance,
UTime timestamp = NULL 
)
inline

Save this message in logfile if significance is less than logLevel. Print also to console (debug feature) if verbose messages. Timestamp is optional, if not used, then Now() is used in logfile.

References toLogGmk().

Member Data Documentation

UPosition UCalibrationMarkSets::chartPos
private

Known position of the calibration chart. for camera position evaluation Set from configuration file, or manually.

UCamParEst UCalibrationMarkSets::estCamPar
private

Estimated camera internal parameters.

UCalibrationMarkSet UCalibrationMarkSets::set[MAX_CALIBRATION_SETS_SAVED]
private

One set of calibration marks for each (possible) camera device.

int UCalibrationMarkSets::setCnt
private

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