BoofCV

lessthanoptimal活跃维护

纯 Java 实现的高性能计算机视觉库,覆盖 SFM、相机标定、基准标记识别、目标跟踪和图像处理,适合在 Android 或 JVM 上做 3D 视觉与摄影测量。

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

v1.6.0发布于 2026-10-23 03:54 UTC1,208star +2 / 7 天270fork同步于 2026-11-10 17:52 UTC

怎么上手

由 README 提炼,执行前请确认
git clone -b SNAPSHOT --recursive https://github.com/lessthanoptimal/BoofCV.git boofcv
cd boofcv
./gradlew autogenerate
./gradlew examplesJar
java -jar examples/examples.jar
硬件要求按 README 说明

README 未说明 GPU 或显存要求;运行只需 Java 11 或更新版本,任意免费 JDK 均可,Gradle 构建会自动下载依赖并忽略不兼容的本地 JDK。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

纯 Java 编写的实时计算机视觉库,覆盖标定、特征跟踪、SFM 与图像处理

纯 Java 实现的高性能计算机视觉库,覆盖 SFM、相机标定、基准标记识别、目标跟踪和图像处理,适合在 Android 或 JVM 上做 3D 视觉与摄影测量。

核心能力

  • 纯 Java 实现,Apache 2.0 许可,可跑在 JVM 与 Android 上
  • 提供相机标定、特征检测跟踪与 structure-from-motion 流程
  • 内置基准标记(fiducial)识别与二维码生成、批量扫描应用
  • 按模块拆分,核心 boofcv-core 可按需叠加 GUI、视频 IO 模块
  • 附带 examples 与可实时调参的 demonstrations 演示程序

容易踩的坑

克隆时必须加 --recursive,否则 data 目录为空,需再执行 git submodule update --init --recursive 补上;从 1.5.0 起 boofcv-ffmpeg 与 boofcv-javacv 不再自带原生库,要按平台(如 linux-x86_64)手动添加 runtimeOnly 依赖,否则报 UnsatisfiedLinkError;构建前建议先 git clean -fd main 清除过期的自动生成代码。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.6.0
  1. v1.6.0最新正式版2026-10-23 · 2026-10-23 03:54 UTC
    • Build: Modernized with Gradle Conventions
    • CreateECoCheckDocumentPDF: Better text alignment and size
    • MeshRender supports multiple texture images. PLY and OBJ
    • MeshRasterizer is about 2x faster
    • Units: Fixed micrometer and mile, added thou
    • Added chainrule from DDogleg, added SBA example
  2. v1.4.02026-05-25 · 2026-05-25 19:07 UTC
    查看更新说明

    Date : 2026/May/25 Version : 1.4.0

    • Image Derivative
      • Correctly scales integer and float variants
      • Need to specify scaling for integer valued images for many feature detectors, breaking change
      • This makes tuning parameters consistent across data types for down stream algorithms
      • Been a known issue from the very beginning in BoofCV. This fixes it.
    • You can specify convergence tolerance for lens distortion
    • Loss function for N-View trianguation
    • Added EasyPyramidKlt
      • High level API that lets you mess with low level KLT
      • More powerful than wrapped versions of KLT which limit how you can use it
    • Support for Matrix and Map Format
  3. v1.3.02026-01-23 · 2026-01-23 04:31 UTC

    这个版本没有写更新说明。

  4. v1.2.42025-10-01 · 2025-10-01 00:00 UTC

    这个版本没有写更新说明。

  5. v1.2.0V1.2.02025-03-22 · 2025-03-22 16:49 UTC
    查看更新说明
    • VerboseUtils
      • Moving verbose related utilities into DDogleg
      • Deprecated functions in BoofCV
    • PointIndex2D_F64
      • Added isIdentical()
    • WorldToCameraToPixel
      • Projects the point even if it's behind the camera
    • CalibrationDetectorMultiECoCheck
      • Fixed a bug in getLayout() where duplicate was handled incorrectly
    • PnPRefineWithPixels3D / 4D
      • Added to make refining PnP optimally easier

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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

    To run BoofCV you need Java 11 or newer and any free version will work, e.g. Zulu. To build BoofCV, just let the Gradle script handle everything. It will automatically download what it needs and ignore your local JDK if it's not compatible.

    cd boofcv
    git clean -fd main # Removes stale autogenerated code
    ./gradlew autogenerate
    ./gradlew examplesJar
    java -jar examples/examples.jar
    ./gradlew demonstrationsJar
    java -jar demonstrations/demonstrations.jar
    

    All the code for examples and demonstrations is in boofcv/examples and boofcv/demonstrations. Example code is intended 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 favorite build systems; Maven, Gradle, ... etc. It's divided up into many modules, but most people will just need 'boofcv-core'. Additional modules are listed below for GUI and IO components. To include it in a Gradle project add the following to your dependencies:

    For Gradle projects:

    dependencies {
        api(group: 'org.boofcv', name: 'boofcv-core', version: '1.6.0')
    }
    

    Here are a list of the most commonly used modules and what they are for:

    NameDescription
    boofcv-coreAll the core libraries without any of the integration modules listed below
    boofcv-androidUseful functions for working inside of Android devices.
    boofcv-ffmpegjavacpp-presets their ffmpeg wrapper is used for reading video files.
    boofcv-javacvJavaCV is a wrapper around OpenCV mainly for file IO.
    boofcv-jcodecJCodec is a pure Java video reader/writer.
    boofcv-kotlinKotlin extensions which take advantage of Kotlin's unique features.
    boofcv-pdfNeeded to render fiduals as PDF documents
    boofcv-swingVisualization using Java Swing. Required for examples and demonstrations.
    boofcv-WebcamCaptureA few functions that make WebcamCapture even easier to use.

    Directories

    DirectoryDescription
    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

    JavaCV and FFMPEG

    Starting in BoofCV 1.5.0, native binaries for the optional boofcv-ffmpeg and boofcv-javacv are no longer included by default. This greatly reduces the number of unnecessary jars which need to be downloaded.

    IMPORTANT: You will need to specify your platform, i.e. linux-x85_64. See JavaCV and FFMPEG for a list of what's available.

    dependencies {
        # FFMPEG
        runtimeOnly 'org.bytedeco:ffmpeg:8.1.2-1.5.14:<ENTER PLATFORM HERE>'
    
        # JavaCV
        runtimeOnly 'org.bytedeco:opencv:4.14.0-1.5.14:<ENTER PLATFORM HERE>'
        runtimeOnly 'org.bytedeco:openblas:0.3.34-1.5.14:<ENTER PLATFORM HERE>'
    }
    

    If you see an error similar to java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path then that's probably the cause and it's fixed by adding the dependencies above.

    boofcv-javacv

    Wraps JavaCV for OpenCV interop and webcam capture.


    Building from Source

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

    cd boofcv
    git clean -fd main                # Removes stale autogenerated code
    ./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

    Similar to IntelliJ, you can now import Gradle projects like BoofCV using the Buildship tooling. Instructions


    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