我想将生物识别拇指印象扫描到我的网络应用程序中。我有SecuGen Hamster的生物识别模型,但我不知道如何访问Web应用程序。或者如何将拇指印象发送到网络浏览器。
由于我之前没有使用过这样的设备,我不知道如何准备代码来实现它。任何有关此主题的帮助都将受到高度赞赏。
我目前在jsp / servlet工作。
Thankx
答案 0 :(得分:0)
你需要三件事 1.用于Java thumb scanner设备的驱动程序 2.用于拇指扫描仪设备的Sdk 3.创建自己的applet.applet可以与某些浏览器交谈
答案 1 :(得分:0)
Secugen提供了包含Java代码的SDK来对其进行操作。使用该Java代码,您可以测试设备。
它以1D字节数组捕获指纹打印。您可以将其转换为2D字节数组并构建图像。
仍然需要代码来完成这里的所有操作: 根据您的需要清理代码。
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import SecuGen.FDxSDKPro.jni.JSGFPLib;
import SecuGen.FDxSDKPro.jni.SGDeviceInfoParam;
import SecuGen.FDxSDKPro.jni.SGFDxDeviceName;
import SecuGen.FDxSDKPro.jni.SGFDxErrorCode;
import SecuGen.FDxSDKPro.jni.SGFingerInfo;
import SecuGen.FDxSDKPro.jni.SGFingerPosition;
import SecuGen.FDxSDKPro.jni.SGImpressionType;
import SecuGen.FDxSDKPro.jni.SGPPPortAddr;
public class RecordFingerPrint {
private static javax.swing.JLabel jLabelImage;
public static JSGFPLib sgfplib = null;
public static long err;
public static SGDeviceInfoParam deviceInfo;
public static byte[] SG400minutiaeBuffer1=null;
public static byte[] SG400minutiaeBuffer2=null;
public static void writeImage(byte[][] img) {
//write your realtime image for testing
String path = "D:\\testimg1.png";
BufferedImage image = new BufferedImage(img.length, img[0].length, BufferedImage.TYPE_BYTE_GRAY);
for (int x = 0; x < img.length; x++) {
for (int y = 0; y <img[0].length; y++) {
image.setRGB(x, y, img[x][y]);
}
}
File ImageFile = new File(path);
try {
ImageIO.write(image, "png", ImageFile);
} catch (IOException e) {
e.printStackTrace();
}
}
public static byte[] returnCapturedFingerImage() {
byte[] imageBuffer1 = null;
/* initialize the secugen bluetooth device */
try
{
sgfplib = new JSGFPLib();
if ((sgfplib != null) && (sgfplib.jniLoadStatus != SGFDxErrorCode.SGFDX_ERROR_JNI_DLLLOAD_FAILED))
{
System.out.println(sgfplib);
}
else
{
System.out.println("An error occurred while loading JSGFPLIB.DLL JNI Wrapper");
// return false;
}
// Init()
System.out.println("Call Init(SGFDxDeviceName.SG_DEV_AUTO)");
err = sgfplib.Init(SGFDxDeviceName.SG_DEV_AUTO);
System.out.println("Init returned : [" + err + "]");
// **************OpenDevice()
System.out.println("Call OpenDevice(SGPPPortAddr.AUTO_DETECT)");
err = sgfplib.OpenDevice(SGPPPortAddr.AUTO_DETECT);
System.out.println("OpenDevice returned : [" + err + "]");
// GetError()
System.out.println("Call GetLastError()");
err = sgfplib.GetLastError();
System.out.println("GetLastError returned : [" + err + "]");
// GetDeviceInfo()
//System.out.println("Call GetDeviceInfo()");
deviceInfo = new SGDeviceInfoParam();
err = sgfplib.GetDeviceInfo(deviceInfo);
//System.out.println( "GetDeviceInfo returned : [" + err + "]");
System.out.println("\tdeviceInfo.DeviceSN: [" + new String(deviceInfo.deviceSN()) + "]");
System.out.println("\tdeviceInfo.Brightness: [" + deviceInfo.brightness + "]");
System.out.println("\tdeviceInfo.ComPort: [" + deviceInfo.comPort + "]");
System.out.println("\tdeviceInfo.ComSpeed: [" + deviceInfo.comSpeed + "]");
System.out.println("\tdeviceInfo.Contrast: [" + deviceInfo.contrast + "]");
System.out.println("\tdeviceInfo.DeviceID: [" + deviceInfo.deviceID + "]");
System.out.println("\tdeviceInfo.FWVersion: [" + deviceInfo.FWVersion + "]");
System.out.println("\tdeviceInfo.Gain: [" + deviceInfo.gain + "]");
System.out.println("\tdeviceInfo.ImageDPI: [" + deviceInfo.imageDPI + "]");
System.out.println("\tdeviceInfo.ImageHeight: [" + deviceInfo.imageHeight + "]");
System.out.println("\tdeviceInfo.ImageWidth: [" + deviceInfo.imageWidth + "]");
}
catch (Exception e)
{
System.out.println("Exception reading FP reader : " + e);
}
//get finger print data captured
/*****************************************************************************/
byte[] buffer = new byte[deviceInfo.imageWidth*deviceInfo.imageHeight];
long timeout = 10000;
long quality = 80;
if(sgfplib.GetImageEx(buffer, timeout, 1, quality) ==SGFDxErrorCode.SGFDX_ERROR_NONE)
{
/*image code*/
javax.swing.JLabel jLabelRegisterImage1 = new javax.swing.JLabel();
/*image code test end*/
PrintStream fp = null;
int[] img_qlty = new int[1];;
err = sgfplib.GetImageQuality(deviceInfo.imageHeight, deviceInfo.imageWidth, buffer, img_qlty);
byte[][] buffer2D = new byte[deviceInfo.imageHeight][deviceInfo.imageWidth];
System.out.println("********************");
for(int i=0;i<deviceInfo.imageHeight;i++) {
for(int j=0;j<deviceInfo.imageWidth;j++) {
buffer2D[i][j]=buffer[i*deviceInfo.imageWidth+j];
System.out.print(buffer2D[i][j]+" ,");
//System.out.println(i+" ,"+j+" "+(i*deviceInfo.imageWidth+j));
}
System.out.println();
}
System.out.println("********************");
writeImage(buffer2D);
System.out.println("Buffer Length:"+buffer.length);
//System.out.println("Buffer array:"+Arrays.toString(buffer));
System.out.println("GetImageQuality returned : [" + err + "]");
System.out.println("Image Quality is : [" + img_qlty[0] + "]");
FileOutputStream fout = null;
try {
//fout = new FileOutputStream("D:\\sample\\fp_image\\fp.raw");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
fp = new PrintStream(fout);
fp.write(buffer,0, buffer.length);
fp.close();
try {
fout.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
fp = null;
fout = null;
}
return null;
}
}