Fast computer vision library for SFM, calibration, fiducials, tracking, image processing, and more.

Overview

Build Status Join the chat at https://gitter.im/lessthanoptimal/BoofCV Maven Central


Table of Contents


Introduction

BoofCV is an open source real-time computer vision library written entirely in Java and released under the Apache License 2.0. Functionality includes low-level image processing, camera calibration, feature detection/tracking, structure-from-motion, classification, and recognition.

Cloning GIT Repository

The bleeding edge source code can be obtained by cloning the git repository.

git clone -b SNAPSHOT --recursive https://github.com/lessthanoptimal/BoofCV.git boofcv

Is the data directory empty? That's because you didn't follow instructions and skipped --recursive. Fix that by doing the following.

cd boofcv
git submodule update --init --recursive

Quick Start Examples and Demonstrations

New to Java? Make sure you have Java 14 or newer installed. In the command line type java -version and you should see something like:

java -version
openjdk version "14" 2020-03-17

In this case I do have Java 14 installed. If you need to install/upgrade Java there are many options these days, such as Zulu. A quick search should help if you need a more detailed explanation. You should avoid anything with -ea in its name since that's a developmental version.

You can now build and run? Then run the commands below! Each jar will open a window, then to run an application just double click on its name.

cd boofcv
./gradlew autogenerate
./gradlew examplesJar
java -jar examples/examples.jar
./gradlew demonstrationsJar
java -jar demonstrations/demonstrations.jar

All the code for what you see is in boofcv/examples and boofcv/demonstrations. Example code is designed to be easy to understand so look there first.

Click HERE for instruction on building and running Applications. There you can calibrate cameras, create QR codes, batch scan for QR codes, batch downsample images, ... etc.

Maven Central Repository

BoofCV is on Maven Central and can be easily added to your Maven, Gradle, ...etc projects. It's divided up into many modules. The easiest way to include the critical modules is to have your project dependent on 'core'.

For Maven projects:

<dependency>
  <groupId>org.boofcv</groupId>
  <artifactId>boofcv-core</artifactId>
  <version>0.37</version>
</dependency>

There are also several integration modules which help BoofCV interact with external projects. A list of those is included below:

Name Description
boofcv-core All the core libraries without any of the integration modules listed below
boofcv-android Useful functions for working inside of Android devices.
boofcv-javacv JavaCV is a wrapper around OpenCV mainly for file IO.
boofcv-ffmpeg javacpp-presets their ffmpeg wrapper is used for reading video files.
boofcv-jcodec JCodec is a pure Java video reader/writer.
boofcv-swing Visualization using Java Swing
boofcv-WebcamCapture A few functions that make WebcamCapture even easier to use.

Directories

Directory Description
applications/ Helpful applications
data/ Directory containing optional data used by applets and examples.
demonstrations/ Demonstration code which typically lets experiment by changing parameters in real-time
examples/ Set of example code designed to be easy to read and understand.
integration/ Contains code which allows BoofCV to be easily integrated with 3rd party libraries. Primary for video input/output.
main/ Contains the source code for BoofCV

Building from Source

Building and installing BoofCV into your local Maven repository is easy[1] using the gradlew script:

cd boofcv
./gradlew autogenerate            # Creates auto generated files
./gradlew publishToMavenLocal     # Installs it into the local maven repository 

If you wish to have jars instead, the following commands are provided.

./gradlew oneJarBin               # Builds a single jar with all of BoofCV in it
./gradlew createLibraryDirectory  # Puts all jars and dependencies into boofcv/library
./gradlew alljavadoc              # Combines all JavaDoc from all sub-projects into a single set

[1] A couple of the integration submodules have a custom build process that can't be performed by Gradle. The script is smart enough to ignore modules and tell you that it is doing so if you haven't configured it yet.

IntelliJ

IntelliJ is the recommended IDE for use with BoofCV. With IntelliJ you can directly import the Gradle project.

  1. File->Project From Existing Sources
  2. Select your local "boofcv" directory
  3. Confirm that you wish to import the Gradle project

Eclipse

The easiest way to import the project is to use Gradle to generate an Eclipse project.

cd boofcv
./gradlew eclipse

Then in Eclipse; 1) "import existing projects", 2) Select your BoofCV directory, 3) Click Finish. You can also install a Gradle plugin to Eclipse and import the project directory. That's left as an exercise for the reader.


Dependencies

Core BoofCV modules depends on the following libraries

The following is required for unit tests

Code from the following libraries has been integrated into BoofCV

The optional sub-projects in integration also have several dependencies. See those sub-projects for a list of their dependencies.


Contact

For questions or comments about BoofCV please use the message board. Only post a bug report after doing some due diligence to make sure it is really a bug and that it has not already been reported.

Message Board

Comments
  • RuntimeException when decoding specific files

    RuntimeException when decoding specific files

    I'm using BoofCV to decode QR codes. When I run the decoder on specific files, I get a RuntimeException with error "An error occurred while calling o40.process":

    py4j.protocol.Py4JJavaError: An error occurred while calling o40.process.
    : java.lang.RuntimeException: Value out of range. value=54
            at boofcv.alg.fiducial.qrcode.QrCodeCodecBitsUtils.valueToAlphanumeric(QrCodeCodecBitsUtils.java:338)
            at boofcv.alg.fiducial.qrcode.QrCodeCodecBitsUtils.decodeAlphanumeric(QrCodeCodecBitsUtils.java:164)
            at boofcv.alg.fiducial.qrcode.QrCodeDecoderBits.decodeAlphanumeric(QrCodeDecoderBits.java:265)
            at boofcv.alg.fiducial.qrcode.QrCodeDecoderBits.decodeMessage(QrCodeDecoderBits.java:157)
            at boofcv.alg.fiducial.qrcode.QrCodeDecoderImage.decode(QrCodeDecoderImage.java:253)
            at boofcv.alg.fiducial.qrcode.QrCodeDecoderImage.process(QrCodeDecoderImage.java:100)
            at boofcv.abst.fiducial.QrCodePreciseDetector.process(QrCodePreciseDetector.java:89)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:564)
            at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
            at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
            at py4j.Gateway.invoke(Gateway.java:282)
            at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
            at py4j.commands.CallCommand.execute(CallCommand.java:79)
            at py4j.GatewayConnection.run(GatewayConnection.java:238)
            at java.base/java.lang.Thread.run(Thread.java:832)
    

    Here is an example of a file that throws exception: pdf_invalid_2.pdf

    Testing Fix Under Investigation 
    opened by ruimelodev 4
  • In Android, Conflict between protobuf-java and protobuf-javalite.

    In Android, Conflict between protobuf-java and protobuf-javalite.

    Hi, when I add a dependency to build.gradle on Android, the following error appears:

    Duplicate class com.google.protobuf.Writer found in modules jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3) and jetified-protobuf-javalite-3.11.4 (com.google.protobuf:protobuf-javalite:3.11.4) Duplicate class com.google.protobuf.Writer$FieldOrder found in modules jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3) and jetified-protobuf-javalite-3.11.4 (com.google.protobuf:protobuf-javalite:3.11.4)

    This seems like a problem with Protobuf, but can I get another version or special detour to avoid this problem in boofcv?

    opened by seankim1311 4
  • Failure to detect in case with multiple high version QR in one image

    Failure to detect in case with multiple high version QR in one image

    https://github.com/lessthanoptimal/PyBoof/issues/15

    Looks like this specific layout is causing issues. The image should probably be added to the regression tests.

    Under Investigation Duplicate 
    opened by lessthanoptimal 1
  • An illegal reflective access operation has occurred

    An illegal reflective access operation has occurred

    When using boocv for similarity search, it throws the following warning:

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by boofcv.io.image.ConvertRaster (file:/C:/Users/brandl/.gradle/caches/modules-2/files-2.1/org.boofcv/boofcv-io/0.40.1/a99b6dbd3e07646ebaecc715aed48a0f03596db0/boofcv-io-0.40.1.jar) to method sun.awt.image.ByteInterleavedRaster.getDataOffset(int)
    WARNING: Please consider reporting this to the maintainers of boofcv.io.image.ConvertRaster
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    
    opened by holgerbrandl 7
  • logic operations for gray scale image type

    logic operations for gray scale image type

    I can see there is a logicAnd and other in BinaryImageOps. Is there a specific reason why this is not available for gray scale image types? I have a little use case for this. So I am wondering if it would be of interest to have these functions in GrayImageOps as well?

    opened by thhart 2
Releases(v0.41)
  • v0.41(Sep 3, 2022)

    Date : 2022/Sep/02 Version : 0.41

    • Applications
      • Added Aztec Code generator
      • Removed unused flag to disable printing info in PDF documents
      • QR and other markers no longer require spacing between markers when there is only a single marker
      • Fixed units in manually specified document size
      • Create Calibration: Fixed units in manually specified paper size
      • Create Calibration: Fixed disable info flag
    • Android
      • Properly handles multi camera systems by finding physical cameras inside a logical camera
    • Demonstrations
      • Better Micro QR Code visualizations
    • Contour Tracing
      • Can specify max and minimum contours using fractional size, i.e. ConfigLength instead of int
      • Added ability to specify maximum contour in places it was missing
      • ConfigPolygonFromContour doesn't produce identical results, but very similar
    • ConvertBufferedImage
      • RGBA with pre-multiplied alpha will have channels swapped correctly
      • BufferedImage sub images work again, Thanks ConvertBufferedImage
    • Added Aztec Code encoder and decoder
    • QR Code
      • Fixed issue where it was rejecting version 1 QR codes at a highly skewed angle
      • Fixed issue where it failed to detect all QR when there was a cluster of several high version
      • If error correction passes it will stop processing the QR. Easier to diagnose issues.
    • Micro QR Code
      • Doesn't keep on trying to decode a marker if it fails after the ECC check
    • Various
      • Fixed crash in Niblack Family when output image was not resized to match input image
      • Image.setTo() now returns 'this' to enable chaining.
      • Can now colorize points based on camera reference frame, not just global
      • PlyCodec - writes correct header for little endian
    • Stereo Disparity: Fixed bug where invalid values got cast to a byte when image was float, causing artifacts.
    • RansacCalibrated now support concurrency
    • Stereo
      • There's now the option to save the fit score for each pixel
    • Photogrammetry
    • Three-View Reconstruction: Does self calibration entirely inside of RANSAC
    • Added ResolveThreeViewScaleAmbiguity
    • N-View reconstruction code now directly uses the 3-view class and skips a projective scene step
    • MultiBaselineDisparity now fuses into an inverse depth image
    • 3D Mesh
      • Added related example code
      • Added support for saving mesh + color points to PLY
      • Added algorithms for converting stereo disparity into a 3D mesh
    • Calibration
      • Mono and Stereo apps now generate calibration quality metrics for coverage and geometry
      • Mono and Stereo GUIs have option to show border and inner coverage
      • Added Division camera model
      • Added multi camera calibration
    • ImageMiscOps
      • Added maskFill()
      • Added a generic filter()
    Source code(tar.gz)
    Source code(zip)
  • v0.40.1(Jan 26, 2022)

    • Build
      • Compiles using Java 17. bytecode is still Java 11
      • Updated to Gradle 7
    • Applications
      • Batch scanning of Micro QR Codes
    • QR Code and Micro QR Code
      • Much stricter and more accurate test that looks for UTF-8 strings in BYTE data
      • Config has defaultEncoding which is the encoding it uses if it decides BYTE isn't UTF-8
      • Added an example demonstrating how raw data can be used ExampleQrCodeRawData
      • Added JMH Benchmarks for regression testing
    • Concurrency
      • Added threaded KLT tracker
    Source code(tar.gz)
    Source code(zip)
  • v0.40(Jan 26, 2022)

    • Build
      • Added sanity check that makes sure autogenerate has been run already first and prints out a helpful message
      • Fixed accidental Lombok dependency
      • Added NullAway again
    • Misc
      • Config classes now must implement setTo() which returns 'this' to allow chaining and easy copies
      • ImageBase.reshapeTo() replaces matchShape()
    • ImageProcessing
      • Added ImageMiscOps.transpose()
    • Background Model
      • Created threaded implementations of stationary and moving
      • Added internal benchmarks for moving
    • QR Code
      • Added ability to decode transposed markers. Can be turned off.
      • Records number of bit errors detected by error correction
    • Micro QR Code
      • Added support for reading and generating
    • DemoThreeViewStereoApp
      • Fixed handling of gray images. Thanks mb for reporting the issue!
    Source code(tar.gz)
    Source code(zip)
  • v0.17(Jun 19, 2014)

    Date : 2014/6/19 Version : Alpha 0.17

    • Improved/Fixed serialization
      • Several classes were missing no argument constructors
    • Added ImageMiscOps.flipHorizontal()
    • Added WeightSample2D_F32 for computing the weight of a sample in an abstract manor
      • Reduced MeanShiftPeak from 3 classes into one
    • Edge Non-Maximum suppression's documentation now clearly states that it suppresses only if adjacent pixel is less than. This is not true non-maximum suppression since it allows equal values but seems to produce better results
      • Improved unit tests to explicitly test for this behavior
    • Canny edge detector would fail if threshold was zero and the image had no texture
      • HysteresisEdge* code was using a value of 0 to mark traversed regions. It now uses -1 and sanity checks the lower threshold.
      • Thanks Lucaro for finding this bug
    • Added GImageMultiBand for generalized access to multi-band image data
    • Added support for MultiSpectral images to:
      • GBlurImageOps and BlurImageOps
    • Image Segmentation / Superpixels
      • Watershed
      • Mean-shift
      • Felzenszwalb-Huttenlocher 2004
      • SLIC Superpixels
    • Dense Optical Flow
      • KLT Based
      • Square Region Based
      • Horn Schunck
      • Horn Schunck Pyramid
      • Brox Spacial Warping
    • Fixed bugs in ConvertNV21
      • Was applying YV12 byte alignment to NV21 images. Depending on image size, this could cause a crash.
    • Fixed bug in ImplConvertToBitmap.multiToArray_F32()
      • Didn't handle case where the input image has 3 bands and not 4
    • ImageBase now provides a method for getting ImageType information
    • Threshold in the interface Associate is now <= instead of <
    • Android
      • Added classes which greatly simplify dealing with camera previews
      • Added new visualizations intended for use with segmented images
      • Simplified example code
    • Added XYZ and LAB color spaces
    • GImageMiscOps.fillUniform() max is inclusive for both integer and float and this is enforced
    • BinaryImageOps
      • Erode and dilate can now be applied multiple times with a single function call
    • StitchingFromMotion2D can now resize and translate the stitch image
      • Thanks Julien Seinturier for the suggestion
    • Convolution
      • 1D convolution now supports kernels which are not symmetric
    • Image gradient from a difference of two neighbors added
    • Square grid calibration grid detector has been improved.
      • No longer permutes through all combinations. Selects each valid square and assumes its the first instead
      • Graph connection rule has been improved too to reduce false connections
    • Moved serializeXML from BoofMiscOps to UtilIO
      • Removing an IO function which shouldn't be in image processing
    • FactoryDerivative
      • If derivative type is null it will use the default
    • Added ImageType to interpolate interface
    • Added ImageType to ImageSegmentation interface
    • Processing (http://processing.org) integration
      • Lots of examples
      • Simplified interface for working with BoofCV
    • XStream now works without that ugly hack
      • Thanks to Jörg Schaible of XStream for fixing the issue and all the help
    • Webcam Capture Support
      • Easy to use library for streaming webcams
      • Wrote several example showing how Webcam Capture can be used with BoofCV
    • Structure From Motion (SFM) example
    Source code(tar.gz)
    Source code(zip)
    boofcv-v0.17-docs.zip(5.38 MB)
    boofcv-v0.17-libs.zip(4.86 MB)
    boofcv-v0.17-src.zip(198.77 MB)
Owner
Peter Abeles
Peter Abeles
Simple Java image-scaling library implementing Chris Campbell's incremental scaling algorithm as well as Java2D's "best-practices" image-scaling techniques.

imgscalr - Java Image-Scaling Library http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/ Changelog --------- 4.2 * Added sup

Riyad Kalla 1.1k Jan 5, 2023
VisionCamera Frame Processor Plugin to label images using MLKit Vision

vision-camera-image-labeler A VisionCamera Frame Processor Plugin to label images using MLKit Vision Image Labeling. Installation npm install vision-c

Marc Rousavy 72 Dec 20, 2022
A VisionCamera Frame Processor Plugin to preform text detection on images using MLKit Vision Text Recognition

vision-camera-ocr A VisionCamera Frame Processor Plugin to preform text detection on images using MLKit Vision Text Recognition. Installation yarn add

Aaron Grider 133 Dec 19, 2022
Roman Beskrovnyi 250 Jan 9, 2023
A well-designed local image and video selector for Android

Matisse Matisse is a well-designed local image and video selector for Android. You can Use it in Activity or Fragment Select images including JPEG, PN

Zhihu 12.4k Dec 29, 2022
Provide image storage and access services.

Provide image storage and access services.

shiyq 2 Jan 23, 2022
Diagrams as code is a term used for storing the source of a diagram image as a text file.

Diagrams as code Diagrams as code is a term used for storing the source of a diagram image as a text file. Examples are architecture diagrams, or diag

null 26 Nov 21, 2022
Custom Image Server for use with ShareX

rImageServer How to use: Normal Instalation: Download .jar Start: javar -jar [filename].jar Edit: imageserver.propierties Check if web works -> Go to

Ryzeon 11 May 21, 2022
Luban—Image compression with efficiency very close to WeChat Moments

Luban—Image compression with efficiency very close to WeChat Moments

郑梓斌 13.1k Dec 29, 2022
Usign ascii characters, recreate an image following a local path

CMDImage Usign ascii characters, recreate an image following a local path README El código toma una imagen desde una ruta local para convertirlo en ca

Alexander Hernández 13 Aug 30, 2022
Java interface to OpenCV, FFmpeg, and more

JavaCV Commercial support: Introduction JavaCV uses wrappers from the JavaCPP Presets of commonly used libraries by researchers in the field of comput

Bytedeco 6.4k Jan 4, 2023
Pw0 Framewrok - magical android pentest app 🔮! Pixie Dust, Handshakes, Deauth, Nmap, Port scanner and more!

Pw0 Framework Pw0 Framewrok - magical android pentest app ?? ! Features: Pixie Dust Handshakes Deauth Nmap Port scanner and more! Version: 0.2 Beta Au

Huntmix 17 Sep 27, 2021
Thumbnailator - a thumbnail generation library for Java

March 11, 2021: Thumbnailator 0.4.14 has been released! See Changes for details. Thumbnailator is now available through Maven! What is Thumbnailator?

Chris Kroells 4.5k Jan 5, 2023
ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

ZXing Project 30.5k Jan 4, 2023
Java library for remapper JARs

Pocolifo's JAR Remapper Making remapping JARs easy, organized, and painless Features Remapping Class remapping Method remapping Field remapping Parame

null 8 Oct 2, 2022
A Java Visualization Library based on Apache ECharts.

ECharts Java "We bring better visualization into Java with ECharts" ?? Introduction ECharts Java is a lightweight but comprehensive library for Java d

ECharts Java Open Source Project 171 Dec 31, 2022
Anthos Edge Use Cases for bringing apps and computation closer to the location where the action is, to improve response times and save bandwidth.

Anthos Bare Metal Edge Use Cases Edge computing is a distributed computing paradigm that brings computation and data storage closer to the location wh

Google Cloud Platform 27 Dec 20, 2022