boofcv
This is the Aussom-Lang BoofCV module. It wraps the BoofCV computer vision library (v1.3.0) so Aussom programs can use its image processing, feature detection, tracking, recognition, fiducial, calibration, stereo, structure from motion, reconstruction, and visualization capabilities.
BoofCV is a mature, pure-Java computer vision library by Peter Abeles licensed under Apache 2.0. The same JAR runs on Linux, Windows, and MacOS with no native dependencies.
The Aussom-side API is implemented entirely with AJI (Aussom Java
Interface) and is organized into a set of topic modules under
boofcv/, such as boofcv.images, boofcv.blur, boofcv.threshold,
boofcv.detect_corner, boofcv.fiducial, boofcv.calibration,
boofcv.stereo, boofcv.sfm, boofcv.reconstruction, and many
more.
Usage
Here's a short example, please see the API doc for details.
include boofcv.boofcv;
include boofcv.images;
include boofcv.image_io;
include boofcv.blur;
// Print the BoofCV version.
c.log(boofcv.version());
// Load an image as a single-channel GrayU8.
img = image_io.loadImageGray("input.png", boofcv.imageClass("u8"));
// Allocate an output image of the same size.
out = images.grayObj(boofcv.imageClass("u8"), img.invoke("getWidth"), img.invoke("getHeight"));
// Apply a Gaussian blur (sigma = 1.5, let BoofCV pick the radius).
blur.GBlurImageOps().gaussian(img, out, 1.5, -1);
// Save the result.
image_io.IO().saveImage(out, "blurred.png");
Video and FFmpeg
Most of this module is pure Java and works out of the box. Video decoding is the one exception.
boofcv.video gives you three ways to read video:
| Class | Native code needed | Included |
|---|---|---|
DefaultMediaManager |
no | yes |
JCodecMediaManager |
no | yes |
FfmpegVideoImageSequence |
yes | no, see below |
JCodecMediaManager is the one to reach for first. It is pure Java,
reads H.264 in MP4, and needs no setup.
Why FFmpeg is not included
The FFmpeg native binaries are not in this package for licensing reasons.
FFmpeg does not have one license. The license of a compiled FFmpeg
binary depends on the flags it was built with. The only prebuilt
binaries that match the API BoofCV was compiled against were built
with enable-gpl together with enable-nonfree. That mixes GPL code
with code the GPL does not allow to be combined with it, and the
result cannot be redistributed under any license at all. Including it
would make this entire package undistributable.
Newer FFmpeg builds without those flags do exist, but they renamed their Java packages and no longer bind to BoofCV, including the current BoofCV 1.5.0. So there is no drop-in replacement to ship.
The Java bindings are still here. Only the binaries were removed. If
you call FfmpegVideoImageSequence without adding FFmpeg you will get
a runtime error reading no jniavutil in java.library.path. That is
expected, not a broken install.
Adding FFmpeg yourself
You are free to use FFmpeg in your own programs. You just have to supply the binaries, which makes you the one distributing them and the one responsible for meeting their license terms.
-
Download the native jar for your platform from Maven Central under
org.bytedeco.javacpp-presets:ffmpeg:4.1-1.4.4. The version must be4.1-1.4.4. Later versions renamed their Java packages and will not work with BoofCV. Choose the classifier for your machine:ffmpeg-4.1-1.4.4-linux-x86_64.jarffmpeg-4.1-1.4.4-macosx-x86_64.jarffmpeg-4.1-1.4.4-windows-x86_64.jar
-
Put it somewhere your program can reach, such as a
lib/directory next to your script. -
Load it with
app.loadJar()before creating a sequence:
include app;
include boofcv.boofcv;
include boofcv.images;
include boofcv.video;
// Load the FFmpeg natives you supplied.
app.loadJar("lib/ffmpeg-4.1-1.4.4-linux-x86_64.jar");
// Now FFmpeg-backed video works.
seq = new FfmpegVideoImageSequence("clip.mp4", ImageTypes.single("u8"));
Order matters only in that loadJar has to run before the first use
of FfmpegVideoImageSequence.
Before you redistribute anything that bundles those binaries, read
their license. The 4.1-1.4.4 build in particular is the
non-redistributable one described above.
OpenCV native libraries
The OpenCV native binaries are not included either, for two reasons that are unrelated to each other.
Bytedeco built them with OPENCV_ENABLE_NONFREE=ON, so the shipped
libopencv_xfeatures2d exports SURF, an algorithm that is still under
patent. OpenCV gates it behind that build flag precisely so whoever
distributes a build makes a deliberate choice about it. Note this is a
patent question, not a license one: OpenCV is BSD-3-Clause and
conflicts with nothing here.
Those same jars were also the only source of 42 proprietary Microsoft Visual C++ and Universal CRT redistributable DLLs that were being carried along inside our jar.
Nothing in this module uses OpenCV, so removing the binaries costs no functionality. Every Java class the Aussom API touches resolves to a pure-Java BoofCV jar. Removing them also took the jar from about 134 MB down to roughly 22 MB.
The saveOpencv and loadOpenCV calibration helpers are unaffected.
Despite the name they never used the OpenCV library; they read and
write OpenCV-format YAML through BoofCV's own pure-Java code.
The OpenCV Java bindings are still in the package. If you want OpenCV
in your own program, download the native jar for your platform from
Maven Central under org.bytedeco.javacpp-presets:opencv:4.0.1-1.4.4
and load it with app.loadJar() the same way as FFmpeg above. There is
no Aussom wrapper API for OpenCV in this module, so you would drive it
through aji directly.
Third-party components
THIRD-PARTY-NOTICES.txt lists everything this package redistributes: the
dependencies themselves, and the works that some of those dependencies carry
shaded inside their own jars, such as the icon fonts and the OpenCV Java API.
Four of them are LGPL-2.1 and are handled differently from the rest. trove4j,
swingx, swing-worker and material-ui-swing are not linked into
aussom-boofcv.jar. They ship next to it as separate, unmodified jars, and
boofcv.aus loads each with app.loadJar(), so you can replace any of them
with your own build of the same library. The notices file carries the section 6
notice and links to the corresponding sources on Maven Central.
License
Copyright 2026 Austin Lehman
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.