Pikkart-AR SDK  3.5
Android SDK References
com.pikkart.ar.recognition.RecognitionFragment Class Reference

The basic component of the Pikkart Augmented Reality SDK. More...

Inherits Fragment, and OnTouchListener.

Inherited by com.pikkart.ar.geo.GeoFragment.

Public Member Functions

void startRecognition (RecognitionOptions recognitionOptions, IRecognitionListener recognitionCallback)
 Starts the recognition process with the selected RecognitionOptions and IRecognitionListener. More...
 
void stopRecognition ()
 Stop the active recognition process manually without closing the camera. More...
 
void changeRecognitionOptions (RecognitionOptions recognitionOptions)
 Changes the current RecognitionOptions without stopping the recognition process. More...
 
void setMarkerCacheSize (int markerCacheSize)
 Set the max number of markers to keep locally. More...
 
boolean isRecognitionActive ()
 Returns if the recognition is currently running. More...
 
boolean enableTorch ()
 Turn on the torch of the device. More...
 
boolean disableTorch ()
 Turn off the torch of the device. More...
 
void setFocusMode (String mode)
 Set the selected focus mode for the camera if available for the device. More...
 
String getFocusMode ()
 Retrieve the currently set focus mode. More...
 
String GetAppPath ()
 Returns the local storage application path.
 
void DisableRecognition ()
 Disable the recognition system.
 
void EnableRecognition ()
 Enables the recognition system.
 
boolean IsRecognitionEnabled ()
 Is the recognition system enabled.
 

Static Public Member Functions

static boolean isTracking ()
 Returns if the Pikkart-AR SDK is currently tracking a marker. More...
 
static Marker getCurrentMarker ()
 Returns the currently tracked marker. More...
 
static float [] getCurrentProjectionMatrix ()
 Returns the current projection matrix and make it available for rendering purpose. More...
 
static float [] getCurrentModelViewMatrix ()
 Returns the current modelview matrix and make it available for rendering purpose. More...
 
static void renderCamera (int viewportWidth, int viewportHeight, int angle)
 Create a texture and render the current camera frame. More...
 

Protected Attributes

RecognitionManager _recognitionManager = null
 The recognition manager.
 
View _fragmentView = null
 This fragment view root.
 
AssetManager asset_manager =null
 The asset manager.
 
RecognitionOptions requestedRecognitionOptions =null
 requested recognition options.
 
IRecognitionListener requestedRecognitionCallback =null
 The recognition listener (usually the calling activity).
 

Detailed Description

The RecognitionFragment is a an Android Fragment that controls the camera and the recognition process.

At its creation it open the camera and setup all its parameters and the internal variables of the system.

It exposes simple methods to manage the recognition process and the communication with the Pikkart Cloud Recognition Service

Member Function Documentation

◆ startRecognition()

void com.pikkart.ar.recognition.RecognitionFragment.startRecognition ( RecognitionOptions  recognitionOptions,
IRecognitionListener  recognitionCallback 
)

Starts the recognition process with the selected RecognitionOptions and IRecognitionListener

◆ stopRecognition()

void com.pikkart.ar.recognition.RecognitionFragment.stopRecognition ( )

Stop the active recognition process manually without closing the camera.

◆ changeRecognitionOptions()

void com.pikkart.ar.recognition.RecognitionFragment.changeRecognitionOptions ( RecognitionOptions  recognitionOptions)

Changes the current RecognitionOptions without stopping the recognition process.

◆ setMarkerCacheSize()

void com.pikkart.ar.recognition.RecognitionFragment.setMarkerCacheSize ( int  markerCacheSize)

Set the max number of markers to keep locally.

If this limit is overcome the oldest accessed markers will be deleted in order to avoid a performance degradation.

Markers from local database will not be deleted even if overcome this limit.

◆ isRecognitionActive()

boolean com.pikkart.ar.recognition.RecognitionFragment.isRecognitionActive ( )

Returns if the recognition is currently running.

◆ isTracking()

static boolean com.pikkart.ar.recognition.RecognitionFragment.isTracking ( )
static

Returns if the Pikkart-AR SDK is currently tracking a marker.

◆ getCurrentMarker()

static Marker com.pikkart.ar.recognition.RecognitionFragment.getCurrentMarker ( )
static

Returns the currently tracked marker.

Returns
A Marker object if the Pikkart-AR SDK is currently tracking a marker, null otherwise.

◆ getCurrentProjectionMatrix()

static float [] com.pikkart.ar.recognition.RecognitionFragment.getCurrentProjectionMatrix ( )
static

Returns the current projection matrix and make it available for rendering purpose.

Returns
A row-major array of 16 float representing a 4x4 matrix.

◆ getCurrentModelViewMatrix()

static float [] com.pikkart.ar.recognition.RecognitionFragment.getCurrentModelViewMatrix ( )
static

Returns the current modelview matrix and make it available for rendering purpose.

Returns
A row-major array of 16 float representing a 4x4 matrix.

◆ renderCamera()

static void com.pikkart.ar.recognition.RecognitionFragment.renderCamera ( int  viewportWidth,
int  viewportHeight,
int  angle 
)
static

Create a texture and render the current camera frame.

This method has to be called inside an OpenGL context and called whenever is necessary to update the current image.

It manages automatically creation, update and deletion of the texture.

Please refers to the tutorial if you want a better understanding of how to use this method.

Parameters
viewportWidthThe width in pixels of the rendered camera image.
viewportHeightThe height in pixels of the rendered camera image.
angleThe current angle of rotation of the device.

◆ enableTorch()

boolean com.pikkart.ar.recognition.RecognitionFragment.enableTorch ( )

Turn on the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ disableTorch()

boolean com.pikkart.ar.recognition.RecognitionFragment.disableTorch ( )

Turn off the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ setFocusMode()

void com.pikkart.ar.recognition.RecognitionFragment.setFocusMode ( String  mode)

Set the selected focus mode for the camera if available for the device.

Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.

Parameters
modeA string representing a focus mode included in Camera.Parameters.

◆ getFocusMode()

String com.pikkart.ar.recognition.RecognitionFragment.getFocusMode ( )

Retrieve the currently set focus mode.

Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.

Returns
A String representing the currently set focus mode .