【问题标题】:Fingerprint Image Binarization指纹图像二值化
【发布时间】:2013-08-30 08:52:03
【问题描述】:

我有一个指纹扫描仪应用程序,它从设备获取指纹图像数据。

现在我正在尝试对图像进行二值化。

我正在使用Otsu's algorithm 对图像进行二值化,即像素值 0 或 255。

阈值使用相同的算法计算在 160 左右。 这是我的代码:

public static byte[][] binarizeImage(BufferedImage bfImage){
    final int THRESHOLD = 160;
    int height = bfImage.getHeight();
    int width = bfImage.getWidth();
    byte[][] image = new byte[width][height];

    for(int i=0; i<width; i++){
        for(int j=0; j<height; j++){
            Color c = new Color(bfImage.getRGB(i,j));
            int red = c.getRed();
            int green = c.getGreen();
            int blue = c.getBlue();
            if(red<THRESHOLD && green<THRESHOLD && blue<THRESHOLD){
                image[i][j] = 1;
            }else{
                image[i][j] = 0;
            }
        }
    }
    return image;
}

但生成的图像不是所需的输出。

谁能帮我解决这个问题。

【问题讨论】:

  • 您不应该使用值2550 而不是10?此外,您可能希望分别在每个通道中应用阈值(这实际上取决于您如何使用生成的byte[])。 This wiki有一个java demo,也许有帮助

标签: java image-processing fingerprint


【解决方案1】:

Otsu 方法不适用于指纹图像。尝试在下面使用此过滤器:

  • Bradley 本地阈值
  • 伯恩森阈值。
  • 最大熵阈值。

你会在这里找到:http://code.google.com/p/catalano-framework/

例子:

FastBitmap fb = new FastBitmap(bufferedImage);
fb.toGrayscale();

BradleyLocalThreshold b = new BradleyLocalThreshold();
b.applyInPlace(fb);

bufferedImage = fb.toBufferedImage();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-05
    • 2017-02-24
    • 1970-01-01
    • 2013-09-09
    • 2012-04-13
    • 2018-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多