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
008da756
Commit
008da756
authored
Jun 12, 2010
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed parameter of drawMatches (mask to matchesMask)
parent
c751e901
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
cv_feature_detection.tex
doc/cv_feature_detection.tex
+3
-3
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+2
-2
descriptors.cpp
modules/features2d/src/descriptors.cpp
+7
-7
descriptor_extractor_matcher.cpp
samples/cpp/descriptor_extractor_matcher.cpp
+6
-6
No files found.
doc/cv_feature_detection.tex
View file @
008da756
...
@@ -1965,7 +1965,7 @@ Match is a line connecting two keypoints (circles).
...
@@ -1965,7 +1965,7 @@ Match is a line connecting two keypoints (circles).
void drawMatches( const Mat
\&
img1, const vector<KeyPoint>
\&
keypoints1,
void drawMatches( const Mat
\&
img1, const vector<KeyPoint>
\&
keypoints1,
const Mat
\&
img2, const vector<KeyPoint>
\&
keypoints2,
const Mat
\&
img2, const vector<KeyPoint>
\&
keypoints2,
const vector<int>
\&
matches, Mat
\&
outImg,
const vector<int>
\&
matches, Mat
\&
outImg,
const vector<char>
\&
mask = vector<char>(),
const vector<char>
\&
ma
tchesMa
sk = vector<char>(),
const Scalar
\&
matchColor = Scalar::all(-1),
const Scalar
\&
matchColor = Scalar::all(-1),
const Scalar
\&
singlePointColor = Scalar::all(-1),
const Scalar
\&
singlePointColor = Scalar::all(-1),
int flags = DrawMatchesFlags::DEFAULT );
int flags = DrawMatchesFlags::DEFAULT );
...
@@ -1996,7 +1996,7 @@ void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1,
...
@@ -1996,7 +1996,7 @@ void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1,
\end{description}
\end{description}
\begin{description}
\begin{description}
\cvarg
{
mask
}{
Mask determining which matches will be drawn. If mask is empty all matches will be drawn.
}
\cvarg
{
ma
tchesMa
sk
}{
Mask determining which matches will be drawn. If mask is empty all matches will be drawn.
}
\end{description}
\end{description}
\begin{description}
\begin{description}
...
@@ -2015,7 +2015,7 @@ void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1,
...
@@ -2015,7 +2015,7 @@ void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1,
struct DrawMatchesFlags
struct DrawMatchesFlags
{
{
enum
{
DEFAULT = 0, // Output image matrix will be created (Mat::create),
enum
{
DEFAULT = 0, // Output image matrix will be created (Mat::create),
// i.e. existing memory of output image
will
be reused.
// i.e. existing memory of output image
may
be reused.
// Two source image, matches and single keypoints will be drawn.
// Two source image, matches and single keypoints will be drawn.
DRAW
_
OVER
_
OUTIMG = 1, // Output image matrix will not be created (Mat::create).
DRAW
_
OVER
_
OUTIMG = 1, // Output image matrix will not be created (Mat::create).
// Matches will be drawn on existing content
// Matches will be drawn on existing content
...
...
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
008da756
...
@@ -2128,7 +2128,7 @@ protected:
...
@@ -2128,7 +2128,7 @@ protected:
struct
CV_EXPORTS
DrawMatchesFlags
struct
CV_EXPORTS
DrawMatchesFlags
{
{
enum
{
DEFAULT
=
0
,
// Output image matrix will be created (Mat::create),
enum
{
DEFAULT
=
0
,
// Output image matrix will be created (Mat::create),
// i.e. existing memory of output image
will
be reused.
// i.e. existing memory of output image
may
be reused.
// Two source image, matches and single keypoints will be drawn.
// Two source image, matches and single keypoints will be drawn.
DRAW_OVER_OUTIMG
=
1
,
// Output image matrix will not be created (Mat::create).
DRAW_OVER_OUTIMG
=
1
,
// Output image matrix will not be created (Mat::create).
// Matches will be drawn on existing content of output image.
// Matches will be drawn on existing content of output image.
...
@@ -2139,7 +2139,7 @@ struct CV_EXPORTS DrawMatchesFlags
...
@@ -2139,7 +2139,7 @@ struct CV_EXPORTS DrawMatchesFlags
// Draws matches of keypints from two images on output image.
// Draws matches of keypints from two images on output image.
CV_EXPORTS
void
drawMatches
(
const
Mat
&
img1
,
const
vector
<
KeyPoint
>&
keypoints1
,
CV_EXPORTS
void
drawMatches
(
const
Mat
&
img1
,
const
vector
<
KeyPoint
>&
keypoints1
,
const
Mat
&
img2
,
const
vector
<
KeyPoint
>&
keypoints2
,
const
Mat
&
img2
,
const
vector
<
KeyPoint
>&
keypoints2
,
const
vector
<
int
>&
matches
,
Mat
&
outImg
,
const
vector
<
char
>&
mask
=
vector
<
char
>
(),
const
vector
<
int
>&
matches
,
Mat
&
outImg
,
const
vector
<
char
>&
ma
tchesMa
sk
=
vector
<
char
>
(),
const
Scalar
&
matchColor
=
Scalar
::
all
(
-
1
),
const
Scalar
&
singlePointColor
=
Scalar
::
all
(
-
1
),
const
Scalar
&
matchColor
=
Scalar
::
all
(
-
1
),
const
Scalar
&
singlePointColor
=
Scalar
::
all
(
-
1
),
int
flags
=
DrawMatchesFlags
::
DEFAULT
);
int
flags
=
DrawMatchesFlags
::
DEFAULT
);
...
...
modules/features2d/src/descriptors.cpp
View file @
008da756
...
@@ -45,11 +45,11 @@ using namespace std;
...
@@ -45,11 +45,11 @@ using namespace std;
namespace
cv
namespace
cv
{
{
CV_EXPORTS
void
drawMatches
(
const
Mat
&
img1
,
const
vector
<
KeyPoint
>&
keypoints1
,
void
drawMatches
(
const
Mat
&
img1
,
const
vector
<
KeyPoint
>&
keypoints1
,
const
Mat
&
img2
,
const
vector
<
KeyPoint
>&
keypoints2
,
const
Mat
&
img2
,
const
vector
<
KeyPoint
>&
keypoints2
,
const
vector
<
int
>&
matches
,
Mat
&
outImg
,
const
vector
<
char
>&
m
ask
,
const
vector
<
int
>&
matches
,
Mat
&
outImg
,
const
vector
<
char
>&
matchesM
ask
,
const
Scalar
&
matchColor
,
const
Scalar
&
singlePointColor
,
const
Scalar
&
matchColor
,
const
Scalar
&
singlePointColor
,
int
flags
)
int
flags
)
{
{
Size
size
(
img1
.
cols
+
img2
.
cols
,
MAX
(
img1
.
rows
,
img2
.
rows
)
);
Size
size
(
img1
.
cols
+
img2
.
cols
,
MAX
(
img1
.
rows
,
img2
.
rows
)
);
if
(
flags
&
DrawMatchesFlags
::
DRAW_OVER_OUTIMG
)
if
(
flags
&
DrawMatchesFlags
::
DRAW_OVER_OUTIMG
)
...
@@ -88,12 +88,12 @@ CV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1
...
@@ -88,12 +88,12 @@ CV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1
bool
isRandMatchColor
=
matchColor
==
Scalar
::
all
(
-
1
);
bool
isRandMatchColor
=
matchColor
==
Scalar
::
all
(
-
1
);
if
(
matches
.
size
()
!=
keypoints1
.
size
()
)
if
(
matches
.
size
()
!=
keypoints1
.
size
()
)
CV_Error
(
CV_StsBadSize
,
"matches must have the same size as keypoints1"
);
CV_Error
(
CV_StsBadSize
,
"matches must have the same size as keypoints1"
);
if
(
!
ma
sk
.
empty
()
&&
m
ask
.
size
()
!=
keypoints1
.
size
()
)
if
(
!
ma
tchesMask
.
empty
()
&&
matchesM
ask
.
size
()
!=
keypoints1
.
size
()
)
CV_Error
(
CV_StsBadSize
,
"mask must have the same size as keypoints1"
);
CV_Error
(
CV_StsBadSize
,
"mask must have the same size as keypoints1"
);
vector
<
int
>::
const_iterator
mit
=
matches
.
begin
();
vector
<
int
>::
const_iterator
mit
=
matches
.
begin
();
for
(
int
i1
=
0
;
mit
!=
matches
.
end
();
++
mit
,
i1
++
)
for
(
int
i1
=
0
;
mit
!=
matches
.
end
();
++
mit
,
i1
++
)
{
{
if
(
(
ma
sk
.
empty
()
||
m
ask
[
i1
]
)
&&
*
mit
>=
0
)
if
(
(
ma
tchesMask
.
empty
()
||
matchesM
ask
[
i1
]
)
&&
*
mit
>=
0
)
{
{
Point2f
pt1
=
keypoints1
[
i1
].
pt
,
Point2f
pt1
=
keypoints1
[
i1
].
pt
,
pt2
=
keypoints2
[
*
mit
].
pt
,
pt2
=
keypoints2
[
*
mit
].
pt
,
...
...
samples/cpp/descriptor_extractor_matcher.cpp
View file @
008da756
...
@@ -88,21 +88,21 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
...
@@ -88,21 +88,21 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
Mat
drawImg
;
Mat
drawImg
;
if
(
!
H12
.
empty
()
)
if
(
!
H12
.
empty
()
)
{
{
vector
<
char
>
mask
(
matches
.
size
(),
0
);
vector
<
char
>
ma
tchesMa
sk
(
matches
.
size
(),
0
);
vector
<
int
>::
const_iterator
mit
=
matches
.
begin
();
vector
<
int
>::
const_iterator
mit
=
matches
.
begin
();
for
(
size_t
i1
=
0
;
mit
!=
matches
.
end
();
++
mit
,
i1
++
)
for
(
size_t
i1
=
0
;
mit
!=
matches
.
end
();
++
mit
,
i1
++
)
{
{
Point2f
pt1
=
keypoints1
[
i1
].
pt
,
Point2f
pt1
=
keypoints1
[
i1
].
pt
,
pt2
=
keypoints2
[
*
mit
].
pt
;
pt2
=
keypoints2
[
*
mit
].
pt
;
if
(
norm
(
pt2
-
applyHomography
(
H12
,
pt1
))
<
4
)
// inlier
if
(
norm
(
pt2
-
applyHomography
(
H12
,
pt1
))
<
4
)
// inlier
mask
[
i1
]
=
1
;
ma
tchesMa
sk
[
i1
]
=
1
;
}
}
// draw inliers
// draw inliers
drawMatches
(
img1
,
keypoints1
,
img2
,
keypoints2
,
matches
,
drawImg
,
mask
,
CV_RGB
(
0
,
255
,
0
),
CV_RGB
(
0
,
0
,
255
)
);
drawMatches
(
img1
,
keypoints1
,
img2
,
keypoints2
,
matches
,
drawImg
,
ma
tchesMa
sk
,
CV_RGB
(
0
,
255
,
0
),
CV_RGB
(
0
,
0
,
255
)
);
// draw outliers
// draw outliers
/*for( size_t i1 = 0; i1 < mask.size(); i1++ )
/*for( size_t i1 = 0; i1 < ma
tchesMa
sk.size(); i1++ )
ma
sk[i1] = !m
ask[i1];
ma
tchesMask[i1] = !matchesM
ask[i1];
drawMatches( img1,
img2, keypoints1, keypoints2, matches, mask, drawImg
, CV_RGB(0, 0, 255), CV_RGB(255, 0, 0),
drawMatches( img1,
keypoints1, img2, keypoints2, matches, drawImg, matchesMask
, CV_RGB(0, 0, 255), CV_RGB(255, 0, 0),
DrawMatchesFlags::DRAW_OVER_OUTIMG | DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );*/
DrawMatchesFlags::DRAW_OVER_OUTIMG | DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );*/
}
}
else
else
...
...
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