Package io.scanbot.sdk.imageprocessing
Class ImageProcessor
java.lang.Object
io.scanbot.sdk.imageprocessing.ImageProcessor
- All Implemented Interfaces:
AutoCloseable
API for image processing.
Required licence feature(s): ImageProcessing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyFilter(ImageRef image, ParametricFilter filter) Applies given filter to the given image.voidclose()Closes native resources held by the object.crop(ImageRef image, List<PointF> quad, DocumentCropOptimization documentCropOptimization) Crops the given image to the given quadrilateral.protected voidfinalize()Resizes the given image to the given size.rotate(ImageRef image, ImageRotation rotation) Rotates the given image by the given angle.
-
Constructor Details
-
ImageProcessor
public ImageProcessor()Constructs ImageProcessor with the given params.
-
-
Method Details
-
crop
public ImageRef crop(ImageRef image, List<PointF> quad, DocumentCropOptimization documentCropOptimization) throws InvalidImageRefException, LicenseException Crops the given image to the given quadrilateral.- Parameters:
image- The image to crop.quad- The quadrilateral of normalized points to crop.documentCropOptimization- The optimization to apply when cropping a document. The method doesn't actually check if the input is a document photo, so it relies entirely on the caller's intent.- Returns:
- Cropped image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
resize
Resizes the given image to the given size.- Parameters:
image- The image to resize.size- Size of the longer side of the image.- Returns:
- Resized image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
rotate
public ImageRef rotate(ImageRef image, ImageRotation rotation) throws InvalidImageRefException, LicenseException Rotates the given image by the given angle.- Parameters:
image- The image to rotate.rotation- Rotation to be applied.- Returns:
- Rotated image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
applyFilter
public ImageRef applyFilter(ImageRef image, ParametricFilter filter) throws InvalidImageRefException, LicenseException Applies given filter to the given image.- Parameters:
image- The image to apply filter on.filter- Filter to be applied.- Returns:
- The result of the filter application.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
close
public void close()Closes native resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
finalize
-