Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
7b6fe5cd
Commit
7b6fe5cd
authored
May 23, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #231 from GilLevi/AddingLATCH
Adding the LATCH descriptor
parents
8fa8fa80
5e64ac0a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
0 deletions
+79
-0
xfeatures2d.hpp
modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
+28
-0
perf_latch.cpp
modules/xfeatures2d/perf/perf_latch.cpp
+34
-0
latch.cpp
modules/xfeatures2d/src/latch.cpp
+0
-0
test_features2d.cpp
modules/xfeatures2d/test/test_features2d.cpp
+7
-0
test_rotation_and_scale_invariance.cpp
...s/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
+10
-0
No files found.
modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
View file @
7b6fe5cd
...
...
@@ -145,6 +145,34 @@ public:
};
/*
* LATCH Descriptor
*/
/** latch Class for computing the LATCH descriptor.
If you find this code useful, please add a reference to the following paper in your work:
Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015
LATCH is a binary descriptor based on learned comparisons of triplets of image patches.
* bytes is the size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1
* rotationInvariance - whether or not the descriptor should compansate for orientation changes.
* half_ssd_size - the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x
then the half_ssd_size should be (7-1)/2 = 3.
Note: the descriptor can be coupled with any keypoint extractor. The only demand is that if you use set rotationInvariance = True then
you will have to use an extractor which estimates the patch orientation (in degrees). Examples for such extractors are ORB and SIFT.
Note: a complete example can be found under /samples/cpp/tutorial_code/xfeatures2D/latch_match.cpp
*/
class
CV_EXPORTS
LATCH
:
public
DescriptorExtractor
{
public
:
static
Ptr
<
LATCH
>
create
(
int
bytes
=
32
,
bool
rotationInvariance
=
true
,
int
half_ssd_size
=
3
);
};
//! @}
...
...
modules/xfeatures2d/perf/perf_latch.cpp
0 → 100644
View file @
7b6fe5cd
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
cv
::
xfeatures2d
;
using
namespace
perf
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
typedef
perf
::
TestBaseWithParam
<
std
::
string
>
latch
;
#define LATCH_IMAGES \
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png"
PERF_TEST_P
(
latch
,
extract
,
testing
::
Values
(
LATCH_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
<
LATCH
>
descriptor
=
LATCH
::
create
();
vector
<
uchar
>
descriptors
;
TEST_CYCLE
()
descriptor
->
compute
(
frame
,
points
,
descriptors
);
SANITY_CHECK
(
descriptors
,
1e-4
);
}
modules/xfeatures2d/src/latch.cpp
0 → 100644
View file @
7b6fe5cd
This diff is collapsed.
Click to expand it.
modules/xfeatures2d/test/test_features2d.cpp
View file @
7b6fe5cd
...
...
@@ -1032,6 +1032,13 @@ TEST( Features2d_DescriptorExtractor_LUCID, regression )
test
.
safe_run
();
}
TEST
(
Features2d_DescriptorExtractor_LATCH
,
regression
)
{
CV_DescriptorExtractorTest
<
Hamming
>
test
(
"descriptor-latch"
,
1
,
LATCH
::
create
()
);
test
.
safe_run
();
}
/*#if CV_SSE2
...
...
modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
View file @
7b6fe5cd
...
...
@@ -651,6 +651,16 @@ TEST(Features2d_RotationInvariance_Descriptor_SIFT, regression)
test
.
safe_run
();
}
TEST
(
Features2d_RotationInvariance_Descriptor_LATCH
,
regression
)
{
DescriptorRotationInvarianceTest
test
(
SIFT
::
create
(),
LATCH
::
create
(),
NORM_HAMMING
,
0.9999
f
);
test
.
safe_run
();
}
/*
* Detector's scale invariance check
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment