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
640408eb
Commit
640408eb
authored
Jul 31, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added FAST<5/8> & FAST<7/12> (by Vincent Rabaud)
parent
b43cec33
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
8 deletions
+25
-8
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+9
-2
perf_fast.cpp
modules/features2d/perf/perf_fast.cpp
+5
-1
fast.cpp
modules/features2d/src/fast.cpp
+0
-0
features2d_init.cpp
modules/features2d/src/features2d_init.cpp
+2
-1
test_fast.cpp
modules/features2d/test/test_fast.cpp
+9
-4
No files found.
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
640408eb
...
...
@@ -473,12 +473,18 @@ protected:
//! detects corners using FAST algorithm by E. Rosten
CV_EXPORTS
void
FAST
(
InputArray
image
,
CV_OUT
vector
<
KeyPoint
>&
keypoints
,
int
threshold
,
bool
nonmaxSupression
=
true
);
int
threshold
,
bool
nonmaxSupression
=
true
,
int
type
=
2
);
class
CV_EXPORTS_W
FastFeatureDetector
:
public
FeatureDetector
{
public
:
CV_WRAP
FastFeatureDetector
(
int
threshold
=
10
,
bool
nonmaxSuppression
=
true
);
enum
{
TYPE_5_8
=
0
,
TYPE_7_12
=
1
,
TYPE_9_16
=
2
};
CV_WRAP
FastFeatureDetector
(
int
threshold
=
10
,
bool
nonmaxSuppression
=
true
);
CV_WRAP
FastFeatureDetector
(
int
threshold
,
bool
nonmaxSuppression
,
int
type
);
AlgorithmInfo
*
info
()
const
;
protected
:
...
...
@@ -486,6 +492,7 @@ protected:
int
threshold
;
bool
nonmaxSuppression
;
int
type
;
};
...
...
modules/features2d/perf/perf_fast.cpp
View file @
640408eb
...
...
@@ -22,9 +22,13 @@ PERF_TEST_P(fast, detectForORB, testing::Values(FAST_IMAGES))
declare
.
in
(
frame
);
FastFeatureDetector
fd
(
20
,
true
);
FastFeatureDetector
fd
(
20
,
true
,
FastFeatureDetector
::
TYPE_5_8
);
vector
<
KeyPoint
>
points
;
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
fd
=
FastFeatureDetector
(
20
,
true
,
FastFeatureDetector
::
TYPE_7_12
);
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
fd
=
FastFeatureDetector
(
20
,
true
,
FastFeatureDetector
::
TYPE_9_16
);
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
}
modules/features2d/src/fast.cpp
View file @
640408eb
This diff is collapsed.
Click to expand it.
modules/features2d/src/features2d_init.cpp
View file @
640408eb
...
...
@@ -58,7 +58,8 @@ CV_INIT_ALGORITHM(BriefDescriptorExtractor, "Feature2D.BRIEF",
CV_INIT_ALGORITHM
(
FastFeatureDetector
,
"Feature2D.FAST"
,
obj
.
info
()
->
addParam
(
obj
,
"threshold"
,
obj
.
threshold
);
obj
.
info
()
->
addParam
(
obj
,
"nonmaxSuppression"
,
obj
.
nonmaxSuppression
));
obj
.
info
()
->
addParam
(
obj
,
"nonmaxSuppression"
,
obj
.
nonmaxSuppression
);
obj
.
info
()
->
addParam
(
obj
,
"type"
,
obj
.
type
,
FastFeatureDetector
::
TYPE_9_16
));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/features2d/test/test_fast.cpp
View file @
640408eb
...
...
@@ -58,6 +58,7 @@ CV_FastTest::~CV_FastTest() {}
void
CV_FastTest
::
run
(
int
)
{
for
(
int
type
=
0
;
type
<=
2
;
++
type
)
{
Mat
image1
=
imread
(
string
(
ts
->
get_data_path
())
+
"inpaint/orig.jpg"
);
Mat
image2
=
imread
(
string
(
ts
->
get_data_path
())
+
"cameracalibration/chess9.jpg"
);
string
xml
=
string
(
ts
->
get_data_path
())
+
"fast/result.xml"
;
...
...
@@ -74,8 +75,8 @@ void CV_FastTest::run( int )
vector
<
KeyPoint
>
keypoints1
;
vector
<
KeyPoint
>
keypoints2
;
FAST
(
gray1
,
keypoints1
,
30
);
FAST
(
gray2
,
keypoints2
,
30
);
FAST
(
gray1
,
keypoints1
,
30
,
type
);
FAST
(
gray2
,
keypoints2
,
30
,
type
);
for
(
size_t
i
=
0
;
i
<
keypoints1
.
size
();
++
i
)
{
...
...
@@ -109,17 +110,21 @@ void CV_FastTest::run( int )
read
(
fs
[
"exp_kps2"
],
exp_kps2
,
Mat
()
);
fs
.
release
();
// We only have testing data for 9_16 but it actually works equally well for 7_12
if
((
type
==
1
)
||
(
type
==
2
)){
if
(
0
!=
norm
(
exp_kps1
,
kps1
,
NORM_L2
)
||
0
!=
norm
(
exp_kps2
,
kps2
,
NORM_L2
))
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_MISMATCH
);
return
;
}
}
/*
cv::namedWindow("Img1"); cv::imshow("Img1", image1);
/*
cv::namedWindow("Img1"); cv::imshow("Img1", image1);
cv::namedWindow("Img2"); cv::imshow("Img2", image2);
cv::waitKey(0);*/
}
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
}
TEST
(
Features2d_FAST
,
regression
)
{
CV_FastTest
test
;
test
.
safe_run
();
}
...
...
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