Interface ObjectClassifier<T>

Type Parameters:
T -
All Known Implementing Classes:
AbstractObjectClassifier, DnnObjectClassifier, OpenCVMLClassifier, OpenCVModelObjectClassifier

public interface ObjectClassifier<T>
Interface defining object classifiers, which assign PathClasses to PathObjects.
Author:
Pete Bankhead
  • Field Details

  • Method Details

    • getPathClasses

      Collection<PathClass> getPathClasses()
      Get the classifications set by this classifier.
      Returns:
    • classifyObjects

      int classifyObjects(ImageData<T> imageData, boolean resetExistingClass)
      Classify all compatible objects from an ImageData.

      Note: this method does not typically fire any hierarchy change/object classification events. It is up to the caller to fire these events if required.

      Parameters:
      imageData - data containing the object hierarchy
      resetExistingClass -
      Returns:
      the number of objects whose classification was changed.
      See Also:
    • classifyObjects

      int classifyObjects(ImageData<T> imageData, Collection<? extends PathObject> pathObjects, boolean resetExistingClass)
      Classify the objects in the specified collection. This provides a means to specify exactly which objects should be classified, avoiding reliance on getCompatibleObjects(ImageData).

      Note: this method does not typically fire any hierarchy change/object classification events. It is up to the caller to fire these events if required.

      Parameters:
      imageData - data that may or may not be required for classification depending upon how features are extracted
      pathObjects - the objects to classify
      resetExistingClass -
      Returns:
      the number of objects whose classification was changed.
      See Also:
    • getCompatibleObjects

      Collection<PathObject> getCompatibleObjects(ImageData<T> imageData)
      Get the objects from an ImageData that are compatible with this classifier.
      Parameters:
      imageData -
      Returns:
      a collection of compatible objects, or empty list if no compatible objects are found
    • getMissingFeatures

      Map<String,Integer> getMissingFeatures(ImageData<T> imageData, Collection<? extends PathObject> pathObjects)
      Check for missing features, returning the names and number of input objects missing the specified features. This is useful as a warning that the input for the classifier may not be valid. Default implementation returns an empty map; however, implementations should attempt to provide a meaningful output if possible. Features that are not missing should not be included in the output.
      Parameters:
      imageData - image containing the objects to test
      pathObjects - objects to test for missing features; if not available, getCompatibleObjects(ImageData) will be called.
      Returns:
      a map of feature names and the number of objects missing the corresponding features.