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
b4dea4ef
Commit
b4dea4ef
authored
Dec 07, 2018
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linemod: add drawFeatures method
parent
7670ff2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
linemod.hpp
modules/rgbd/include/opencv2/rgbd/linemod.hpp
+9
-0
linemod.cpp
modules/rgbd/src/linemod.cpp
+23
-0
No files found.
modules/rgbd/include/opencv2/rgbd/linemod.hpp
View file @
b4dea4ef
...
...
@@ -239,6 +239,15 @@ protected:
*/
CV_EXPORTS_W
void
colormap
(
const
Mat
&
quantized
,
CV_OUT
Mat
&
dst
);
/**
* \brief Debug function to draw linemod features
* @param img
* @param templates see @ref Detector::addTemplate
* @param tl template bbox top-left offset see @ref Detector::addTemplate
* @param size marker size see @ref cv::drawMarker
*/
CV_EXPORTS_W
void
drawFeatures
(
InputOutputArray
img
,
const
std
::
vector
<
Template
>&
templates
,
const
Point2i
&
tl
,
int
size
=
10
);
/**
* \brief Represents a successful template match.
*/
...
...
modules/rgbd/src/linemod.cpp
View file @
b4dea4ef
...
...
@@ -207,6 +207,29 @@ void colormap(const Mat& quantized, Mat& dst)
}
}
void
drawFeatures
(
InputOutputArray
img
,
const
std
::
vector
<
Template
>&
templates
,
const
Point2i
&
tl
,
int
size
)
{
#ifdef HAVE_OPENCV_IMGPROC
static
Scalar
colors
[]
=
{{
0
,
0
,
255
},
{
0
,
255
,
0
}};
static
int
markers
[]
=
{
MARKER_SQUARE
,
MARKER_DIAMOND
};
int
modality
=
0
;
for
(
const
Template
&
t
:
templates
)
{
if
(
t
.
pyramid_level
!=
0
)
continue
;
for
(
const
Feature
&
f
:
t
.
features
)
{
drawMarker
(
img
,
tl
+
Point
(
f
.
x
,
f
.
y
),
colors
[
int
(
modality
!=
0
)],
markers
[
int
(
modality
!=
0
)],
size
);
}
modality
++
;
}
#else
CV_Assert
(
false
,
"functionality needs imgproc module"
);
#endif
}
/****************************************************************************************\
* Color gradient modality *
\****************************************************************************************/
...
...
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