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
5bc10ef7
Commit
5bc10ef7
authored
Jul 12, 2016
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed empty image condition in resize
parent
02aabcca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+6
-5
test_imgwarp_strict.cpp
modules/imgproc/test/test_imgwarp_strict.cpp
+31
-0
No files found.
modules/imgproc/src/imgwarp.cpp
View file @
5bc10ef7
...
...
@@ -3477,7 +3477,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
{
Size
ssize
=
_src
.
size
();
CV_Assert
(
ssize
.
area
()
>
0
);
CV_Assert
(
ssize
.
width
>
0
&&
ssize
.
height
>
0
);
CV_Assert
(
dsize
.
area
()
>
0
||
(
inv_scale_x
>
0
&&
inv_scale_y
>
0
)
);
if
(
dsize
.
area
()
==
0
)
{
...
...
@@ -3498,10 +3498,11 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
_dst
.
create
(
dsize
,
src
.
type
());
Mat
dst
=
_dst
.
getMat
();
if
(
dsize
==
ssize
)
{
// Source and destination are of same size. Use simple copy.
src
.
copyTo
(
dst
);
return
;
if
(
dsize
==
ssize
)
{
// Source and destination are of same size. Use simple copy.
src
.
copyTo
(
dst
);
return
;
}
hal
::
resize
(
src
.
type
(),
src
.
data
,
src
.
step
,
src
.
cols
,
src
.
rows
,
dst
.
data
,
dst
.
step
,
dst
.
cols
,
dst
.
rows
,
inv_scale_x
,
inv_scale_y
,
interpolation
);
...
...
modules/imgproc/test/test_imgwarp_strict.cpp
View file @
5bc10ef7
...
...
@@ -1218,3 +1218,34 @@ TEST(Imgproc_Resize_Test, accuracy) { CV_Resize_Test test; test.safe_run(); }
TEST
(
Imgproc_Remap_Test
,
accuracy
)
{
CV_Remap_Test
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_WarpAffine_Test
,
accuracy
)
{
CV_WarpAffine_Test
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_WarpPerspective_Test
,
accuracy
)
{
CV_WarpPerspective_Test
test
;
test
.
safe_run
();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef OPENCV_TEST_BIGDATA
CV_ENUM
(
Interpolation
,
INTER_NEAREST
,
INTER_LINEAR
,
INTER_CUBIC
,
INTER_AREA
)
class
Imgproc_Resize
:
public
::
testing
::
TestWithParam
<
Interpolation
>
{
public
:
virtual
void
SetUp
()
{
inter
=
GetParam
();
}
protected
:
int
inter
;
};
TEST_P
(
Imgproc_Resize
,
BigSize
)
{
cv
::
Mat
src
(
46342
,
46342
,
CV_8UC3
,
cv
::
Scalar
::
all
(
10
)),
dst
;
ASSERT_FALSE
(
src
.
empty
());
ASSERT_NO_THROW
(
cv
::
resize
(
src
,
dst
,
cv
::
Size
(),
0.5
,
0.5
,
inter
));
}
INSTANTIATE_TEST_CASE_P
(
Imgproc
,
Imgproc_Resize
,
Interpolation
::
all
());
#endif
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