我目前正在运行一个旧版本(0.17)的Boofcv,并希望升级。文档(https://boofcv.org/index.php?title=Download )令人困惑:
使用boofcv最简单的方法是在Maven Central上引用它的jars。请参阅下面的Maven和Gradle代码。BoofCV被分解成许多模块。为了更容易地使用BoofCV,可以使用“all”模块引用它的所有核心功能。“集成”中的各个模块仍然必须单独引用。 人工制品清单 boofcv-core : BoofCV BoofCV的所有核心功能- All :BoofCV中的所有核心和集成包。你可能想要核心而不是这个
这是自相矛盾的-我们是使用“全部”还是“核心”?
当我介绍0.32版本的boofcv-core时,我得到了许多未解决的引用,比如Description Resource Path Location Type ImageFloat32 cannot be resolved to a type BoofCVTest.java
我问题的三个部分:图像的基本类型是否被重命名了?如何编辑遗留代码?Maven中的默认库集是什么?
发布于 2019-01-05 18:36:49
从0.17开始就有了大量的重构,这是因为事情变得非常冗长,并且为了简化API。例如,ImageFloat32现在是GrayF32。找出所有更改的最简单方法是查看相关的示例代码。
对于模块,从boofcv核开始。然后根据需要添加集成中列出的模块。例如,如果您需要android支持,可以添加boofcv-android。如果您包括boofcv-所有您将有很多东西,您可能不需要,如Kinect支持。
发布于 2019-01-06 11:55:40
为了帮助正在升级的其他人,下面是我为升级到当前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;
}https://stackoverflow.com/questions/54035630
复制相似问题