代码之家  ›  专栏  ›  技术社区  ›  peter.murray.rust

升级到Boofcv的最新版本

  •  2
  • peter.murray.rust  · 技术社区  · 6 年前

    我目前运行的是Boofcv的旧版本(0.17),希望升级。文件( https://boofcv.org/index.php?title=Download )令人困惑的是:

    使用boofcv最简单的方法是在Maven上引用它的jar 中心的Maven和Gradle代码见下文。BoofCV被分解为 许多模块。使BoofCV的所有核心功能更易于使用 可以使用“全部”模块引用功能。个人 “集成”中的模块仍然必须单独引用。

    工件列表

    boofcv-core : All the core functionality of BoofCV
    boofcv-all : All the core and integration packages in BoofCV. YOU PROBABLY WANT CORE AND NOT THIS
    

    boofcv-core 我得到了许多未解决的引用,例如 Description Resource Path Location Type ImageFloat32 cannot be resolved to a type BoofCVTest.java

    我的问题有三个部分: 遗留代码需要如何编辑? Maven中的默认库集是什么?

    2 回复  |  直到 6 年前
        1
  •  3
  •   lessthanoptimal    6 年前

    自0.17以来,由于事情变得多么冗长,为了简化API,已经进行了很多重构。例如,ImageFloat32现在为灰色F32。找出所有更改的最简单方法是查看相关的示例代码。

        2
  •  1
  •   peter.murray.rust    6 年前

    Boofcv . 他们似乎不太难;我只是用 s/ImageUInt/GrayU/g 其他类型也类似。到目前为止,我只找到了一种需要改变的方法( VisualizeBinaryData.renderBinary ).

    /** thresholds an image
     * uses BoofCV 0.32 or later
     * NOT YET TESTED
     * 
     * @param image
     * @param threshold 
     * @return thresholded BufferedImage
     */
    
    /* WAS Boofcv 0.17
    public static BufferedImage boofCVBinarization(BufferedImage image, int threshold) {
        ImageUInt8 input = ConvertBufferedImage.convertFrom(image,(ImageUInt8)null);
        ImageUInt8 binary = new ImageUInt8(input.getWidth(), input.getHeight());
        ThresholdImageOps.threshold(input, binary, threshold, false);
        BufferedImage outputImage = VisualizeBinaryData.renderBinary(binary,null);
        return outputImage;
    }
    The changes are ImageUInt8 => GrayU8 (etc.) 
    VisualizeBinaryData.renderBinary(binary,null) => ConvertBufferedImage.extractBuffered(binary)
    
    It compiles - but haven't yet run it.
    
     */
    public static BufferedImage boofCVBinarization(BufferedImage image, int threshold) {
    
        GrayU8 input = ConvertBufferedImage.convertFrom(image,(GrayU8)null);
        GrayU8 binary = new GrayU8(input.getWidth(), input.getHeight());
        ThresholdImageOps.threshold(input, binary, threshold, false);
        BufferedImage outputImage = ConvertBufferedImage.extractBuffered(binary);
        return outputImage;
    }