public class VisionManager implements BaseVisionManager
The main object for registering for events from the SDK, starting and stopping their delivery. It also provides some useful functions for performance configuration and data conversion.
Lifecycle of VisionManager :
VisionManager.startRecording
(optional)
VisionManager.stopRecording
(optional)
VisionManager.stop
, then lifecycle may proceed with VisionManager.destroy
or VisionManager.start
Modifier and Type | Field and Description |
---|---|
static VisionManager |
INSTANCE
The main object for registering for events from the SDK, starting and stopping their delivery.
It also provides some useful functions for performance configuration and data conversion.
|
Modifier and Type | Method and Description |
---|---|
static void |
create(VideoSource videoSource)
Method for creating a
class VisionManager instance.
It's only allowed to have one living instance of class VisionManager or class VisionReplayManager .
To create class VisionManager with different configuration call VisionManager.destroy on existing instance or release all references to it. |
static void |
create()
Method for creating a
class VisionManager instance.
It's only allowed to have one living instance of class VisionManager or class VisionReplayManager .
To create class VisionManager with different configuration call VisionManager.destroy on existing instance or release all references to it. |
static void |
destroy()
Clean up the state and resources of
class VisionManager .
Do NOT call this method more than once. |
static WorldCoordinate |
geoToWorld(GeoCoordinate geoCoordinate)
Converts the location of the point from a geographical coordinate to a world coordinate.
|
android.app.Application |
getApplication() |
static FrameStatistics |
getFrameStatistics() |
java.lang.String |
getMapboxToken() |
static VisionEventsListener |
getVisionEventsListener()
Listener for
class VisionManager . It's held as a week reference. |
static void |
init(android.app.Application application,
java.lang.String mapboxToken)
Initialize SDK with mapbox access token and application instance.
Do it once per application session, eg in android.app.Application.onCreate.
|
static WorldCoordinate |
pixelToWorld(PixelCoordinate pixelCoordinate)
Converts the location of the point from a frame coordinate to a world coordinate.
|
void |
registerModule(ModuleInterface moduleInterface) |
static void |
setModelPerformance(ModelPerformance modelPerformance) |
static void |
setModelPerformanceConfig(ModelPerformanceConfig modelPerformanceConfig)
Deprecated.
|
static void |
setVisionEventsListener(VisionEventsListener p)
Listener for
class VisionManager . It's held as a week reference. |
static void |
start()
Start delivering events from
class VisionManager .
Should be called with all permission granted, and after VisionManager.create is called.
Do NOT call this method more than once or after VisionManager.destroy is called. |
static void |
startRecording(java.lang.String path)
Start recording a session.
Do NOT call this method more than once or before
VisionManager.start or after VisionManager.stop is called.
During the session full telemetry and video are recorded to specified path.
You may use resulted directory to replay the recorded session with class VisionReplayManager .
Important: Method serves debugging purposes.
Do NOT use session recording in production applications. |
static void |
stop()
Stop delivering events from
class VisionManager .
Do NOT call this method more than once or before VisionManager.start or after VisionManager.destroy is called.
To resume call VisionManager.start again.
Call this method after VisionManager.start and before VisionManager.destroy . |
static void |
stopRecording()
Stop recording a session.
Do NOT call this method more than once or before
VisionManager.startRecording or after VisionManager.stop is called.
Important: Method serves debugging purposes.
Do NOT use session recording in production applications. |
void |
unregisterModule(ModuleInterface moduleInterface) |
static GeoCoordinate |
worldToGeo(WorldCoordinate worldCoordinate)
Converts the location of the point in a world coordinate to a geographical coordinate.
|
static PixelCoordinate |
worldToPixel(WorldCoordinate worldCoordinate)
Converts the location of the point from a world coordinate to a frame coordinate.
|
registerModule, unregisterModule
public static VisionManager INSTANCE
The main object for registering for events from the SDK, starting and stopping their delivery. It also provides some useful functions for performance configuration and data conversion.
Lifecycle of VisionManager :
VisionManager.startRecording
(optional)
VisionManager.stopRecording
(optional)
VisionManager.stop
, then lifecycle may proceed with VisionManager.destroy
or VisionManager.start
public android.app.Application getApplication()
public java.lang.String getMapboxToken()
public static VisionEventsListener getVisionEventsListener()
Listener for class VisionManager
. It's held as a week reference.
class VisionManager
public static void setVisionEventsListener(VisionEventsListener p)
Listener for class VisionManager
. It's held as a week reference.
class VisionManager
public static void init(android.app.Application application, java.lang.String mapboxToken)
Initialize SDK with mapbox access token and application instance. Do it once per application session, eg in android.app.Application.onCreate.
public static void create(VideoSource videoSource)
Method for creating a class VisionManager
instance.
It's only allowed to have one living instance of class VisionManager
or class VisionReplayManager
.
To create class VisionManager
with different configuration call VisionManager.destroy
on existing instance or release all references to it.
videoSource
- : Video source which will be utilized by class VisionManager
.class VisionManager
,
class VisionManager
,
class VisionReplayManager
,
class VisionManager
,
VisionManager.destroy
public static void create()
Method for creating a class VisionManager
instance.
It's only allowed to have one living instance of class VisionManager
or class VisionReplayManager
.
To create class VisionManager
with different configuration call VisionManager.destroy
on existing instance or release all references to it.
public static void start()
Start delivering events from class VisionManager
.
Should be called with all permission granted, and after VisionManager.create
is called.
Do NOT call this method more than once or after VisionManager.destroy
is called.
public static void startRecording(java.lang.String path)
Start recording a session.
Do NOT call this method more than once or before VisionManager.start
or after VisionManager.stop
is called.
During the session full telemetry and video are recorded to specified path.
You may use resulted directory to replay the recorded session with class VisionReplayManager
.
Important: Method serves debugging purposes.
Do NOT use session recording in production applications.
path
- : Path to directory where you'd like session to be recorded.VisionManager.start
,
VisionManager.stop
,
class VisionReplayManager
public static void stopRecording()
Stop recording a session.
Do NOT call this method more than once or before VisionManager.startRecording
or after VisionManager.stop
is called.
Important: Method serves debugging purposes.
Do NOT use session recording in production applications.
VisionManager.startRecording
,
VisionManager.stop
public static void stop()
Stop delivering events from class VisionManager
.
Do NOT call this method more than once or before VisionManager.start
or after VisionManager.destroy
is called.
To resume call VisionManager.start
again.
Call this method after VisionManager.start
and before VisionManager.destroy
.
public static void destroy()
Clean up the state and resources of class VisionManager
.
Do NOT call this method more than once.
class VisionManager
public static void setModelPerformanceConfig(ModelPerformanceConfig modelPerformanceConfig)
public static void setModelPerformance(ModelPerformance modelPerformance)
public static PixelCoordinate worldToPixel(WorldCoordinate worldCoordinate)
Converts the location of the point from a world coordinate to a frame coordinate.
class PixelCoordinate
if worldCoordinate can be represented in screen coordinates and null otherwisepublic static WorldCoordinate pixelToWorld(PixelCoordinate pixelCoordinate)
Converts the location of the point from a frame coordinate to a world coordinate.
class WorldCoordinate
if pixelCoordinate can be projected on the road and null otherwisepublic static GeoCoordinate worldToGeo(WorldCoordinate worldCoordinate)
Converts the location of the point in a world coordinate to a geographical coordinate.
public static WorldCoordinate geoToWorld(GeoCoordinate geoCoordinate)
Converts the location of the point from a geographical coordinate to a world coordinate.
public static FrameStatistics getFrameStatistics()
public void registerModule(ModuleInterface moduleInterface)
public void unregisterModule(ModuleInterface moduleInterface)