CVBpy 14.0
Classifier Class Reference

ShapeFinder2 classifier object. More...

Inherits object.

Public Member Functions

cvb.Angle angular_tolerance (self)
 Gets the acceptance parameter for feature gradient angles. More...
 
int gradient_type (self)
 Gets the gradient type this classifier uses for feature extraction. More...
 
None save (self, str file_name)
 Writes the classifier to a file. More...
 
List[cvb.shapefinder2.SearchResultsearch_all (self, cvb.ImagePlane plane, cvb.Rect aoi, int precision, float relative_threshold, int minimum_threshold, int coarse_locality, Optional[cvb.AngleRange] rotation_range, Optional[cvb.NumberRange] scale_range)
 Use this classifier to perform a ShapeFinder search on an image plane. More...
 
None set_angular_tolerance (self, cvb.Angle angular_tolerance)
 Sets the acceptance parameter for feature gradient angles. More...
 
bool use_cuda (self, int status)
 Set the flag to use CUDA if possible or to force not using CUDA. More...
 
cvb.Image visualization (self, Optional[int] layer=-1)
 Creates and returns a color coded image representation of this ShapeFinder classifier. More...
 

Properties

 coarse_features = property
 List[cvb.Point2D]: The features the classifier uses on the coarsely granular level.
 
 coarse_scale = property
 int: Scale factor between the fine and the coarse feature level.
 
 comment = property
 str: Gets or sets the comment assigned to the classifier.
 
 contrast_mode = property
 int: Contrast mode for which this classifier has been created (see cvb.shapefinder2.ContrastMode).
 
 contrast_threshold = property
 int: Gets or sets the threshold for the gradient slope.
 
 feature_count = property
 int: Gets the number of features this classifier contains.
 
 feature_window = property
 cvb.Rect: Gets the feature window of this classifier.
 
 file_name = property
 str: Gets the name of the file, from which this classifier was loaded.
 
 fine_features = property
 List[cvb.Point2D]: The features the classifier uses on the finely granular level.
 
 num_layers = property
 int: Number of layers in the classifier.
 
 rotation = property
 cvb.AngleRange: Range of rotations for which this classifier has been generated.
 
 rotation_step = property
 float: Step size at which the rotations in the classifier have been generated.
 
 scale = property
 cvb.NumberRange: Range of scales for which this classifier has been generated.
 
 scale_step = property
 float: Step size at which the scales in the classifier have been generated.
 
 training_window = property
 cvb.Rect: Training window of the classes in the classifier relative to the anchor point.
 

Detailed Description

ShapeFinder2 classifier object.

Creates a classifier object loading a classifier file.

Parameters

file_name : str The file name.

Member Function Documentation

◆ angular_tolerance()

cvb.Angle angular_tolerance (   self)

Gets the acceptance parameter for feature gradient angles.

Returns

cvb.Angle The angular tolerance.

◆ gradient_type()

int gradient_type (   self)

Gets the gradient type this classifier uses for feature extraction.

Returns

int The gradient type (see cvb.shapefinder2.GradientType).

◆ save()

None save (   self,
str  file_name 
)

Writes the classifier to a file.

Parameters

file_name : str The file name to save the classifier.

◆ search_all()

List[cvb.shapefinder2.SearchResult] search_all (   self,
cvb.ImagePlane  plane,
cvb.Rect  aoi,
int  precision,
float  relative_threshold,
int  minimum_threshold,
int  coarse_locality,
Optional[cvb.AngleRange rotation_range,
Optional[cvb.NumberRange scale_range 
)

Use this classifier to perform a ShapeFinder search on an image plane.

Parameters

plane : cvb.ImagePlane The image plane in which to use the classifier.

aoi : cvb.Rect The area of interest in the plane to search in.

precision : int The search mode to use (see cvb.shapefinder2.PrecisionMode).

relative_threshold : float The threshold used for eliminating less promising candidates in the edge model search step.

minimum_threshold : int The minimum gray value different that must be visible in the image before an edge location may be considered a feature.

coarse_locality : int The minimum distance between two results in the coarse layer during the edge model search.

rotation_range : Optional[cvb.AngleRange] The range of rotations to be reported.

scale_range : Optional[cvb.NumberRange] The range of scales to be reported.

Returns

List[cvb.shapefinder2.SearchResult] The list of all results that were found.

◆ set_angular_tolerance()

None set_angular_tolerance (   self,
cvb.Angle  angular_tolerance 
)

Sets the acceptance parameter for feature gradient angles.

Parameters

angular_tolerance : cvb.Angle The angular tolerance.

◆ use_cuda()

bool use_cuda (   self,
int  status 
)

Set the flag to use CUDA if possible or to force not using CUDA.

Parameters

status : int The CUDA status. If CudaStatus.ForceDisable CUDA won't be used in SF2Search. (see cvb.shapefinder2.CudaStatus).

Returns

bool True if status == CudaStatus.Default and a CUDA capable device is present, false otherwise.

◆ visualization()

cvb.Image visualization (   self,
Optional[int]   layer = -1 
)

Creates and returns a color coded image representation of this ShapeFinder classifier.

Parameters

layer : Optional[int] The layer of the classifier to be visualized. A value of -1 superimposes all layers (default -1).

Returns

cvb.Image The image representation.