Interface ImagePyramid<T extends ImageBase<T>>

All Known Implementing Classes:
ImagePyramidBase, PyramidDiscrete, PyramidDiscreteAverage, PyramidDiscreteSampleBlur, PyramidFloat, PyramidFloatGaussianScale, PyramidFloatScale

public interface ImagePyramid<T extends ImageBase<T>>

Image pyramids represent an image at different resolution in a fine to coarse fashion. Lower layers in the pyramid are at a higher resolution than the upper layers. The resolution of a layer is specified by its scale. The scale number indicates how many pixels in the original input image correspond to a single pixel at the current layer. So a layer with a scale of 5 is 5 times lower resolution than the input layer.

The transform from a pixel coordinate in layer 'i' to the original image will vary depending on the pyramid is constructed. In general it, can be described by the following equation: (x,y) = (offX_i,offY_i) + scale_i*(x_i,y_i), where (x_i,y_i) is the pixel coordinate in layer 'i'. The offsets (offX_i,offY_i) vary depending on how each layer in the pyramid samples the previous layers. This offset can be found by calling getSampleOffset(int).

  • Method Summary

    Modifier and Type Method Description
    <IP extends ImagePyramid<T>>
    IP
    copyStructure()
    Creates a copy of the pyramids structure but not the pixel data
    int getHeight​(int layer)
    Returns the height of an image at ths specified layer.
    ImageType<T> getImageType()
    The type of image.
    int getInputHeight()
    Height of input image.
    int getInputWidth()
    Width of input image.
    T getLayer​(int layerNum)
    Returns a layer in the pyramid.
    int getNumLayers()
    Returns the number of layers in the pyramid.
    double getSampleOffset​(int layer)
    Returns the sampling offset.
    double getScale​(int layer)
    Returns the scale of the specified layer in the pyramid.
    double getSigma​(int layer)
    Returns the scale-space scale for the specified layer.
    int getWidth​(int layer)
    Returns the width of an image at ths specified layer.
    void initialize​(int width, int height)
    Declares internal data structures for an image with the specified dimensions
    boolean isInitialized()
    Checks to see if the pyramid has been initialized or not
    void process​(T input)
    Constructs the image pyramid given the input image.
    void setTo​(ImagePyramid<T> input)
    Set's this pyramid to be the same as input.
  • Method Details

    • process

      void process​(T input)
      Constructs the image pyramid given the input image.
    • initialize

      void initialize​(int width, int height)
      Declares internal data structures for an image with the specified dimensions
      Parameters:
      width - image width
      height - image height
    • getScale

      double getScale​(int layer)
      Returns the scale of the specified layer in the pyramid. Larger the scale smaller the image is relative to the input image.
      Parameters:
      layer - Which layer is being inspected.
      Returns:
      The layer's scale.
    • getLayer

      T getLayer​(int layerNum)
      Returns a layer in the pyramid.
      Parameters:
      layerNum - which image is to be returned.
      Returns:
      The image in the pyramid.
    • getNumLayers

      int getNumLayers()
      Returns the number of layers in the pyramid.
    • getWidth

      int getWidth​(int layer)
      Returns the width of an image at ths specified layer.
      Parameters:
      layer - The layer being requested.
      Returns:
      The layer's width.
    • getHeight

      int getHeight​(int layer)
      Returns the height of an image at ths specified layer.
      Parameters:
      layer - The layer being requested.
      Returns:
      The layer's height.
    • getInputWidth

      int getInputWidth()
      Width of input image.
    • getInputHeight

      int getInputHeight()
      Height of input image.
    • getImageType

      ImageType<T> getImageType()
      The type of image.
      Returns:
      Image type.
    • setTo

      void setTo​(ImagePyramid<T> input)
      Set's this pyramid to be the same as input. The two pyramids must have the same structure or else an exception will be thrown.
      Parameters:
      input - Input pyramid. Not modified.
    • getSampleOffset

      double getSampleOffset​(int layer)
      Returns the sampling offset. Both x and y axises are assumed to have the same offset. See comment in constructor above.
      Parameters:
      layer - Layer in the pyramid
      Returns:
      Sampling offset in pixels.
    • getSigma

      double getSigma​(int layer)
      Returns the scale-space scale for the specified layer. This scale is equivalent amount of Gaussian blur applied to the input image. If Gaussian blur is not applied to each layer then an approximation should be returned.
      Parameters:
      layer - Layer in the pyramid
      Returns:
      Equivalent sigma for Gaussian blur.
    • copyStructure

      <IP extends ImagePyramid<T>> IP copyStructure()
      Creates a copy of the pyramids structure but not the pixel data
    • isInitialized

      boolean isInitialized()
      Checks to see if the pyramid has been initialized or not