MotionTrackerCameraDevice Class¶
Description¶
MotionTrackerCameraDevice实现了一个真实尺度6DOF运动追踪的camera设备,输出 InputFrame (包含图像、摄像机参数、时间戳、6DOF位置信息和跟踪状态)。
创建之后,可以调用start/stop来开始和停止数据流。
当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。
MotionTrackerCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。参考 概览 。
Constructor¶
创建MotionTrackerCameraDevice对象。
- C
void easyar_MotionTrackerCameraDevice__ctor(easyar_MotionTrackerCameraDevice * * Return)
- C++
MotionTrackerCameraDevice()
- Java
public MotionTrackerCameraDevice()
- Kotlin
constructor()
- Objective-C
+ (easyar_MotionTrackerCameraDevice *) create
- Swift
public convenience init()
- C#
public MotionTrackerCameraDevice()
isAvailable¶
检查设备是否支持Motion Tracking. 当设备支持运动追踪功能时返回True,否则返回False。
- C
bool easyar_MotionTrackerCameraDevice_isAvailable(void)
- C++
static bool isAvailable()
- Java
public static boolean isAvailable()
- Kotlin
companion object fun isAvailable(): Boolean
- Objective-C
+ (bool)isAvailable
- Swift
public static func isAvailable() -> Bool
- C#
public static bool isAvailable()
getQualityLevel¶
获取设备上Motion Tracking的质量,结合应用场景,可以通过此值判断是否启动Motion Tracking。
- C
easyar_MotionTrackerCameraDeviceQualityLevel easyar_MotionTrackerCameraDevice_getQualityLevel(void)
- C++
static MotionTrackerCameraDeviceQualityLevel getQualityLevel()
- Java
public static int getQualityLevel()
- Kotlin
companion object fun getQualityLevel(): Int
- Objective-C
+ (easyar_MotionTrackerCameraDeviceQualityLevel)getQualityLevel
- Swift
public static func getQualityLevel() -> MotionTrackerCameraDeviceQualityLevel
- C#
public static MotionTrackerCameraDeviceQualityLevel getQualityLevel()
setFrameRateType¶
设置当前设备的当前帧率。在start之前调用。如果该功能不被调用,默认是30fps
- C
bool easyar_MotionTrackerCameraDevice_setFrameRateType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFPS fps)
- C++
bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)
- Java
public boolean setFrameRateType(int fps)
- Kotlin
fun setFrameRateType(fps: Int): Boolean
- Objective-C
- (bool)setFrameRateType:(easyar_MotionTrackerCameraDeviceFPS)fps
- Swift
public func setFrameRateType(_ fps: MotionTrackerCameraDeviceFPS) -> Bool
- C#
public virtual bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)
setFocusMode¶
设置对焦模式为focusMode。在start之前调用。如果该功能不被调用,默认是连续自动对焦
- C
bool easyar_MotionTrackerCameraDevice_setFocusMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFocusMode focusMode)
- C++
bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)
- Java
public boolean setFocusMode(int focusMode)
- Kotlin
fun setFocusMode(focusMode: Int): Boolean
- Objective-C
- (bool)setFocusMode:(easyar_MotionTrackerCameraDeviceFocusMode)focusMode
- Swift
public func setFocusMode(_ focusMode: MotionTrackerCameraDeviceFocusMode) -> Bool
- C#
public virtual bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)
setFrameResolutionType¶
设置帧分辨率。在start之前调用。如果该功能不被调用,默认是1280x960或者1280x720
- C
bool easyar_MotionTrackerCameraDevice_setFrameResolutionType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceResolution resolution)
- C++
bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)
- Java
public boolean setFrameResolutionType(int resolution)
- Kotlin
fun setFrameResolutionType(resolution: Int): Boolean
- Objective-C
- (bool)setFrameResolutionType:(easyar_MotionTrackerCameraDeviceResolution)resolution
- Swift
public func setFrameResolutionType(_ resolution: MotionTrackerCameraDeviceResolution) -> Bool
- C#
public virtual bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)
setTrackingMode¶
设置跟踪模式。在start之前调用。如果该功能不被调用,默认是锚点模式
- C
bool easyar_MotionTrackerCameraDevice_setTrackingMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceTrackingMode trackingMode)
- C++
bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)
- Java
public boolean setTrackingMode(int trackingMode)
- Kotlin
fun setTrackingMode(trackingMode: Int): Boolean
- Objective-C
- (bool)setTrackingMode:(easyar_MotionTrackerCameraDeviceTrackingMode)trackingMode
- Swift
public func setTrackingMode(_ trackingMode: MotionTrackerCameraDeviceTrackingMode) -> Bool
- C#
public virtual bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)
setBufferCapacity¶
设置 InputFrame 缓冲的容量。
bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。参考 概览 。
- C
void easyar_MotionTrackerCameraDevice_setBufferCapacity(easyar_MotionTrackerCameraDevice * This, int capacity)
- C++
void setBufferCapacity(int capacity)
- Java
public void setBufferCapacity(int capacity)
- Kotlin
fun setBufferCapacity(capacity: Int): Unit
- Objective-C
- (void)setBufferCapacity:(int)capacity
- Swift
public func setBufferCapacity(_ capacity: Int32) -> Void
- C#
public virtual void setBufferCapacity(int capacity)
bufferCapacity¶
获取 InputFrame 缓冲的容量,默认值为8。
- C
int easyar_MotionTrackerCameraDevice_bufferCapacity(const easyar_MotionTrackerCameraDevice * This)
- C++
int bufferCapacity()
- Java
public int bufferCapacity()
- Kotlin
fun bufferCapacity(): Int
- Objective-C
- (int)bufferCapacity
- Swift
public func bufferCapacity() -> Int32
- C#
public virtual int bufferCapacity()
inputFrameSource¶
InputFrame 输出端口。
- C
void easyar_MotionTrackerCameraDevice_inputFrameSource(easyar_MotionTrackerCameraDevice * This, easyar_InputFrameSource * * Return)
- C++
std::shared_ptr<InputFrameSource> inputFrameSource()
- Java
public @Nonnull InputFrameSource inputFrameSource()
- Kotlin
fun inputFrameSource(): InputFrameSource
- Objective-C
- (easyar_InputFrameSource *)inputFrameSource
- Swift
public func inputFrameSource() -> InputFrameSource
- C#
public virtual InputFrameSource inputFrameSource()
inputFrameSourceType¶
InputFrame来源类型。
- C
easyar_InputFrameSourceType easyar_MotionTrackerCameraDevice_inputFrameSourceType(easyar_MotionTrackerCameraDevice * This)
- C++
InputFrameSourceType inputFrameSourceType()
- Java
public int inputFrameSourceType()
- Kotlin
fun inputFrameSourceType(): Int
- Objective-C
- (easyar_InputFrameSourceType)inputFrameSourceType
- Swift
public func inputFrameSourceType() -> InputFrameSourceType
- C#
public virtual InputFrameSourceType inputFrameSourceType()
start¶
开始运动追踪,或者从暂停中触发重定位,成功后继续追踪。
注意:如果设备是调用stop暂停后再调用start追踪,会触发重定位,当重定位成功以后才会继续追踪。
- C
bool easyar_MotionTrackerCameraDevice_start(easyar_MotionTrackerCameraDevice * This)
- C++
bool start()
- Java
public boolean start()
- Kotlin
fun start(): Boolean
- Objective-C
- (bool)start
- Swift
public func start() -> Bool
- C#
public virtual bool start()
stop¶
暂停运动追踪。调用start触发重定位,重定位成功后继续运动追踪。
- C
void easyar_MotionTrackerCameraDevice_stop(easyar_MotionTrackerCameraDevice * This)
- C++
void stop()
- Java
public void stop()
- Kotlin
fun stop(): Unit
- Objective-C
- (void)stop
- Swift
public func stop() -> Void
- C#
public virtual void stop()
close¶
关闭运动追踪过程。close之后不应继续使用。
- C
void easyar_MotionTrackerCameraDevice_close(easyar_MotionTrackerCameraDevice * This)
- C++
void close()
- Java
public void close()
- Kotlin
fun close(): Unit
- Objective-C
- (void)close
- Swift
public func close() -> Void
- C#
public virtual void close()
hitTestAgainstPointCloud¶
在当前点云中进行Hit Test,得到距离相机从近到远一条射线上的最近的一个3D点位置坐标。该点由三个连续的值表示,分别代表X,Y,Z轴上的坐标值。
输入图像坐标系([0, 1]^2)的x朝右、y朝下,原点在左上角。可以使用 CameraParameters.imageCoordinatesFromScreenCoordinates 来从屏幕坐标转换为图像坐标。
- C
void easyar_MotionTrackerCameraDevice_hitTestAgainstPointCloud(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
- C++
std::vector<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)
- Java
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstPointCloud(@Nonnull Vec2F cameraImagePoint)
- Kotlin
fun hitTestAgainstPointCloud(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- Objective-C
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPointCloud:(easyar_Vec2F *)cameraImagePoint
- Swift
public func hitTestAgainstPointCloud(_ cameraImagePoint: Vec2F) -> [Vec3F]
- C#
public virtual List<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)
hitTestAgainstHorizontalPlane¶
在当前视野内实时检测到的水平面上进行Hit Test,点击到某个水平面后返回该平面上距离Hit Test射线最近的3D点的位置坐标。
输入图像坐标系([0, 1]^2)的x朝右、y朝下,原点在左上角。可以使用 CameraParameters.imageCoordinatesFromScreenCoordinates 来从屏幕坐标转换为图像坐标。
输出为平面上的点云在世界坐标系中的坐标。每一个点由三个连续的值表示,分别代表X,Y,Z轴上的坐标值。
- C
void easyar_MotionTrackerCameraDevice_hitTestAgainstHorizontalPlane(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
- C++
std::vector<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)
- Java
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstHorizontalPlane(@Nonnull Vec2F cameraImagePoint)
- Kotlin
fun hitTestAgainstHorizontalPlane(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- Objective-C
- (NSArray<easyar_Vec3F *> *)hitTestAgainstHorizontalPlane:(easyar_Vec2F *)cameraImagePoint
- Swift
public func hitTestAgainstHorizontalPlane(_ cameraImagePoint: Vec2F) -> [Vec3F]
- C#
public virtual List<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)
getLocalPointsCloud¶
获取当前点云数据位置信息。其中点云位置为世界坐标系中的位置,每一个点由三个连续的值表示,分别代表X,Y,Z轴上的坐标值。
- C
void easyar_MotionTrackerCameraDevice_getLocalPointsCloud(easyar_MotionTrackerCameraDevice * This, easyar_ListOfVec3F * * Return)
- C++
std::vector<Vec3F> getLocalPointsCloud()
- Java
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> getLocalPointsCloud()
- Kotlin
fun getLocalPointsCloud(): ArrayList<Vec3F>
- Objective-C
- (NSArray<easyar_Vec3F *> *)getLocalPointsCloud
- Swift
public func getLocalPointsCloud() -> [Vec3F]
- C#
public virtual List<Vec3F> getLocalPointsCloud()