Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
1748f65f
Commit
1748f65f
authored
Jan 31, 2011
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ticket #823
parent
152fefe8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+1
-1
draw.cpp
modules/features2d/src/draw.cpp
+16
-3
No files found.
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
1748f65f
...
@@ -2620,7 +2620,7 @@ struct CV_EXPORTS DrawMatchesFlags
...
@@ -2620,7 +2620,7 @@ struct CV_EXPORTS DrawMatchesFlags
};
};
// Draw keypoints.
// Draw keypoints.
CV_EXPORTS
void
drawKeypoints
(
const
Mat
&
image
,
const
vector
<
KeyPoint
>&
keypoints
,
Mat
&
outIm
g
,
CV_EXPORTS
void
drawKeypoints
(
const
Mat
&
image
,
const
vector
<
KeyPoint
>&
keypoints
,
Mat
&
outIm
age
,
const
Scalar
&
color
=
Scalar
::
all
(
-
1
),
int
flags
=
DrawMatchesFlags
::
DEFAULT
);
const
Scalar
&
color
=
Scalar
::
all
(
-
1
),
int
flags
=
DrawMatchesFlags
::
DEFAULT
);
// Draws matches of keypints from two images on output image.
// Draws matches of keypints from two images on output image.
...
...
modules/features2d/src/draw.cpp
View file @
1748f65f
...
@@ -88,11 +88,24 @@ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& col
...
@@ -88,11 +88,24 @@ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& col
}
}
}
}
void
drawKeypoints
(
const
Mat
&
image
,
const
vector
<
KeyPoint
>&
keypoints
,
Mat
&
outIm
g
,
void
drawKeypoints
(
const
Mat
&
image
,
const
vector
<
KeyPoint
>&
keypoints
,
Mat
&
outIm
age
,
const
Scalar
&
_color
,
int
flags
)
const
Scalar
&
_color
,
int
flags
)
{
{
if
(
!
(
flags
&
DrawMatchesFlags
::
DRAW_OVER_OUTIMG
)
)
if
(
!
(
flags
&
DrawMatchesFlags
::
DRAW_OVER_OUTIMG
)
)
cvtColor
(
image
,
outImg
,
CV_GRAY2BGR
);
{
if
(
image
.
type
()
==
CV_8UC3
)
{
image
.
copyTo
(
outImage
);
}
else
if
(
image
.
type
()
==
CV_8UC1
)
{
cvtColor
(
image
,
outImage
,
CV_GRAY2BGR
);
}
else
{
CV_Error
(
CV_StsBadArg
,
"Incorrect type of input image.
\n
"
);
}
}
RNG
&
rng
=
theRNG
();
RNG
&
rng
=
theRNG
();
bool
isRandColor
=
_color
==
Scalar
::
all
(
-
1
);
bool
isRandColor
=
_color
==
Scalar
::
all
(
-
1
);
...
@@ -100,7 +113,7 @@ void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, Mat& ou
...
@@ -100,7 +113,7 @@ void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, Mat& ou
for
(
vector
<
KeyPoint
>::
const_iterator
i
=
keypoints
.
begin
(),
ie
=
keypoints
.
end
();
i
!=
ie
;
++
i
)
for
(
vector
<
KeyPoint
>::
const_iterator
i
=
keypoints
.
begin
(),
ie
=
keypoints
.
end
();
i
!=
ie
;
++
i
)
{
{
Scalar
color
=
isRandColor
?
Scalar
(
rng
(
256
),
rng
(
256
),
rng
(
256
))
:
_color
;
Scalar
color
=
isRandColor
?
Scalar
(
rng
(
256
),
rng
(
256
),
rng
(
256
))
:
_color
;
_drawKeypoint
(
outIm
g
,
*
i
,
color
,
flags
);
_drawKeypoint
(
outIm
age
,
*
i
,
color
,
flags
);
}
}
}
}
...
...
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