Error integration fingerprint U.are.U SDK with java web application

后端 未结 2 1696
無奈伤痛
無奈伤痛 2021-02-11 07:23

I developed a web application using Java and play framework in the BackEnd, and AngularJS in the FrontEnd.

I did an integration with the U.are.U SDK for fingerprint scan

相关标签:
2条回答
  • 2021-02-11 07:34

    I use this method to get a successful result, being m_fmdAuxiliar a variable which store the data from DB, I just save data then I retrieve.

    m_fmd = m_engine.CreateFmd(cap_result.image, Fmd.Format.ANSI_378_2004);
    data = m_fmd.getData();
    
    Fmd m_fmdAuxiliar = UareUGlobal.GetImporter().ImportFmd(data, Fmd.Format.ANSI_378_2004, Fmd.Format.ANSI_378_2004);
    
    Fmd m_fmd2 = m_engine.CreateFmd(cap_result.image, Fmd.Format.ANSI_378_2004);
    m_score = m_engine.Compare(m_fmdAuxiliar, 0, m_fmd2, 0);
    
    0 讨论(0)
  • 2021-02-11 07:37
    1. Convert your PNG image to raw bytearray in grayscale:

           // read an image from the disk
           BufferedImage image = ImageIO.read(new File("kittens.jpg"));
      
           setPreferredSize(new Dimension(
               image.getWidth(),image.getHeight()));
      
           // create a grayscale image the same size
           gray = new BufferedImage(image.getWidth(),image.getHeight(),
               BufferedImage.TYPE_BYTE_GRAY);
      
           // convert the original colored image to grayscale
           ColorConvertOp op = new ColorConvertOp(
               image.getColorModel().getColorSpace(),
               gray.getColorModel().getColorSpace(),null);
           op.filter(image,gray);
      
           //convert BuffuredImage to raw byte array
           WritableRaster raster = gray.getRaster();
           DataBufferByte data = (DataBufferByte) raster.getDataBuffer();    
           byte[] rawPixels = data.getData();
      
    2. convert your bytearray to FID

           Fid fid = UareUGlobal.getImporter().ImportRaw(rawPixels, 
               width, height, inDpi, fingerPosition, cbeffId, 
               Fid.Format.ANSI_381_2004, outDpi, rotate180);
      
    3. convert your FID to FMD

           Fmd fmd = UareUGlobal.GetEngine().CreateFmd(fid, 
               Fid.Format.ANSI_381_2004);
      
    4. Now you could compare this Fmd with current capture

    0 讨论(0)
提交回复
热议问题