2

I'm currently running an old version (0.17) of Boofcv and want to upgrade. The documentation (https://boofcv.org/index.php?title=Download ) is confusing:

The easiest way to use boofcv is to reference its jars on Maven Central. See below for Maven and Gradle code. BoofCV is broken up into many modules. To make it easier to use BoofCV all of its core functionality can be referenced using the 'all' module. Individual modules in "integration" still must be referenced individually.

Artifact List

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

This is self-contradictory - do we use "all" or "core"?

When I introduce 0.32 version of boofcv-core I get many unresolved references, such as Description Resource Path Location Type ImageFloat32 cannot be resolved to a type BoofCVTest.java

Three parts of my question: Have the fundamental types for images been renamed? How will legacy code need editing? What is the default set of libraries in Maven?

peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217

2 Answers2

3

There's been a lot of refactoring since 0.17 because of how verbose things were getting and to simplify the API. For example, ImageFloat32 is now GrayF32. The easiest way to figure out all the changes is to look at the relevant example code.

For modules, start with boofcv-core. Then add modules listed in integration as needed. For example if you need android support add boofcv-android. If you include boofcv-all you will have a lot of stuff you probably don't need, like Kinect support.

lessthanoptimal
  • 2,722
  • 2
  • 23
  • 25
  • +1 and tick. I guessed this was true, but a definitive answer saves a lot of time. I will start with the examples. I find Boofcv very useful and it's at the core of my image processing. – peter.murray.rust Jan 05 '19 at 22:41
1

To help others who are upgrading, here is an example of the changes I have made to upgrade to current Boofcv. They don't seem to be too difficult ; I have simply used s/ImageUInt/GrayU/g and similar for other types. So far I have only found one method that needs changing (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;
}
peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217