【问题标题】:Wavelet Transform (Haar or Daubechies) in Java with BoofCV带有 BoofCV 的 Java 小波变换(Haar 或 Daubechies)
【发布时间】:2016-07-22 00:23:28
【问题描述】:

有人知道如何在 Java 中使用 BoofCV 的小波变换(Haar 或 Daubechies)吗?

网络上没有代码示例,我对这个库很陌生。

我在下面尝试过这段代码,但没有结果。

public static void main(String[] args) throws IOException, InstantiationException, IllegalAccessException {
    String dir = "C:\\Users\\user\\Desktop\\ImgTest\\";
    BufferedImage buff =UtilImageIO.loadImage(dir+"img.png");

    ImageUInt16 aux = UtilImageIO.loadImage(dir+"img.png", ImageUInt16.class);

    ImageSInt16 input = new ImageSInt16(aux.width, aux.height);
    input =ConvertImage.convert(aux, input);
    ImageSInt32 output = new ImageSInt32(aux.width, aux.height);

    int minPixelValue = 0;
    int maxPixelValue = 255;
    WaveletTransform<ImageSInt16, ImageSInt32, WlCoef_I32> transform =  
            FactoryWaveletTransform.create_I(FactoryWaveletHaar.generate(true, 0), 1, 
                    minPixelValue, maxPixelValue,ImageSInt16.class);
    output=transform.transform(input, output);

    //BufferedImage out = ConvertBufferedImage.convertTo(output, null);
    BufferedImage out = new BufferedImage(input.width*6, input.height*6, 5);
     out = VisualizeBinaryData.renderLabeled(output, 0, out);
    ImageIO.write(out, "PNG", new File(dir+"out.png"));
    }
}

我也尝试过 JWave,但也没有代码示例,负责人也无法提供帮助。

谢谢!

【问题讨论】:

    标签: java image wavelet wavelet-transform boofcv


    【解决方案1】:

    外面有很多代码示例。我以前做过一个,但用的是 C# 而不是 Java。 Java代码可以参考here

    【讨论】:

    • 我之前也尝试过,但无法将其应用于图像 java.lang.谢谢!
    猜你喜欢
    • 2015-11-28
    • 2016-04-09
    • 2012-05-30
    • 1970-01-01
    • 2014-07-01
    • 1970-01-01
    • 2018-01-27
    • 2013-07-23
    • 2018-10-23
    相关资源
    最近更新 更多