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
2b6b6f12
Commit
2b6b6f12
authored
Jun 29, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debug message is turned off
parent
0584ac52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
matchers.cpp
modules/stitching/src/matchers.cpp
+18
-18
No files found.
modules/stitching/src/matchers.cpp
View file @
2b6b6f12
...
...
@@ -273,14 +273,14 @@ namespace cv {
namespace
detail
{
void
FeaturesFinder
::
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
)
{
{
find
(
image
,
features
);
features
.
img_size
=
image
.
size
();
}
void
FeaturesFinder
::
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
,
const
vector
<
Rect
>
&
rois
)
{
{
vector
<
ImageFeatures
>
roi_features
(
rois
.
size
());
size_t
total_kps_count
=
0
;
int
total_descriptors_height
=
0
;
...
...
@@ -294,8 +294,8 @@ void FeaturesFinder::operator ()(const Mat &image, ImageFeatures &features, cons
features
.
img_size
=
image
.
size
();
features
.
keypoints
.
resize
(
total_kps_count
);
features
.
descriptors
.
create
(
total_descriptors_height
,
roi_features
[
0
].
descriptors
.
cols
,
features
.
descriptors
.
create
(
total_descriptors_height
,
roi_features
[
0
].
descriptors
.
cols
,
roi_features
[
0
].
descriptors
.
type
());
int
kp_idx
=
0
;
...
...
@@ -332,14 +332,14 @@ SurfFeaturesFinder::SurfFeaturesFinder(double hess_thresh, int num_octaves, int
{
detector_
=
Algorithm
::
create
<
FeatureDetector
>
(
"Feature2D.SURF"
);
extractor_
=
Algorithm
::
create
<
DescriptorExtractor
>
(
"Feature2D.SURF"
);
if
(
detector_
.
empty
()
||
extractor_
.
empty
()
)
CV_Error
(
CV_StsNotImplemented
,
"OpenCV was built without SURF support"
);
detector_
->
set
(
"hessianThreshold"
,
hess_thresh
);
detector_
->
set
(
"nOctaves"
,
num_octaves
);
detector_
->
set
(
"nOctaveLayers"
,
num_layers
);
extractor_
->
set
(
"nOctaves"
,
num_octaves_descr
);
extractor_
->
set
(
"nOctaveLayers"
,
num_layers_descr
);
}
...
...
@@ -403,17 +403,17 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features)
int
xr
=
(
c
+
1
)
*
gray_image
.
cols
/
grid_size
.
width
;
int
yr
=
(
r
+
1
)
*
gray_image
.
rows
/
grid_size
.
height
;
LOGLN
(
"OrbFeaturesFinder::find: gray_image.empty="
<<
(
gray_image
.
empty
()
?
"true"
:
"false"
)
<<
", "
<<
" gray_image.size()=("
<<
gray_image
.
size
().
width
<<
"x"
<<
gray_image
.
size
().
height
<<
"), "
<<
" yl="
<<
yl
<<
", yr="
<<
yr
<<
", "
<<
" xl="
<<
xl
<<
", xr="
<<
xr
<<
", gray_image.data="
<<
((
size_t
)
gray_image
.
data
)
<<
", "
<<
"gray_image.dims="
<<
gray_image
.
dims
<<
"
\n
"
);
//
LOGLN("OrbFeaturesFinder::find: gray_image.empty=" << (gray_image.empty()?"true":"false") << ", "
//
<< " gray_image.size()=(" << gray_image.size().width << "x" << gray_image.size().height << "), "
//
<< " yl=" << yl << ", yr=" << yr << ", "
//
<< " xl=" << xl << ", xr=" << xr << ", gray_image.data=" << ((size_t)gray_image.data) << ", "
//
<< "gray_image.dims=" << gray_image.dims << "\n");
Mat
gray_image_part
=
gray_image
(
Range
(
yl
,
yr
),
Range
(
xl
,
xr
));
LOGLN
(
"OrbFeaturesFinder::find: gray_image_part.empty="
<<
(
gray_image_part
.
empty
()
?
"true"
:
"false"
)
<<
", "
<<
" gray_image_part.size()=("
<<
gray_image_part
.
size
().
width
<<
"x"
<<
gray_image_part
.
size
().
height
<<
"), "
<<
" gray_image_part.dims="
<<
gray_image_part
.
dims
<<
", "
<<
" gray_image_part.data="
<<
((
size_t
)
gray_image_part
.
data
)
<<
"
\n
"
);
//
LOGLN("OrbFeaturesFinder::find: gray_image_part.empty=" << (gray_image_part.empty()?"true":"false") << ", "
//
<< " gray_image_part.size()=(" << gray_image_part.size().width << "x" << gray_image_part.size().height << "), "
//
<< " gray_image_part.dims=" << gray_image_part.dims << ", "
//
<< " gray_image_part.data=" << ((size_t)gray_image_part.data) << "\n");
(
*
orb
)(
gray_image_part
,
Mat
(),
points
,
descriptors
);
...
...
@@ -583,11 +583,11 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea
if
(
matches_info
.
inliers_mask
[
i
])
matches_info
.
num_inliers
++
;
// These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching
// These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching
// using Invariant Features"
matches_info
.
confidence
=
matches_info
.
num_inliers
/
(
8
+
0.3
*
matches_info
.
matches
.
size
());
// Set zero confidence to remove matches between too close images, as they don't provide
// Set zero confidence to remove matches between too close images, as they don't provide
// additional information anyway. The threshold was set experimentally.
matches_info
.
confidence
=
matches_info
.
confidence
>
3.
?
0.
:
matches_info
.
confidence
;
...
...
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