Package 

Class ImageCaptureScenario

  • All Implemented Interfaces:
    com.abbyy.mobile.uicomponents.scenario.CaptureScenario , com.abbyy.mobile.uicomponents.scenario.ImageCaptureSettings

    
    public final class ImageCaptureScenario
    extends BaseCaptureScenario implements ImageCaptureSettings
                        

    Provides access to the image capture scenario management. The ImageCaptureScenario object constructor receives an instance of the Engine object, required for connection of the User Interface API with the capture and recognition mechanisms.

    Scenario represented by this class is started when the CaptureView.setCaptureScenario method of the CaptureView is called.

    • Constructor Detail

      • ImageCaptureScenario

        ImageCaptureScenario(Engine engine)
    • Method Detail

      • isCropEnabled

        @Deprecated(message = "This flag should no longer be used", replaceWith = @ReplaceWith(imports = {}, expression = "false"))@MainThread() Boolean isCropEnabled()

        Checks if the crop function is enabled and the captured image will be cropped.

      • setCropEnabled

        @Deprecated(message = "This flag should no longer be used")@MainThread() Unit setCropEnabled(Boolean isCropEnabled)

        Enables or disables the automatic crop option. In case this option is enabled, the fields around captured document will be cropped. Also perspective distortion will be corrected if needed.

        Parameters:
        isCropEnabled - This parameter defines if the crop option should be enabled.
      • setMinimumDocumentToViewRatio

        @MainThread() Unit setMinimumDocumentToViewRatio(Float ratio)

        Set the minimum document area, relative to the whole frame area, that is required for capture. If the document area is less than that, the image will not be captured.

        Parameters:
        ratio - The 0..
      • setAspectRatioMin

        @MainThread() Unit setAspectRatioMin(Float minValue)

        Set the lower limit of the document's aspect ratio.

        This method is used in pair with the setAspectRatioMax, defining an interval of acceptable aspect ratio values of the document to be captured. Setting aspect ratio will help to improve boundary detection accuracy.

        If only upper limit is set, lower limit will be set to 1.

        Note: Aspect ratio is calculated by division of the upper limit to lower limit and is expected to be greater than or equal to 1 (or 0 if not set). By default aspect ratio is not set and is defined by DocumentSize.

        Parameters:
        minValue - minimum acceptable value for document's aspect ratio
      • getAspectRatioMin

        @MainThread() Float getAspectRatioMin()

        Return the value of defined lower limit of document's aspect ratio.

      • setAspectRatioMax

        @MainThread() Unit setAspectRatioMax(Float maxValue)

        Set the upper limit of document's aspect ratio.

        This method is used in pair with the setAspectRatioMin, defining an interval of acceptable aspect ratio values of the document to be captured. Setting aspect ratio will help to improve boundary detection accuracy.

        If only lower limit is set, upper limit will be set to infinity

        Note: Aspect ratio is calculated by division of the upper limit to lower limit and is expected to be greater than or equal to 1 (or 0 if not set). By default aspect ratio is not set and is defined by DocumentSize.

        Parameters:
        maxValue - maximum acceptable value for document's aspect ratio
      • getAspectRatioMax

        @MainThread() Float getAspectRatioMax()

        Return the value of defined upper limit of document's aspect ratio.

      • getImageFromGalleryMaxSize

        @MainThread() Integer getImageFromGalleryMaxSize()

        Return the value of the maximum available size of an image that can be loaded from the gallery.

      • setNamedProperty

        @MainThread() Unit setNamedProperty(String name, Object value)

        Set the named extended property for image capture.

        Parameters:
        name - the name of the property
        value - the value of the property
      • start

        @MainThread() final Unit start()

        Starts the capture scenario execution.

        This method can be called before the camera launch. In this case scenario will start simultaneously with the camera.

      • captureImageManually

        @MainThread() final Unit captureImageManually()

        Captures image immediately. This method is useful for implementing your own manual capture button.

      • stop

        @MainThread() final Unit stop()

        Stops the automatic capture process and releases the resources.

      • pickImageFromGallery

        @MainThread() final Unit pickImageFromGallery()

        Opens image gallery view. This method can be used for implementing your own gallery button.

      • setManualCaptureEnabled

        @MainThread() final Unit setManualCaptureEnabled(Boolean isEnabled)

        Enables manual capture buttons (photo and gallery) for user.

        Parameters:
        isEnabled - Set true to enable buttons for user and false otherwise.