Object that holds methods for generating ShapeFinder classifiers. In case of ShapeFinder 1 the learner contains only static methods as no complex state aggregations are required here.
More...

static int[]  GradientHistogram (ImagePlane plane, Rect aoi, GradientType gradient) 
 Calculate the gradient histogram over the aoi in an image plane . The gradient histogram may be useful to determine a suitable contrast threshold value for classifier generation and search operations. More...


static Classifier  Learn (ImagePlane plane, Point2D position, Rect teachWindow, int contrastThreshold, GradientType gradientType) 
 Create a ShapeFinder classifier from the input image plane . More...


static Classifier  CreateCircle (double radius, int contrastThreshold, GradientType gradientType) 
 Create a classifier that is able to detect a circle of a given radius . More...


static Classifier  CreateLineSegment (Angle orientation, int length, int contrastThreshold, GradientType gradientType) 
 Create a ShapeFinder classifier for the recognition of a straight line of specific length and orientation . More...


static Classifier  CreateRotationInvariant (Classifier source, Angle startAngle, Angle stopAngle, int numLayers, int rotationsPerLayer) 
 Generate a rotation symmetric classifier from the input classifier. Rotation symmetric in this context means that the resulting classifier will be able to identify the trained object in more than just the trained orientation (range that can be covered is controlled by the startAngle and stopAngle parameters). The angular sensitivity and the capability to report the found angle are controlled view the numLayers and the rotationsPerLayer parameter. For example it is possible to put all the rotations into just one layer (numLayers = 1, rotationsPerLayer = 255) so that the classifier will be able to correctly identify the object but not its orientation. The other extreme would be to have one rotation per layer, so that the layer information from the search function directly corresponds to orientation. Note that ShapeFinder (1) has very limited angular resolution  if you are interested in detecting orientation with a high degree of accuracy, consider using ShapeFinder2. Note that the product of numLayers and rotationsPerLayer should not become too high, otherwise the classifier will become fairly big and slow to process. More...



const int  ContrastThresholdMin = 1 
 Minimum contrast for features eligible for entering the classifier.


Object that holds methods for generating ShapeFinder classifiers. In case of ShapeFinder 1 the learner contains only static methods as no complex state aggregations are required here.
◆ CreateCircle()
Create a classifier that is able to detect a circle of a given radius .
 Parameters

radius  radius of the circle classifier; must be bigger than 0 
contrastThreshold  minimum contrast of the circle features (must be greater than 0) 
gradientType  type of gradient extractor to use 
 Returns
 newly created classifier
◆ CreateLineSegment()
Create a ShapeFinder classifier for the recognition of a straight line of specific length and orientation .
 Parameters

orientation  angle of the line segment 
length  length of the line segment in pixels (must be greater than 0) 
contrastThreshold  minimum contrast of the line segment features (must be greater than 0) 
gradientType  
 Returns
 A classifier representing the line segment defined by the input parameters.
 Exceptions

ArgumentException  if length is less than or equal to zero or if contrastThreshold is less than or equal to zero. 
◆ CreateRotationInvariant()
Generate a rotation symmetric classifier from the input classifier. Rotation symmetric in this context means that the resulting classifier will be able to identify the trained object in more than just the trained orientation (range that can be covered is controlled by the startAngle and stopAngle parameters). The angular sensitivity and the capability to report the found angle are controlled view the numLayers and the rotationsPerLayer parameter. For example it is possible to put all the rotations into just one layer (numLayers = 1, rotationsPerLayer = 255) so that the classifier will be able to correctly identify the object but not its orientation. The other extreme would be to have one rotation per layer, so that the layer information from the search function directly corresponds to orientation. Note that ShapeFinder (1) has very limited angular resolution  if you are interested in detecting orientation with a high degree of accuracy, consider using ShapeFinder2. Note that the product of numLayers and rotationsPerLayer should not become too high, otherwise the classifier will become fairly big and slow to process.
 Parameters

source  classifier to generate the rotation symmetric classifier from 
numLayers  number of layers to generate for the orientation; layers will be used for identifying the orientation of the object in the result feedback of the search functions 
rotationsPerLayer  number of rotational states to be added per layer; decides over the angular resolution (which will never be better than roughly 1.4 degrees!) 
startAngle  rotation start angle in radians; must be within the range [pi...pi] and less than or equal to stopAngle 
stopAngle  rotation stop angle in radians; must be within the range [pi...pi] and greater or equal to startAngle 
 Returns
 newly created rotation invariant classifier
 Exceptions

ArgumentNullException  If source is null 
ArgumentOutOfRangeException  If startAngle or stopAngle exceeds the range [pi...pi] or if startAngle is greater than stopAngle or if numLayers or rotationsPerLayer are less than 1 
◆ GradientHistogram()
Calculate the gradient histogram over the aoi in an image plane . The gradient histogram may be useful to determine a suitable contrast threshold value for classifier generation and search operations.
 Parameters

plane  image plane in which to claculate the histogram 
aoi  area of interest in which to calculate the histogram 
gradient  gradient operator to use for the calculating the histogram 
 Returns
 the calculated histogram
 Exceptions

ArgumentNullException  If the Parent of plane parameter is null 
ObjectDisposedException  If the Parent of plane has already been disposed 
CvbException  when trying to learn a classifier from an image plane that does not have the data type 8 bits per pixel unsigned, or if an unspecific error occurs 
◆ Learn()
Create a ShapeFinder classifier from the input image plane .
 Parameters

plane  image plane to create the classifier from 
position  position in the input image at which to extract the classifier 
teachWindow  teach window for the classifier learning process relative to position 
contrastThreshold  minimum contrast a feature must have for entering the model 
gradientType  gradient operator to use for calculating the model 
 Returns
 the newly created classifier
 Exceptions

ArgumentNullException  If the Parent of the plane parameter is null 
ObjectDisposedException  If the Parent of plane has already been disposed 
CvbException  when trying to learn a classifier from an image plane that does not have the data type 8 bits per pixel unsigned, or if an unspecific error occurs 
ArgumentException  If the position lies outside the image plane , the teachWindow lies outside the image plane or the contrastThreshold is less than 1 