java.lang.Object
imagingbook.common.image.matching.lucaskanade.ImageExtractor

public class ImageExtractor extends Object
Used to extract warped images for testing class LucasKanadeMatcher.
Version:
2022/09/16
  • Constructor Details

  • Method Details

    • setInterpolationMethod

      public void setInterpolationMethod(int method)
      Sets the interpolation method to be used for extracting sub-images (defined by ImageJ's ImageProcessor): ImageProcessor.BILINEAR (default), NEAREST_NEIGHBOR, BICUBIC or NONE.
      Parameters:
      method - the interpolation method to use
    • extractImage

      public ImageProcessor extractImage(int width, int height, LinearMapping2D T)
      Extracts a sub-image of size width x height from the source image I (referenced by this ImageExtractor), using the specified transformation. The image R is extracted from a quadrilateral patch of the source image, defined by the transformation of the boundary of R by T(x).
      Parameters:
      width - the width of the extracted image
      height - the height of the extracted image
      T - a LinearMapping2D instance
      Returns:
      the extracted image, which is of the same type as the source image.
    • extractImage

      Fills the image R from the source image I (referenced by this object). The image R is extracted from a quadrilateral patch of the source image, defined by the transformation of the boundary of R by T(x). Grayscale and color images my not be mixed (i.e., R must be of the same type as I).
      Parameters:
      R - the image to be filled.
      T - a LinearMapping2D object.
    • extractImage

      public void extractImage(ImageProcessor R, Pnt2d[] sourcePnts)
      Extracts a warped sub-image of the associated target image I, defined by a sequence of 3 or 4 points. In the case of 3 points in sourcePnts, an AffineMapping2D is used; with 4 points, a ProjectiveMapping2D is used. The 3 or 4 points map clockwise to the corner points of the target image R, starting with the top-left corner.
      Parameters:
      R - the target image
      sourcePnts - an array of 3 or 4 Pnt2d objects