Griaule Biometrics

Home » Forums » FINGERPRINT SDK » C/C++ Specific » Identify error!!
1 reply [Last post]
atendim1
Offline
Joined: 2009-06-16
Rate this post:
0
No votes yet
Identify error!!

Pessoal, realizo a captura da imagem e extraio o template para salvar no banco Firebird 2.03 como mostrado abaixo:

        // get raw image
        GrCapRawImageToHandle(rawImage, width, height, hdc, handle);

_template_size = GR_MAX_SIZE_TEMPLATE;
int result = GrExtract(rawImage, _width, _height, res, (char*)_template, &_template_size, GR_DEFAULT_CONTEXT);

if( result < 0 ) {
_template_size = 0;
QMessageBox::warning( 0, "Atenção", "Failed to extract template" );
return;
}

char *temp1 = (char*)_template; // dedo polegar direito

QSqlQuery queryTemplate;
queryTemplate.prepare( "INSERT INTO biometria ( cod_func, template ) VALUES ( ?, ? )" );
queryTemplate.addBindValue( cod_func );
queryTemplate.addBindValue( temp1 );
if( !queryTemplate.exec() )
return;


Após salvar no banco Firebird tento realizar a identificação através da função abaixo:



//template colocado para procurar no banco (dedo polegar direito);
result = GrIdentifyPrepare((char*)_template, GR_DEFAULT_CONTEXT);

//busca cada registro e verifica.
QSqlQuery query;
query.exec( "SELECT cod_func, template FROM biometria;" );
while( query.next() ) {

// busca template do banco de dados.
QByteArray *temp = new QByteArray( query.value(1).toByteArray(), (int)GR_MAX_SIZE_TEMPLATE );

result = GrIdentify(temp->data(), &score, GR_DEFAULT_CONTEXT);
if( result == GR_MATCH ) {
QMessageBox::warning( 0, "Atenção", "Funcionário identificado..." );
} else {
QMessageBox::warning( 0, "Atenção", "NÃO IDENTIFICADO..." );
}

}

Fazendo desta forma nunca consigo identificar uma pessoa, pois sempre me retorna que as digitais são diferentes. Utilizo sempre o mesmo dedo. O que eu posso estar fazendo de errado?? Utilizo C/C++ e QT 4.


tiago.o
Offline
Joined: 2009-12-03
Rate this post:
0
No votes yet

Hi,

please check if you are using a BLOB field in your database to store the template.

Thanks