Click or drag to resize
Accord.NET (logo)

FastCornersDetector Class

Features from Accelerated Segment Test (FAST) corners detector.
Inheritance Hierarchy
System.Object
  Accord.Imaging.BaseFeatureExtractor<CornerFeaturePoint>
    Accord.Imaging.BaseSparseFeatureExtractor<CornerFeaturePoint>
      Accord.Imaging.BaseCornersDetector
        Accord.Imaging.FastCornersDetector

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class FastCornersDetector : BaseCornersDetector
Request Example View Source

The FastCornersDetector type exposes the following members.

Constructors
  NameDescription
Public methodFastCornersDetector
Initializes a new instance of the FastCornersDetector class.
Top
Properties
  NameDescription
Public propertyNumberOfInputs
Returns -1.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public propertyNumberOfOutputs
Gets the dimensionality of the features generated by this extractor.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public propertyScores
Gets the scores of the each corner detected in the previous call to Transform(Bitmap).
Public propertySupportedFormats
Gets the list of image pixel formats that are supported by this extractor. The extractor will check whether the pixel format of any provided images are in this list to determine whether the image can be processed or not.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public propertySuppress
Gets or sets a value indicating whether non-maximum points should be suppressed. Default is true.
Public propertyThreshold
Gets or sets the corner detection threshold. Increasing this value results in less corners, whereas decreasing this value will result in more corners detected by the algorithm.
Top
Methods
  NameDescription
Public methodClone()
Creates a new object that is a copy of the current instance.
(Inherited from BaseFeatureExtractor<TFeature>.)
Protected methodClone(ISet<PixelFormat>)
Creates a new object that is a copy of the current instance.
(Overrides BaseFeatureExtractor<TFeature>.Clone(ISet<PixelFormat>).)
Public methodDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from BaseFeatureExtractor<TFeature>.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodInnerProcess
This method should be implemented by inheriting classes to implement the actual corners detection, transforming the input image into a list of points.
(Overrides BaseCornersDetector.InnerProcess(UnmanagedImage).)
Protected methodInnerTransform
This method should be implemented by inheriting classes to implement the actual feature extraction, transforming the input image into a list of features.
(Inherited from BaseCornersDetector.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProcessImage(Bitmap)
Process image looking for corners.
(Inherited from BaseCornersDetector.)
Public methodProcessImage(BitmapData)
Process image looking for corners.
(Inherited from BaseCornersDetector.)
Public methodProcessImage(UnmanagedImage)
Process image looking for corners.
(Inherited from BaseCornersDetector.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTransform(Bitmap)
Applies the transformation to an input, producing an associated output.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodTransform(Bitmap[])
Applies the transformation to an input, producing an associated output.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodTransform(UnmanagedImage)
Applies the transformation to an input, producing an associated output.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodTransform(UnmanagedImage[])
Applies the transformation to an input, producing an associated output.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodTransform(Bitmap[],IEnumerable<TFeature>[])
Applies the transformation to a set of input vectors, producing an associated set of output vectors.
(Inherited from BaseFeatureExtractor<TFeature>.)
Public methodTransform(UnmanagedImage[],IEnumerable<TFeature>[])
Applies the transformation to a set of input vectors, producing an associated set of output vectors.
(Inherited from BaseFeatureExtractor<TFeature>.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodTo<T>()Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

In the FAST corner detection algorithm, a pixel is defined as a corner if (in a circle surrounding the pixel), N or more contiguous pixels are all significantly brighter then or all significantly darker than the center pixel. The ordering of questions used to classify a pixel is learned using the ID3 algorithm.

This detector has been shown to exhibit a high degree of repeatability.

The code is roughly based on the 9 valued FAST corner detection algorithm implementation in C by Edward Rosten, which has been published under a 3-clause BSD license and is freely available at: http://svr-www.eng.cam.ac.uk/~er258/work/fast.html.

References:

  • E. Rosten, T. Drummond. Fusing Points and Lines for High Performance Tracking, ICCV 2005.
  • E. Rosten, T. Drummond. Machine learning for high-speed corner detection, ICCV 2005

Examples
Bitmap image = ... // Lena's famous picture

// Create a new FAST Corners Detector
FastCornersDetector fast = new FastCornersDetector()
{
    Suppress = true, // suppress non-maximum points
    Threshold = 40   // less leads to more corners
};

// Process the image looking for corners
List<IntPoint> points = fast.ProcessImage(image);

// Create a filter to mark the corners
PointsMarker marker = new PointsMarker(points);

// Apply the corner-marking filter
Bitmap markers = marker.Apply(image);

// Show on the screen
ImageBox.Show(markers);

The resulting image is shown below:

The second example shows how to extract FAST descriptors from a standard test image:

// Let's load an example image, such as Lena,
// from a standard dataset of example images:
var images = new TestImages(path: localPath);
Bitmap lena = images["lena.bmp"];

// Create FAST with the default parameter values:
var fast = new FastCornersDetector(threshold: 20);

// Use it to extract interest points from the Lena image:
List<IntPoint> descriptors = fast.ProcessImage(lena);

// Now those descriptors can be used to represent the image itself, such
// as for example, in the Bag-of-Visual-Words approach for classification.
See Also