Ir para conteúdo
Fórum Script Brasil
  • 0

Sample Fingerprint Error


Bianorz

Pergunta

Olá,

comecei a pesquisar sobre alguma api/sdk que me ajudasse a comunicar um leitor biomérico(Eikon Upek), com o pc, de modo a extrair,comparar,gravar em banco de dados as digitais. Só que estou com alguns problemas, primeiro que o site www.upek.com do fabricante simplesmente desapareceu... e não conseguia achar uma api/sdk free ou open source. Achei essa api/sdk https://github.com/FingerJetFXOSE/FingerJetFXOSE e estou a estudando nesse momento. Minha dúvida é a seguinte, não consigo compilar o exemplo que vem feito nela, e vim pedir a ajuda de vocês para resolver isso. O erro que aparece aqui é undefined reference to `fjfx_create_fmd_from_raw', vou por o código para vocês darem uma olhada.

#include <stdio.h>
#include <stdlib.h>
#include "fjfx.h"

int main(int argc, char ** argv) {
  FILE *fp = 0;
  int height, width, gray;
  unsigned int size;
  void * image = 0;
  size_t n;
  int err;
  unsigned char tmpl[FJFX_FMD_BUFFER_SIZE] = {0};

  if(argc != 3 || argv[1] == NULL || argv[2] == NULL) {
    printf("Fingerprint Minutia Extraction\n"
           "Usage: %s <image.pgm> <fmd.ist>\n"
           "where <image.pgm> is the binary PGM (P5) file that containing 500DPI 8-bpp grayscale figerprint image\n"
           "      <fmd.ist> is the file where to write fingerprint minutia data in ISO/IEC 19794-2 2005 format\n", argv[0]);
    return -1;
  }

  fp = fopen(argv[1], "rb");
  if (fp == 0) {
    printf("Cannot open image file: %s\n", argv[1]);
    return 9;
  }
  n = fscanf(fp, "P5%d%d%d", &width, &height, &gray);
  if (n != 3 ||
      gray > 256 || width > 0xffff || height > 0xffff ||
      gray <= 1 || width < 32 || height < 32) {
    printf("Image file %s is in unsupported format\n", argv[1]);
    fclose(fp);
    return 10;
  }

  size = width * height;
  image = malloc(size);
  if (image == 0) {
    printf("Cannot allocate image buffer: image size is %dx%d", width, height);
    return 12;
  }

  n = fread(image, 1, size, fp);
  fclose(fp); fp = 0;
  if (n != size) {
    printf("Image file %s is too short\n", argv[1]);
    free(image);
    return 11;
  }

  size = FJFX_FMD_BUFFER_SIZE;
  err = fjfx_create_fmd_from_raw(image, 500, height, width, FJFX_FMD_ISO_19794_2_2005, tmpl, &size);
  free(image); image = 0;
  if (err != FJFX_SUCCESS) {
    printf("Failed feature extraction\n");
    return err;
  }

  fp = fopen(argv[2], "wb");
  if (fp == 0) {
    printf("Cannot create output file: %s\n", argv[2]);
    return 14;
  }
  n = fwrite(tmpl, 1, size, fp);
  fclose(fp);
  if (n != size) {
    printf("Cannot write output file of size %d\n", size);
    free(image);
    return 15;
  }
  return 0;
}
#ifndef __fjfx_h
#define __fjfx_h

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

// Error codes
#define FJFX_SUCCESS                         (0)     // Extraction succeeded, minutiae data is in output buffer.
#define FJFX_FAIL_IMAGE_SIZE_NOT_SUP         (1)     // Failed. Input image size was too large or too small.
#define FJFX_FAIL_EXTRACTION_UNSPEC          (2)     // Failed. Unknown error.
#define FJFX_FAIL_EXTRACTION_BAD_IMP         (3)     // Failed. No fingerprint detected in input image.
#define FJFX_FAIL_INVALID_OUTPUT_FORMAT      (7)     // Failed. Invalid output record type - only ANSI INCIT 378-2004 or ISO/IEC 19794-2:2005 are supported.
#define FJFX_FAIL_OUTPUT_BUFFER_IS_TOO_SMALL (8)     // Failed. Output buffer too small. 

// Output fingerprint minutiae data format (per CBEFF IBIA registry)
#define FJFX_FMD_ANSI_378_2004        (0x001B0201)   // ANSI INCIT 378-2004 data format
#define FJFX_FMD_ISO_19794_2_2005     (0x01010001)   // ISO/IEC 19794-2:2005 data format

// Required output buffer size
#define FJFX_FMD_BUFFER_SIZE          (34 + 256 * 6) // Output data buffer must be at least this size, in bytes (34 bytes for header + 6 bytes per minutiae point, for up to 256 minutiae points)

// Minutiae Extraction interface
int fjfx_create_fmd_from_raw(
  const void *raw_image,                      // Input: image to convert.  The image must be grayscale (8 bits/pixel), no padding, bright field (dark fingerprint on white background), scan sequence consistent with ISO/IEC 19794-4:2005.
  const unsigned int  pixel_resolution_dpi,   // Must be between 300 and 1024 dpi; the resolution must be the same for horizontal and vertical size (square pixels)
  const unsigned int  height,                 // Height of the input image, in pixels. Physical height must be between 0.3 inches (7.62 mm) and 1.6 inches (40.6 mm)
  const unsigned int  width,                  // Width of the input image, in pixels. Physical height must be between 0.3 inches (7.62 mm) and 1.5 inches (38.1 mm)
  const unsigned int  output_fmd_data_format, // FJFX_FMD_ANSI_378_2004 or FJFX_FMD_ISO_19794_2_2005
  void  *fmd,                                 // Where to store resulting fingerprint minutiae data (FMD)
  unsigned int *size_of_fmd_ptr               // Input: fmd buffer size. Output: actual size of the FMD.
);

// Misc functions
int fjfx_get_pid(unsigned int *feature_extractor); // Returns 2-byte vendor ID + 2-byte product ID.
                                                   // Standard biometric component identifier per CBEFF registry
                                                   // http://www.ibia.org/cbeff/iso/
                                                   // http://www.ibia.org/base/cbeff/_biometric_org.phpx

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // __fjfx_h

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Você está no Linux?

Instalou o pacote ou apenas copiou o header fjfx.h?

Se tiver instalado, deve ser questão de informar -lfjfx na linha de comando.

Além disso, você deverá substituir #include "fjfx.h" por #include <fjfx.h>

Editado por vega
Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...