我目前正在研究android中的人脸识别.我在网上度过了合理的时间,我在Android中找到了FaceDetector.Face类.这些是这个类的实用程序:
Constants
float CONFIDENCE_THRESHOLD
int EULER_X The x-axis Euler angle of a face.
int EULER_Y The y-axis Euler angle of a face.
int EULER_Z The z-axis Euler angle of a face.
Public Methods
float confidence()
float eyesDistance()
void getMidPoint(PointF point)
float pose(int euler)
Run Code Online (Sandbox Code Playgroud)
问题是,我不知道如何使用这些方法,我找不到任何教程或示例源代码.问题是,我应该使用eyesDistance()来区分人吗?例如,莎拉的眼睛距离= 6.51厘米,约翰的眼睛= 6.82.当代码计算人眼距离时,它是6.82,它是否告诉你"这是约翰"这是识别人的方式吗?或者算法是什么?或者我应该使用EULER常数?以什么方式?我想我将使用这些方法进行人脸识别,但我不知道如何使用它.
或者你能建议另一种面部识别解决方案吗?任何帮助,将不胜感激.
我目前正在忙于语音识别,我希望语音识别器能够永远地听我说话.该应用程序的目的是,它将等待特定关键字的语音:当用户说出此关键字时,服务就可以接收用户语音命令了.经过研究,我发现我们可以完成识别器监听的时间.通过这些常数:
顺便说一句,默认识别器服务侦听大约10秒.(谷歌api)
String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS The amount of time that it should take after we stop hearing speech to consider the input complete.
String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS The minimum length of an utterance.
String EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS The amount of time that it should take after we stop hearing speech to consider the input possibly complete.
Run Code Online (Sandbox Code Playgroud)
http://java.llp2.dcc.ufmg.br/apiminer/docs/reference/android/speech/RecognizerIntent.html
这些是bundle类的附加功能.
问题是,当我在我的代码中使用这些常量时,它不起作用.
这是我的代码:
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 5000);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 5000);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, 5000);
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,虽然我写了5000毫秒,识别器仍然会听我大约10秒钟.
你能想到这个问题吗?也许我不知道如何使用额外的或者它是关于权限,也许它跳过我的代码或我应该添加一些其他代码.
任何帮助都会得到满足.
编辑:这是我的完整代码:
VoiceRecognitionActivity.java
public class VoiceRecognitionActivity extends Activity implements
TextToSpeech.OnInitListener {
private static final int REQUEST_CODE = …Run Code Online (Sandbox Code Playgroud)