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

Manages the recognition pipeline.

Inherits com.pikkart.ar.recognition.CameraManager, and com.pikkart.ar.recognition.data.IRecognitionDataProviderListener.

Public Member Functions

void DisableRecognition ()
 DISABLE the recognition pipeline entirely.
 
void EnableRecognition ()
 ENABLE the recognition pipeline.
 
boolean IsRecognitionEnabled ()
 IS the recognition pipeline enabled.
 
 RecognitionManager (Context context, Fragment fragment, AssetManager amngr, boolean load_markers)
 Constructor: requires main activity, parent fragment, asset manager and whatever or not to load markers on startup.
 
 RecognitionManager (Context context, Fragment fragment, AssetManager amngr)
 Constructor: requires main activity, parent fragment, asset manager.
 
void scheduleTimers ()
 Schedule MAIN_INTERVAL and SERVER_RESPONSE_INTERVAL timers stop recognition at the end of the timers.
 
void stopTimers ()
 Cancel MAIN_INTERVAL and SERVER_RESPONSE_INTERVAL timers. Usually done on a succesfull cloud recognition.
 
void startRecognition (RecognitionOptions recognitionOptions, final IRecognitionListener recognitionListener)
 Start the recognition process. More...
 
void forceMarkerSearch (String markerId)
 Force the system to search fon a specific marker only. Also stop recognition of new markers. As only the selected marker is tracked and detected.
 
void changeRecognitionOptions (RecognitionOptions recognitionOptions)
 Change recognition options.
 
void stopRecognition ()
 Stop recogniton.
 
void localMarkerFound (String markerId)
 Callback from the recognition system. A local(or cloud) markers has been found.
 
void localMarkerNotFound ()
 no one of the locally saved markers has found something, call the cloud recognition service if it was activated.
 
void markerTrackingLost (String markerId)
 Just lost tracing of the current marker.
 
void markerEngineToUpdate (String markerId)
 this app recognition engine is too old for the selected marker.
 
void ARLogoFound (String markerId, int code)
 ARLogo succesfullt found with code.
 
void getMarkerCallback (com.pikkart.ar.recognition.data.models.Marker marker)
 callback from the cloud/DB system on marker data get.
 
void getCameraParamCallback (double[] params)
 callback from the camera parameter async request to the cloud.
 
void findMarkerCallback (com.pikkart.ar.recognition.data.models.Marker marker)
 callback from the cloud recognition service on succesfull cloud recognition.
 
void findSimilarMarkerCallback (String[] markersId)
 UNUSED.
 
boolean isConnectionAvailable (Context context)
 check if connection is available. The actual check is not implemented here, we ask the recognition listener to check it for us. The SDK user will have to provide his own implementation.
 
void loadLocalMarkersOnStartup (boolean isRecognitionManagerRunning)
 Load and save locally all the markers located in the app apk assets folder.
 
void close ()
 force exit activity.
 
void closeWithAlert ()
 force exit activity.
 
- Public Member Functions inherited from com.pikkart.ar.recognition.CameraManager
 CameraManager (Fragment parent)
 Constructor.
 
boolean isRecognitionRunning ()
 To be overridden by derivative classes (i.e. RecognitionManager)
 
void onPreviewFrame (byte[] data, Camera camera)
 callback from the camera on a new frame capture
 
void onCreate ()
 on app onCreate create buffers, surfaceTetures etc... App onCreate need to be forwarded here
 
boolean onTouch (View v, MotionEvent event)
 app onTouch App onTouch need to be forwarded here
 
void onResume ()
 app onResume: open and init camera App onResume need to be forwarded here
 
void onDestroy ()
 app onDestroy: destroy buffers App onDestroy need to be forwarded here
 
void onPause ()
 app onPause: stop camera preview and release resources App onPause need to be forwarded here
 
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...
 

Static Public Member Functions

static String getAppDataPath (Context context)
 Get the app internal storage location in Android.
 
static String getDeviceId (Context context)
 Get the Android device id.
 
static float getScreenInches (Context context)
 Compute the physical screen inches from Android params.
 
static void syncMarkersWithFolder ()
 Force a new synchronization between the loaded marker and the locally saved ones.
 

Static Public Attributes

static boolean NativeWrapperInitialized = false
 Whatever the jni/native side has been previously initialized or not.
 
static int MarkerCacheSize = 25
 Max number of active markers in the system.
 

Protected Attributes

HashSet< String > _markerIds = new HashSet<String>()
 Currently found and tracked marker.
 
IRecognitionListener _recognitionListener
 Callback interface.
 
RecognitionDataProvider _dataProvider
 Data provider for recognition data/markers.
 
Context _context
 Context. Usually parent activity.
 
String _deviceId
 Current device id.
 
- Protected Attributes inherited from com.pikkart.ar.recognition.CameraManager
Camera _camera = null
 The Android Camera.
 
ByteBuffer [] _frameData = null
 Circular ByteBuffers for the frame data.
 
SurfaceTexture _surface
 Placeholder surface texture for the camera.
 
int frames = 0
 frame counter.
 
String saved_focus_mode = FOCUS_MODE_CENTER
 requested focus mode.
 
int _cameraID
 Active camera id.
 
boolean _tapToFocusActive
 FOCUS_MODE_CENTER_W_TAP, taptoFocus is active.
 
boolean _focusAtCenterActive
 our custom focusing is active.
 
boolean _checkfocus
 Flag variable changed by the focustimer.
 
Timer _focusTimer
 focus timer.
 
boolean _focusStep1
 Flag variable, Step1: movement detected.
 
boolean _isTracking
 ARNativeWrapper currently tracking.
 
int _nframesSteady
 Number of consecutive frames of steady device.
 
float _avgRowsValuesLastFocus []
 Avg values of image rows taken at last focus.
 
float _avgRowsValuesPrev []
 Avg values of image rows taken at last frame.
 
Fragment _parent = null
 Parent fragment.
 

Additional Inherited Members

- Protected Member Functions inherited from com.pikkart.ar.recognition.CameraManager
void initCamera () throws IOException
 Init the android camera.
 
void createFocusTimer ()
 Create timers for our custom focus mode.
 
void computeAvgRowsValues ()
 support function for our custom focus mode
 
Camera openCamera ()
 open android camera
 

Member Function Documentation

◆ startRecognition()

void com.pikkart.ar.recognition.RecognitionManager.startRecognition ( RecognitionOptions  recognitionOptions,
final IRecognitionListener  recognitionListener 
)

Must be called at least once to start recognition/tracking.