DNCFind (CVDNCFind.dll) 14.0
CVDNCFind

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 &params)
 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...
 

Detailed Description

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.

Typedef Documentation

◆ CVDNCFINDER

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.

See also
CVDNCCreateFromSamples, CVDNCCreateFromFile, CVDNCCreateFromFileW

◆ CVDNCRESULTS

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.

See also
CVDNCFind, CVDNCGetNumResults, CVDNCGetResult, CVDNCResult

◆ CVDNCTeachCallback

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.

Parameters
[in]DoneAmount of progress (0 for initialization, 1..Total otherwise).
[in]TotalNumber of samples to teach. (0 for initialization, >0 otherwise).
[in]pPrivateAddress of callback's owner object.
Returns
  • Teaching will be stopped if return value is false.
  • Teaching will continue if return value is true.
See also
CVDNCCreateFromSamples

Function Documentation

◆ CVDNCCreateFromFile()

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.

Parameters
[in]FileNamePath to classifier file.
[out]DncfPointer to DNC-classifier object.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCCreateFromFileW

◆ CVDNCCreateFromFileW()

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.

Parameters
[in]FileNamePath to classifier file.
[out]DncfPointer to DNC-classifier object.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCCreateFromFile

◆ CVDNCCreateFromSamples()

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.

Parameters
[in]DncsPointer to existing DNC-samples object.
[in]ParamsTeach parameters.
[out]DncfPointer to newly created DNC-classifier object.
[in]CallbackFuncTeach callback function.
[in]pPrivatePointer to CallbackFunc's owner.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncs is not a CVDNCSAMPLES object
  • CVC_ERROR(CVC_E_PARAMETER) if some of the values in Params are out of range
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCTeachParams, CVDNCTeachCallback

◆ CVDNCFind()

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.

Parameters
[in]DncfPointer to DNC-classifier object.
[in]DenseCloudThe point cloud in which objects are to be detected.
[out]ResultsPointer to result list.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_WRONGOBJECT) if DenseCloud is not a dense COMPOSITE
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCGetNumResults, CVDNCGetResult, CVDNCSetSearchParams

◆ CVDNCGetNumResults()

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.

Parameters
[in]ResultsPointer to result list.
Returns
  • Number of entries in result list on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) else
See also
CVDNCGetResult

◆ CVDNCGetResult()

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.

Parameters
[in]ResultsPointer to result list.
[in]IndexIndex of result entry.
[out]ResultA CVDNCResult structure filled with the corresponding data.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_PARAMETER) if Index is out of range
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Results is not a CVDNCRESULTS-object
See also
CVDNCGetNumResults

◆ CVDNCGetSearchParams()

cvbres_t CVDNCGetSearchParams ( CVDNCFINDER  Dncf,
CVDNCSearchParams params 
)

Retrieve search parameters.

This function returns the current search parameters.

Parameters
[in]DncfPointer to DNC-classifier object.
[out]paramsSearch parameters.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCSetSearchParams

◆ CVDNCGetTeachParams()

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.

Parameters
[in]DncfPointer to DNC-classifier object.
[out]ResolutionSampling resolution in pixels per millimeter.
[out]FringeFringe around object during sampling in mm.
[out]ParamsTeach parameters.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_ERROR) else
See also
DNCSSetResolution, DNCSSetFringe CVDNCCreateFromSamples

◆ CVDNCSaveClassifier()

cvbres_t CVDNCSaveClassifier ( CVDNCFINDER  Dncf,
const char *  FileName 
)

Write current classifier to file (ASCII string version).

Parameters
[in]DncfPointer to DNC-classifier object.
[in]FileNamePath to classifier file.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCSaveClassifierW

◆ CVDNCSaveClassifierW()

cvbres_t CVDNCSaveClassifierW ( CVDNCFINDER  Dncf,
const wchar_t *  FileName 
)

Write current classifier to file (UNICODE string version).

Parameters
[in]DncfPointer to DNC-classifier object.
[in]FileNamePath to classifier file.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCSaveClassifier

◆ CVDNCSetSearchParams()

cvbres_t CVDNCSetSearchParams ( CVDNCFINDER  Dncf,
CVDNCSearchParams  params 
)

Specify search parameters.

This function specifies the search parameters for subsequent calls of CVDNCFind.

Parameters
[in]DncfPointer to DNC-classifier object.
[in]paramsSearch parameters.
Returns
  • CVC_ERROR(CVC_E_OK) on success
  • CVC_ERROR(CVC_E_WRONGOBJECT) if Dncf is not a CVDNCFINDER object
  • CVC_ERROR(CVC_E_PARAMETER) if some values in params are out of range
  • CVC_ERROR(CVC_E_ERROR) else
See also
CVDNCGetSearchParams