public class OCRAumentia
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SCREEN_ORIENTATION_LANDSCAPE
Landscape screen orientation
|
static int |
SCREEN_ORIENTATION_PORTRAIT
Portrait screen orientation
|
Constructor and Description |
---|
OCRAumentia() |
Modifier and Type | Method and Description |
---|---|
int |
getCameraPreviewHeight()
Get camera preview height
|
int |
getCameraPreviewWidth()
Get camera preview width
|
FrameLayout |
getCameraViewInstance()
Get camera instance
|
static OCRAumentia |
getmInstance()
OCRAumentia singleton
|
void |
init(Activity context,
java.lang.String api_key,
int resSize)
OCRAumentia init
Call this init method if you want to use your own camera. |
void |
init(Activity context,
java.lang.String api_key,
int orientationMode,
int screenWidth,
int screenHeight,
boolean doAutoFocus,
int previewFormat,
FrameLayout parentLayout,
int resSize)
OCRAumentia init method
Call this init method to use the build it camera. |
boolean |
isRunning()
Check if the engine is running.
|
void |
onAccuracyChanged(Sensor sensor,
int accuracy) |
void |
onSensorChanged(SensorEvent event) |
void |
processFrame(Bitmap bitmap,
boolean rotate)
Process a bitmap to recognise characters.
|
void |
processRGBFrame(int[] RGBdata,
int width,
int height) |
void |
processYUVFrame(byte[] YUVdata,
int width,
int height) |
void |
release()
Release engine
|
void |
setOnTextRecognitionCallback(OnTextRecognition textRecognitionCallback)
Set text recognition callback.
|
void |
start()
Starts the text recognition process
Use this function only if your are using the built in camera |
void |
stop()
Stops the text recognition process
Use this function only if your are using the built in camera |
public static final int SCREEN_ORIENTATION_PORTRAIT
public static final int SCREEN_ORIENTATION_LANDSCAPE
public static OCRAumentia getmInstance()
public void init(Activity context, java.lang.String api_key, int orientationMode, int screenWidth, int screenHeight, boolean doAutoFocus, int previewFormat, FrameLayout parentLayout, int resSize)
context
- Parent activityapi_key
- App API KEYorientationMode
- Application orientation modescreenWidth
- Screen widthscreenHeight
- Screen heightdoAutoFocus
- Enable or disable camera auto focus. By default enabled.previewFormat
- ImageFormat.NV21
or ImageFormat.RGB_565
or PixelFormat.RGBA_8888
parentLayout
- Parent layout where to place the cameraresSize
- Size of the frame to be analysed. public void init(Activity context, java.lang.String api_key, int resSize)
context
- Parent activityapi_key
- App API KEYresSize
- Size of the frame to be analysed. public void release()
public void start()
public void stop()
public boolean isRunning()
public int getCameraPreviewHeight()
public int getCameraPreviewWidth()
public FrameLayout getCameraViewInstance()
public void setOnTextRecognitionCallback(OnTextRecognition textRecognitionCallback)
textRecognitionCallback
- Text recognition callbackpublic void processFrame(Bitmap bitmap, boolean rotate)
bitmap
- Bitmap to processrotate
- true if the text is presented horizontally, false if the text is verticalpublic void processRGBFrame(int[] RGBdata, int width, int height)
public void processYUVFrame(byte[] YUVdata, int width, int height)
public void onSensorChanged(SensorEvent event)
public void onAccuracyChanged(Sensor sensor, int accuracy)