public class ContourDetector implements Disposable
Performs contour detection.
public static io.scanbot.sdk.core.contourdetector.ContourDetector.Companion Companion
public ContourDetector(@NotNull
io.scanbot.sdk.core.contourdetector.ContourDetector.Type contourDetectorType)
Performs contour detection.
contourDetectorType - type of the document detector to use@Nullable public DetectionResult detect(@NotNull kotlin.Array[] nv21, int width, int height)
Tries to detect a polygon from the given image.
nv21 - NV21 encoded camera imagewidth - Width of the image pixelsheight - Height of the image in pixelsenum DetectionResult that gives information about the recognition state.@Nullable public DetectionResult detect(@NotNull kotlin.Array[] data)
Tries to detect a polygon from the given image.
data - Encoded image (e.g. a JPEG)enum DetectionResult that gives information about the recognition state.@Nullable public DetectionResult detect(@NotNull java.lang.String fileName)
Tries to detect a polygon from the given file.
fileName - Encoded file path (e.g. a JPEG)enum DetectionResult that gives information about the recognition state.@Nullable public DetectionResult detect(@NotNull android.graphics.Bitmap bitmap)
Tries to detect a polygon from the given image.
bitmap - The imageenum DetectionResult that gives information about the recognition state.@Nullable public java.util.List<android.graphics.Point> getPolygon()
@Nullable public java.util.List<android.graphics.PointF> getPolygonF()
[0.f, 1.f[.public double getDetectionScore()
[0.0, 100.0].@NotNull public java.util.List<io.scanbot.sdk.core.contourdetector.Line2D> getVerticalLines()
@NotNull public java.util.List<io.scanbot.sdk.core.contourdetector.Line2D> getHorizontalLines()
public void setAcceptedAngleScore(double acceptedAngleScore)
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Default is 75.0. Set lower values to accept more perspective distortion.
Warning: Lower values result in more blurred document images.
acceptedAngleScore - public void setAcceptedSizeScore(double acceptedSizeScore)
The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score. Default is 80.0.
Warning: Lower values result in low resolution document images.
acceptedSizeScore - public void setRequiredAspectRatios(@NotNull
java.util.List<io.scanbot.sdk.core.contourdetector.PageAspectRatio> requiredPageAspectRatios)
Set required class PageAspectRatios.
requiredPageAspectRatios - class PageAspectRatiopublic void setRectOfInterest(@NotNull
android.graphics.RectF rectOfInterest)
Set rect od interest sizes.
rectOfInterest - RectFpublic void resetPolygonHistory()
Calling this method will reset the polygon smoothing history.
public void dispose()
Disposes the native resources held by this instance.
public void dtor(long ptr)
@JvmStatic
@NotNull
public static android.graphics.Bitmap createBitmapFromEncodedData(@NotNull
kotlin.Array[] data)
Creates a ARGB_8888 Bitmap from an in-memory JPEG.
data - JPEG data.@JvmStatic
@NotNull
public static android.graphics.Bitmap createBitmapFromEncodedFile(@Nullable
java.lang.String fileName)
Creates a ARGB_8888 Bitmap from encoded JPEG on file system
fileName - path to JPEG file