2

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

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

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

将手势添加到库: public void addGesture() { 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();
            }
        }
    }

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

4

1 回答 1

0

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

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

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

于 2012-06-13T09:20:39.113 回答