[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

hugin_utils Namespace Reference

namespace for various utils More...


Classes

struct  hugin_utils::GraphEdge
struct  hugin_utils::RemoveVisitor
 removes vertices from the set More...
struct  hugin_utils::TrackVisitor
 remember/track all visited vertices More...
struct  hugin_utils::TDiff2D< T >
class  hugin_utils::LMS_Solver
 Solve a linear least squares problem. More...

Typedefs

typedef std::vector< int > AdjList
typedef std::vector< AdjListAdjListGraph
typedef TDiff2D< doubleFDiff2D

Functions

void sortd (int length, double *a, int *ind)
void eig_jacobi (int n, double a[3][3], double v[3][3], double *d, int *ind, int *maxsweep, int *maxannil, double *epsilon)
 Implements jacobi eigenvalue/vector algorithm on a symmetric matrix stored as a 2 dimensional matrix a[n][n] and computes the eigenvectors in another globally allocated matrix v[n][n].
void findSubGraphs (AdjListGraph &graph, std::vector< int > &subgraphStart)
 find subgraphs
template<class FUNCTOR>
void traverseEdges (const AdjListGraph &graph, int startNode, FUNCTOR &visitor)
 traverse a graph, and run visitor on every vertice - vertice edge encounterd
template<class FUNCTOR>
void traverseVertices (const AdjListGraph &graph, int start, FUNCTOR &visitor)
 traverse graph vertices
double round (double x)
float roundf (float x)
int ceili (double x)
int floori (double x)
template<class T>
int roundi (T x)
int isnan (double x)
template<class T>
simpleClipPoint (const T &point, const T &min, const T &max)
 clip a point to fit int [min, max] does not do a mathematical clipping, just sets p.x and p.y to the borders if they are outside.
template<class T>
sqr (T t)
template<class T>
double norm (T t)
template<class InputIterator1, class InputIterator2>
double euclid_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
 calculate squared Euclidean distance between two vectors.
template<class InputIterator1, class InputIterator2, class T>
sqr_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T res)
 calculate squared Euclidean distance between two vectors.
template<class POINT>
vigra::Rect2D calcCircleROIFromPoints (const POINT &p1, const POINT &p2)
 calculate the bounding box of a circle that goes through both points.
int getCPUCount ()
 return the CPU count. On error returns a cpu count of 0 or -1
template<class str>
str quoteStringInternal (const str &arg, const str &quotechar, const str &replacements)
 utility function; escapes characters in replacements with quotechar.
template<class str>
str quoteString (const str &arg)
 Try to escape special chars on windows and linux.
template<class str>
str quoteStringShell (const str &arg)
 Try to escape special chars in a string used by a unix type shell.
template<class str>
str escapeStringMake (const str &arg)
 Escape dangerous chars in makefile strings/filenames (space),#,=.
template<class str>
str quoteFilename (const str &arg)
 Quote a filename, so that it is surrounded by "".
std::string tolower (const std::string &s)
 convert a string to lowercase
std::string CurrentTime ()
 current time as a string
std::string getExtension (const std::string &basename2)
 Get extension of a filename.
std::string stripExtension (const std::string &basename2)
 remove extension of a filename
std::string stripPath (const std::string &filename)
 remove the path of a filename (mainly useful for gui display of filenames)
std::string getPathPrefix (const std::string &filename)
 Get the path to a filename.
std::string doubleToString (double d, int digits)
 convert a double to a string, suitable for display within a GUI.
void ControlPointErrorColour (const double cperr, double &r, double &g, double &b)
template<typename STR>
bool stringToDouble (const STR &str_, double &dest)
 convert a string to a double, ignore localisation.
template<typename Target, typename Source>
Target lexical_cast (Source arg)
template<class str>
str QuoteStringInternal (const str &arg, const str &quotechar, const str &replacements)
template<class str>
str replaceAll (const str &arg, const str &target, const str &replacement)


Detailed Description

namespace for various utils

Typedef Documentation

typedef std::vector<int> hugin_utils::AdjList
 

typedef std::vector<AdjList> hugin_utils::AdjListGraph
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true hugin_utils::FDiff2D
 


Function Documentation

template<class POINT>
vigra::Rect2D calcCircleROIFromPoints const POINT &  p1,
const POINT &  p2
 

calculate the bounding box of a circle that goes through both points.

the center of the circle is halfway between the two points

int ceili double  x  )  [inline]
 

IMPEX void hugin_utils::ControlPointErrorColour const double  cperr,
double r,
double g,
double b
 

IMPEX std::string hugin_utils::CurrentTime  ) 
 

current time as a string

IMPEX std::string hugin_utils::doubleToString double  d,
int  fractionaldigits = -1
 

convert a double to a string, suitable for display within a GUI.

d value to convert t a string fractionaldigits number of fractional digits. -1: not specified, use default.

void hugin_utils::eig_jacobi int  n,
double  a[3][3],
double  v[3][3],
double d,
int *  ind,
int *  maxsweep,
int *  maxannil,
double epsilon
 

Implements jacobi eigenvalue/vector algorithm on a symmetric matrix stored as a 2 dimensional matrix a[n][n] and computes the eigenvectors in another globally allocated matrix v[n][n].

intput: n - size of matrix problem outputs: v - eigenvector matrix d[MAX] - a vector of unsorted eigenvalues ind[MAX] - a vector of indicies sorting d[] into descending order maxanil - number of rotations applied inputs/outputs a - input matrix (the input is changed) maxsweep - on input max number of sweeps

  • on output actual number of sweeps epsilon - on input tolerance to consider offdiagonal elements as zero
  • on output sum of offdiagonal elements

template<class str>
str escapeStringMake const str &  arg  ) 
 

Escape dangerous chars in makefile strings/filenames (space),#,=.

template<class InputIterator1, class InputIterator2>
double euclid_dist InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2
 

calculate squared Euclidean distance between two vectors.

void hugin_utils::findSubGraphs AdjListGraph graph,
std::vector< int > &  subgraphStart
 

find subgraphs

Actually, we could just use the BOOST graph library instead of hacking our own graph functions.

int floori double  x  )  [inline]
 

IMPEX int hugin_utils::getCPUCount  ) 
 

return the CPU count. On error returns a cpu count of 0 or -1

IMPEX std::string hugin_utils::getExtension const std::string &  basename  ) 
 

Get extension of a filename.

IMPEX std::string hugin_utils::getPathPrefix const std::string &  filename  ) 
 

Get the path to a filename.

int isnan double  x  )  [inline]
 

template<typename Target, typename Source>
Target lexical_cast Source  arg  ) 
 

template<class T>
double norm t  ) 
 

template<class str>
str quoteFilename const str &  arg  ) 
 

Quote a filename, so that it is surrounded by "".

I don't know the escape char for windows

template<class str>
str quoteString const str &  arg  ) 
 

Try to escape special chars on windows and linux.

: I'm quite sure that this routine doesn't replace some important shell chars I don't know of. This could lead to nasty behaviour and maybe even security holes.

template<class str>
str QuoteStringInternal const str &  arg,
const str &  quotechar,
const str &  replacements
 

template<class str>
str quoteStringInternal const str &  arg,
const str &  quotechar,
const str &  replacements
 

utility function; escapes characters in replacements with quotechar.

template<class str>
str quoteStringShell const str &  arg  ) 
 

Try to escape special chars in a string used by a unix type shell.

: I'm quite sure that this routine doesn't replace some important shell chars I don't know of. This could lead to nasty behaviour and maybe even security holes.

Note that : and = are not special shell charaters but they also should be escaped because they causes problems with gnumake.

template<class str>
str replaceAll const str &  arg,
const str &  target,
const str &  replacement
 

double hugin_utils::round double  x  )  [inline]
 

float hugin_utils::roundf float  x  )  [inline]
 

template<class T>
int roundi x  )  [inline]
 

template<class T>
T simpleClipPoint const T &  point,
const T &  min,
const T &  max
 

clip a point to fit int [min, max] does not do a mathematical clipping, just sets p.x and p.y to the borders if they are outside.

void sortd int  length,
double a,
int *  ind
 

template<class T>
T sqr t  ) 
 

template<class InputIterator1, class InputIterator2, class T>
T sqr_dist InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
res
 

calculate squared Euclidean distance between two vectors.

template<typename STR>
bool stringToDouble const STR &  str_,
double dest
 

convert a string to a double, ignore localisation.

always accept both.

sets dest to the new value, and returns true if it could be read.

it the conversion fails, returns false and does not modify dest.

Returns:
success

IMPEX std::string hugin_utils::stripExtension const std::string &  basename  ) 
 

remove extension of a filename

IMPEX std::string hugin_utils::stripPath const std::string &  filename  ) 
 

remove the path of a filename (mainly useful for gui display of filenames)

std::string tolower const std::string &  s  )  [inline]
 

convert a string to lowercase

template<class FUNCTOR>
void traverseEdges const AdjListGraph graph,
int  startNode,
FUNCTOR &  visitor
 

traverse a graph, and run visitor on every vertice - vertice edge encounterd

template<class FUNCTOR>
void traverseVertices const AdjListGraph graph,
int  start,
FUNCTOR &  visitor
 

traverse graph vertices


Generated on Mon Sep 20 01:01:35 2010 for Hugintrunk by doxygen 1.3.9.1