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
2266a8c8
Commit
2266a8c8
authored
Feb 02, 2018
by
sergeybe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix FindContours default offset for CV_LINK_RUNS method
parent
83761d5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
contours.cpp
modules/imgproc/src/contours.cpp
+12
-3
No files found.
modules/imgproc/src/contours.cpp
View file @
2266a8c8
...
...
@@ -1893,14 +1893,23 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
CV_Assert
(
_contours
.
empty
()
||
(
_contours
.
channels
()
==
2
&&
_contours
.
depth
()
==
CV_32S
));
Mat
image
;
copyMakeBorder
(
_image
,
image
,
1
,
1
,
1
,
1
,
BORDER_CONSTANT
|
BORDER_ISOLATED
,
Scalar
(
0
));
Mat
image0
=
_image
.
getMat
(),
image
;
Point
offset0
(
0
,
0
);
if
(
method
!=
CV_LINK_RUNS
)
{
offset0
=
Point
(
-
1
,
-
1
);
copyMakeBorder
(
image0
,
image
,
1
,
1
,
1
,
1
,
BORDER_CONSTANT
|
BORDER_ISOLATED
,
Scalar
(
0
));
}
else
{
image
=
image0
;
}
MemStorage
storage
(
cvCreateMemStorage
());
CvMat
_cimage
=
image
;
CvSeq
*
_ccontours
=
0
;
if
(
_hierarchy
.
needed
()
)
_hierarchy
.
clear
();
cvFindContours_Impl
(
&
_cimage
,
storage
,
&
_ccontours
,
sizeof
(
CvContour
),
mode
,
method
,
offset
+
Point
(
-
1
,
-
1
)
,
0
);
cvFindContours_Impl
(
&
_cimage
,
storage
,
&
_ccontours
,
sizeof
(
CvContour
),
mode
,
method
,
offset
+
offset0
,
0
);
if
(
!
_ccontours
)
{
_contours
.
clear
();
...
...
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