ShapeFinder2 OCX Reference 15.0
Properties

Properties

boolean AffectMatrix [get, set]
 If this property is set to TRUE the control will modify the coordinate system of the image to reflect the rotation and scaling of the best object found. More...
 
boolean AffectOrigin [get, set]
 If this property is set to TRUE the control will modify the coordinate system of the image to reflect the location of the best object found. More...
 
long BoosterMinQuality [get, set]
 If the #PrecisionBooster property is set to #PRECISIONBOOSTER_LOW or #PRECISIONBOOSTER_HIGH this property defines the minimum correlation of an object to be reported in the result list. More...
 
__int3264 CLF [get, set]
 Defines the handle to the classifier being used. More...
 
BSTR ClfName [get, set]
 Defines the filename of the classifier being used. More...
 
boolean Entire [get, set]
 If this property is set to TRUE the area defined by the #X0, #Y0, #X1, and #Y1 properties is ignored and the complete image will be used in #Execute calls to search for object(s). More...
 
__int3264 Image [get, set]
 Defines the image object that is assigned to the Common Vision ShapeFinder2 Search Control. More...
 
long Locality [get, set]
 Defines the minimum distance between two objects in pixel. More...
 
long MaxObjectCount [get, set]
 Defines the maximum number of objects to be found. More...
 
long MinimumThreshold [get, set]
 Defines the minimum threshold (accumulator value) to be used to find objects. More...
 
long ObjectCount [get]
 Returns the number of objects found. More...
 
long ObjectIndex [get, set]
 Used to set the index to access one of the objects found. More...
 
double PAngle [get]
 Returns the orientation (angle in degree) of the currently selected object at index #ObjectIndex. More...
 
long PlaneIndex [get, set]
 Used to define the color plane to be used if the image assigned to the control contains more than one plane. More...
 
double PQuality [get]
 Returns the quality of the currently selected object at index #ObjectIndex. More...
 
PrecisionBooster PrecisionBooster [get, set]
 The Precision Booster controls the relationship between processing speed and accuracy. More...
 
double PScale [get]
 Returns the number of objects found. More...
 
double PX [get]
 Returns the x-position of the currently selected object at index #ObjectIndex. More...
 
double PY [get]
 Returns the y-position of the currently selected object at index #ObjectIndex. More...
 
long RelativeThreshold [get, set]
 Defines the quality threshold relative to the maximum in the image. More...
 
boolean ResetCS [get, set]
 Indicates if the coordinate system will be reset before the actual search task will be executed. More...
 
double X0 [get, set]
 The properties X0, #Y0, #X1 and #Y1 define the area in which the control tries to find an object. More...
 
double X1 [get, set]
 The properties #X0, #Y0, X1 and #Y1 define the area in which the control tries to find an object. More...
 
double Y0 [get, set]
 The properties #X0, Y0, #X1 and #Y1 define the area in which the control tries to find an object. More...
 
double Y1 [get, set]
 The properties #X0, #Y0, #X1 and Y1 define the area in which the control tries to find an object. More...
 

Detailed Description

Properties

◆ AffectMatrix

boolean AffectMatrix
getset

If this property is set to TRUE the control will modify the coordinate system of the image to reflect the rotation and scaling of the best object found.

This is useful if you use the ShapeFinder2 Search control as a pre-processing tool of other tools that support the coordinate system of the image such as Edge and Minos. The search area of those tools will be transformed according to the image coordinate system. Doing so you are able to find an object position, orientation and scaling using the ShapeFinder2 control and then execute an OCR on the rotated and scaled image using e.g., Minos.

Parameters
[in,out]AffectMatrixIf TRUE the used coordinate system of the image will be modified in the #Execute method, FALSE otherwise.
Returns
TRUE indicates that the coordinate system will be modified, FALSE otherwise.
Related Topics:
#AffectOrigin Property, #ResetCS Property,
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ AffectOrigin

boolean AffectOrigin
getset

If this property is set to TRUE the control will modify the coordinate system of the image to reflect the location of the best object found.

This is useful if you use the ShapeFinder2 Search control as a pre-processing tool of other tools that support the coordinate system of the image such as Edge and Minos. The search area of those tools will be transformed according to the image coordinate system. Doing so you are able to find an object position, orientation and scaling using the ShapeFinder2 control and then execute an OCR on the rotated and scaled image using e.g., Minos.

Parameters
[in,out]AffectOriginIf TRUE the coordinate system of the image used will be modified in the #Execute method, FALSE otherwise.
Returns
TRUE indicates that the coordinate system will be modified, FALSE otherwise.
Related Topics:
#AffectMatrix Property, #ResetCS Property
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ BoosterMinQuality

long BoosterMinQuality
getset

If the #PrecisionBooster property is set to #PRECISIONBOOSTER_LOW or #PRECISIONBOOSTER_HIGH this property defines the minimum correlation of an object to be reported in the result list.

Attention
Objects below this threshold are ignored.
Parameters
[in,out]BoosterMinQualityCorrelation threshold between 0 to 100.
Returns
Correlation threshold.
Related Topics:
#MinimumThreshold Property, #RelativeThreshold Property, #PrecisionBooster Property
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ CLF

__int3264 CLF
getset

Defines the handle to the classifier being used.

The classifier has to be created using the ShapeFinder2 Teach
application or with the \c CreateSF2 function of the ShapeFinder library.
Parameters
[in,out]CLFHandle to the classifier being used.
Returns
Handle of classifier.
Supported platforms:
Win32
Related Topics:
TSearchAllParams Method
#LoadClassifierByDialog Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ ClfName

BSTR ClfName
getset

Defines the filename of the classifier being used.

If you write this property the control will automatically invoke the #LoadClassifier method.
On the other hand if you invoke the #LoadClassifier or #LoadClassifierByDialog method
this property will reflect the filename of the classifier being used.
Attention
The control will fire the #CVCError event if the classifier could not be loaded. This property will be serialized to ensure that the control can be loaded in the same state as it was unloaded.
Parameters
[in,out]ClfNameFilename of the classifier being used.
Returns
Filename of classifier being used.
Supported platforms:
Win32
Related Topics:
#CLF Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ Entire

boolean Entire
getset

If this property is set to TRUE the area defined by the #X0, #Y0, #X1, and #Y1 properties is ignored and the complete image will be used in #Execute calls to search for object(s).

Parameters
[in,out]EntireTRUE indicates that the complete image will be searched, FALSE specifies that the search rectangle is defined by #X0, #Y0, #X1 and #Y1 is being used.
Returns
Indicates if complete image is used.
Supported platforms:
Win32
Related Topics:
#X0, #Y0, #X1 and #Y1 Properties
#Execute Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ Image

__int3264 Image
getset

Defines the image object that is assigned to the Common Vision ShapeFinder2 Search Control.

Parameters
[in,out]ImageHandle of the image object.
Returns
Image object handle.
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ Locality

long Locality
getset

Defines the minimum distance between two objects in pixel.

Objects that are closer together are treated as one
(the one with the higher quality). The locality refers to the center points of the
found objects. But the distance is not the euclidean distance. The x and y components
are evaluated separately. If e.g. the euclidean distance of two center points is 57
pixels and the angle is about 45° the X and Y distance is about 40 pixels respectively.
Thus the \a Locality must be below 40.
Parameters
[in,out]LocalityMinimum distance between two objects.
Returns
Minimum distance between two objects.
Supported platforms:
Win32
Related Topics:
TSearchAllParams structure (LocXY member) in the ShapeFinder library.
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ MaxObjectCount

long MaxObjectCount
getset

Defines the maximum number of objects to be found.

Parameters
[in,out]MaxObjectCountMaximum number of objects to be found.
Returns
Maximum number of objects to be found.
Supported platforms:
Win32
Related Topics:
TSearchAllParams structure (MaxNumSolutions member) in the ShapeFinder library.
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ MinimumThreshold

long MinimumThreshold
getset

Defines the minimum threshold (accumulator value) to be used to find objects.

Refer to the documentation of the search algorithm.
Parameters
[in,out]MinimumThresholdMinimum accumulator value.
Returns
Minimum threshold.
Supported platforms:
Win32
Related Topics:
TSearchAllParams structure (MinimalThreshold member) in the ShapeFinder library.
#BoosterMinQuality Property
#RelativeThreshold Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ ObjectCount

long ObjectCount
get

Returns the number of objects found.

To retrieve the information about a specific object you have to set its index first
using the #ObjectIndex property. Valid values are 0 to \a ObjectCount - 1.
The position of the object is returned in the #PX and #PY properties, the
quality is returned in the #PQuality property. Orientation and Scaling are returned
in the #PAngle and #PScale properties respectively. All these properties are read only.
Use the #MaxObjectCount property to define the maximum number of object to be found.
Parameters
[out]ObjectCountNumber of objects being found.
Returns
Number of objects being found.
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ ObjectIndex

long ObjectIndex
getset

Used to set the index to access one of the objects found.

Valid values are 0 to #ObjectCount - 1. The position of the object is
returned in the #PX and #PY properties, the quality is returned in
the #PQuality property. Orientation and Scaling are returned in the
#PAngle and #PScale properties respectively. All these properties are read only.
Parameters
[in,out]ObjectIndexCurrent object index to select.
Returns
Current object index.
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PAngle

double PAngle
get

Returns the orientation (angle in degree) of the currently selected object at index #ObjectIndex.

Parameters
[out]PAngleOrientation of selected object.
Returns
Orientation of selected object.
Supported platforms:
Win32
Related Topics:
#PQuality Property, #PScale Property, #PX and #PY Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PlaneIndex

long PlaneIndex
getset

Used to define the color plane to be used if the image assigned to the control contains more than one plane.

Valid values are 0 to \a ImageDimension (cvSF2.Image) - 1. If you specify
an invalid value the #CVCError event will be fired.
Parameters
[in,out]PlaneIndexIndex of plane to be used.
Returns
Current plane index.
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PQuality

double PQuality
get

Returns the quality of the currently selected object at index #ObjectIndex.

Parameters
[out]PQualityQuality of selected object.
Returns
Quality of selected object.
Supported platforms:
Win32
Related Topics:
#PAngle Property, #PScale Property, #PX and #PY Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PrecisionBooster

The Precision Booster controls the relationship between processing speed and accuracy.

Refer to <i>Theory of Operation</i> documentation of ShapeFinder2 search algorithm.
Parameters
[in,out]PrecisionBoosterMinimum distance between two objects.
Returns
Minimum distance between two objects.
Supported platforms:
Win32
Related Topics:
PrecisionBooster
TSearchAllParams structure (Precision member) in the ShapeFinder library.
#MinimumThreshold Property
#RelativeThreshold Property
#BoosterMinQuality Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PScale

double PScale
get

Returns the number of objects found.

Parameters
[out]PScaleScaling of selected object.
Returns
Scaling of selected object.
Supported platforms:
Win32
Related Topics:
#PQuality Property, #PAngle Property, #PX and #PY Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PX

double PX
get

Returns the x-position of the currently selected object at index #ObjectIndex.

Parameters
[out]PXX-position of selected object.
Returns
X-position of selected object.
Supported platforms:
Win32
Related Topics:
#PAngle Property, #PQuality Property, #PScale Property, #PY Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ PY

double PY
get

Returns the y-position of the currently selected object at index #ObjectIndex.

Parameters
[out]PYY-position of selected object.
Returns
Y-position of selected object.
Supported platforms:
Win32
Related Topics:
#PAngle Property, #PQuality Property, #PScale Property, #PX Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ RelativeThreshold

long RelativeThreshold
getset

Defines the quality threshold relative to the maximum in the image.

For detailed information refer to the \c TSearchAllParams structure in the ShapeFinder library.
Parameters
[in,out]RelativeThresholdRelative (to the best object found) quality threshold.
Returns
Relative threshold.
Supported platforms:
Win32
Related Topics:
TSearchAllParams structure (RelativeThreshold member) in the ShapeFinder library.
#BoosterMinQuality Property
#MinimumThreshold Property
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ ResetCS

boolean ResetCS
getset

Indicates if the coordinate system will be reset before the actual search task will be executed.

Parameters
[in,out]ResetCSTRUE indicates that the coordinate system of the image will be reset before the actual search task will be executed,
FALSE means that the search area will be transformed using the current image origin.
Returns
TRUE indicates that the coordinate system will be reset before the search task, FALSE otherwise.
Related Topics:
#AffectMatrix Property, #AffectOrigin Property, #Entire Property, #X0, #Y0, #X1 and #Y0 Property
Supported platforms:
Win32
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ X0

double X0
getset

The properties X0, #Y0, #X1 and #Y1 define the area in which the control tries to find an object.

Attention
If the #Entire property is set to TRUE these values will be ignored and the complete image will be used instead to find objects. If the image coordinate system defines an origin other than 0,0 this area is shifted by origin X and origin Y respectively. Scaling and rotation of the coordinate system will be ignored. To ensure an origin at 0,0 set the #ResetCS property to TRUE.
Parameters
[in,out]X0X0 coordinate of the area of interest.
Returns
X0 coordinate.
Supported platforms:
Win32
Related Topics:
#X0, #X1, #Y0, #Y1
#Entire Property, #Execute Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ X1

double X1
getset

The properties #X0, #Y0, X1 and #Y1 define the area in which the control tries to find an object.

Attention
If the #Entire property is set to TRUE these values will be ignored and the complete image will be used instead to find objects. If the image coordinate system defines an origin other than 0,0 this area is shifted by origin X and origin Y respectively. Scaling and rotation of the coordinate system will be ignored. To ensure an origin at 0,0 set the #ResetCS property to TRUE.
Parameters
[in,out]X1X1 coordinate of the area of interest.
Returns
X1 coordinate.
Supported platforms:
Win32
Related Topics:
#X0, #X1, #Y0, #Y1
#Entire Property, #Execute Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ Y0

double Y0
getset

The properties #X0, Y0, #X1 and #Y1 define the area in which the control tries to find an object.

Attention
If the #Entire property is set to TRUE these values will be ignored and the complete image will be used instead to find objects. If the image coordinate system defines an origin other than 0,0 this area is shifted by origin X and origin Y respectively. Scaling and rotation of the coordinate system will be ignored. To ensure an origin at 0,0 set the #ResetCS property to TRUE.
Parameters
[in,out]Y0Y0 coordinate of the area of interest.
Returns
Y0 coordinate.
Supported platforms:
Win32
Related Topics:
#X0, #X1, #Y0, #Y1
#Entire Property, #Execute Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example

◆ Y1

double Y1
getset

The properties #X0, #Y0, #X1 and Y1 define the area in which the control tries to find an object.

Attention
If the #Entire property is set to TRUE these values will be ignored and the complete image will be used instead to find objects. If the image coordinate system defines an origin other than 0,0 this area is shifted by origin X and origin Y respectively. Scaling and rotation of the coordinate system will be ignored. To ensure an origin at 0,0 set the #ResetCS property to TRUE.
Parameters
[in,out]Y1Y1 coordinate of the area of interest.
Returns
Y1 coordinate.
Supported platforms:
Win32
Related Topics:
#X0, #X1, #Y0, #Y1
#Entire Property, #Execute Method
Examples:
Visual Basic - VB ShapeFinder2 OCX Example