Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/xfeatures2d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Extra 2D Features Framework
2. Non-free 2D feature algorithms

Extra 2D Features Framework containing experimental and non-free 2D feature detector/descriptor algorithms:
SURF, BRIEF, Censure, Freak, LUCID, Daisy, Self-similar.
SURF, BRIEF, Censure, Freak, LUCID, Daisy, BEBLID, Self-similar.
20 changes: 20 additions & 0 deletions modules/xfeatures2d/doc/xfeatures2d.bib
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,24 @@ @incollection{LUCID
pages = {1--9}
year = {2012}
publisher = {NIPS}
}

@article{Suarez2020BEBLID,
title = {{BEBLID: Boosted Efficient Binary Local Image Descriptor}},
journal = {Pattern Recognition Letters},
volume = {133},
pages = {366--372},
year = {2020},
issn = {0167-8655},
doi = {https://doi.org/10.1016/j.patrec.2020.04.005},
url = {https://raw.githubusercontent.com/iago-suarez/BEBLID/master/BEBLID_Boosted_Efficient_Binary_Local_Image_Descriptor.pdf},
author = {Iago Su\'arez and Ghesn Sfeir and Jos\'e M. Buenaposada and Luis Baumela},
}

@inproceedings{winder2007learning,
title= {Learning Local Image Descriptors},
author= {Winder, Simon AJ and Brown, Matthew},
booktitle= {Computer Vision and Pattern Recognition},
pages={1--8},
year={2007},
}
45 changes: 45 additions & 0 deletions modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,51 @@ class CV_EXPORTS_W LATCH : public Feature2D
CV_WRAP static Ptr<LATCH> create(int bytes = 32, bool rotationInvariance = true, int half_ssd_size = 3, double sigma = 2.0);
};

/** @brief Class implementing BEBLID (Boosted Efficient Binary Local Image Descriptor),
* described in @cite Suarez2020BEBLID .

BEBLID \cite Suarez2020BEBLID is a efficient binary descriptor learned with boosting.
It is able to describe keypoints from any detector just by changing the scale_factor parameter.
In several benchmarks it has proved to largely improve other binary descriptors like ORB or
BRISK with the same efficiency. BEBLID describes using the difference of mean gray values in
different regions of the image around the KeyPoint, the descriptor is specifically optimized for
image matching and patch retrieval addressing the asymmetries of these problems.

If you find this code useful, please add a reference to the following paper:
<BLOCKQUOTE> Iago Suárez, Ghesn Sfeir, José M. Buenaposada, and Luis Baumela.
BEBLID: Boosted efficient binary local image descriptor.
Pattern Recognition Letters, 133:366–372, 2020. </BLOCKQUOTE>

The descriptor was trained using 1 million of randomly sampled pairs of patches
(20% positives and 80% negatives) from the Liberty split of the UBC datasets
\cite winder2007learning as described in the paper @cite Suarez2020BEBLID.
You can check in the [AKAZE example](https://raw.githubusercontent.com/opencv/opencv/master/samples/cpp/tutorial_code/features2D/AKAZE_match.cpp)
how well BEBLID works. Detecting 10000 keypoints with ORB and describing with BEBLID obtains
561 inliers (75%) whereas describing with ORB obtains only 493 inliers (63%).
*/
class CV_EXPORTS_W BEBLID : public Feature2D
{
public:
/**
* @brief Descriptor number of bits, each bit is a boosting weak-learner.
* The user can choose between 512 or 256 bits.
*/
enum BeblidSize
{
SIZE_512_BITS = 100, SIZE_256_BITS = 101,
};
/** @brief Creates the BEBLID descriptor.
@param scale_factor Adjust the sampling window around detected keypoints:
- <b> 1.00f </b> should be the scale for ORB keypoints
- <b> 6.75f </b> should be the scale for SIFT detected keypoints
- <b> 6.25f </b> is default and fits for KAZE, SURF detected keypoints
- <b> 5.00f </b> should be the scale for AKAZE, MSD, AGAST, FAST, BRISK keypoints
@param n_bits Determine the number of bits in the descriptor. Should be either
BEBLID::SIZE_512_BITS or BEBLID::SIZE_256_BITS.
*/
CV_WRAP static Ptr<BEBLID> create(float scale_factor, int n_bits = BEBLID::SIZE_512_BITS);
};

/** @brief Class implementing DAISY descriptor, described in @cite Tola10

@param radius radius of the descriptor at the initial scale
Expand Down
36 changes: 36 additions & 0 deletions modules/xfeatures2d/perf/perf_beblid.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "perf_precomp.hpp"

namespace opencv_test { namespace {

typedef perf::TestBaseWithParam<std::string> beblid;

#define BEBLID_IMAGES \
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png"

#ifdef OPENCV_ENABLE_NONFREE
PERF_TEST_P(beblid, extract, testing::Values(BEBLID_IMAGES))
{
string filename = getDataPath(GetParam());
Mat frame = imread(filename, IMREAD_GRAYSCALE);
ASSERT_FALSE(frame.empty()) << "Unable to load source image " << filename;

Mat mask;
declare.in(frame).time(90);

Ptr<SURF> detector = SURF::create();
vector<KeyPoint> points;
detector->detect(frame, points, mask);

Ptr<BEBLID> descriptor = BEBLID::create(6.25f);
cv::Mat descriptors;
TEST_CYCLE() descriptor->compute(frame, points, descriptors);

SANITY_CHECK_NOTHING();
}
#endif // NONFREE

}} // namespace
Loading