Giter VIP home page Giter VIP logo

bailool / anms-codes Goto Github PK

View Code? Open in Web Editor NEW
324.0 14.0 67.0 6.19 MB

Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution

Home Page: https://www.researchgate.net/publication/323388062_Efficient_adaptive_non-maximal_suppression_algorithms_for_homogeneous_spatial_keypoint_distribution

License: MIT License

CMake 0.71% C++ 86.92% C 0.21% QMake 0.38% MATLAB 0.83% Python 4.18% Shell 0.11% Java 6.67%
cmake qt opencv cpp11 computer-vision anms adaptive-non-maximal-suppression slam point-detection matlab python robotics nms non-maximum-suppression java spatial-keypoints-distribution maximal-suppression-algorithms algorithm algorithm-overview paper

anms-codes's Introduction

Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution

This is the implementation of the paper "Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution" that is published in Pattern Recognition Letters (PRL). Alternatively, see TL;DR version.

Algorithm Overview

While competing ANMS methods have similar performance in terms of spatial keypoints distribution, the proposed method SSC is substantially faster and scales better:

Retrieve 10% Retrieve 40% Retrieve 70%

Here is how proposed ANMS method visually compares to traditional methods: TopM | Bucketing | SSC (proposed)

TopM Bucketing SSC

Related algorithms that are implemented in this repository are:

  • "Visual Odometry based on Stereo Image Sequences with RANSAC-based Outlier Rejection Scheme" - bucketing
  • "Multi-Image Matching using Multi-Scale Oriented Patches" - original ANMS
  • "Efficiently selecting spatially distributed keypoints for visual tracking" - more efficient ANMS

For more details about the algorithm, experiments as well as the importance of homogeneously distributed keypoints for SLAM please refer to the paper.

How to run

  1. Clone this repository: git clone https://github.com/BAILOOL/ANMS-Codes.git. See codebase visualization to better understand code repository structure.

  2. Choose your language:

  3. Make sure the path to test image is set correctly

  4. Run produced executable ./ANMS_Codes for C++ or relevant script for other languages

Codes have been tested with OpenCV 2.4.8, OpenCV 3.3.1, OpenCV 4.2.0 and Ubuntu 14.04, 16.04, 20.04.

Contributing

Follow instructions in docs/contributing.

Citation

If you use these codes in your research, please cite:

@article{bailo2018efficient,
  title={Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution},
  author={Bailo, Oleksandr and Rameau, Francois and Joo, Kyungdon and Park, Jinsun and Bogdan, Oleksandr and Kweon, In So},
  journal={Pattern Recognition Letters},
  volume={106},
  pages={53--60},
  year={2018},
  publisher={Elsevier}
}

anms-codes's People

Contributors

bailool avatar drondao avatar lgalardini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anms-codes's Issues

"RANDR" missing on display

Getting the following error when trying to run the code:

Xlib:  extension "RANDR" missing on display ":6".

(Input Image:3187): GdkGLExt-WARNING **: Window system doesn't support OpenGL.
dh@dh-All-Series:~/Downloads/ANMS-Codes-master/CmakeProject/build$ ./ANMS_Codes Demo of the ANMS algorithms
Xlib:  extension "RANDR" missing on display ":6".

(Input Image:3295): GdkGLExt-WARNING **: Window system doesn't support OpenGL.

Getting std::bad_alloc error when using SSC function

I'm getting an std::bad_alloc error when testing a visual odometry algorithm, that uses the ssc() function (suppression via square covering) (in this case it is occurring on the Kitti sequence 01 odometry dataset). The error occurs on the line that says:

std::vector<std::vector<bool>> coveredVec(numCellRows + 1, std::vector<bool>(numCellCols + 1, false));

The root-cause of the issue occurs a few lines up when width = 1, since the variable c is defined as:

double c = width / 2;

which will cause c = 1/2 = 0 due to integer division. This then has the follow-on effect that numCellCols and numCellRows are undefined since they are created by dividing by c (which is 0 in this case).

I can fix the issue by simply defining c using floating point division instead of integer division (i.e. double c = width / 2.0). However, as I do not have enough time to delve deep into the theory, I wanted to ask if this "fix" is theoretically sound. Thanks.

Effectiveness for monocular SLAM

Hi,

First of all, congratulations for your paper and thank you for your contribution to computer vision field.

After reading your paper and making some tests I can conclude that this new ANMS approach can be helpful for stereo systems where line matching can be used to get correspondences from a pair of images. However, when feature matchers are used, I get much better results with the bucketing approach, probably because feature matchers don't work well with low contrast features (although well distributed).

I'm my tests I've used ORB for keypoints and descriptors extraction, and tested correspondences with both a Brute Force matcher and a Flann matcher.

Could you share your thoughts about using ANMS approaches for monocular systems? Any recommendation to improve keypoint matching?

Python version mistake

To make it work properly with rectangular images,

covered_vec = [[False for _ in range(num_cell_cols + 1)] for _ in range(num_cell_cols + 1)]

has to be

covered_vec = [[False for _ in range(num_cell_cols + 1)] for _ in range(num_cell_rows + 1)]

Get exact number of points

Thanks for the work.

I can get the exact number of returned points using brownANMS, but using other methods, I couldn't, even when I set the tolerance to 0.

Is there a quick modification to get the exact number of points for the other methods?

Error C2334 unexpected token(s) preceding '{'; skipping apparent function body

When compiling the CmakeProject on Windows 7 for Visual Studio 15 2017 Win64 with OpenCV 3 I get a lot of errors.

The first one is for example:
Severity Code Description Project File Line Suppression State Error C2334 unexpected token(s) preceding '{'; skipping apparent function body ANMS_Codes c:\users\cookie\documents\anms\cmakeproject\source\range-tree\ranget.h 523

Is the code not compatible with my setup or have I simply missed something?

Response vector

Hello everyone,

In main.cpp the following code
//Sorting keypoints by deacreasing order of strength vector<**int**> responseVector; for (unsigned int i =0 ; i<keyPoints.size(); i++) responseVector.push_back(keyPoints[i].response);

Since the response of a cv::Keypoint is a float value, I think that the responseVector should be float as well instead of int. In fact, if other detectors than FAST are used, the response vector is going to be populated of zeros because the range is different.

Can I use in ORB Matchs

Hello,

I want to use my key points that I got here in the ORB. Do you think this is possible?

Best Regards

Onur Güzeldemirci

expression for lower bound al of binary search

In the paper, the al=sqrt(n/m)/2, while in the code implementation, e.g. line 303 of anms.h, the al is calculated as int low = floor(sqrt((double)keyPoints.size()/numRetPoints));. Could the author clarify the discrepancy?

std::bad_alloc in anms.h

In "anms.h", the following line assigns c = 0 when width = 1 because of integer division:

double c = width/2; //initializing Grid

This causes the assignment of infinity to

int numCellCols = floor(cols/c);
int numCellRows = floor(rows/c);

which, in turn, returns an std::bad_alloc exception because of the call

std::vector<std::vector<bool> > coveredVec(numCellRows+1,std::vector<bool>(numCellCols+1,false));

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.