fmd is invalid using android studio with digital persona SDK

Viewed 45

I'm having trouble with creating fmd from byte. Error with fmd is invalid.
Here is my code

String id = jsonobject.getString("fps_thumb");

byte [] encodeByte= Base64.decode(id,Base64.DEFAULT);

Fmd m_fmdAuxiliar = UareUGlobal.GetImporter().ImportFmd(encodeByte, Fmd.Format.ANSI_378_2004, Fmd.Format.ISO_19794_2_2005);

Does anyone know?

1 Answers

this is the code for retrieving data from api and compare it from the reader finger print

try{
        JSONArray jsonarray = new JSONArray(http.getResponse());
        for(int i=0; i < jsonarray.length(); i++) {
        JSONObject jsonobject = jsonarray.getJSONObject(i);
        String id = jsonobject.getString("fps_thumb");
        byte[] bytes = id.getBytes(StandardCharsets.UTF_8);

        try {
        Fmd m_fmdAuxiliar = UareUGlobal.GetImporter().ImportFmd(bytes, Fmd.Format.ANSI_378_2004, Fmd.Format.ANSI_378_2004);
        m_score = m_engine.Compare(m_fmdAuxiliar, 0,m_engine.CreateFmd(cap_result.image, Fmd.Format.ANSI_378_2004), 0);

        DecimalFormat formatting = new DecimalFormat("##.######");
        m_text_conclusionString = "Dissimilarity Score: " + String.valueOf(m_score)+ ", False match rate: " +
        Double.valueOf(formatting.format((double)m_score/0x7FFFFFFF)) + " (" + (m_score < (0x7FFFFFFF/100000)
        ? "match" : "no match") + ")";

        Log.i("TAG",m_text_conclusionString);

        } catch (UareUException e) {
        e.printStackTrace();
        }

        }
        }
        catch (JSONException e){
        e.printStackTrace();
        }
Related