1

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 を試しましたが、コード例もなく、担当者もそれを手伝うことができませんでした。

ありがとうございました!

4

1 に答える 1