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
c64ac42b
Commit
c64ac42b
authored
8 years ago
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7852 from savuor:fix/orb_rotation
parents
01de65c2
13b9dd39
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
orb.cpp
modules/features2d/src/orb.cpp
+3
-1
test_orb.cpp
modules/features2d/test/test_orb.cpp
+33
-0
No files found.
modules/features2d/src/orb.cpp
View file @
c64ac42b
...
...
@@ -970,7 +970,9 @@ void ORB_Impl::detectAndCompute( InputArray _image, InputArray _mask,
//ROI handling
const
int
HARRIS_BLOCK_SIZE
=
9
;
int
halfPatchSize
=
patchSize
/
2
;
int
border
=
std
::
max
(
edgeThreshold
,
std
::
max
(
halfPatchSize
,
HARRIS_BLOCK_SIZE
/
2
))
+
1
;
// sqrt(2.0) is for handling patch rotation
int
descPatchSize
=
cvCeil
(
halfPatchSize
*
sqrt
(
2.0
));
int
border
=
std
::
max
(
edgeThreshold
,
std
::
max
(
descPatchSize
,
HARRIS_BLOCK_SIZE
/
2
))
+
1
;
bool
useOCL
=
ocl
::
useOpenCL
()
&&
OCL_FORCE_CHECK
(
_image
.
isUMat
()
||
_descriptors
.
isUMat
());
...
...
This diff is collapsed.
Click to expand it.
modules/features2d/test/test_orb.cpp
View file @
c64ac42b
...
...
@@ -90,3 +90,36 @@ TEST(Features2D_ORB, _1996)
ASSERT_EQ
(
0
,
roiViolations
);
}
TEST
(
Features2D_ORB
,
crash
)
{
cv
::
Mat
image
=
cv
::
Mat
::
zeros
(
cv
::
Size
(
1920
,
1080
),
CV_8UC3
);
int
nfeatures
=
8000
;
float
orbScaleFactor
=
1.2
f
;
int
nlevels
=
18
;
int
edgeThreshold
=
4
;
int
firstLevel
=
0
;
int
WTA_K
=
2
;
int
scoreType
=
cv
::
ORB
::
HARRIS_SCORE
;
int
patchSize
=
47
;
int
fastThreshold
=
20
;
Ptr
<
ORB
>
orb
=
cv
::
ORB
::
create
(
nfeatures
,
orbScaleFactor
,
nlevels
,
edgeThreshold
,
firstLevel
,
WTA_K
,
scoreType
,
patchSize
,
fastThreshold
);
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
cv
::
Mat
descriptors
;
cv
::
KeyPoint
kp
;
kp
.
pt
.
x
=
443
;
kp
.
pt
.
y
=
5
;
kp
.
size
=
47
;
kp
.
angle
=
53.4580612
f
;
kp
.
response
=
0.0000470733867
f
;
kp
.
octave
=
0
;
kp
.
class_id
=
-
1
;
keypoints
.
push_back
(
kp
);
ASSERT_NO_THROW
(
orb
->
compute
(
image
,
keypoints
,
descriptors
));
}
This diff is collapsed.
Click to expand it.
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