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
73d4f12c
Commit
73d4f12c
authored
Nov 17, 2017
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9997 from ElenaGvozdeva:GaussianBlur_bug
parents
0eb1bfa8
eb136ebb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+4
-4
test_filter.cpp
modules/imgproc/test/test_filter.cpp
+21
-0
No files found.
modules/core/include/opencv2/core/mat.inl.hpp
View file @
73d4f12c
...
...
@@ -508,7 +508,6 @@ Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step)
}
else
{
if
(
rows
==
1
)
_step
=
minstep
;
CV_DbgAssert
(
_step
>=
minstep
);
if
(
_step
%
esz1
!=
0
)
...
...
@@ -516,7 +515,8 @@ Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step)
CV_Error
(
Error
::
BadStep
,
"Step must be a multiple of esz1"
);
}
flags
|=
_step
==
minstep
?
CONTINUOUS_FLAG
:
0
;
if
(
_step
==
minstep
||
rows
==
1
)
flags
|=
CONTINUOUS_FLAG
;
}
step
[
0
]
=
_step
;
step
[
1
]
=
esz
;
...
...
@@ -541,7 +541,6 @@ Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
}
else
{
if
(
rows
==
1
)
_step
=
minstep
;
CV_DbgAssert
(
_step
>=
minstep
);
if
(
_step
%
esz1
!=
0
)
...
...
@@ -549,7 +548,8 @@ Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
CV_Error
(
Error
::
BadStep
,
"Step must be a multiple of esz1"
);
}
flags
|=
_step
==
minstep
?
CONTINUOUS_FLAG
:
0
;
if
(
_step
==
minstep
||
rows
==
1
)
flags
|=
CONTINUOUS_FLAG
;
}
step
[
0
]
=
_step
;
step
[
1
]
=
esz
;
...
...
modules/imgproc/test/test_filter.cpp
View file @
73d4f12c
...
...
@@ -1982,6 +1982,27 @@ TEST(Imgproc_Blur, borderTypes)
EXPECT_DOUBLE_EQ
(
0.0
,
cvtest
::
norm
(
expected_dst
,
dst
,
NORM_INF
));
}
TEST
(
Imgproc_GaussianBlur
,
borderTypes
)
{
Size
kernelSize
(
3
,
3
);
Mat
src_16
(
16
,
16
,
CV_8UC1
,
cv
::
Scalar
::
all
(
42
)),
dst_16
;
Mat
src_roi_16
=
src_16
(
Rect
(
1
,
1
,
14
,
14
));
src_roi_16
.
setTo
(
cv
::
Scalar
::
all
(
3
));
cv
::
GaussianBlur
(
src_roi_16
,
dst_16
,
kernelSize
,
0
,
0
,
BORDER_REPLICATE
);
EXPECT_EQ
(
20
,
dst_16
.
at
<
uchar
>
(
0
,
0
));
Mat
src
(
3
,
12
,
CV_8UC1
,
cv
::
Scalar
::
all
(
42
)),
dst
;
Mat
src_roi
=
src
(
Rect
(
1
,
1
,
10
,
1
));
src_roi
.
setTo
(
cv
::
Scalar
::
all
(
2
));
cv
::
GaussianBlur
(
src_roi
,
dst
,
kernelSize
,
0
,
0
,
BORDER_REPLICATE
);
EXPECT_EQ
(
27
,
dst
.
at
<
uchar
>
(
0
,
0
));
}
TEST
(
Imgproc_Morphology
,
iterated
)
{
RNG
&
rng
=
theRNG
();
...
...
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