Git Product home page Git Product logo

brisk's Introduction

brisk

Effective and efficient generation of keypoints from an image is a well-studied problem in the literature and forms the basis of numerous Computer Vision applications. Established leaders in the field are the SIFT and SURF algorithms which exhibit great performance under a variety of image transformations, with SURF in particular considered as the most computationally efficient amongst the high-performance methods to date.

Since the OpenCV brisk-detector is broken Bug #2491 and the original code can't be compiled with new OpenCV versions (conflicting names), I've forked the original code and made some minor tweaks and a new python wrapper.

Original Header

BRISK package: Source Code Release v0.0 Copyright 2011 Autonomous Systems Lab (ASL), ETH Zurich Stefan Leutenegger, Simon Lynen and Margarita Chli

License: BSD (see license file included in this folder)

This software is an implementation of [1]:
[1] Stefan Leutenegger, Margarita Chli and Roland Siegwart, BRISK:
Binary Robust Invariant Scalable Keypoints, in Proceedings of the
IEEE International Conference on Computer Vision (ICCV2011).

Dependencies

C++

  • OpenCV
  • cmake

Python

  • Python (dev)
  • Numpy

Building

Download the source code

cd ${brisk-dir}
wget https://github.com/clemenscorny/brisk/archive/master.zip
unzip master.zip
cd brisk-master

Create the Makifile with cmake

mkdir build
cd build
cmake ..
# or
# cmake .. -DBUILD_PYTHON_BINDING=OFF
# to build without python wrapper

Build the project

make

The built files files are stored in ${brisk-dir}/brisk-master/build/bin and ${brisk-dir}/brisk-master/build/lib

Testing

Navigate to the bin folder and run the demo

cd ${brisk-dir}/brisk-master/build/bin/
./demo

Example

Python

Add the python wrapper folder to the python path

export PYTHONPATH=${brisk-dir}/brisk-master/build/lib:$PYTHONPATH

and run

import brisk
import cv2

img = cv2.imread('path/to/an/image.png')

b = brisk.Brisk()
# detector
kpts = b.detect(img)
# desriptor
kpts, features = b.compute(img, kpts)

# draw and show keypoints in the image
cv2.imshow('Brisk', cv2.drawKeypoints(img, kpts, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS))
cv2.waitKey()

C++

Take a look at demo.cpp

Important note: This brisk implementation (original implementation) doesn't calculate the angles in brisk::BriskFeatureDetector::detect. Use this piece of code to compute it

cv::Mat img; // use for example cv::imread to load an image
cv::Ptr<cv::FeatureDetector> detector;
detector = new brisk::BriskFeatureDetector(60, 4);
std::vector<cv::KeyPoint> keypoints;
detector->detect(img, keypoints);

// keypoints have invalid angles
// keypoints[i].angle is every time -1

// code of interest
// brisk::BriskDescriptorExtractor::BriskDescriptorExtractor needs some computation
// time. (But you don't have to create for every new image a new new instance of
// this class).
brisk::BriskDescriptorExtractor* descriptor_extractor = new brisk::BriskDescriptorExtractor();
descriptor_extractor->computeAngles(img, keypoints);

// keypoints have valid angles
// keypoints[i].angle works

brisk's People

Contributors

kornerc avatar gnebehay avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.