Catalano.Imaging.Tools
Class QuadrilateralTransformation
- java.lang.Object
-
- Catalano.Imaging.Tools.QuadrilateralTransformation
-
- All Implemented Interfaces:
- IProcessImage
public class QuadrilateralTransformation extends java.lang.Object implements IProcessImage
Performs quadrilateral transformation of an area in a given source image. The class implements quadrilateral transformation algorithm, which allows to transform any quadrilateral from a given source image to a rectangular image. The idea of the algorithm is based on homogeneous transformation and its math is described by Paul Heckbert in his "Projective Mappings for Image Warping" paper.
-
-
Constructor Summary
Constructors Constructor and Description QuadrilateralTransformation(java.util.List<IntPoint> sourceQuadrilateral)Initializes a new instance of the QuadrilateralTransformation class.QuadrilateralTransformation(java.util.List<IntPoint> sourceQuadrilateral, int newWidth, int newHeight)Initializes a new instance of the QuadrilateralTransformation class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetNewHeight()Get New height.intgetNewWidth()Get New width.java.util.List<IntPoint>getSourceQuadrilateral()Get Quadrilateral's corners in source image.booleanisAutomaticSizeCalculaton()Is Automatic calculation of destination image.booleanisUseInterpolation()Specifies if bilinear interpolation should be used or not.FastBitmapProcessImage(FastBitmap fastBitmap)Process image.voidsetAutomaticSizeCalculaton(boolean automaticSizeCalculaton)Set Automatic calculation of destination imagevoidsetNewHeight(int newHeight)Set New height.voidsetNewWidth(int newWidth)Set New width.voidsetSourceQuadrilateral(java.util.List<IntPoint> sourceQuadrilateral)Set Quadrilateral's corners in source image.voidsetUseInterpolation(boolean useInterpolation)Set if bilinear interpolation should be used or not.
-
-
-
Constructor Detail
-
QuadrilateralTransformation
public QuadrilateralTransformation(java.util.List<IntPoint> sourceQuadrilateral)
Initializes a new instance of the QuadrilateralTransformation class.- Parameters:
sourceQuadrilateral- Quadrilateral's corners.
-
QuadrilateralTransformation
public QuadrilateralTransformation(java.util.List<IntPoint> sourceQuadrilateral, int newWidth, int newHeight)
Initializes a new instance of the QuadrilateralTransformation class.- Parameters:
sourceQuadrilateral- Quadrilateral's corners.newWidth- New width.newHeight- New height.
-
-
Method Detail
-
isAutomaticSizeCalculaton
public boolean isAutomaticSizeCalculaton()
Is Automatic calculation of destination image.- Returns:
- True or false.
-
setAutomaticSizeCalculaton
public void setAutomaticSizeCalculaton(boolean automaticSizeCalculaton)
Set Automatic calculation of destination image- Parameters:
automaticSizeCalculaton- True or false.
-
getSourceQuadrilateral
public java.util.List<IntPoint> getSourceQuadrilateral()
Get Quadrilateral's corners in source image.- Returns:
- Quadrilateral's corners.
-
setSourceQuadrilateral
public void setSourceQuadrilateral(java.util.List<IntPoint> sourceQuadrilateral)
Set Quadrilateral's corners in source image.- Parameters:
sourceQuadrilateral- Quadrilateral's corners.
-
getNewWidth
public int getNewWidth()
Get New width.- Returns:
- New width.
-
setNewWidth
public void setNewWidth(int newWidth)
Set New width.- Parameters:
newWidth- New width.
-
getNewHeight
public int getNewHeight()
Get New height.- Returns:
- New height.
-
setNewHeight
public void setNewHeight(int newHeight)
Set New height.- Parameters:
newHeight- New height.
-
isUseInterpolation
public boolean isUseInterpolation()
Specifies if bilinear interpolation should be used or not.- Returns:
- True or false.
-
setUseInterpolation
public void setUseInterpolation(boolean useInterpolation)
Set if bilinear interpolation should be used or not.- Parameters:
useInterpolation- True or false.
-
ProcessImage
public FastBitmap ProcessImage(FastBitmap fastBitmap)
Description copied from interface:IProcessImageProcess image.- Specified by:
ProcessImagein interfaceIProcessImage- Parameters:
fastBitmap- Image to be processed.- Returns:
- Processed image.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG