在Glass上访问后置摄像头 [英] Accessing rear facing camera on Glass

查看:77
本文介绍了在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 package android.glass.GlassGestureManager . Get it via Context.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆