Skip to content

carzuiliam/speeded-up-robust-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speeded-Up Robust Features (SURF) in Java

This project is an implementation of the SURF algorithm (Speeded-Up Robust Features), written entirely in Java. SURF is a computer vision technique used for detecting and describing local features in images. It is known for being faster than SIFT while still being robust to changes in scale, rotation, illumination, and noise [1].

Introduction

The SURF algorithm is widely used in image matching, object recognition, image stitching, and 3D reconstruction. Its core steps are:

  • Integral Image: Precomputed image representation that enables very fast area summation (constant time lookup).
  • Hessian Matrix Detector: Uses determinant of Hessian to find blob-like keypoints in multiple scales.
  • Keypoint Localization: Detects robust interest points in the image.
  • Orientation Assignment (future work): Assigns a dominant direction to each keypoint, ensuring rotation invariance.
  • Descriptor Generation (future work): Builds a descriptor vector around each keypoint for robust matching.

The goal of this implementation is to provide a pure Java version of SURF, for experimentation, study, and integration into other Java-based projects.

Usage Instructions

Requirements

  • Java 17 or newer;
  • No external dependencies (pure Java, standard libraries only).

How to Run

  1. Clone this repository.

  2. Place your input image (JPG format, grayscale recommended) into the src/main/resources folder.

  3. Example usage in Java:

public class Main {
    public static void main(String[] args) throws IOException {
        SURFBuilder builder = new SURFBuilder()
                .setInputImage("lenna.jpg")
                .setThreshold(0.0004f);

        // Run the SURF pipeline
        builder.generate("surf_output.jpg");
    }
}
  1. Output images are saved in the folder: target/output/.

Current Features

  • Grayscale conversion and preprocessing (Gaussian smoothing).
  • Hessian-based keypoint detection at a single scale.
  • Export of keypoints for visualization or further processing.

Roadmap (Planned Features)

  • Multi-scale detection (scale-space representation using box filters).
  • Orientation assignment (for rotation invariance).
  • Descriptor extraction (for feature matching).
  • Feature matching utilities between two images.

Project Structure

  • SURFBuilder.java — Main class to configure and run the SURF algorithm.
  • HessianDetector.java — Computes the determinant of Hessian and extracts keypoints.
  • KeyPoint.java — Immutable record representing a feature point.
  • Main.java — Example entry point.

Notes

  • Input/output images are handled in JPG format only.
  • Input images are converted internally to grayscale.
  • The implementation is a simplified SURF, intended for learning and experimentation.

License

The available source codes here are under the Apache License, version 2.0 (see the attached LICENSE file for more details). Any questions can be submitted to my email: [email protected].

References

[1] H. Bay, T. Tuytelaars, and L. Van Gool, "SURF: Speeded Up Robust Features", European Conference on Computer Vision, 2006.

About

A SURF (Speeded-Up Robust Features) implementation using Java.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages