Class DocumentScannerParameters


  • public class DocumentScannerParameters
    extends java.lang.Object
    Parameters for the document scanner.
    • Constructor Detail

      • DocumentScannerParameters

        public DocumentScannerParameters​(ProcessingMode processingMode,
                                         double acceptedAngleScore,
                                         double acceptedSizeScore,
                                         int acceptedBrightnessThreshold,
                                         double acceptedAspectRatioScore,
                                         java.util.List<AspectRatio> aspectRatios,
                                         boolean ignoreOrientationMismatch)
        Constructs DocumentScannerParameters with the given params.
        Parameters:
        processingMode - In live mode, the document scanner will return only the best document contour. In single-shot mode it will return additional document contours, suitable for use in the cropping screen. Default is AUTO
        acceptedAngleScore - The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Set lower values to accept more perspective distortion. Warning: Lower values result in more blurred document images. Default is 75
        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. Warning: Lower values result in low resolution document images. Default is 80
        acceptedBrightnessThreshold - The minimum brightness value (0-255) to accept a detected document. Default is 0
        acceptedAspectRatioScore - The minimum score in percent (0 - 100) that the aspect ratio of the document must match one of the required aspect ratios (if any) to accept a detected document. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios (if any), otherwise OK_BUT_BAD_ASPECT_RATIO is returned. Default is 85
        aspectRatios - The possible desired aspect ratios for the detected document. A document matches if its aspect ratio matches any of the given aspect ratios. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios, otherwise OK_BUT_BAD_ASPECT_RATIO is returned. If empty, no aspect ratio is preferred.
        ignoreOrientationMismatch - If false, the document scanner will return OK_BUT_ORIENTATION_MISMATCH if the detected document orientation does not match the input image orientation, e.g. if the document is detected as landscape but the input image is portrait. If true, the document scanner will ignore orientation mismatches. Default is false
      • DocumentScannerParameters

        public DocumentScannerParameters()
        Constructs DocumentScannerParameters with default parameters.
    • Method Detail

      • getProcessingMode

        public ProcessingMode getProcessingMode()
        Getter for processingMode field. See constructor documentation for more information about the field.
        Returns:
        processingMode
      • setProcessingMode

        public void setProcessingMode​(ProcessingMode processingMode)
        Setter for processingMode field. See constructor documentation for more information about the field.
        Parameters:
        processingMode - Value to set.
      • getAcceptedAngleScore

        public double getAcceptedAngleScore()
        Getter for acceptedAngleScore field. See constructor documentation for more information about the field.
        Returns:
        acceptedAngleScore
      • setAcceptedAngleScore

        public void setAcceptedAngleScore​(double acceptedAngleScore)
        Setter for acceptedAngleScore field. See constructor documentation for more information about the field.
        Parameters:
        acceptedAngleScore - Value to set.
      • getAcceptedSizeScore

        public double getAcceptedSizeScore()
        Getter for acceptedSizeScore field. See constructor documentation for more information about the field.
        Returns:
        acceptedSizeScore
      • setAcceptedSizeScore

        public void setAcceptedSizeScore​(double acceptedSizeScore)
        Setter for acceptedSizeScore field. See constructor documentation for more information about the field.
        Parameters:
        acceptedSizeScore - Value to set.
      • getAcceptedBrightnessThreshold

        public int getAcceptedBrightnessThreshold()
        Getter for acceptedBrightnessThreshold field. See constructor documentation for more information about the field.
        Returns:
        acceptedBrightnessThreshold
      • setAcceptedBrightnessThreshold

        public void setAcceptedBrightnessThreshold​(int acceptedBrightnessThreshold)
        Setter for acceptedBrightnessThreshold field. See constructor documentation for more information about the field.
        Parameters:
        acceptedBrightnessThreshold - Value to set.
      • getAcceptedAspectRatioScore

        public double getAcceptedAspectRatioScore()
        Getter for acceptedAspectRatioScore field. See constructor documentation for more information about the field.
        Returns:
        acceptedAspectRatioScore
      • setAcceptedAspectRatioScore

        public void setAcceptedAspectRatioScore​(double acceptedAspectRatioScore)
        Setter for acceptedAspectRatioScore field. See constructor documentation for more information about the field.
        Parameters:
        acceptedAspectRatioScore - Value to set.
      • getAspectRatios

        public java.util.List<AspectRatio> getAspectRatios()
        Getter for aspectRatios field. See constructor documentation for more information about the field.
        Returns:
        aspectRatios
      • setAspectRatios

        public void setAspectRatios​(java.util.List<AspectRatio> aspectRatios)
        Setter for aspectRatios field. See constructor documentation for more information about the field.
        Parameters:
        aspectRatios - Value to set.
      • getIgnoreOrientationMismatch

        public boolean getIgnoreOrientationMismatch()
        Getter for ignoreOrientationMismatch field. See constructor documentation for more information about the field.
        Returns:
        ignoreOrientationMismatch
      • setIgnoreOrientationMismatch

        public void setIgnoreOrientationMismatch​(boolean ignoreOrientationMismatch)
        Setter for ignoreOrientationMismatch field. See constructor documentation for more information about the field.
        Parameters:
        ignoreOrientationMismatch - Value to set.