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
25aad108
Commit
25aad108
authored
Jan 20, 2015
by
Str3iber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make suggested changes
parent
84c598f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
135 deletions
+23
-135
extra_features.rst
modules/xfeatures2d/doc/extra_features.rst
+0
-25
xfeatures2d.hpp
modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
+8
-9
lucid.cpp
modules/xfeatures2d/src/lucid.cpp
+15
-101
No files found.
modules/xfeatures2d/doc/extra_features.rst
View file @
25aad108
...
...
@@ -91,28 +91,3 @@ We notice that for keypoint matching applications, image content has little effe
:param keypoints: Set of detected keypoints
:param corrThresh: Correlation threshold.
:param verbose: Prints pair selection informations.
LUCID
------------------------
.. ocv:class:: LUCID : public DescriptorExtractor
Class for computing LUCID descriptors described in a paper by Ziegler, Andrew,
Eric Christiansen, David Kriegman, and Serge J. Belongie.
*Locally uniform comparison image descriptor.* In Advances in Neural Information Processing Systems, pp. 1-9. 2012. ::
class LUCID : public DescriptorExtractor
{
public:
LUCID(const int lucid_kernel = 1, const int blur_kernel = 2);
virtual int descriptorSize() const;
virtual int descriptorType() const;
virtual int defaultNorm() const;
virtual void compute(InputArray _src, std::vector<KeyPoint> &keypoints, OutputArray _desc);
protected:
int l_kernel, b_kernel;
};
modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
View file @
25aad108
...
...
@@ -130,22 +130,21 @@ public:
};
/
/ Locally Uniform Comparison Image Descriptor
/
** @brief Class implementing the locally uniform comparison image descriptor, described in @cite LUCID
// @brief This class implements the Locally Uniform Comparison Image Descriptor @cite LUCID
An image descriptor that can be computed very fast, while being
about as robust as, for example, SURF or BRIEF.
*/
class
CV_EXPORTS
LUCID
:
public
DescriptorExtractor
{
public
:
/**
* @param lucid_kernel kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
* @param blur_kernel kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
*/
static
Ptr
<
LUCID
>
create
(
const
int
lucid_kernel
,
const
int
blur_kernel
);
};
/** @brief Separable box filter blur, needed by LUCID, also exposed for the user
@param _src Image on which blur should be applied
@param _dst Image resulting from _src having blur applied, the output image
@param kernel Blur kernel size where 1 equates a 3x3 matrix, 2 = 5x5, 3 = 7x7, and so on
*/
CV_EXPORTS
void
separable_blur
(
const
InputArray
_src
,
CV_OUT
OutputArray
_dst
,
const
int
kernel
);
//! @}
...
...
modules/xfeatures2d/src/lucid.cpp
View file @
25aad108
...
...
@@ -50,110 +50,24 @@ the use of this software, even if advised of the possibility of such damage.
namespace
cv
{
namespace
xfeatures2d
{
void
separable_blur
(
const
InputArray
_src
,
OutputArray
_dst
,
const
int
kernel
)
{
int
z
,
p
,
r
=
0
,
g
=
0
,
b
=
0
,
m
=
kernel
*
2
+
1
,
width
,
height
;
Point3_
<
uchar
>
*
pnt
;
Mat_
<
Vec3b
>
src
=
_src
.
getMat
();
if
(
src
.
empty
())
{
CV_Error
(
Error
::
StsBadArg
,
"empty source image supplied"
);
return
;
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
Mat_
<
Vec3b
>
dst
=
_dst
.
getMat
();
width
=
dst
.
cols
,
height
=
dst
.
rows
;
for
(
int
y
=
0
;
y
<
height
;
++
y
)
{
for
(
int
x
=
0
;
x
<
width
;
++
x
)
{
z
=
kernel
*-
1
;
if
(
!
x
)
{
r
=
0
,
g
=
0
,
b
=
0
;
for
(
p
=
x
+
z
;
z
<=
kernel
;
++
z
,
p
=
x
+
z
)
{
pnt
=
src
.
ptr
<
Point3_
<
uchar
>
>
(
y
,
(
p
<
0
?
width
+
p
:
p
>=
width
?
p
-
width
:
p
));
r
+=
pnt
->
z
;
g
+=
pnt
->
y
;
b
+=
pnt
->
x
;
}
}
else
{
p
=
x
+
z
-
1
;
pnt
=
src
.
ptr
<
Point3_
<
uchar
>
>
(
y
,
(
p
<
0
?
width
+
p
:
p
>=
width
?
p
-
width
:
p
));
r
-=
pnt
->
z
;
g
-=
pnt
->
y
;
b
-=
pnt
->
x
;
p
=
x
+
kernel
;
pnt
=
src
.
ptr
<
Point3_
<
uchar
>
>
(
y
,
(
p
<
0
?
width
+
p
:
p
>=
width
?
p
-
width
:
p
));
r
+=
pnt
->
z
;
g
+=
pnt
->
y
;
b
+=
pnt
->
x
;
}
pnt
=
dst
.
ptr
<
Point3_
<
uchar
>
>
(
y
,
x
);
pnt
->
z
=
static_cast
<
uchar
>
(
r
/
m
);
pnt
->
y
=
static_cast
<
uchar
>
(
g
/
m
);
pnt
->
x
=
static_cast
<
uchar
>
(
b
/
m
);
}
}
for
(
int
x
=
0
,
rl
=
0
,
gl
=
0
,
bl
=
0
,
rn
=
0
,
gn
=
0
,
bn
=
0
;
x
<
width
;
++
x
)
{
for
(
int
y
=
0
;
y
<
height
;
++
y
)
{
z
=
kernel
*-
1
;
if
(
!
y
)
{
r
=
0
,
g
=
0
,
b
=
0
;
for
(
p
=
y
+
z
;
z
<=
kernel
;
++
z
,
p
=
y
+
z
)
{
pnt
=
dst
.
ptr
<
Point3_
<
uchar
>
>
((
p
<
0
?
height
+
p
:
p
>=
height
?
p
-
height
:
p
),
x
);
r
+=
pnt
->
z
;
g
+=
pnt
->
y
;
b
+=
pnt
->
x
;
}
}
else
{
p
=
y
+
z
-
1
;
pnt
=
dst
.
ptr
<
Point3_
<
uchar
>
>
((
p
<
0
?
height
+
p
:
p
>=
height
?
p
-
height
:
p
),
x
);
r
-=
pnt
->
z
,
r
-=
rl
;
g
-=
pnt
->
y
,
g
-=
gl
;
b
-=
pnt
->
x
,
b
-=
bl
;
p
=
y
+
kernel
;
pnt
=
dst
.
ptr
<
Point3_
<
uchar
>
>
((
p
<
0
?
height
+
p
:
p
>=
height
?
p
-
height
:
p
),
x
);
r
+=
pnt
->
z
,
r
+=
rn
;
g
+=
pnt
->
y
,
g
+=
gn
;
b
+=
pnt
->
x
,
b
+=
bn
;
}
pnt
=
dst
.
ptr
<
Point3_
<
uchar
>
>
(
y
,
x
);
rl
=
pnt
->
z
;
gl
=
pnt
->
y
;
bl
=
pnt
->
x
;
rn
=
r
/
m
;
gn
=
g
/
m
;
bn
=
b
/
m
;
pnt
->
z
=
static_cast
<
uchar
>
(
rn
);
pnt
->
y
=
static_cast
<
uchar
>
(
gn
);
pnt
->
x
=
static_cast
<
uchar
>
(
bn
);
}
}
}
/*!
LUCID implementation
*/
class
LUCIDImpl
:
public
LUCID
{
public
:
/** Constructor
* @param lucid_kernel kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
* @param blur_kernel kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
*/
LUCIDImpl
(
const
int
lucid_kernel
=
1
,
const
int
blur_kernel
=
2
);
/** returns the descriptor length */
virtual
int
descriptorSize
()
const
;
/** returns the descriptor type */
virtual
int
descriptorType
()
const
;
/** returns the default norm type */
virtual
int
defaultNorm
()
const
;
virtual
void
compute
(
InputArray
_src
,
std
::
vector
<
KeyPoint
>
&
keypoints
,
OutputArray
_desc
);
...
...
@@ -168,7 +82,7 @@ namespace cv {
LUCIDImpl
::
LUCIDImpl
(
const
int
lucid_kernel
,
const
int
blur_kernel
)
{
l_kernel
=
lucid_kernel
;
b_kernel
=
blur_kernel
;
b_kernel
=
blur_kernel
*
2
+
1
;
}
int
LUCIDImpl
::
descriptorSize
()
const
{
...
...
@@ -191,7 +105,7 @@ namespace cv {
Mat_
<
Vec3b
>
src
;
separable_blur
(
_src
.
getMat
(),
src
,
b_kernel
);
blur
(
_src
.
getMat
(),
src
,
cv
::
Size
(
b_kernel
,
b_kernel
)
);
int
x
,
y
,
j
,
d
,
p
,
m
=
(
l_kernel
*
2
+
1
)
*
(
l_kernel
*
2
+
1
)
*
3
,
width
=
src
.
cols
,
height
=
src
.
rows
,
r
,
c
;
...
...
@@ -223,4 +137,4 @@ namespace cv {
sort
(
desc
,
_desc
,
SORT_EVERY_ROW
|
SORT_ASCENDING
);
}
}
}
}
// END NAMESPACE CV
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