在Glass上访问后置摄像头 [英] Accessing rear facing camera on Glass
问题描述
我浏览了api,stackoverflow和google,却没有找到任何东西. API中是否有一种方法可以访问面对眼睛的相机?我想知道用户的眼睛是睁开还是闭着...使用此版本的GDK可以做到吗?
内置的眨眼拍照应用程序在做什么吗?
AFAIK,您目前无法确定打开/关闭状态,但是假设您具有最新版本的Glass硬件,则可以支持某些眼动手势.>
从此处,您可以看到受支持的手势:
BLINK("BLINK", 3),
DOFF("DOFF", 6),
DON("DON", 5),
DOUBLE_BLINK("DOUBLE_BLINK", 4),
DOUBLE_WINK("DOUBLE_WINK", 2),
NO_GESTURE("NO_GESTURE", 0),
WINK("WINK", 1);
此外,在该页面上,他们还说明了您如何收听com.google.glass.action.EYE_GESTURE
意图以接收事件:
如果您正在编写应用程序,则收听的意图是
com.google.glass.action.EYE_GESTURE
.有一个公共API 在未记录的软件包中启用/禁用它们android.glass.GlassGestureManager
.通过获取Context.getSystemService("glass_gesture")
.
查看winky的 MainActivity .java 为例.
这是另一个与眼睛手势交互的眼睛手势示例.
I looked through the api, stackoverflow and google, and didn't find anything. Is there a way in the API to access the camera that faces the eye? I would like to be able to tell if the user's eye is open or closed...is this possible with this version of the GDK?
Is that what the built in wink-to-take-a-picture app is doing?
AFAIK, you cannot currently determine open/closed, however there are some eye gestures that are supported, assuming that you have the latest version of Glass hardware.
From here, you can see the supported gestures:
BLINK("BLINK", 3),
DOFF("DOFF", 6),
DON("DON", 5),
DOUBLE_BLINK("DOUBLE_BLINK", 4),
DOUBLE_WINK("DOUBLE_WINK", 2),
NO_GESTURE("NO_GESTURE", 0),
WINK("WINK", 1);
Also, on that page, they explain how you have to listen to the com.google.glass.action.EYE_GESTURE
intent to receive the events:
If you are writing an app, the intent to listen for is
com.google.glass.action.EYE_GESTURE
. There is a public API to enable/disable them in the undocumented packageandroid.glass.GlassGestureManager
. Get it viaContext.getSystemService("glass_gesture")
.
Check out winky's MainActivity.java for an example.
Here's another eye gesture example which interacts with eye gestures.
这篇关于在Glass上访问后置摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!