public interface VuforiaLocalizer
VuforiaLocalizer
interface provides
an interface for interacting with subsystems that can help support localization through
visual means.Modifier and Type | Interface and Description |
---|---|
static class |
VuforiaLocalizer.CameraDirection
VuforiaLocalizer.CameraDirection enumerates the identities of the builtin phone cameras that Vuforia can use. |
static class |
VuforiaLocalizer.CloseableFrame
VuforiaLocalizer.CloseableFrame exposes a close() method so that one can proactively
reduce memory pressure when we're done with a Frame |
static class |
VuforiaLocalizer.Parameters
VuforiaLocalizer.Parameters provides configuration information for instantiating the Vuforia localizer |
Modifier and Type | Method and Description |
---|---|
android.graphics.Bitmap |
convertFrameToBitmap(Frame frame)
(Advanced) A helper utility that converts a Vuforia
Frame into an Android Bitmap . |
void |
enableConvertFrameToBitmap()
(Advanced) Ensures that Vuforia exposes necessary data formats in
Frame s that allows
convertFrameToBitmap(Frame) to function |
boolean[] |
enableConvertFrameToFormat(int... pixelFormats)
(Advanced) Ask Vuforia to convert frames to the given requested formats.
|
Camera |
getCamera()
Provides access to the
Camera used by Vuforia. |
CameraCalibration |
getCameraCalibration()
(Advanced) Returns information about Vuforia's knowledge of the camera that it is using.
|
CameraName |
getCameraName()
Provides access to the name of the camera used by Vuforia.
|
void |
getFrameOnce(<any> frameConsumer)
(Advanced) Calls the indicated code with a frame from the video stream, exactly once.
|
java.util.concurrent.BlockingQueue<VuforiaLocalizer.CloseableFrame> |
getFrameQueue()
(Advanced) Returns a queue into which, if requested, Vuforia
Frame s are placed
as they become available. |
int |
getFrameQueueCapacity()
(Advanced) Returns the current capacity of the frame queue.
|
VuforiaTrackables |
loadTrackablesFromAsset(java.lang.String assetName)
Loads a Vuforia dataset from the indicated application asset, which must be of
type .XML.
|
VuforiaTrackables |
loadTrackablesFromFile(java.lang.String absoluteFileName)
Loads a Vuforia dataset from the indicated file, which must be a .XML file
and contain the full file path.
|
void |
setFrameQueueCapacity(int capacity)
(Advanced) Sets the maximum number of
Frame s that will simultaneously be stored in the
frame queue. |
VuforiaTrackables loadTrackablesFromAsset(java.lang.String assetName)
Datasets are created using the Vuforia Target Manager
assetName
- the name of the .XML dataset asset to loadloadTrackablesFromFile(String)
VuforiaTrackables loadTrackablesFromFile(java.lang.String absoluteFileName)
Datasets are created using the Vuforia Target Manager
absoluteFileName
- the full path to the .XML file of the datasetloadTrackablesFromAsset(String)
Camera getCamera()
Camera
used by Vuforia. Will be null if a built-in camera
is in use. Note that Vuforia is usually actively interacting with this Camera
; users
should on their own not initiate streaming, close the camera, or the like.CameraName getCameraName()
CameraCalibration getCameraCalibration()
com.vuforia.Tool#getProjectionGL(CameraCalibration, float, float)
java.util.concurrent.BlockingQueue<VuforiaLocalizer.CloseableFrame> getFrameQueue()
Frame
s are placed
as they become available. This provides a means by which camera image data can be accessed
even while the Vuforia engine is running.
While the Vuforia engine is running, it takes exclusive ownership of the camera it is
using. This impedes the ability to also use that camera image data in alternative visual
processing algorithms. However, periodically (at a rate of tens of Hz), the Vuforia engine
makes available Frame
s containing snapshots from the camera, and through which
camera image data can be retrieved. These can optionally be retrieved through the frame
queue.
To access these Frame
s, call setFrameQueueCapacity(int)
to enable the
frame queue. Once enabled, the frame queue can be accessed using getFrameQueue()
and the methods thereon used to access Frame
s as they become available.
When setFrameQueueCapacity(int)
is called, any frame queue returned previously by
getFrameQueue()
becomes invalid and must be re-fetched.
Frame
s may be retrieved.setFrameQueueCapacity(int)
,
Frame (Java),
Frame (C++),
BlockingQueuevoid setFrameQueueCapacity(int capacity)
Frame
s that will simultaneously be stored in the
frame queue. If the queue is full and new Frame
s become available, older frames
will be discarded. The frame queue initially has a capacity of zero.
Note that calling this method invalidates any frame queue retrieved previously
through getFrameQueue()
.
capacity
- the maximum number of items that may be stored in the frame queuegetFrameQueue()
,
getFrameQueueCapacity()
int getFrameQueueCapacity()
setFrameQueueCapacity(int)
,
getFrameQueue()
void getFrameOnce(<any> frameConsumer)
frameConsumer
- the code to call with the to-be-processed frame.void enableConvertFrameToBitmap()
Frame
s that allows
convertFrameToBitmap(Frame)
to functionboolean[] enableConvertFrameToFormat(int... pixelFormats)
pixelFormats
- Formats to request Vuforia to convert to.android.graphics.Bitmap convertFrameToBitmap(Frame frame)
Frame
into an Android Bitmap
.