Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Static Public Member Functions | List of all members
BIAS::GenGroundTruth Class Reference

#include <Utils/GenGroundTruth.hh>

Static Public Member Functions

static void CreateIdealMatches (std::vector< BIAS::PMatrix > &pvec, unsigned num, unsigned width, unsigned height, std::vector< std::vector< BIAS::HomgPoint2D > > &matches, std::vector< BIAS::HomgPoint3D > &points, double minx=-50.0, double maxx=50.0, double miny=-50.0, double maxy=50.0, double minz=-50.0, double maxz=50.0)
 Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras. More...
 
static void CreateMatches (std::vector< BIAS::PMatrix > &pvec, unsigned num, unsigned width, unsigned height, double spatial_noise, std::vector< std::vector< BIAS::HomgPoint2D > > &i_matches, std::vector< std::vector< BIAS::HomgPoint2D > > &n_matches, std::vector< BIAS::HomgPoint3D > &points, double minx=-50.0, double maxx=50.0, double miny=-50.0, double maxy=50.0, double minz=-50.0, double maxz=50.0)
 Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras Adds spatial noise with sigma spatial_noise to position of 2D points in every camera. More...
 
static void CreateMatches (std::vector< BIAS::PMatrix > &pvec, std::vector< BIAS::PMatrix > &n_pvec, unsigned num, unsigned width, unsigned height, double spatial_noise, double r_noise, double c_noise, std::vector< std::vector< BIAS::HomgPoint2D > > &i_matches, std::vector< std::vector< BIAS::HomgPoint2D > > &n_matches, std::vector< BIAS::HomgPoint3D > &points, double minx=-50.0, double maxx=50.0, double miny=-50.0, double maxy=50.0, double minz=-50.0, double maxz=50.0, bool print=false)
 Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras. More...
 
static void CreateMatchesOutlier (std::vector< BIAS::PMatrix > &pvec, std::vector< BIAS::PMatrix > &n_pvec, unsigned num, unsigned width, unsigned height, double spatial_noise, double r_noise, double c_noise, double outlier_fraction, std::vector< std::vector< BIAS::HomgPoint2D > > &i_matches, std::vector< std::vector< BIAS::HomgPoint2D > > &n_matches, std::vector< BIAS::HomgPoint3D > &points, double minx=-50.0, double maxx=50.0, double miny=-50.0, double maxy=50.0, double minz=-50.0, double maxz=50.0, bool print=false)
 Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras. More...
 
static void DeNormalizeMatches (std::vector< BIAS::HomgPoint2D > &match1, std::vector< BIAS::HomgPoint2D > &match2, BIAS::KMatrix K)
 de-normalizes the matches by multiplying with K More...
 
static void DrawMatches (BIAS::Image< unsigned char > &im, std::vector< BIAS::HomgPoint2D > &match1, std::vector< BIAS::HomgPoint2D > &match2, unsigned char lcolor, unsigned char mcolor)
 draws the matches in image im with background 0, match in color mcolor and line defined by match in color lcolcor woelk 05 2003 More...
 
static void GenerateRandomCube (std::vector< BIAS::HomgPoint3D > &Points, int n=200, double aX=-50.0, double aY=-50.0, double aZ=-50.0, double alphaX=1.0, double alphaY=0.0, double alphaZ=0.0, double betaX=0.0, double betaY=1.0, double betaZ=0.0, double gammaX=0.0, double gammaY=0.0, double gammaZ=1.0, double alphamax=100.0, double betamax=100.0, double gammamax=100.0)
 Generates 'n' points which are all located in a cube specified by space point coords aX, aY, aZ and the coords of three spanning vectors alphaX, alphaY, alphaZ and betaX, betaY, betaZ and gammaX, gammaY, gammaZ, which are normalized internally. More...
 
static void GenerateRandomPlane (std::vector< BIAS::HomgPoint3D > &Points, int n=200, double aX=-50.0, double aY=-50.0, double aZ=0.0, double alphaX=1.0, double alphaY=0.0, double alphaZ=0.0, double betaX=0.0, double betaY=1.0, double betaZ=0.0, double alphamax=100.0, double betamax=100.0)
 Generates 'n' points which are all located on a plane specified by space point coords aX, aY, aZ and the coords of two spanning vectors alphaX, alphaY, alphaZ and betaX, betaY, betaZ, which are normalized internally. More...
 
static void NormalizeMatches (std::vector< BIAS::HomgPoint2D > &match1, std::vector< BIAS::HomgPoint2D > &match2, BIAS::KMatrix K)
 normalizes the matches by multiplying with K^-1 More...
 
static int ReadCorrespondences (const char *Filename, std::vector< BIAS::HomgPoint2D > &Points1, std::vector< BIAS::HomgPoint2D > &Points2)
 
static int ReadWorldPoints (const char *Filename, std::vector< BIAS::HomgPoint3D > &Points)
 Read 3D world coordinates from a file in binary format. More...
 
static int WriteCorrespondences (const char *Filename, std::vector< BIAS::HomgPoint2D > &Points1, std::vector< BIAS::HomgPoint2D > &Points2)
 Store 2D picture correspondences in a file in binary format, so that you can keep the full accuracy of a double. More...
 
static int WriteWorldPoints (const char *Filename, std::vector< BIAS::HomgPoint3D > &Points)
 Store 3D world coordinates in a file in binary format, so that you can keep the full accuracy of a double. More...
 

Detailed Description

Definition at line 41 of file GenGroundTruth.hh.

Member Function Documentation

void GenGroundTruth::CreateIdealMatches ( std::vector< BIAS::PMatrix > &  pvec,
unsigned  num,
unsigned  width,
unsigned  height,
std::vector< std::vector< BIAS::HomgPoint2D > > &  matches,
std::vector< BIAS::HomgPoint3D > &  points,
double  minx = -50.0,
double  maxx = 50.0,
double  miny = -50.0,
double  maxy = 50.0,
double  minz = -50.0,
double  maxz = 50.0 
)
static

Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras.

Author
woelk 05 2003

Definition at line 95 of file GenGroundTruth.cpp.

References BIAS::Random::GetUniformDistributed(), and BIAS::HomgPoint2D::Homogenize().

void GenGroundTruth::CreateMatches ( std::vector< BIAS::PMatrix > &  pvec,
unsigned  num,
unsigned  width,
unsigned  height,
double  spatial_noise,
std::vector< std::vector< BIAS::HomgPoint2D > > &  i_matches,
std::vector< std::vector< BIAS::HomgPoint2D > > &  n_matches,
std::vector< BIAS::HomgPoint3D > &  points,
double  minx = -50.0,
double  maxx = 50.0,
double  miny = -50.0,
double  maxy = 50.0,
double  minz = -50.0,
double  maxz = 50.0 
)
static

Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras Adds spatial noise with sigma spatial_noise to position of 2D points in every camera.

The ideal matches are returned in i_matches, the noisy matches are returned in n_matches.

Author
woelk 05 2003

Definition at line 140 of file GenGroundTruth.cpp.

References BIAS::Random::GetNormalDistributed(), BIAS::Random::GetUniformDistributed(), and BIAS::HomgPoint3D::Homogenize().

void GenGroundTruth::CreateMatches ( std::vector< BIAS::PMatrix > &  pvec,
std::vector< BIAS::PMatrix > &  n_pvec,
unsigned  num,
unsigned  width,
unsigned  height,
double  spatial_noise,
double  r_noise,
double  c_noise,
std::vector< std::vector< BIAS::HomgPoint2D > > &  i_matches,
std::vector< std::vector< BIAS::HomgPoint2D > > &  n_matches,
std::vector< BIAS::HomgPoint3D > &  points,
double  minx = -50.0,
double  maxx = 50.0,
double  miny = -50.0,
double  maxy = 50.0,
double  minz = -50.0,
double  maxz = 50.0,
bool  print = false 
)
static

Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras.

Adds spatial noise with a sigma of spatial_noise to position of 2D points in every camera. The ideal matches are returned in i_matches, the noisy matches are returned in n_matches. An additional normal ditributed position error with sigma of c_noise and a normal distributed rotational error with sigma of r_noise are assumed for the camera matrices. The noisy camera matrices are returned in n_pvec.

Author
woelk 05 2003

Definition at line 195 of file GenGroundTruth.cpp.

References BIAS::PMatrix::Compose(), BIAS::Random::GetNormalDistributed(), BIAS::RMatrixBase::GetRotationAnglesXYZ(), BIAS::Random::GetUniformDistributed(), BIAS::HomgPoint3D::Homogenize(), BIAS::HomgPoint2D::Homogenize(), and BIAS::RMatrixBase::SetXYZ().

void GenGroundTruth::CreateMatchesOutlier ( std::vector< BIAS::PMatrix > &  pvec,
std::vector< BIAS::PMatrix > &  n_pvec,
unsigned  num,
unsigned  width,
unsigned  height,
double  spatial_noise,
double  r_noise,
double  c_noise,
double  outlier_fraction,
std::vector< std::vector< BIAS::HomgPoint2D > > &  i_matches,
std::vector< std::vector< BIAS::HomgPoint2D > > &  n_matches,
std::vector< BIAS::HomgPoint3D > &  points,
double  minx = -50.0,
double  maxx = 50.0,
double  miny = -50.0,
double  maxy = 50.0,
double  minz = -50.0,
double  maxz = 50.0,
bool  print = false 
)
static

Generates ideal matches in cameras from pvec by randomly creating a 3D point in the cube between min[x,y,z] and max[x,y,z] and than looking if it projects into all cameras.

Adds spatial noise with a sigma of spatial_noise to position of 2D points in every camera. The ideal matches are returned in i_matches, the noisy matches are returned in n_matches. An additional normal ditributed position error with sigma of c_noise and a normal distributed rotational error with sigma of r_noise are assumed for the camera matrices. The noisy camera matrices are returned in n_pvec. outlier_fraction of the matches are outlier. They are generated by adding a random offset to each x and y of each point after image 0. The offset is generated between 2*spatial_noise and 10*spatial_noise.

Author
woelk 05 2003

Definition at line 311 of file GenGroundTruth.cpp.

References BIAS::Random::GetUniformDistributed().

void GenGroundTruth::DeNormalizeMatches ( std::vector< BIAS::HomgPoint2D > &  match1,
std::vector< BIAS::HomgPoint2D > &  match2,
BIAS::KMatrix  K 
)
static

de-normalizes the matches by multiplying with K

Author
woelk 05 2003

Definition at line 51 of file GenGroundTruth.cpp.

void GenGroundTruth::DrawMatches ( BIAS::Image< unsigned char > &  im,
std::vector< BIAS::HomgPoint2D > &  match1,
std::vector< BIAS::HomgPoint2D > &  match2,
unsigned char  lcolor,
unsigned char  mcolor 
)
static

draws the matches in image im with background 0, match in color mcolor and line defined by match in color lcolcor woelk 05 2003

Definition at line 61 of file GenGroundTruth.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::HomgLine2D::GetIntersectionsWithImage(), BIAS::ImageBase::GetWidth(), and BIAS::HomgLine2D::Set().

void GenGroundTruth::GenerateRandomCube ( std::vector< BIAS::HomgPoint3D > &  Points,
int  n = 200,
double  aX = -50.0,
double  aY = -50.0,
double  aZ = -50.0,
double  alphaX = 1.0,
double  alphaY = 0.0,
double  alphaZ = 0.0,
double  betaX = 0.0,
double  betaY = 1.0,
double  betaZ = 0.0,
double  gammaX = 0.0,
double  gammaY = 0.0,
double  gammaZ = 1.0,
double  alphamax = 100.0,
double  betamax = 100.0,
double  gammamax = 100.0 
)
static

Generates 'n' points which are all located in a cube specified by space point coords aX, aY, aZ and the coords of three spanning vectors alphaX, alphaY, alphaZ and betaX, betaY, betaZ and gammaX, gammaY, gammaZ, which are normalized internally.

'alphamax', 'betamax' and 'gammamax' define width, height and depth of the cube. This method does not clear the result vector 'Points'! By default it generates 200 points on a rectangular 100x100x100 cube centered at 0 0 0.

Author
Matthias Dunda 08 2003

Definition at line 388 of file GenGroundTruth.cpp.

References BIAS::Random::GetUniformDistributed(), and BIAS::Vector3< T >::Normalize().

void GenGroundTruth::GenerateRandomPlane ( std::vector< BIAS::HomgPoint3D > &  Points,
int  n = 200,
double  aX = -50.0,
double  aY = -50.0,
double  aZ = 0.0,
double  alphaX = 1.0,
double  alphaY = 0.0,
double  alphaZ = 0.0,
double  betaX = 0.0,
double  betaY = 1.0,
double  betaZ = 0.0,
double  alphamax = 100.0,
double  betamax = 100.0 
)
static

Generates 'n' points which are all located on a plane specified by space point coords aX, aY, aZ and the coords of two spanning vectors alphaX, alphaY, alphaZ and betaX, betaY, betaZ, which are normalized internally.

'alphamax' and 'betamax' define width and height of the plane. This method does not clear the result vector 'Points'! By default it generates 200 points on a rectangular 100x100 plane in the x-y-plane. This method implicitly calls GenerateRandomCube with the third dimension set to zero.

Author
Matthias Dunda 08 2003

Definition at line 373 of file GenGroundTruth.cpp.

void GenGroundTruth::NormalizeMatches ( std::vector< BIAS::HomgPoint2D > &  match1,
std::vector< BIAS::HomgPoint2D > &  match2,
BIAS::KMatrix  K 
)
static

normalizes the matches by multiplying with K^-1

Author
woelk 05 2003

Definition at line 40 of file GenGroundTruth.cpp.

References BIAS::KMatrix::Invert().

int GenGroundTruth::ReadCorrespondences ( const char *  Filename,
std::vector< BIAS::HomgPoint2D > &  Points1,
std::vector< BIAS::HomgPoint2D > &  Points2 
)
static

Definition at line 420 of file GenGroundTruth.cpp.

References BIAS::HomgPoint2D.

int GenGroundTruth::ReadWorldPoints ( const char *  Filename,
std::vector< BIAS::HomgPoint3D > &  Points 
)
static

Read 3D world coordinates from a file in binary format.

tested

Author
mdunda

Definition at line 480 of file GenGroundTruth.cpp.

References BIAS::HomgPoint3D.

int GenGroundTruth::WriteCorrespondences ( const char *  Filename,
std::vector< BIAS::HomgPoint2D > &  Points1,
std::vector< BIAS::HomgPoint2D > &  Points2 
)
static

Store 2D picture correspondences in a file in binary format, so that you can keep the full accuracy of a double.

tested

Author
mdunda

Definition at line 454 of file GenGroundTruth.cpp.

int GenGroundTruth::WriteWorldPoints ( const char *  Filename,
std::vector< BIAS::HomgPoint3D > &  Points 
)
static

Store 3D world coordinates in a file in binary format, so that you can keep the full accuracy of a double.

tested

Author
mdunda

Definition at line 507 of file GenGroundTruth.cpp.


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