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
24e5ff7a
Commit
24e5ff7a
authored
May 26, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes in opencv_stitching
parent
c0ec0e05
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
31 deletions
+5
-31
main.cpp
modules/stitching/main.cpp
+2
-1
matchers.cpp
modules/stitching/matchers.cpp
+2
-30
matchers.hpp
modules/stitching/matchers.hpp
+1
-0
No files found.
modules/stitching/main.cpp
View file @
24e5ff7a
...
...
@@ -316,6 +316,7 @@ int main(int argc, char* argv[])
}
finder
(
img
,
features
[
i
]);
features
[
i
].
img_idx
=
i
;
LOGLN
(
"Features in image #"
<<
i
<<
": "
<<
features
[
i
].
keypoints
.
size
());
resize
(
full_img
,
img
,
Size
(),
seam_scale
,
seam_scale
);
...
...
@@ -346,8 +347,8 @@ int main(int argc, char* argv[])
img_subset
.
push_back
(
images
[
indices
[
i
]]);
}
img_names
=
img_names_subset
;
images
=
img_subset
;
img_names
=
img_names_subset
;
// Check if we still have enough images
num_images
=
static_cast
<
int
>
(
img_names
.
size
());
...
...
modules/stitching/matchers.cpp
View file @
24e5ff7a
...
...
@@ -244,37 +244,10 @@ void FeaturesMatcher::operator ()(const vector<ImageFeatures> &features, vector<
{
const
int
num_images
=
static_cast
<
int
>
(
features
.
size
());
Mat_
<
uchar
>
is_near
(
num_images
,
num_images
);
is_near
.
setTo
(
0
);
// Find good image pairs
for
(
int
i
=
0
;
i
<
num_images
;
++
i
)
{
vector
<
DistIdxPair
>
dists
(
num_images
);
for
(
int
j
=
0
;
j
<
num_images
;
++
j
)
{
dists
[
j
].
dist
=
1
-
compareHist
(
features
[
i
].
hist
,
features
[
j
].
hist
,
CV_COMP_INTERSECT
)
/
min
(
features
[
i
].
img_size
.
area
(),
features
[
j
].
img_size
.
area
());
dists
[
j
].
idx
=
j
;
}
// Leave near images
for
(
int
j
=
0
;
j
<
num_images
;
++
j
)
if
(
dists
[
j
].
dist
<
0.6
)
is_near
(
i
,
dists
[
j
].
idx
)
=
1
;
// Leave k-nearest images
int
k
=
min
(
4
,
num_images
);
nth_element
(
dists
.
begin
(),
dists
.
begin
()
+
k
,
dists
.
end
());
for
(
int
j
=
0
;
j
<
k
;
++
j
)
is_near
(
i
,
dists
[
j
].
idx
)
=
1
;
}
vector
<
pair
<
int
,
int
>
>
near_pairs
;
for
(
int
i
=
0
;
i
<
num_images
-
1
;
++
i
)
for
(
int
j
=
i
+
1
;
j
<
num_images
;
++
j
)
if
(
is_near
(
i
,
j
)
||
is_near
(
j
,
i
))
near_pairs
.
push_back
(
make_pair
(
i
,
j
));
near_pairs
.
push_back
(
make_pair
(
i
,
j
));
pairwise_matches
.
resize
(
num_images
*
num_images
);
MatchPairsBody
body
(
*
this
,
features
,
pairwise_matches
,
near_pairs
);
...
...
@@ -312,8 +285,7 @@ namespace
private
:
float
match_conf_
;
GpuMat
descriptors1_
;
GpuMat
descriptors2_
;
GpuMat
descriptors1_
,
descriptors2_
;
GpuMat
train_idx_
,
distance_
,
all_dist_
;
};
...
...
modules/stitching/matchers.hpp
View file @
24e5ff7a
...
...
@@ -46,6 +46,7 @@
struct
ImageFeatures
{
int
img_idx
;
cv
::
Size
img_size
;
cv
::
Mat
hist
;
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
...
...
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