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
9575a82a
Commit
9575a82a
authored
Oct 09, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3299 from felixendres:orb_keypoint_detector_threshold
parents
6fa6e3d3
ee683549
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+2
-1
features2d_init.cpp
modules/features2d/src/features2d_init.cpp
+2
-1
orb.cpp
modules/features2d/src/orb.cpp
+6
-5
test_orb.cpp
modules/features2d/test/test_orb.cpp
+2
-0
No files found.
modules/features2d/include/opencv2/features2d.hpp
View file @
9575a82a
...
...
@@ -317,7 +317,7 @@ public:
enum
{
kBytes
=
32
,
HARRIS_SCORE
=
0
,
FAST_SCORE
=
1
};
CV_WRAP
explicit
ORB
(
int
nfeatures
=
500
,
float
scaleFactor
=
1.2
f
,
int
nlevels
=
8
,
int
edgeThreshold
=
31
,
int
firstLevel
=
0
,
int
WTA_K
=
2
,
int
scoreType
=
ORB
::
HARRIS_SCORE
,
int
patchSize
=
31
);
int
firstLevel
=
0
,
int
WTA_K
=
2
,
int
scoreType
=
ORB
::
HARRIS_SCORE
,
int
patchSize
=
31
,
int
fastThreshold
=
20
);
// returns the descriptor size in bytes
int
descriptorSize
()
const
;
...
...
@@ -348,6 +348,7 @@ protected:
CV_PROP_RW
int
WTA_K
;
CV_PROP_RW
int
scoreType
;
CV_PROP_RW
int
patchSize
;
CV_PROP_RW
int
fastThreshold
;
};
typedef
ORB
OrbFeatureDetector
;
...
...
modules/features2d/src/features2d_init.cpp
View file @
9575a82a
...
...
@@ -91,7 +91,8 @@ CV_INIT_ALGORITHM(ORB, "Feature2D.ORB",
obj
.
info
()
->
addParam
(
obj
,
"edgeThreshold"
,
obj
.
edgeThreshold
);
obj
.
info
()
->
addParam
(
obj
,
"patchSize"
,
obj
.
patchSize
);
obj
.
info
()
->
addParam
(
obj
,
"WTA_K"
,
obj
.
WTA_K
);
obj
.
info
()
->
addParam
(
obj
,
"scoreType"
,
obj
.
scoreType
))
obj
.
info
()
->
addParam
(
obj
,
"scoreType"
,
obj
.
scoreType
);
obj
.
info
()
->
addParam
(
obj
,
"fastThreshold"
,
obj
.
fastThreshold
))
///////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/features2d/src/orb.cpp
View file @
9575a82a
...
...
@@ -649,10 +649,10 @@ static inline float getScale(int level, int firstLevel, double scaleFactor)
* @param detector_params parameters to use
*/
ORB
::
ORB
(
int
_nfeatures
,
float
_scaleFactor
,
int
_nlevels
,
int
_edgeThreshold
,
int
_firstLevel
,
int
_WTA_K
,
int
_scoreType
,
int
_patchSize
)
:
int
_firstLevel
,
int
_WTA_K
,
int
_scoreType
,
int
_patchSize
,
int
_fastThreshold
)
:
nfeatures
(
_nfeatures
),
scaleFactor
(
_scaleFactor
),
nlevels
(
_nlevels
),
edgeThreshold
(
_edgeThreshold
),
firstLevel
(
_firstLevel
),
WTA_K
(
_WTA_K
),
scoreType
(
_scoreType
),
patchSize
(
_patchSize
)
scoreType
(
_scoreType
),
patchSize
(
_patchSize
)
,
fastThreshold
(
_fastThreshold
)
{}
...
...
@@ -730,7 +730,7 @@ static void computeKeyPoints(const Mat& imagePyramid,
std
::
vector
<
KeyPoint
>&
allKeypoints
,
int
nfeatures
,
double
scaleFactor
,
int
edgeThreshold
,
int
patchSize
,
int
scoreType
,
bool
useOCL
)
bool
useOCL
,
int
fastThreshold
)
{
int
i
,
nkeypoints
,
level
,
nlevels
=
(
int
)
layerInfo
.
size
();
std
::
vector
<
int
>
nfeaturesPerLevel
(
nlevels
);
...
...
@@ -781,7 +781,7 @@ static void computeKeyPoints(const Mat& imagePyramid,
Mat
mask
=
maskPyramid
.
empty
()
?
Mat
()
:
maskPyramid
(
layerInfo
[
level
]);
// Detect FAST features, 20 is a good threshold
FastFeatureDetector
fd
(
20
,
true
);
FastFeatureDetector
fd
(
fastThreshold
,
true
);
fd
.
detect
(
img
,
keypoints
,
mask
);
// Remove keypoints very close to the border
...
...
@@ -1033,7 +1033,7 @@ void ORB::operator()( InputArray _image, InputArray _mask, std::vector<KeyPoint>
// Get keypoints, those will be far enough from the border that no check will be required for the descriptor
computeKeyPoints
(
imagePyramid
,
uimagePyramid
,
maskPyramid
,
layerInfo
,
ulayerInfo
,
layerScale
,
keypoints
,
nfeatures
,
scaleFactor
,
edgeThreshold
,
patchSize
,
scoreType
,
useOCL
);
nfeatures
,
scaleFactor
,
edgeThreshold
,
patchSize
,
scoreType
,
useOCL
,
fastThreshold
);
}
else
{
...
...
@@ -1131,4 +1131,5 @@ void ORB::computeImpl( InputArray image, std::vector<KeyPoint>& keypoints, Outpu
(
*
this
)(
image
,
Mat
(),
keypoints
,
descriptors
,
true
);
}
}
modules/features2d/test/test_orb.cpp
View file @
9575a82a
...
...
@@ -48,6 +48,8 @@ using namespace cv;
TEST
(
Features2D_ORB
,
_1996
)
{
Ptr
<
FeatureDetector
>
fd
=
FeatureDetector
::
create
(
"ORB"
);
fd
->
set
(
"nFeatures"
,
10000
);
//setting a higher maximum to make effect of threshold visible
fd
->
set
(
"fastThreshold"
,
20
);
//more features than the default
Ptr
<
DescriptorExtractor
>
de
=
DescriptorExtractor
::
create
(
"ORB"
);
Mat
image
=
imread
(
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"shared/lena.png"
);
...
...
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