The main class for the the object detection functionality. More...
#include <ObjectDetection.h>
Public Member Functions | |
ObjectDetection () | |
bool | Initialize (bool quiet=false) |
bool | LoadRcFile () |
bool | Interpret (const string &keystr, const string &valstr) |
bool | Interpret (const char *keqv) |
bool | SetOption (const string &keystr, const string &valstr) |
bool | SetOption (const char *keqv) |
void | SetDebug (size_t d) |
size_t | GetDebug () |
void | SetScale (double s) |
void | SetScale (const string &sstr) |
double | GetScale () |
void | SetNewsize (int ns) |
void | SetBlur (bool b) |
void | SetOutImgName (const string &o) |
void | SetOutVidName (const string &o) |
void | SetOutDbName (const string &o) |
void | SetShowResults (bool s) |
void | SetShowOnlineResults (bool s) |
void | SetShowOnlineDbResults (bool s) |
bool | GetShowOnlineAnyResults () |
void | SetFlannIndexMode (flann_index_type f) |
void | SetExhaustiveSearch (bool e) |
void | SetAnalyseOnlyBest (bool a) |
void | SetWriteMatches (bool w) |
void | SetWriteMatchesFn (const string &fn) |
void | SetSecondStage (bool s) |
void | SetUseBinaryFiles (bool u) |
void | SetDisplayInfo (bool d) |
void | SetShowKeypoints (bool s) |
void | SetUseMask (mask_type mt) |
void | SetUseFileMask (const string &o) |
void | SetUsePolygonMask (const string &o) |
void | SetUseXMask (const string &o) |
void | SetUseBorders (const string &o) |
void | PossiblySetShowKeypoints (bool s) |
void | SetUsedDetector (const string &d) |
void | SetUsedDescriptor (const string &d) |
void | SetUpdateApriori (bool u) |
void | SetMatchingKeypointsName (const string &m) |
void | SetMatchingKeypointsMode (const record_keypoints_type &mkm) |
bool | RecordMatchingKeypoints (const record_keypoints_type &mkm) |
void | SetFilter (const string &f, const string &s, size_t t) |
bool | FilterInUse () |
bool | FilterLoaded () |
string | FilterString () |
bool | DbIndicesInUse () |
void | DbIndicesInUse (bool i) |
bool | ProcessImage (const string &fn, savetype &savemode) |
bool | ProcessImage (const string &fn, savetype &savemode, dbitem &res) |
bool | ProcessImage (IplImage *image, const string &imgfn) |
bool | ProcessImageCommonPartOne (IplImage **imgptr, IplImage **maskptr) |
bool | ProcessImageCommonPartTwo (IplImage **imgptr, IplImage **maskptr, const string &imgfn) |
string | SavemodeStr (savetype &savemode) |
void | DisplayDetExtTime () |
void | AppendDescriptors () |
void | CheckKeypointsAndDescriptors (vector< cv::KeyPoint > &keyps, cv::Mat &descs) |
void | CheckKeypointsAndDescriptors () |
bool | ShowNthResult (const IplImage *image, size_t ii, bool openwindow=true) |
bool | ShowBestResult (const IplImage *image, bool openwindow=true) |
bool | ShowAllResults (const IplImage *image) |
bool | ShowAllMatchingResults (const IplImage *image) |
bool | ShowResultsCommon (const IplImage *image, bool nonmatchesalso=true) |
bool | ShowDbResults (const IplImage *image) |
bool | ShowSMIResults (IplImage *img) |
bool | InsidePolygon (CvPoint p, size_t ii) |
bool | ProcessWholeDatabase (const IplImage *image) |
bool | ProcessDatabaseUntilGoodMatch (const IplImage *image) |
bool | ProcessPrevious (const IplImage *image) |
bool | DoGazeMatch () |
bool | UpdateApriori (size_t) |
bool | ProcessCapture (int i=0, const string &fn="") |
bool | ProcessSoap (string &port, bool dummy=false) |
bool | AnalyseImages (const string &fn) |
bool | ProcessImageFromStatic (IplImage *image, dbitem &res) |
void | GetStatusInfoFromStatic (double &, size_t &, size_t &, time_t &) |
bool | LoadImage (IplImage **imgptr, const string &fn) |
bool | ScaleImage (IplImage **imgptr) |
bool | ScaleImage (IplImage **imgptr, double s) |
bool | ResizeImage (IplImage **imgptr) |
bool | CreatePolygonMask (IplImage **imgptr, IplImage **maskptr, const string &fn) |
bool | LoadPolygon (vector< CvPoint > &pts, const string &fn) |
string | DetectorString (const detector_type &dt, bool lc=false) |
string | AllDetectors () |
string | DescriptorString (const desc_type &dt, bool lc=false) |
string | AllDescriptors () |
int | UsedDescriptorSize () |
bool | Detect (const IplImage *image, IplImage **maskptr) |
bool | Extract (const IplImage *image) |
void | FlannFindPairs (const cv::Mat &dbDescriptors, vector< int > &ptpairs) |
void | FlannFindPairs (FlannIndexType *index, vector< int > &ptpairs) |
void | FindMatches (const size_t ii, bool descmode=false) |
void | FindMatchesUsingDescriptors (const size_t ii) |
void | FindMatchesUsingIndex (const size_t ii) |
void | FindMatches () |
bool | FindHomography (const IplImage *image, const size_t ii) |
bool | FindHomography (const IplImage *image, dbitem &dbit) |
bool | CalcHomography (const double *h, double x, double y, double &X, double &Y) |
bool | ShowKeypoints (const IplImage *image, IplImage **maskptr) |
bool | LoadData_Text (dbitem &item) |
bool | LoadData_Bin (dbitem &item) |
FlannIndexType * | LoadIndex (string &indexname, bool dbg=false) |
bool | LoadBorders (dbitem &item) |
bool | SaveData_Text (const string &fn, const vector< cv::KeyPoint > &keypoints, const cv::Mat &descriptors, bool usefilter=false, bool printsize=true) |
bool | SaveData_Bin (const string &fn, const vector< cv::KeyPoint > &keypoints, const cv::Mat &descriptors, bool usefilter=false) |
bool | CreateAndSaveIndex (vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, const string &fn, const string &descfn, bool usefilter=false) |
bool | CreateAndSaveIndex (const string &fn, const string &descfn, bool usefilter=false) |
bool | LoadDbItems (vector< vector< string > > &list, const string &fn, string &indexfn, string &dsuffix, string &path) |
bool | LoadDbAprioris (vector< double > &aprioris, string &fn) |
void | LoadDb (const string &listfn, string indexfn) |
bool | LoadDbs (const string &listfns, const string &indexfns) |
bool | LoadDbs (const vector< string > &listfns, const vector< string > &indexfns) |
bool | LoadDbsList (const string &fn) |
void | SaveDbHeader (size_t n, const string &idxname) |
void | PossiblySaveDbItem (const IplImage *image, const string &fn) |
bool | LoadImgList (vector< vector< string > > &list, const string &fn) |
bool | FileExists (const string &filename) |
bool | IsAffirmative (const char *s) |
bool | ReadSMI (const string &f) |
Static Public Member Functions | |
static const string & | Version () |
static herror_t | SoapExecuteCommon (SoapCtx *, SoapCtx *, bool) |
static herror_t | SoapExecuteReal (SoapCtx *req, SoapCtx *res) |
static herror_t | SoapExecuteDummy (SoapCtx *req, SoapCtx *res) |
static herror_t | SoapStatus (SoapCtx *req, SoapCtx *res) |
static void | ProcessDummy (dbitem &dummybest) |
static void | ProcessFail (dbitem &failbest) |
Protected Attributes | |
string | rcfilename |
size_t | debug |
time_t | start_time |
size_t | nqueries |
size_t | nsoaps |
detector_type | used_detector |
descriptor_type | used_descriptor |
bool | usebinaryfiles |
bool | dbindices_in_use |
double | scale |
int | newsize |
vector< double > | scales |
bool | applyblur |
vector< dbitem > | db |
vector< jointindex > | dbindices |
jointindex | dbindex |
CvMemStorage * | storage |
vector< cv::KeyPoint > | imageKeypoints |
cv::Mat | imageDescriptors |
CvFont | statusfont |
flann_index_type | flann_index_mode |
bool | exhaustivesearch |
bool | analyseonlybest |
bool | writematches |
string | writematchesfn |
bool | secondstage |
map< size_t, size_t > | matchingkeypoints |
mask_type | usemask |
pair< string, string > | maskreplace |
bool | useborders |
pair< string, string > | borderreplace |
bool | showresults |
bool | showonlineresults |
bool | showonlinedbresults |
dbresultimage | dbresultimg |
bool | displayinfo |
bool | showkeypoints |
bool | updateapriori |
bool | preserveorder |
bool | soap |
vector< dbitem > | previmgs |
string | outimgname |
string | outvidname |
string | outdbname |
record_keypoints_type | matchingkeypointsmode |
string | matchingkeypointsname |
KeypointFilter * | filter |
cv::VideoWriter | outputVideo |
size_t | frame_no |
int | ncuda |
pair< double, double > | det_ext_time |
SMI | smi |
Static Protected Attributes | |
static double | SURF_HESSIAN_THRESHOLD |
static bool | SURF_USE_EXTENDED |
static double | DEFAULT_SCALING_FACTOR |
static size_t | MATCHING_NSURVIVORS_TH |
static size_t | MATCHING_NMATCHES_TH |
static size_t | FLANN_NTREES |
static double | FLANN_SIMILARITY_RATIO_JOINT |
static double | FLANN_SIMILARITY_RATIO_SEPARATE |
static size_t | FLANN_MULTIPLE_MATCH_TH |
static size_t | FLANN_SEARCH_CHECKS |
static size_t | JOINT_2NDSTAGE_NIMAGES |
static size_t | HOMOGRAPHY_NIMAGES |
static double | HOMOGRAPHY_DETERMINANT_TH |
static bool | HOMOGRAPHY_CHECK_ANGLES |
static double | HOMOGRAPHY_MINLENGTH_TH |
static double | HOMOGRAPHY_MAXLENGTH_TH |
static double | HOMOGRAPHY_BACKPROJECTION_TH |
static ObjectDetection * | op |
static pthread_mutex_t | pi_mutex |
static size_t | n_soap_threads |
The main class for the the object detection functionality.
ObjectDetection::ObjectDetection | ( | ) |
Constructor. Does very little, initializations are done in Initialize().
bool ObjectDetection::AnalyseImages | ( | const string & | fn | ) |
Entry point for the analysis mode.
Runs the matching for a pre-specified set of test images and displays the results.
fn | file containing the images to analyse. |
void ObjectDetection::AppendDescriptors | ( | ) |
Appends imageDescriptors to jointindex.descriptors and imageKeypoints to jointindex.keypoints.
bool ObjectDetection::CalcHomography | ( | const double * | h, | |
double | x, | |||
double | y, | |||
double & | X, | |||
double & | Y | |||
) |
Calculates a perspective projection of (x,y) to (X, Y) using the vectorized homography matrix h.
void ObjectDetection::CheckKeypointsAndDescriptors | ( | ) |
Checks that the numbers of descriptors, keypoints, and (optional) filtering results match.
For imageKeypoints and imageDescriptors.
void ObjectDetection::CheckKeypointsAndDescriptors | ( | vector< cv::KeyPoint > & | keyps, | |
cv::Mat & | descs | |||
) |
Checks that the numbers of descriptors, keypoints, and (optional) filtering results match.
For arbitrary keyps and descs.
bool ObjectDetection::CreateAndSaveIndex | ( | const string & | fn, | |
const string & | descfn, | |||
bool | usefilter = false | |||
) |
Creates a FLANN index for dbindex.descriptors and saves it to file fn The corresponding descriptors are saved to file fn.xml.
If descfn is non-empty, the descriptors are saved there in plain text and some info about keypoints is saved to descfn+".kpdata".
fn | filename of index | |
descfn | optional filename for saving descriptors in plain text | |
usefilter | whether to use keypoints filtered with KeypointFilter.keypoint_ok |
bool ObjectDetection::CreateAndSaveIndex | ( | vector< cv::KeyPoint > & | keypoints, | |
cv::Mat & | descriptors, | |||
const string & | fn, | |||
const string & | descfn, | |||
bool | usefilter = false | |||
) |
Creates a FLANN index for descriptors and saves it to file fn The corresponding descriptors are saved to file fn.xml.
If descfn is non-empty, the descriptors are saved there in plain text and some info about keypoints is saved to descfn+".kpdata".
keypoints | keypoints | |
descriptors | descriptors | |
fn | filename of index | |
descfn | optional filename for saving descriptors in plain text | |
usefilter | whether to use keypoints filtered with KeypointFilter.keypoint_ok |
bool ObjectDetection::CreatePolygonMask | ( | IplImage ** | imgptr, | |
IplImage ** | maskptr, | |||
const string & | fn | |||
) |
Creates a mask for descriptor extraction based on a polygon.
void ObjectDetection::DbIndicesInUse | ( | bool | i | ) | [inline] |
Sets dbindices_in_use.
bool ObjectDetection::DbIndicesInUse | ( | ) | [inline] |
Whether joint indices i.e. dbindices are used.
string ObjectDetection::DescriptorString | ( | const desc_type & | dt, | |
bool | lc = false | |||
) |
Converts desc_type into a string.
bool ObjectDetection::Detect | ( | const IplImage * | image, | |
IplImage ** | maskptr | |||
) |
Detect keypoints from image.
maskptr | can be used to spatially limit keypoint detection |
void ObjectDetection::DisplayDetExtTime | ( | ) |
Displays total time used in detection and extraction.
bool ObjectDetection::DoGazeMatch | ( | ) |
Matches SMI::B_POR() with with polygons.
bool ObjectDetection::Extract | ( | const IplImage * | image | ) |
Extracts descriptors from image.
bool ObjectDetection::FileExists | ( | const string & | filename | ) |
Checks if a file exists.
bool ObjectDetection::FilterInUse | ( | ) | [inline] |
Whether a filter is to be used.
This doesn't mean that it is ready for use, so you probably want to test FilterLoaded() instead.
bool ObjectDetection::FilterLoaded | ( | ) | [inline] |
Whether a filter is loaded and ready.
string ObjectDetection::FilterString | ( | ) | [inline] |
Returns a filter-specific string to be included in filenames when filtering is used.
bool ObjectDetection::FindHomography | ( | const IplImage * | image, | |
dbitem & | dbit | |||
) |
Performs a homography test for dbit.keypoints.
Also updates vector<bool> dbit.survivors and calculates size_t dbit.nsurvivors.
bool ObjectDetection::FindHomography | ( | const IplImage * | image, | |
const size_t | ii | |||
) | [inline] |
Performs a homography test for dbitem.keypoints for ii 'th dbitem in db.
Also updates vector<bool> dbindex.survivors of surviving keypoints and calculates size_t dbindex.nsurvivors.
void ObjectDetection::FindMatches | ( | ) |
Finds matching descriptors to imageDescriptors from ii 'th dbitem in db using FlannFindPairs().
void ObjectDetection::FindMatches | ( | const size_t | ii, | |
bool | descmode = false | |||
) |
Helper function for FlannFindPairs().
Fills mat with descriptors. NOT NEEDED ANYMORE Finds matching descriptors to imageDescriptors from ii 'th dbitem in db using FlannFindPairs().
void ObjectDetection::FindMatchesUsingDescriptors | ( | const size_t | ii | ) | [inline] |
A way to call FindMatches(size_t, bool).
void ObjectDetection::FindMatchesUsingIndex | ( | const size_t | ii | ) | [inline] |
A way to call FindMatches(size_t, bool).
void ObjectDetection::FlannFindPairs | ( | FlannIndexType * | index, | |
vector< int > & | ptpairs | |||
) |
Runs FLANN for imageDescriptors against an existing index.
index | the FLANN index to use. | |
ptpairs | the resulting matches are stored here as two ints. |
void ObjectDetection::FlannFindPairs | ( | const cv::Mat & | dbDescriptors, | |
vector< int > & | ptpairs | |||
) |
Runs FLANN for imageDescriptors against a set of SURF descriptors given in dbDescriptors.
First creates an index and then uses the index to search.
dbDescriptors | target descriptors for which the index is created | |
ptpairs | the resulting matches are stored here as two ints. |
size_t ObjectDetection::GetDebug | ( | ) | [inline] |
Needed by static SOAP functions.
double ObjectDetection::GetScale | ( | ) | [inline] |
Returns the real scale in use.
bool ObjectDetection::GetShowOnlineAnyResults | ( | ) | [inline] |
Returns true if either showonlineresults or showonlinedbresults.
void ObjectDetection::GetStatusInfoFromStatic | ( | double & | , | |
size_t & | , | |||
size_t & | , | |||
time_t & | ||||
) |
A method for accessing various pieces of information from static SoapStatus() using the object pointer op.
bool ObjectDetection::Initialize | ( | bool | quiet = false |
) |
Performs all initializations.
Has to be called immediately after an ObjectDetection object has been created.
bool ObjectDetection::InsidePolygon | ( | CvPoint | p, | |
size_t | ii | |||
) |
An implementation of a ray-casting algorithm to determine whether a point p is inside the dbitemborders polygon of ii 'th result.
bool ObjectDetection::Interpret | ( | const char * | keqv | ) |
Splits keqv to keystr and valstr and calls Interpret(keystr,valstr).
bool ObjectDetection::Interpret | ( | const string & | keystr, | |
const string & | valstr | |||
) |
Sets almost any variable keystr to value valstr. Includes SetOption().
bool ObjectDetection::IsAffirmative | ( | const char * | s | ) |
Is s true or false?
bool ObjectDetection::LoadBorders | ( | dbitem & | item | ) |
Loads a polygon file and stores the polygon in item.dbitemborders.
bool ObjectDetection::LoadData_Bin | ( | dbitem & | item | ) |
Loads binary format keypoints and descriptors for a dbitem item from item.descname.
bool ObjectDetection::LoadData_Text | ( | dbitem & | item | ) |
Loads text format keypoints and descriptors for a dbitem item from item.descname.
void ObjectDetection::LoadDb | ( | const string & | listfn, | |
string | indexfn | |||
) |
Loads an existing database, which will be stored in db.
listfn | name of the database list file | |
indexfn | name of the optional joint index file |
bool ObjectDetection::LoadDbAprioris | ( | vector< double > & | aprioris, | |
string & | fn | |||
) |
Loads an apriori file from file fn and stores the result in aprioris.
bool ObjectDetection::LoadDbItems | ( | vector< vector< string > > & | list, | |
const string & | fn, | |||
string & | indexfn, | |||
string & | dsuffix, | |||
string & | path | |||
) |
Loads a database list from file fn and stores it in list.
The filename of the default index is copied from fn to indexfn if it was not explicitly specified in the call of LoadDb().
list | list of databases | |
fn | filename | |
indexfn | filename of index | |
dsuffix | suffix for the descriptor files | |
path | path to image files |
bool ObjectDetection::LoadDbs | ( | const vector< string > & | listfns, | |
const vector< string > & | indexfns | |||
) |
Entry point for loading existing databases from a vector<string>.
listfns | comma separated list of database list files | |
indexfns | optional comma separated list of index files |
bool ObjectDetection::LoadDbs | ( | const string & | listfns, | |
const string & | indexfns | |||
) |
Entry point for loading existing databases from a comma-separated string.
listfns | comma separated list of database list files | |
indexfns | optional comma separated list of index files |
bool ObjectDetection::LoadDbsList | ( | const string & | fn | ) |
Entry point for loading existing databases using a list file.
Parses databases from fn and then calls LoadDbs().
fn | database list file |
bool ObjectDetection::LoadImage | ( | IplImage ** | imgptr, | |
const string & | fn | |||
) |
Loads an image from disk.
imgptr | pointer to the image pointer | |
fn | filename. |
bool ObjectDetection::LoadImgList | ( | vector< vector< string > > & | list, | |
const string & | fn | |||
) |
Loads an image list from fn and stores the results in list, used in AnalyseImages().
Requires boost/algorithm/string.hpp, and can be disabled by commenting out "#define USE_BOOST_ALGORITHM_STRING" in ObjectDetection.h.
FlannIndexType* ObjectDetection::LoadIndex | ( | string & | indexname, | |
bool | dbg = false | |||
) |
Loads XML format descriptor data from indexname+".xml" and an index from indexname.
indexname | name of index to load | |
dbg | turn on debug information |
bool ObjectDetection::LoadPolygon | ( | vector< CvPoint > & | pts, | |
const string & | fn | |||
) |
Loads a polygon from a text-format file fn.
bool ObjectDetection::LoadRcFile | ( | ) |
Loads and interprets file rcfilename and sets found parameter values.
void ObjectDetection::PossiblySaveDbItem | ( | const IplImage * | image, | |
const string & | fn | |||
) |
Saves information about the processed image fn to a TOC file outdbname.
Used in creating new databases.
void ObjectDetection::PossiblySetShowKeypoints | ( | bool | s | ) | [inline] |
Sets showkeypoints if true, i.e.
if not explicitly set to false at some point.
bool ObjectDetection::ProcessCapture | ( | int | i = 0 , |
|
const string & | fn = "" | |||
) |
Entry point for the webcam and video modes.
i | webcam number, typically 0; or -1 for video mode | |
fn | video filename |
bool ObjectDetection::ProcessDatabaseUntilGoodMatch | ( | const IplImage * | image | ) |
Process database items one by one until a good-enough match is found.
static void ObjectDetection::ProcessDummy | ( | dbitem & | dummybest | ) | [static] |
Fills a dummy result in dummybest.
static void ObjectDetection::ProcessFail | ( | dbitem & | failbest | ) | [static] |
Fills a failed result in failbest.
bool ObjectDetection::ProcessImage | ( | IplImage * | image, | |
const string & | imgfn | |||
) |
The other way to process an image.
Assumes that the input image already exists (loaded separately, obtained from webcam etc.) Used with SOAP, in analysis mode, and in webcam mode.
bool ObjectDetection::ProcessImage | ( | const string & | fn, | |
savetype & | savemode | |||
) |
Processes a file-based image.
fn | filename | |
savemode | specifies whether and how the keypoints, descriptors and index should be saved. |
bool ObjectDetection::ProcessImageCommonPartOne | ( | IplImage ** | imgptr, | |
IplImage ** | maskptr | |||
) |
The first part of common tasks for all ProcessImage()'s.
bool ObjectDetection::ProcessImageCommonPartTwo | ( | IplImage ** | imgptr, | |
IplImage ** | maskptr, | |||
const string & | imgfn | |||
) |
The second part of common tasks for all ProcessImage()'s, which eventually call this function if everything is ok.
bool ObjectDetection::ProcessImageFromStatic | ( | IplImage * | image, | |
dbitem & | res | |||
) |
A method for accessing ProcessImage() from static SoapExecuteCommon() using the object pointer op.
image | image | |
res | the best matching result |
bool ObjectDetection::ProcessPrevious | ( | const IplImage * | image | ) |
Processed previous images from previmgs to find matches.
bool ObjectDetection::ProcessSoap | ( | string & | port, | |
bool | dummy = false | |||
) |
Entry point for the SOAP server mode.
port | server port to use | |
dummy | refers to test server that always returns a dummy answer. |
bool ObjectDetection::ProcessWholeDatabase | ( | const IplImage * | image | ) |
Processes always the whole database to find the best matches.
bool ObjectDetection::RecordMatchingKeypoints | ( | const record_keypoints_type & | mkm | ) |
Whether matching keypoints are recorded in analysis mode.
bool ObjectDetection::ResizeImage | ( | IplImage ** | imgptr | ) |
Resize the image with the longest edge to the input options.
bool ObjectDetection::SaveData_Bin | ( | const string & | fn, | |
const vector< cv::KeyPoint > & | keypoints, | |||
const cv::Mat & | descriptors, | |||
bool | usefilter = false | |||
) |
Saves keypoints and descriptors in binary format.
keypoints | keypoints | |
descriptors | descriptors | |
fn | filename | |
usefilter | whether to use keypoints filtered with KeypointFilter.keypoint_ok |
bool ObjectDetection::SaveData_Text | ( | const string & | fn, | |
const vector< cv::KeyPoint > & | keypoints, | |||
const cv::Mat & | descriptors, | |||
bool | usefilter = false , |
|||
bool | printsize = true | |||
) |
Saves keypoints and descriptors in text format.
keypoints | keypoints | |
descriptors | descriptors | |
fn | filename | |
usefilter | whether to use keypoints filtered with KeypointFilter.keypoint_ok | |
printsize | whether to print the number of rows to the first line |
void ObjectDetection::SaveDbHeader | ( | size_t | n, | |
const string & | idxname | |||
) |
Saves the first line of the TOC file outdbname.
Used in creating new databases.
n | size of database | |
idxname | name of default index |
string ObjectDetection::SavemodeStr | ( | savetype & | savemode | ) | [inline] |
Returns savetype as a string.
bool ObjectDetection::ScaleImage | ( | IplImage ** | imgptr, | |
double | s | |||
) | [inline] |
Scales the input image.
imgptr | pointer to the image pointer | |
s | scale to use |
bool ObjectDetection::ScaleImage | ( | IplImage ** | imgptr | ) |
Scales the input image by the factor specified in scale.
imgptr | pointer to the image pointer |
void ObjectDetection::SetAnalyseOnlyBest | ( | bool | a | ) | [inline] |
Sets analyseonlybest.
void ObjectDetection::SetBlur | ( | bool | b | ) | [inline] |
Sets applyblur.
void ObjectDetection::SetDebug | ( | size_t | d | ) | [inline] |
Sets debug.
void ObjectDetection::SetDisplayInfo | ( | bool | d | ) | [inline] |
Sets displayinfo.
void ObjectDetection::SetExhaustiveSearch | ( | bool | e | ) | [inline] |
Sets exhaustivesearch.
void ObjectDetection::SetFilter | ( | const string & | f, | |
const string & | s, | |||
size_t | t | |||
) |
Creates a keypoint filter and sets its KeypointFilter.name and KeypointFilter.threshold.
f | filter name | |
s | filter forced namestring, may be empty. See KeypointFilter.namestring. | |
t | threshold |
void ObjectDetection::SetFlannIndexMode | ( | flann_index_type | f | ) | [inline] |
Sets flann_index_mode.
void ObjectDetection::SetMatchingKeypointsMode | ( | const record_keypoints_type & | mkm | ) | [inline] |
Sets matchingkeypointsmode.
void ObjectDetection::SetMatchingKeypointsName | ( | const string & | m | ) | [inline] |
Sets matchingkeypointsname.
void ObjectDetection::SetNewsize | ( | int | ns | ) | [inline] |
Sets longest edge after resizing the images.
bool ObjectDetection::SetOption | ( | const char * | keqv | ) |
Splits keqv to keystr and valstr and calls SetOption(keystr,valstr).
bool ObjectDetection::SetOption | ( | const string & | keystr, | |
const string & | valstr | |||
) |
Sets a command-line variable keystr to value valstr.
void ObjectDetection::SetOutDbName | ( | const string & | o | ) | [inline] |
Sets outdbname.
void ObjectDetection::SetOutImgName | ( | const string & | o | ) | [inline] |
Sets outimgname.
void ObjectDetection::SetOutVidName | ( | const string & | o | ) | [inline] |
Sets outvidname.
void ObjectDetection::SetScale | ( | double | s | ) | [inline] |
Sets scale.
void ObjectDetection::SetSecondStage | ( | bool | s | ) | [inline] |
Sets secondstage.
void ObjectDetection::SetShowKeypoints | ( | bool | s | ) | [inline] |
Sets showkeypoints.
void ObjectDetection::SetShowOnlineDbResults | ( | bool | s | ) | [inline] |
Sets showonlinedbresults.
void ObjectDetection::SetShowOnlineResults | ( | bool | s | ) | [inline] |
Sets showonlineresults.
void ObjectDetection::SetShowResults | ( | bool | s | ) | [inline] |
Sets showresults.
void ObjectDetection::SetUpdateApriori | ( | bool | u | ) | [inline] |
Sets updateapriori.
void ObjectDetection::SetUseBinaryFiles | ( | bool | u | ) | [inline] |
Sets usebinaryfiles.
void ObjectDetection::SetUseBorders | ( | const string & | o | ) |
Use specified polygon (quadrilateral) borders for database images.
void ObjectDetection::SetUsedDescriptor | ( | const string & | d | ) |
Sets used_descriptor.
void ObjectDetection::SetUsedDetector | ( | const string & | d | ) |
Sets used_detector.
void ObjectDetection::SetUseFileMask | ( | const string & | o | ) | [inline] |
Starts to use file-based masks for images.
void ObjectDetection::SetUseMask | ( | mask_type | mt | ) | [inline] |
Sets usemask.
void ObjectDetection::SetUsePolygonMask | ( | const string & | o | ) | [inline] |
Starts to use polygon-based masks for images.
void ObjectDetection::SetUseXMask | ( | const string & | o | ) |
Common implementation for setting up masks.
void ObjectDetection::SetWriteMatches | ( | bool | w | ) | [inline] |
Sets writematches.
void ObjectDetection::SetWriteMatchesFn | ( | const string & | fn | ) | [inline] |
Sets writematchesfn and writematches to true;.
bool ObjectDetection::ShowAllMatchingResults | ( | const IplImage * | image | ) | [inline] |
Show all results that have at least one matching point.
bool ObjectDetection::ShowAllResults | ( | const IplImage * | image | ) | [inline] |
Show all resulting matches.
bool ObjectDetection::ShowBestResult | ( | const IplImage * | image, | |
bool | openwindow = true | |||
) | [inline] |
Shows 0 'th matching result using ShowNthResult().
openwindow | whether to open a new OpenCV window for the results |
bool ObjectDetection::ShowDbResults | ( | const IplImage * | image | ) |
Shows online recognition results over the whole database.
bool ObjectDetection::ShowKeypoints | ( | const IplImage * | image, | |
IplImage ** | maskptr | |||
) |
Show the location and scale of imageKeypoints over a copy of image.
maskptr | if mask is used, it is showed in a separate window |
bool ObjectDetection::ShowNthResult | ( | const IplImage * | image, | |
size_t | ii, | |||
bool | openwindow = true | |||
) |
Shows ii 'th matching result.
openwindow | whether to open a new OpenCV window for the results |
bool ObjectDetection::ShowResultsCommon | ( | const IplImage * | image, | |
bool | nonmatchesalso = true | |||
) |
Common implementation of ShowAllResults() and ShowAllMatchingResults().
bool ObjectDetection::ShowSMIResults | ( | IplImage * | img | ) |
Shows SMI's gaze point.
static herror_t ObjectDetection::SoapExecuteCommon | ( | SoapCtx * | , | |
SoapCtx * | , | |||
bool | ||||
) | [static] |
The common implementation of SoapExecuteReal() and SoapExecuteDummy().
static herror_t ObjectDetection::SoapExecuteDummy | ( | SoapCtx * | req, | |
SoapCtx * | res | |||
) | [inline, static] |
A dummy SOAP service registered for sendImage.
Generates a fixed response intended for testing purposes.
req | the SOAP request | |
res | the generated SOAP response |
static herror_t ObjectDetection::SoapExecuteReal | ( | SoapCtx * | req, | |
SoapCtx * | res | |||
) | [inline, static] |
The real SOAP service registered for sendImage.
Performs matching for the attached image and generates a response.
req | the SOAP request | |
res | the generated SOAP response |
static herror_t ObjectDetection::SoapStatus | ( | SoapCtx * | req, | |
SoapCtx * | res | |||
) | [static] |
A SOAP service registered for status.
Provides status information about the SOAP server.
req | the SOAP request | |
res | the generated SOAP response |
bool ObjectDetection::UpdateApriori | ( | size_t | ) |
Updates the apriori values after a match has been found.
static const string& ObjectDetection::Version | ( | ) | [static] |
Returns the version of this software.
bool ObjectDetection::analyseonlybest [protected] |
Whether to consider only the best match in analysis.
Multiple groundtruth are treated as alternatives if true, as separate if false.
bool ObjectDetection::applyblur [protected] |
Whether do apply gaussian blurring on the input image.
Default is true when matching, false otherwise.
pair<string,string> ObjectDetection::borderreplace [protected] |
The "from" and "to" strings in filename replace from borders.
vector<dbitem> ObjectDetection::db [protected] |
Parameters for SURF extraction.
Parameters for MSER extraction The database of images (actually descriptors, indices and other associated data) is stored here.
jointindex ObjectDetection::dbindex [protected] |
A single joint index containing descriptors from multiple database images.
This is used only when creating new indices; when matching, dbindices is used instead.
vector<jointindex> ObjectDetection::dbindices [protected] |
The joint indices containing descriptors from multiple database images.
This is used while matching; in index creation dbindex is used instead.
bool ObjectDetection::dbindices_in_use [protected] |
Whether joint indices are used in matching.
dbresultimage ObjectDetection::dbresultimg [protected] |
The image containing the thumbnails of database images and some other needed variables.
Used with showonlinedbresults.
size_t ObjectDetection::debug [protected] |
Debug level: 0=none, 1=some, 2=all.
double ObjectDetection::DEFAULT_SCALING_FACTOR [static, protected] |
The default scaling applied to query images, if a scaling factor is not specified.
Usually followed by by gaussian blurring.
pair<double,double> ObjectDetection::det_ext_time [protected] |
Total time used in detection and extraction.
bool ObjectDetection::displayinfo [protected] |
whether to display textual information on results images
bool ObjectDetection::exhaustivesearch [protected] |
Whether the whole database is always searched (doesn't work with joint indices).
KeypointFilter* ObjectDetection::filter [protected] |
The filter optionally used to reduce the number of keypoints and descriptors after descriptor extraction.
flann_index_type ObjectDetection::flann_index_mode [protected] |
The type of FLANN index to create and save.
size_t ObjectDetection::FLANN_MULTIPLE_MATCH_TH [static, protected] |
Threshold for rejecting all matches to a target keypoint that has this many multiple matches from the query image.
size_t ObjectDetection::FLANN_NTREES [static, protected] |
The number of parallel kd-trees to use.
Good values are in the range [1..16].
size_t ObjectDetection::FLANN_SEARCH_CHECKS [static, protected] |
The number of times the Flann tree(s) in the index should be recursively traversed.
double ObjectDetection::FLANN_SIMILARITY_RATIO_JOINT [static, protected] |
The similarity ratio between best and 2nd best matches.
Value 0.6 is traditionally used with SIFT, value over 1.0 means no pruning of matches. JOINT refers to joint indices.
double ObjectDetection::FLANN_SIMILARITY_RATIO_SEPARATE [static, protected] |
The similarity ratio between best and 2nd best matches.
Value 0.6 is traditionally used with SIFT, value over 1.0 means no pruning of matches. SEPARATE refers to imagewise indices.
size_t ObjectDetection::frame_no [protected] |
Running numer of processed frames.
double ObjectDetection::HOMOGRAPHY_BACKPROJECTION_TH [static, protected] |
Error threshold for backprojection of points based on homography.
bool ObjectDetection::HOMOGRAPHY_CHECK_ANGLES [static, protected] |
Whether the check that the angles in the homography mapping are near pi/2.
double ObjectDetection::HOMOGRAPHY_DETERMINANT_TH [static, protected] |
Absolute value of the determinant of the homography matrix has to be larger than this threshold.
double ObjectDetection::HOMOGRAPHY_MAXLENGTH_TH [static, protected] |
The edges of the quadrilateral have to be smaller than this threshold.
double ObjectDetection::HOMOGRAPHY_MINLENGTH_TH [static, protected] |
The edges of the quadrilateral have to be longer than this threshold.
size_t ObjectDetection::HOMOGRAPHY_NIMAGES [static, protected] |
Homography test is done for HOMOGRAPHY_NIMAGES best matches in exhaustive search.
cv::Mat ObjectDetection::imageDescriptors [protected] |
Descriptors corresponding to imageKeypoints.
vector<cv::KeyPoint> ObjectDetection::imageKeypoints [protected] |
Keypoints of the current image.
size_t ObjectDetection::JOINT_2NDSTAGE_NIMAGES [static, protected] |
The number of images tested on the second stage of joint index mode.
pair<string,string> ObjectDetection::maskreplace [protected] |
The "from" and "to" strings in filename replace from masks.
size_t ObjectDetection::MATCHING_NMATCHES_TH [static, protected] |
Threshold for the number of matching keypoints for doing the homography test in non-exhaustive search.
size_t ObjectDetection::MATCHING_NSURVIVORS_TH [static, protected] |
Threshold for accepting a correct match: 8 seems to work quite well, 10 is perhaps overly cautious.
map<size_t, size_t> ObjectDetection::matchingkeypoints [protected] |
The matching keypoints in the index, as <keypoint,nmatches>.
These are optionally recorded in analysis mode.
record_keypoints_type ObjectDetection::matchingkeypointsmode [protected] |
The mode used for recording matching keypoints.
string ObjectDetection::matchingkeypointsname [protected] |
The name of the output file containing the matching keypoints.
size_t ObjectDetection::n_soap_threads [static, protected] |
A simple counter for the number of soap threads currently active.
int ObjectDetection::ncuda [protected] |
Number of CUDA devices found. Is 0 or -1 if disabled/none.
int ObjectDetection::newsize [protected] |
The input images will be resized to the newsize pixels on the longer axis if specified.
Set to -1 by default.
size_t ObjectDetection::nqueries [protected] |
Number of image queries successfully processed.
size_t ObjectDetection::nsoaps [protected] |
Number of SOAP calls processed.
ObjectDetection* ObjectDetection::op [static, protected] |
Object pointer pointing to the object itself.
Used to return back from the static functions SoapExecuteCommon() and SoapStatus().
string ObjectDetection::outdbname [protected] |
The name of the image database TOC file, written if so requested.
string ObjectDetection::outimgname [protected] |
The name of the image written if 's' is pressed when displaying results.
cv::VideoWriter ObjectDetection::outputVideo [protected] |
A video output for showing results.
string ObjectDetection::outvidname [protected] |
The name of the output video written. Used only with ProcessCapture().
pthread_mutex_t ObjectDetection::pi_mutex [static, protected] |
Mutex for calls to ProcessImageFromStatic() from SoapExecuteCommon().
bool ObjectDetection::preserveorder [protected] |
preserve the order of database items, i.e. do not use a priori sorting
vector<dbitem> ObjectDetection::previmgs [protected] |
Previously processed images that can also be matched against.
string ObjectDetection::rcfilename [protected] |
Name of rc file containing modifiable parameter values.
double ObjectDetection::scale [protected] |
The scaling factor applied to the input image, if explicitly specified.
Otherwise, if matching, DEFAULT_SCALING_FACTOR is used instead. Therefore you probably want to use GetScale() instead than this directly.
vector<double> ObjectDetection::scales [protected] |
A set of scales to be applied to the input image.
The current scale is always stored in scale.
bool ObjectDetection::secondstage [protected] |
Whether the second matching stage is done (with joint indices).
bool ObjectDetection::showkeypoints [protected] |
whether to show the keypoints found in an image
bool ObjectDetection::showonlinedbresults [protected] |
Whether to show online recognition results over the whole database.
Used in capture mode. Overrides showresults if true.
bool ObjectDetection::showonlineresults [protected] |
Whether to show online recognition results.
Used in capture mode but can be used by calling ProcessImage() directly as well. Overrides showresults if true.
bool ObjectDetection::showresults [protected] |
Whether to show the recognition results images.
Overrides showkeypoints if false.
SMI ObjectDetection::smi [protected] |
SMI gaze tracker data.
bool ObjectDetection::soap [protected] |
whether to listen for SOAP connections
time_t ObjectDetection::start_time [protected] |
Time of starting the application.
CvFont ObjectDetection::statusfont [protected] |
Font used in displaying information overlaid to shown images.
CvMemStorage* ObjectDetection::storage [protected] |
The storage used for all OpenCV memory allocations.
double ObjectDetection::SURF_HESSIAN_THRESHOLD [static, protected] |
The threshold for keypoint.hessian, only features with larger values are extracted.
OpenCV documentation suggests that good default value is ~300-500 (can depend on the average local contrast and sharpness of the image).
bool ObjectDetection::SURF_USE_EXTENDED [static, protected] |
false means basic SURF descriptors (64 elements each), true means extended descriptors (128 elements each).
bool ObjectDetection::updateapriori [protected] |
whether to update the a priori probabilities of the database items
bool ObjectDetection::usebinaryfiles [protected] |
Whether to load and save data in binary format. True by default.
bool ObjectDetection::useborders [protected] |
Whether to use specified quadrilateral borders for database images.
mask_type ObjectDetection::usemask [protected] |
Whether to use mask to spatially limit keypoint detection.
Supports two types, MASK_FILE and MASK_POLYGON. Default is MASK_NONE.
bool ObjectDetection::writematches [protected] |
Whether to write all matches to a text file.
string ObjectDetection::writematchesfn [protected] |
File name for writing matches to a file.