Interface PixelClassifier


public interface PixelClassifier
Interface defining a pixel classifier.

Pixel classifiers can be applied directly to an image, typically using colors and textures.

Author:
Pete Bankhead
  • Field Details

  • Method Details

    • supportsImage

      boolean supportsImage(ImageData<BufferedImage> imageData)
      Query whether the classifier supports a particular image. It may not if the number of channels (for example) is incompatible.
      Parameters:
      imageData -
      Returns:
    • applyClassification

      BufferedImage applyClassification(ImageData<BufferedImage> server, RegionRequest request) throws IOException
      Apply pixel classifier to a specified region of an image.

      An ImageData and RegionRequest are supplied, rather than a BufferedImage directly, because there may be a need to adapt to the image resolution and/or incorporate padding to reduce boundary effects.

      There is no guarantee that the returned BufferedImage will be the same size as the input region (after downsampling), but rather that it should contain the full classification information for the specified region.

      Practically, this means that there may be fewer pixels in the output because the classification inherently involves downsampling.

      Parameters:
      server -
      request -
      Returns:
      a BufferedImage representing the pixel classifications as separate bands.
      Throws:
      IOException - if unable to read pixels from server
    • getMetadata

      Get metadata that describes how the classifier should be called, and the kind of output it provides.
      Returns: