Classes | Defines | Functions
calibration.hpp File Reference

Declarations for generic geometric calibration. More...

#include "improc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <sys/stat.h>
#include <stdio.h>
Include dependency graph for calibration.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mserPatch
 Class enables for storing an MSER feature beyond simply its bounding points. More...

Defines

#define ALL_PATTERNS_OPTIMIZATION_CODE   0
#define BEST_OF_RANDOM_PATTERNS_OPTIMIZATION_CODE   4
#define CHESSBOARD_FINDER_CODE   0
#define DEBUG_MODE   0
#define ENHANCED_MCM_OPTIMIZATION_CODE   3
#define EXHAUSTIVE_SEARCH_OPTIMIZATION_CODE   5
#define EXTENDED_CHESSBOARD_FINDER   5
#define FIRST_N_PATTERNS_OPTIMIZATION_CODE   2
#define FOLD_COUNT   1
#define HEATED_CHESSBOARD_FINDER_CODE   2
#define INVERTED_OPENCV_CHESSBOARD_FINDER   10
#define MASK_FINDER   3
#define MASK_FINDER_CODE   1
#define MASK_FINDER_INNERS   8
#define MAX_CAMS   3
#define MAX_CANDIDATE_PATTERNS   100
#define MAX_CORNER_SEPARATION   100
#define MAX_FRAMES_PER_INPUT   5000
#define MAX_FRAMES_TO_LOAD   1000
#define MAX_PATTERNS_PER_SET   10
#define MAX_PATTERNS_TO_KEEP   500
#define MAX_SEARCH_DIST   3
#define MIN_CORNER_SEPARATION   3
#define MIN_DISTANCE_FROM_EDGE   2
#define MINIMUM_CORRECTION_DISTANCE   1
#define MINIMUM_MSER_AREA   50
#define PATCH_CORRECTION_INTRINSICS_FLAGS   CV_CALIB_RATIONAL_MODEL
#define PATTERN_FINDER_CV_CORNER_SUBPIX_FLAG   4
#define PI   3.14159265
#define RADIAL_LENGTH   1000
#define RANDOM_SEED_OPTIMIZATION_CODE   6
#define RANDOM_SET_OPTIMIZATION_CODE   1
#define REGULAR_OPENCV_CHESSBOARD_FINDER   0
#define SCORE_BASED_OPTIMIZATION_CODE   7
#define TRACKING   0

Functions

void addToBinMap (Mat &binMap, cv::vector< Point2f > &cornerSet, Size imSize)
 Add a cornerset to the tally matrix.
void addToDistributionMap (Mat &distributionMap, vector< Point2f > &corners)
 Measures the coverage of a cameras field of view by analysing the distribution tally.
void addToRadialDistribution (double *radialDistribution, cv::vector< Point2f > &cornerSet, Size imSize)
 Adds a pointset to a radial distribution array.
bool checkAcutance ()
 Checks validity of image for calibration.
void clusterFilter (vector< mserPatch > &patches, vector< vector< Point > > &msers, int totalPatches)
 Filters out MSERs that cannot possibly be part of the geometric pattern.
bool correctPatchCentres (const Mat &image, Size patternSize, vector< Point2f > &patchCentres, int mode)
 Uses contrast enhancement etc to improve positional estimates of patch centres.
void debugDisplayPatches (const Mat &image, vector< vector< Point > > &msers)
 Visually display patches on image.
void debugDisplayPattern (const Mat &image, Size patternSize, Mat &corners, bool mode=true, double delay=0.0)
 Visually pattern on image.
void determineFindablePatches (Size patternSize, int mode, int *XVec, int *YVec)
 Determines how many patches can be found in each row and extreme columns.
void determinePatchDistribution (Size patternSize, int mode, int &rows, int &cols, int &quant)
 Determines the distribution of patches based on pattern dimensions and pattern type.
void enclosureFilter (vector< mserPatch > &patches, vector< vector< Point > > &msers)
 Filters out MSERs that are enclosed by or enclose true patches.
void findAllPatches (const Mat &image, Size patternSize, vector< vector< Point > > &msers, int mserDelta=8, float max_var=0.25, float min_div=0.2, double area_threshold=1.01)
 Find all patches (MSERS - using default settings) in an image.
int findBestCorners (const Mat &image, vector< Point2f > &src, vector< Point2f > &dst, Size patternSize, int detector, int searchDist=MAX_SEARCH_DIST)
 Returns the subpixel location of the corner given a decent estimate.
void findCornerPatches (Size imageSize, Size patternSize, int mode, int *XVec, int *YVec, vector< Point2f > &patchCentres, vector< Point2f > &remainingPatches)
 Finds (or simulates) the four corners patches in a pattern.
void findEdgePatches (Size patternSize, int mode, int *XVec, int *YVec, vector< Point2f > &patchCentres, vector< Point2f > &remainingPatches)
 Finds (or simulates) the edge patches in a pattern.
void findInteriorPatches (Size patternSize, int mode, int *XVec, int *YVec, vector< Point2f > &patchCentres, vector< Point2f > &remainingPatches)
 Finds (or simulates) the interior patches in a pattern.
bool findMaskCorners (const Mat &image, Size patternSize, vector< Point2f > &corners, int detector=0, int mserDelta=8, float max_var=0.25, float min_div=0.2, double area_threshold=1.01)
 MSER-clustering mask corner locater.
bool findPatchCorners (const Mat &image, Size patternSize, Mat &homography, vector< Point2f > &corners, vector< Point2f > &patchCentres2f, int mode, int detector=0)
 Estimates the co-ordinates of the corners of the patches.
bool findPatternCentres (const Mat &image, Size patternSize, vector< Point2f > &centres, int mode)
 Finds just the MSER centres from an image.
bool findPatternCorners (const Mat &image, Size patternSize, vector< Point2f > &corners, int mode, int detector=0, int mserDelta=8, float max_var=0.25, float min_div=0.2, double area_threshold=1.01)
 Core pattern-finding function.
void generateRandomIndexArray (int *randomArray, int maxElements, int maxVal)
 Generates a random set of indices from a valid range.
void groupPointsInQuads (Size patternSize, vector< Point2f > &corners)
 Converts points ordering from row-by-row to quad-clustered.
void initialRefinementOfCorners (const Mat &imGrey, vector< Point2f > &src, Size patternSize)
 Initial attempt to correct locations of all corners based on estimates from MSER centroids.
void interpolateCornerLocations2 (const Mat &image, int mode, Size patternSize, vector< Point2f > &vCentres, vector< Point2f > &vCorners)
 Estimate the locations of patch corners based on patch centroids.
double obtainSetScore (Mat &distributionMap, Mat &binMap, Mat &gaussianMat, cv::vector< Point2f > &cornerSet, double *radialDistribution)
 Calculate the score for a pointset in terms of its contribution to calibration.
bool patternInFrame (Size imSize, vector< Point2f > &patternPoints, int minBorder=2)
 Checks that the entire pattern is inside the frame by at least a specified margin.
void prepForDisplay (const Mat &distributionMap, Mat &distributionDisplay)
 Blurs and enhances a distribution map to make it more displayable.
void randomCulling (vector< std::string > &inputList, int maxSearch)
 Randomly cuts down a list of input files.
void randomCulling (vector< std::string > &inputList, int maxSearch, vector< vector< Point2f > > &patterns)
 Culls some patterns from a vector, and from the corresponding names list.
void randomCulling (vector< std::string > &inputList, int maxSearch, vector< vector< vector< Point2f > > > &patterns)
 Culls some sets of patterns from a vector vector, and from the corresponding names list.
void reduceCluster (vector< mserPatch > &patches, vector< vector< Point > > &msers, int totalPatches)
 Filters out most deviant patches to retain only the correct number for the pattern.
void refineCornerPositions (const Mat &image, Size patternSize, vector< Point2f > &vCorners)
 Refines positions of corners through iterative local homography mappings.
bool refinePatches (const Mat &image, Size patternSize, vector< vector< Point > > &msers, vector< Point2f > &patchCentres, int mode)
 Applies various area, colour and positional filters to reduce no. of patches to desired amount.
void reorderPatches (Size patternSize, int mode, int *XVec, int *YVec, vector< Point2f > &patchCentres)
 Re-orders patches into row by row, left to right.
void shapeFilter (vector< mserPatch > &patches, vector< vector< Point > > &msers)
 Filters out MSERs that do not have a realistic shape.
void sortCorners (Size imageSize, Size patternSize, vector< Point2f > &corners)
 Sorts the corners into a standard order to prepare for calibration.
void sortPatches (Size imageSize, Size patternSize, vector< Point2f > &patchCentres, int mode)
 Sorts the patches into a standard order to prepare for homography.
void transferMserElement (vector< vector< Point > > &dst, vector< vector< Point > > &src, int index)
 Move a vector of points from one vector of vectors to another.
void transferPatchElement (vector< mserPatch > &dst, vector< mserPatch > &src, int index)
 Move an MSER-patch from one vector to another, resizing and shifting the old vector.
void varianceFilter (vector< mserPatch > &patches, vector< vector< Point > > &msers)
 Filters out MSERs that have a large amount of internal pixel intensity variance.
bool verifyCorners (Size imSize, Size patternSize, vector< Point2f > &patternPoints, double minDist=MIN_CORNER_SEPARATION, double maxDist=MAX_CORNER_SEPARATION)
 Verifies that the final patches do actually represent a grid pattern.
bool verifyPatches (Size imSize, Size patternSize, vector< Point2f > &patchCentres, int mode, double minDist, double maxDist)
 Verifies that the final patches do actually represent a grid pattern.
bool verifyPattern (Size imSize, Size patternSize, vector< Point2f > &patternPoints, double minDist, double maxDist)
 Generic grid verification function.

Detailed Description

Declarations for generic geometric calibration.

Definition in file calibration.hpp.


Define Documentation

Definition at line 35 of file calibration.hpp.

Definition at line 39 of file calibration.hpp.

#define CHESSBOARD_FINDER_CODE   0

Definition at line 28 of file calibration.hpp.

#define DEBUG_MODE   0

Definition at line 44 of file calibration.hpp.

Definition at line 38 of file calibration.hpp.

Definition at line 40 of file calibration.hpp.

Definition at line 62 of file calibration.hpp.

Definition at line 37 of file calibration.hpp.

#define FOLD_COUNT   1

Definition at line 52 of file calibration.hpp.

Definition at line 30 of file calibration.hpp.

Definition at line 63 of file calibration.hpp.

#define MASK_FINDER   3

Definition at line 60 of file calibration.hpp.

#define MASK_FINDER_CODE   1

Definition at line 29 of file calibration.hpp.

#define MASK_FINDER_INNERS   8

Definition at line 61 of file calibration.hpp.

#define MAX_CAMS   3

Definition at line 56 of file calibration.hpp.

#define MAX_CANDIDATE_PATTERNS   100

Definition at line 70 of file calibration.hpp.

#define MAX_CORNER_SEPARATION   100

Definition at line 33 of file calibration.hpp.

#define MAX_FRAMES_PER_INPUT   5000

Definition at line 67 of file calibration.hpp.

#define MAX_FRAMES_TO_LOAD   1000

Definition at line 68 of file calibration.hpp.

#define MAX_PATTERNS_PER_SET   10

Definition at line 71 of file calibration.hpp.

#define MAX_PATTERNS_TO_KEEP   500

Definition at line 69 of file calibration.hpp.

#define MAX_SEARCH_DIST   3

Definition at line 57 of file calibration.hpp.

#define MIN_CORNER_SEPARATION   3

Definition at line 32 of file calibration.hpp.

#define MIN_DISTANCE_FROM_EDGE   2

Definition at line 65 of file calibration.hpp.

Definition at line 46 of file calibration.hpp.

#define MINIMUM_MSER_AREA   50

Definition at line 73 of file calibration.hpp.

#define PATCH_CORRECTION_INTRINSICS_FLAGS   CV_CALIB_RATIONAL_MODEL

Definition at line 75 of file calibration.hpp.

Definition at line 48 of file calibration.hpp.

#define PI   3.14159265

Definition at line 54 of file calibration.hpp.

#define RADIAL_LENGTH   1000

Definition at line 51 of file calibration.hpp.

Definition at line 41 of file calibration.hpp.

Definition at line 36 of file calibration.hpp.

Definition at line 59 of file calibration.hpp.

Definition at line 42 of file calibration.hpp.

#define TRACKING   0

Definition at line 50 of file calibration.hpp.


Function Documentation

void addToBinMap ( Mat &  binMap,
cv::vector< Point2f > &  cornerSet,
Size  imSize 
)

Add a cornerset to the tally matrix.

Definition at line 1685 of file calibration.cpp.

void addToDistributionMap ( Mat &  distributionMap,
vector< Point2f > &  corners 
)

Measures the coverage of a cameras field of view by analysing the distribution tally.

Definition at line 1792 of file calibration.cpp.

void addToRadialDistribution ( double *  radialDistribution,
cv::vector< Point2f > &  cornerSet,
Size  imSize 
)

Adds a pointset to a radial distribution array.

Definition at line 1763 of file calibration.cpp.

bool checkAcutance ( )

Checks validity of image for calibration.

Definition at line 142 of file calibration.cpp.

void clusterFilter ( vector< mserPatch > &  patches,
vector< vector< Point > > &  msers,
int  totalPatches 
)

Filters out MSERs that cannot possibly be part of the geometric pattern.

Definition at line 3891 of file calibration.cpp.

bool correctPatchCentres ( const Mat &  image,
Size  patternSize,
vector< Point2f > &  patchCentres,
int  mode 
)

Uses contrast enhancement etc to improve positional estimates of patch centres.

Definition at line 3115 of file calibration.cpp.

void debugDisplayPatches ( const Mat &  image,
vector< vector< Point > > &  msers 
)

Visually display patches on image.

Definition at line 320 of file calibration.cpp.

void debugDisplayPattern ( const Mat &  image,
Size  patternSize,
Mat &  corners,
bool  mode = true,
double  delay = 0.0 
)

Visually pattern on image.

Definition at line 1296 of file calibration.cpp.

void determineFindablePatches ( Size  patternSize,
int  mode,
int *  XVec,
int *  YVec 
)

Determines how many patches can be found in each row and extreme columns.

Definition at line 344 of file calibration.cpp.

void determinePatchDistribution ( Size  patternSize,
int  mode,
int &  rows,
int &  cols,
int &  quant 
)

Determines the distribution of patches based on pattern dimensions and pattern type.

Definition at line 149 of file calibration.cpp.

void enclosureFilter ( vector< mserPatch > &  patches,
vector< vector< Point > > &  msers 
)

Filters out MSERs that are enclosed by or enclose true patches.

Definition at line 3658 of file calibration.cpp.

void findAllPatches ( const Mat &  image,
Size  patternSize,
vector< vector< Point > > &  msers,
int  mserDelta = 8,
float  max_var = 0.25,
float  min_div = 0.2,
double  area_threshold = 1.01 
)

Find all patches (MSERS - using default settings) in an image.

Definition at line 166 of file calibration.cpp.

int findBestCorners ( const Mat &  image,
vector< Point2f > &  src,
vector< Point2f > &  dst,
Size  patternSize,
int  detector,
int  searchDist = MAX_SEARCH_DIST 
)

Returns the subpixel location of the corner given a decent estimate.

Definition at line 2675 of file calibration.cpp.

void findCornerPatches ( Size  imageSize,
Size  patternSize,
int  mode,
int *  XVec,
int *  YVec,
vector< Point2f > &  patchCentres,
vector< Point2f > &  remainingPatches 
)

Finds (or simulates) the four corners patches in a pattern.

Definition at line 424 of file calibration.cpp.

void findEdgePatches ( Size  patternSize,
int  mode,
int *  XVec,
int *  YVec,
vector< Point2f > &  patchCentres,
vector< Point2f > &  remainingPatches 
)

Finds (or simulates) the edge patches in a pattern.

Definition at line 687 of file calibration.cpp.

void findInteriorPatches ( Size  patternSize,
int  mode,
int *  XVec,
int *  YVec,
vector< Point2f > &  patchCentres,
vector< Point2f > &  remainingPatches 
)

Finds (or simulates) the interior patches in a pattern.

Definition at line 901 of file calibration.cpp.

bool findMaskCorners ( const Mat &  image,
Size  patternSize,
vector< Point2f > &  corners,
int  detector = 0,
int  mserDelta = 8,
float  max_var = 0.25,
float  min_div = 0.2,
double  area_threshold = 1.01 
)

MSER-clustering mask corner locater.

Definition at line 129 of file calibration.cpp.

bool findPatchCorners ( const Mat &  image,
Size  patternSize,
Mat &  homography,
vector< Point2f > &  corners,
vector< Point2f > &  patchCentres2f,
int  mode,
int  detector = 0 
)

Estimates the co-ordinates of the corners of the patches.

Definition at line 1992 of file calibration.cpp.

bool findPatternCentres ( const Mat &  image,
Size  patternSize,
vector< Point2f > &  centres,
int  mode 
)

Finds just the MSER centres from an image.

Definition at line 3273 of file calibration.cpp.

bool findPatternCorners ( const Mat &  image,
Size  patternSize,
vector< Point2f > &  corners,
int  mode,
int  detector = 0,
int  mserDelta = 8,
float  max_var = 0.25,
float  min_div = 0.2,
double  area_threshold = 1.01 
)

Core pattern-finding function.

Definition at line 1331 of file calibration.cpp.

void generateRandomIndexArray ( int *  randomArray,
int  maxElements,
int  maxVal 
)

Generates a random set of indices from a valid range.

Definition at line 7 of file calibration.cpp.

void groupPointsInQuads ( Size  patternSize,
vector< Point2f > &  corners 
)

Converts points ordering from row-by-row to quad-clustered.

Definition at line 2648 of file calibration.cpp.

void initialRefinementOfCorners ( const Mat &  imGrey,
vector< Point2f > &  src,
Size  patternSize 
)

Initial attempt to correct locations of all corners based on estimates from MSER centroids.

Definition at line 2964 of file calibration.cpp.

void interpolateCornerLocations2 ( const Mat &  image,
int  mode,
Size  patternSize,
vector< Point2f > &  vCentres,
vector< Point2f > &  vCorners 
)

Estimate the locations of patch corners based on patch centroids.

Definition at line 1484 of file calibration.cpp.

double obtainSetScore ( Mat &  distributionMap,
Mat &  binMap,
Mat &  gaussianMat,
cv::vector< Point2f > &  cornerSet,
double *  radialDistribution 
)

Calculate the score for a pointset in terms of its contribution to calibration.

Definition at line 1800 of file calibration.cpp.

bool patternInFrame ( Size  imSize,
vector< Point2f > &  patternPoints,
int  minBorder = 2 
)

Checks that the entire pattern is inside the frame by at least a specified margin.

Definition at line 3569 of file calibration.cpp.

void prepForDisplay ( const Mat &  distributionMap,
Mat &  distributionDisplay 
)

Blurs and enhances a distribution map to make it more displayable.

Definition at line 1699 of file calibration.cpp.

void randomCulling ( vector< std::string > &  inputList,
int  maxSearch 
)

Randomly cuts down a list of input files.

Definition at line 266 of file calibration.cpp.

void randomCulling ( vector< std::string > &  inputList,
int  maxSearch,
vector< vector< Point2f > > &  patterns 
)

Culls some patterns from a vector, and from the corresponding names list.

Definition at line 280 of file calibration.cpp.

void randomCulling ( vector< std::string > &  inputList,
int  maxSearch,
vector< vector< vector< Point2f > > > &  patterns 
)

Culls some sets of patterns from a vector vector, and from the corresponding names list.

void reduceCluster ( vector< mserPatch > &  patches,
vector< vector< Point > > &  msers,
int  totalPatches 
)

Filters out most deviant patches to retain only the correct number for the pattern.

Definition at line 3791 of file calibration.cpp.

void refineCornerPositions ( const Mat &  image,
Size  patternSize,
vector< Point2f > &  vCorners 
)

Refines positions of corners through iterative local homography mappings.

Definition at line 2100 of file calibration.cpp.

bool refinePatches ( const Mat &  image,
Size  patternSize,
vector< vector< Point > > &  msers,
vector< Point2f > &  patchCentres,
int  mode 
)

Applies various area, colour and positional filters to reduce no. of patches to desired amount.

Definition at line 4193 of file calibration.cpp.

void reorderPatches ( Size  patternSize,
int  mode,
int *  XVec,
int *  YVec,
vector< Point2f > &  patchCentres 
)

Re-orders patches into row by row, left to right.

Definition at line 1208 of file calibration.cpp.

void shapeFilter ( vector< mserPatch > &  patches,
vector< vector< Point > > &  msers 
)

Filters out MSERs that do not have a realistic shape.

Definition at line 3589 of file calibration.cpp.

void sortCorners ( Size  imageSize,
Size  patternSize,
vector< Point2f > &  corners 
)

Sorts the corners into a standard order to prepare for calibration.

Definition at line 3073 of file calibration.cpp.

void sortPatches ( Size  imageSize,
Size  patternSize,
vector< Point2f > &  patchCentres,
int  mode 
)

Sorts the patches into a standard order to prepare for homography.

Definition at line 1118 of file calibration.cpp.

void transferMserElement ( vector< vector< Point > > &  dst,
vector< vector< Point > > &  src,
int  index 
)

Move a vector of points from one vector of vectors to another.

Definition at line 4181 of file calibration.cpp.

void transferPatchElement ( vector< mserPatch > &  dst,
vector< mserPatch > &  src,
int  index 
)

Move an MSER-patch from one vector to another, resizing and shifting the old vector.

Definition at line 4169 of file calibration.cpp.

void varianceFilter ( vector< mserPatch > &  patches,
vector< vector< Point > > &  msers 
)

Filters out MSERs that have a large amount of internal pixel intensity variance.

Definition at line 3630 of file calibration.cpp.

bool verifyCorners ( Size  imSize,
Size  patternSize,
vector< Point2f > &  patternPoints,
double  minDist = MIN_CORNER_SEPARATION,
double  maxDist = MAX_CORNER_SEPARATION 
)

Verifies that the final patches do actually represent a grid pattern.

Definition at line 2088 of file calibration.cpp.

bool verifyPatches ( Size  imSize,
Size  patternSize,
vector< Point2f > &  patchCentres,
int  mode,
double  minDist,
double  maxDist 
)

Verifies that the final patches do actually represent a grid pattern.

Definition at line 3527 of file calibration.cpp.

bool verifyPattern ( Size  imSize,
Size  patternSize,
vector< Point2f > &  patternPoints,
double  minDist,
double  maxDist 
)

Generic grid verification function.

Definition at line 3355 of file calibration.cpp.



thermalvis
Author(s): Stephen Vidas
autogenerated on Sun Jan 5 2014 11:38:45