public class

MlKitTextDetectionView

extends ImageProcessingView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.sap.cloud.mobile.fiori.ocr.ImageProcessingView
           ↳ com.sap.cloud.mobile.fiori.ocr.MlKitTextDetectionView

Class Overview

A concrete class for processing image using Android MLKit library. For using the class you wll need to download and save the google service json file in the project. This class provides capabilities for processing an image (converting YUV image to RGB, rotating image if required and cropping image), generate topology of the detected text elements.

Summary

Nested Classes
enum MlKitTextDetectionView.TextRecognizerType Enum class to control which text recognizer to be used. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
MlKitTextDetectionView(Context context)
MlKitTextDetectionView(Context context, AttributeSet attrs)
MlKitTextDetectionView(Context context, AttributeSet attrs, int defStyleAttr)
MlKitTextDetectionView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void onImageReadyForDetection(Bitmap image, IsNextFrameRequestedNotifier requestedNotifier)
process the image after image is ready
void setTextRecognizerType(MlKitTextDetectionView.TextRecognizerType type)
MLKit uses two different types of text recognizers.
void setTopologyDetectionObserver(TopologyDetectionObserver topologyDetectionObserver)
Set the callback for listening to generated topology
[Expand]
Inherited Methods
From class com.sap.cloud.mobile.fiori.ocr.ImageProcessingView
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.sap.cloud.mobile.fiori.ocr.ImageReadyForDetectionListener

Public Constructors

public MlKitTextDetectionView (Context context)

public MlKitTextDetectionView (Context context, AttributeSet attrs)

public MlKitTextDetectionView (Context context, AttributeSet attrs, int defStyleAttr)

public MlKitTextDetectionView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void onImageReadyForDetection (Bitmap image, IsNextFrameRequestedNotifier requestedNotifier)

process the image after image is ready

Parameters
image pre processed image
requestedNotifier should the framework send next pre processed image

public void setTextRecognizerType (MlKitTextDetectionView.TextRecognizerType type)

MLKit uses two different types of text recognizers. One for on device text detection and other for cloud based text detections. Set which type of text detector to be used in this view.

public void setTopologyDetectionObserver (TopologyDetectionObserver topologyDetectionObserver)

Set the callback for listening to generated topology

Parameters
topologyDetectionObserver TextBlockTopology