Definitions for generic geometric calibration. More...
#include "calibration.hpp"
Go to the source code of this file.
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, double delay) |
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 delta, float max_var, float min_diversity, double area_threshold) |
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) |
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, int mserDelta, float max_var, float min_diversity, double area_threshold) |
MSER-clustering mask corner locater. | |
bool | findPatchCorners (const Mat &image, Size patternSize, Mat &homography, vector< Point2f > &corners, vector< Point2f > &patchCentres2f, int mode, int detector) |
Estimates the co-ordinates of the corners of the patches. | |
bool | findPatternCentres (const Mat &image, Size patternSize, vector< Point2f > ¢res, int mode) |
Finds just the MSER centres from an image. | |
bool | findPatternCorners (const Mat &image, Size patternSize, vector< Point2f > &corners, int mode, int detector, int mserDelta, float max_var, float min_div, double area_threshold) |
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) |
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< string > &inputList, int maxSearch, vector< vector< vector< Point2f > > > &patterns) |
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, double maxDist) |
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. |
Definitions for generic geometric calibration.
Definition in file calibration.cpp.
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, | ||
double | delay | ||
) |
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 | delta, | ||
float | max_var, | ||
float | min_diversity, | ||
double | area_threshold | ||
) |
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 | ||
) |
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, | ||
int | mserDelta, | ||
float | max_var, | ||
float | min_diversity, | ||
double | area_threshold | ||
) |
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 | ||
) |
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, | ||
int | mserDelta, | ||
float | max_var, | ||
float | min_div, | ||
double | area_threshold | ||
) |
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 | ||
) |
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< string > & | inputList, |
int | maxSearch, | ||
vector< vector< vector< Point2f > > > & | patterns | ||
) |
Definition at line 295 of file calibration.cpp.
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, | ||
double | maxDist | ||
) |
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.