Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
862e03c4
Commit
862e03c4
authored
Nov 16, 2016
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix segFault when no lines found in BinaryDescriptor
parent
f3ca1a2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
binary_descriptor.cpp
modules/line_descriptor/src/binary_descriptor.cpp
+5
-0
test_descriptors_regression.cpp
modules/line_descriptor/test/test_descriptors_regression.cpp
+15
-0
No files found.
modules/line_descriptor/src/binary_descriptor.cpp
View file @
862e03c4
...
...
@@ -2196,6 +2196,11 @@ int BinaryDescriptor::EDLineDetector::EdgeDrawing( cv::Mat &image, EdgeChains &e
"numofedgePixel1 = "
<<
offsetPFirst
<<
", numofedgePixel2 = "
<<
offsetPSecond
<<
", MaxNumOfEdgePixel="
<<
edgePixelArraySize
<<
std
::
endl
;
return
-
1
;
}
if
(
!
(
offsetPFirst
&&
offsetPSecond
)
)
{
std
::
cout
<<
"Edge drawing Error: lines not found"
<<
std
::
endl
;
return
-
1
;
}
/*now all the edge information are stored in pFirstPartEdgeX_, pFirstPartEdgeY_,
*pFirstPartEdgeS_, pSecondPartEdgeX_, pSecondPartEdgeY_, pSecondPartEdgeS_;
...
...
modules/line_descriptor/test/test_descriptors_regression.cpp
View file @
862e03c4
...
...
@@ -372,3 +372,18 @@ TEST( BinaryDescriptor_Descriptors, regression )
CV_BD_DescriptorsTest
<
Hamming
>
test
(
std
::
string
(
"lbd_descriptors_cameraman"
),
1
);
test
.
safe_run
();
}
/****************************************************************************************\
* Other tests *
\****************************************************************************************/
TEST
(
BinaryDescriptor
,
no_lines_found
)
{
Mat
Image
=
Mat
::
zeros
(
100
,
100
,
CV_8U
);
Ptr
<
line_descriptor
::
BinaryDescriptor
>
binDescriptor
=
line_descriptor
::
BinaryDescriptor
::
createBinaryDescriptor
();
std
::
vector
<
cv
::
line_descriptor
::
KeyLine
>
keyLines
;
binDescriptor
->
detect
(
Image
,
keyLines
);
ASSERT_EQ
(
keyLines
.
size
(),
0u
);
}
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