使用Android检测人的跌倒 [英] Detect person's fall with Android

查看:122
本文介绍了使用Android检测人的跌倒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好

在使用Microsoft SQL Server开发C#/ ASP.NET中的某些应用程序/网站之前,我是Android开发的新手。
现在我要开发一个Android应用程序,以检测我何时摔倒并发送警报。
我发现了这样的示例:

I'm new in Android development, before I deveped some application/website in C#/ASP.NET with Microsoft SQL Server. Now I've to develop a Android application to detect when I person falls down and send an alarm. I found an examples like this:

public class MainActivity extends Activity implements SensorEventListener{
    private SensorManager sensorManager;
    TextView text_X;
    TextView text_Y;
    TextView text_Z;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
        sensorManager.registerListener(this, sensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER ),SensorManager.SENSOR_DELAY_NORMAL );
        //Collegamento con le textView del layout
        text_X=(TextView)findViewById(R.id.txtXValue);
        text_Y=(TextView)findViewById(R.id.txtYValue);
        text_Z=(TextView)findViewById(R.id.txtZValue);
    }

    @Override
    public void onSensorChanged(SensorEvent event) {
        if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
            //L'accelerometro ha cambiato stato
            mostraValori(event);
        }

    }   

    @Override
    public void onAccuracyChanged(Sensor sensor, int accuracy) {

    }

    private void mostraValori(SensorEvent event){
        float[] valori=event.values;//array che contiene i valori dell'accelerometro
        //modifica del valore delle textView

        text_X.setText("Valore X: "+valori[0]);
        text_Y.setText("Valore Y: "+valori[1]);
        text_Z.setText("Valore Z: "+valori[2]);

    }
}

所以加速度计的X屏幕上的Y和Z值。
现在下一步是什么?

So I've accelerometer's X, Y and Z values on the screen. Now what is the next step?

谢谢。

推荐答案

恕我直言,下一步是让您决定在一段时间内哪种加速度计值曲线表示下降,从而最大程度地减少误报和误报。这将需要考虑使用的设备种类(平板电脑?手机?手表?眼镜?)以及如何使用(手持电话?口袋里的电话?钱包里的电话?)。

IMHO, the next step is for you to decide what profile of accelerometer values over a time period represent a "fall", in a way that minimizes false positives and false negatives. This will need to take into account the sort of device that is being used (tablet? phone? watch? glasses?) and how it is being used (phone in hand? phone in pocket? phone in purse?).

这篇关于使用Android检测人的跌倒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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