【问题标题】:comparing user signature using guestures使用手势比较用户签名
【发布时间】:2012-06-13 08:34:41
【问题描述】:

在我的应用程序中,用户将输入签名,下次它会比较并进行身份验证。

我看到了关于 SO 的问题,但我找不到我们如何比较。如果我们使用手势并将文件存储为图像,则它不正确,因为用户下次签名时可能变化不大。

我曾尝试使用自己的手势进行比较,但首先多笔画无法正常工作,第二个预测并不完美。

将手势添加到库: 公共无效添加手势(){ if (mGesture != null) {

            final GestureLibrary store = getStore();
            store.addGesture("ges", mGesture);
            store.save();
            setResult(RESULT_OK);

            final String path = new File(Environment.getExternalStorageDirectory(),
                    "gestures").getAbsolutePath();
            Toast.makeText(this,"success", Toast.LENGTH_LONG).show();
        } else {
            setResult(RESULT_CANCELED);
        }           
    }

比较:

public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
        ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
        Log.e("predictions","predictions----"+predictions.size());
        // We want at least one prediction
        if (predictions.size() > 0) {
            Prediction prediction = predictions.get(0);
            // We want at least some confidence in the result
            Log.e("SCORE","SCORE----"+prediction.score);
            if (prediction.score > 1.0) {
                // Show the spell
                Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();
            }
        }
    }

任何人都可以提出一些关于这个的建议。

【问题讨论】:

    标签: android gesture


    【解决方案1】:

    您可以做一件事,将预测分数从 0.7 降低到 0.7。

    if (prediction.score > 0.7) {                 // Show the spell                 Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();             } 
    

    我认为这应该可以解决您的问题。

    【讨论】:

    • 我应该减少还是增加,因为文档说分数低于 1.0 很差?
    • 你应该减少它。因为签名总是有点变化。否则不匹配。
    • oo.. 你能做的只是尝试打印 predication.score 检查它的值。
    • 好吧,你有没有试过这样的事情,因为当我写名字的时候,“我”是不可能的。
    猜你喜欢
    • 2020-09-12
    • 1970-01-01
    • 1970-01-01
    • 2013-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多