为了帮助其他正在升级的人,这里是我为升级到 current 所做的更改的示例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;
}