Functions for DNC object detection. More...
Data Structures | |
struct | CVDNCResult |
Definition of a specific detection result. More... | |
struct | CVDNCSearchParams |
Definition of search parameters. More... | |
struct | CVDNCTeachParams |
Definition of teach parameters which are used to create a DNC-classifier from a CVDNCSAMPLES object. More... | |
Typedefs | |
typedef void * | CVDNCFINDER |
Definition of DNC-classifier object. More... | |
typedef void * | CVDNCRESULTS |
Definition of DNC-results object. More... | |
typedef cvbbool_t(* | CVDNCTeachCallback) (cvbint32_t Done, cvbint32_t Total, void *pPrivate) |
Callback definition for teach-process. More... | |
Functions | |
cvbres_t | CVDNCCreateFromFile (const char *FileName, CVDNCFINDER &Dncf) |
Create an instance of DNC-classifier from file (ASCII string version). More... | |
cvbres_t | CVDNCCreateFromFileW (const wchar_t *FileName, CVDNCFINDER &Dncf) |
Create an instance of DNC-classifier from file (UNICODE string version). More... | |
cvbres_t | CVDNCCreateFromSamples (CVDNCSAMPLES Dncs, CVDNCTeachParams Params, CVDNCFINDER &Dncf, CVDNCTeachCallback CallbackFunc, void *pPrivate) |
Create a DNC-classifier from an instance of DNC-samples. More... | |
cvbres_t | CVDNCFind (CVDNCFINDER Dncf, CVCOMPOSITE DenseCloud, CVDNCRESULTS &Results) |
Perform a search task. More... | |
cvbint32_t | CVDNCGetNumResults (CVDNCRESULTS Results) |
Read size of result list. More... | |
cvbres_t | CVDNCGetResult (CVDNCRESULTS Results, cvbdim_t Index, CVDNCResult &Result) |
Get values for an individual search result. More... | |
cvbres_t | CVDNCGetSearchParams (CVDNCFINDER Dncf, CVDNCSearchParams ¶ms) |
Retrieve search parameters. More... | |
cvbres_t | CVDNCGetTeachParams (CVDNCFINDER Dncf, double &Resolution, double &Fringe, CVDNCTeachParams &Params) |
Retrieve the teach parameters of the classifier. More... | |
cvbres_t | CVDNCSaveClassifier (CVDNCFINDER Dncf, const char *FileName) |
Write current classifier to file (ASCII string version). More... | |
cvbres_t | CVDNCSaveClassifierW (CVDNCFINDER Dncf, const wchar_t *FileName) |
Write current classifier to file (UNICODE string version). More... | |
cvbres_t | CVDNCSetSearchParams (CVDNCFINDER Dncf, CVDNCSearchParams params) |
Specify search parameters. More... | |
Functions for DNC object detection.
To distinguish between sample generation and object detection functions, the function names for sample generation start with DNCS, whereas functions for object detection start with CVDNC.
Definition of DNC-classifier object.
There are various functions to create a DNC-classifier object, see CVDNCCreateFromSamples, CVDNCCreateFromFile, CVDNCCreateFromFileW. Each of these functions return a pointer of type CVDNCFINDER, which is used in subsequent function calls to address this object.
When the object is no longer used, it must be released with a call to ReleaseObject.
Definition of DNC-results object.
A (successful) call of CVDNCFind returns a pointer to a DNC-results object. This object represents a list of individual results. Special functions give access to these results, e.g. CVDNCGetNumResults and CVDNCGetResult.
When the object is no longer used, it must be released with a call to ReleaseObject.
CVDNCTeachCallback |
Callback definition for teach-process.
During teaching (see CVDNCCreateFromSamples) a callback will be executed repeatedly, indicating progress. At each call, the number of samples to teach (Total) and the number of already teached samples (Done) will be given. The first call (initialization) gives 0 for both Done and Total.
You can control the termination of the teaching process by setting the return value of this callback to false. In this case, teaching will terminate and CVDNCCreateFromSamples will return an error.
[in] | Done | Amount of progress (0 for initialization, 1..Total otherwise). |
[in] | Total | Number of samples to teach. (0 for initialization, >0 otherwise). |
[in] | pPrivate | Address of callback's owner object. |
cvbres_t CVDNCCreateFromFile | ( | const char * | FileName, |
CVDNCFINDER & | Dncf | ||
) |
Create an instance of DNC-classifier from file (ASCII string version).
This function loads a previously stored DNC-classifier file and returns a pointer to a CVDNCFINDER object.
[in] | FileName | Path to classifier file. |
[out] | Dncf | Pointer to DNC-classifier object. |
cvbres_t CVDNCCreateFromFileW | ( | const wchar_t * | FileName, |
CVDNCFINDER & | Dncf | ||
) |
Create an instance of DNC-classifier from file (UNICODE string version).
This function loads a previously stored DNC classifier file and returns a pointer to a CVDNCFINDER object.
[in] | FileName | Path to classifier file. |
[out] | Dncf | Pointer to DNC-classifier object. |
cvbres_t CVDNCCreateFromSamples | ( | CVDNCSAMPLES | Dncs, |
CVDNCTeachParams | Params, | ||
CVDNCFINDER & | Dncf, | ||
CVDNCTeachCallback | CallbackFunc, | ||
void * | pPrivate | ||
) |
Create a DNC-classifier from an instance of DNC-samples.
This function converts a set of examples created from a CAD model into a CVDNCFINDER object that can be used to search for the model in a point cloud. The examples are given in the form of the CVDNCSAMPLES object Dncs.
Classifier creation is controlled by the teach parameters Params and the callback function CallbackFunc. If CallbackFunc is set and returns false, the classifier creation is terminated immediately.
If you do not want or need a callback mechanism, you can set CallbackFunc and pPrivate to Null.
[in] | Dncs | Pointer to existing DNC-samples object. |
[in] | Params | Teach parameters. |
[out] | Dncf | Pointer to newly created DNC-classifier object. |
[in] | CallbackFunc | Teach callback function. |
[in] | pPrivate | Pointer to CallbackFunc's owner. |
cvbres_t CVDNCFind | ( | CVDNCFINDER | Dncf, |
CVCOMPOSITE | DenseCloud, | ||
CVDNCRESULTS & | Results | ||
) |
Perform a search task.
Detect objects in the given point cloud and return a list of results. Try to adjust the search parameters if there are too few results or the result list contains false positives.
The result list must be released after use by calling ReleaseObject.
The point cloud DenseCloud must be of dense format, otherwise an error is returned. It must also either be orientated in sensor frame coordinates, or the point cloud must be extrinsically calibrated such that the direction of the Z-axis points to the sensor.
[in] | Dncf | Pointer to DNC-classifier object. |
[in] | DenseCloud | The point cloud in which objects are to be detected. |
[out] | Results | Pointer to result list. |
cvbint32_t CVDNCGetNumResults | ( | CVDNCRESULTS | Results | ) |
Read size of result list.
This function returns the number of CVDNCResult-entries contained in the given result list Results.
[in] | Results | Pointer to result list. |
cvbres_t CVDNCGetResult | ( | CVDNCRESULTS | Results, |
cvbdim_t | Index, | ||
CVDNCResult & | Result | ||
) |
Get values for an individual search result.
Retrieve specific information of an individual result in Results.
[in] | Results | Pointer to result list. |
[in] | Index | Index of result entry. |
[out] | Result | A CVDNCResult structure filled with the corresponding data. |
cvbres_t CVDNCGetSearchParams | ( | CVDNCFINDER | Dncf, |
CVDNCSearchParams & | params | ||
) |
Retrieve search parameters.
This function returns the current search parameters.
[in] | Dncf | Pointer to DNC-classifier object. |
[out] | params | Search parameters. |
cvbres_t CVDNCGetTeachParams | ( | CVDNCFINDER | Dncf, |
double & | Resolution, | ||
double & | Fringe, | ||
CVDNCTeachParams & | Params | ||
) |
Retrieve the teach parameters of the classifier.
This function returns the parameters with which the classifier was trained. The values for Resolution and Fringe are not teach parameters in the strict sense - they rather concern the sample generation itself -, but they are given for the sake of completeness.
[in] | Dncf | Pointer to DNC-classifier object. |
[out] | Resolution | Sampling resolution in pixels per millimeter. |
[out] | Fringe | Fringe around object during sampling in mm. |
[out] | Params | Teach parameters. |
cvbres_t CVDNCSaveClassifier | ( | CVDNCFINDER | Dncf, |
const char * | FileName | ||
) |
Write current classifier to file (ASCII string version).
[in] | Dncf | Pointer to DNC-classifier object. |
[in] | FileName | Path to classifier file. |
cvbres_t CVDNCSaveClassifierW | ( | CVDNCFINDER | Dncf, |
const wchar_t * | FileName | ||
) |
Write current classifier to file (UNICODE string version).
[in] | Dncf | Pointer to DNC-classifier object. |
[in] | FileName | Path to classifier file. |
cvbres_t CVDNCSetSearchParams | ( | CVDNCFINDER | Dncf, |
CVDNCSearchParams | params | ||
) |
Specify search parameters.
This function specifies the search parameters for subsequent calls of CVDNCFind.
[in] | Dncf | Pointer to DNC-classifier object. |
[in] | params | Search parameters. |