Module imagingbook.common
Class ImageExtractor
java.lang.Object
imagingbook.common.image.matching.lucaskanade.ImageExtractor
Used to extract warped images for testing class
LucasKanadeMatcher.- Version:
- 2022/09/16
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractImage(int width, int height, LinearMapping2D T) Extracts a sub-image of sizewidthxheightfrom the source imageI(referenced bythisImageExtractor), using the specified transformation.voidextractImage(ImageProcessor R, Pnt2d[] sourcePnts) Extracts a warped sub-image of the associated target image I, defined by a sequence of 3 or 4 points.voidFills the imageRfrom the source imageI(referenced bythisobject).voidsetInterpolationMethod(int method) Sets the interpolation method to be used for extracting sub-images (defined by ImageJ'sImageProcessor):ImageProcessor.BILINEAR(default),NEAREST_NEIGHBOR,BICUBICorNONE.
-
Constructor Details
-
ImageExtractor
Creates a new instance ofImageExtractorfor the imageI.- Parameters:
I- the target image.
-
-
Method Details
-
setInterpolationMethod
Sets the interpolation method to be used for extracting sub-images (defined by ImageJ'sImageProcessor):ImageProcessor.BILINEAR(default),NEAREST_NEIGHBOR,BICUBICorNONE.- Parameters:
method- the interpolation method to use
-
extractImage
Extracts a sub-image of sizewidthxheightfrom the source imageI(referenced bythisImageExtractor), using the specified transformation. The imageRis extracted from a quadrilateral patch of the source image, defined by the transformation of the boundary ofRbyT(x).- Parameters:
width- the width of the extracted imageheight- the height of the extracted imageT- aLinearMapping2Dinstance- Returns:
- the extracted image, which is of the same type as the source image.
-
extractImage
Fills the imageRfrom the source imageI(referenced bythisobject). The imageRis extracted from a quadrilateral patch of the source image, defined by the transformation of the boundary ofRbyT(x). Grayscale and color images my not be mixed (i.e.,Rmust be of the same type asI).- Parameters:
R- the image to be filled.T- aLinearMapping2Dobject.
-
extractImage
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, anAffineMapping2Dis used; with 4 points, aProjectiveMapping2Dis 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 imagesourcePnts- an array of 3 or 4Pnt2dobjects
-