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
a65cb5d2
Commit
a65cb5d2
authored
Sep 17, 2012
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added extra debug parameters in resize test
parent
58fb8692
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
test_imgwarp.cpp
modules/imgproc/test/test_imgwarp.cpp
+25
-2
test_imgwarp_strict.cpp
modules/imgproc/test/test_imgwarp_strict.cpp
+12
-5
No files found.
modules/imgproc/test/test_imgwarp.cpp
View file @
a65cb5d2
...
...
@@ -1491,16 +1491,39 @@ TEST(Imgproc_resize_area, regression)
};
cv
::
Mat
src
(
16
,
16
,
CV_16UC1
,
input_data
);
cv
::
Mat
actual
;
cv
::
Mat
expected
(
5
,
5
,
CV_16UC1
,
expected_data
);
cv
::
Mat
actual
(
expected
.
size
(),
expected
.
type
());
cv
::
resize
(
src
,
actual
,
cv
::
Size
(),
0.3
,
0.3
,
INTER_AREA
);
cv
::
resize
(
src
,
actual
,
actual
.
size
(),
0.0
,
0.0
,
INTER_AREA
);
ASSERT_EQ
(
actual
.
type
(),
expected
.
type
());
ASSERT_EQ
(
actual
.
size
(),
expected
.
size
());
Mat
diff
;
absdiff
(
actual
,
expected
,
diff
);
Mat
one_channel_diff
=
diff
.
reshape
(
1
);
int
elem_diff
=
1.0
f
;
Size
dsize
=
actual
.
size
();
for
(
int
dy
=
0
;
dy
<
dsize
.
height
;
++
dy
)
{
ushort
*
eD
=
expected
.
ptr
<
ushort
>
(
dy
);
ushort
*
aD
=
actual
.
ptr
<
ushort
>
(
dy
);
for
(
int
dx
=
0
;
dx
<
dsize
.
width
;
++
dx
)
if
(
fabs
(
static_cast
<
float
>
(
aD
[
dx
]
-
eD
[
dx
]))
>
elem_diff
)
{
cvtest
::
TS
::
ptr
()
->
printf
(
cvtest
::
TS
::
SUMMARY
,
"Inf norm: %f
\n
"
,
static_cast
<
float
>
(
norm
(
actual
,
expected
,
NORM_INF
)));
cvtest
::
TS
::
ptr
()
->
printf
(
cvtest
::
TS
::
SUMMARY
,
"Error in : (%d, %d)
\n
"
,
dx
,
dy
);
const
int
radius
=
3
;
int
rmin
=
MAX
(
dy
-
radius
,
0
),
rmax
=
MIN
(
dy
+
radius
,
dsize
.
height
);
int
cmin
=
MAX
(
dx
-
radius
,
0
),
cmax
=
MIN
(
dx
+
radius
,
dsize
.
width
);
std
::
cout
<<
"actual result:
\n
"
<<
actual
(
Range
(
rmin
,
rmax
),
Range
(
cmin
,
cmax
))
<<
std
::
endl
;
std
::
cout
<<
"expected result:
\n
"
<<
expected
(
Range
(
rmin
,
rmax
),
Range
(
cmin
,
cmax
))
<<
std
::
endl
;
}
}
ASSERT_EQ
(
norm
(
one_channel_diff
,
cv
::
NORM_INF
),
0
);
}
...
...
modules/imgproc/test/test_imgwarp_strict.cpp
View file @
a65cb5d2
...
...
@@ -261,11 +261,18 @@ void CV_ImageWarpBaseTest::validate_results() const
PRINT_TO_LOG
(
"Dsize: (%d, %d)
\n
"
,
dsize
.
width
/
cn
,
dsize
.
height
);
PRINT_TO_LOG
(
"Ssize: (%d, %d)
\n
"
,
src
.
cols
,
src
.
rows
);
float
scale_x
=
static_cast
<
float
>
(
ssize
.
width
)
/
dsize
.
width
,
scale_y
=
static_cast
<
float
>
(
ssize
.
height
)
/
dsize
.
height
;
PRINT_TO_LOG
(
"Interpolation: %s
\n
"
,
interpolation_to_string
(
interpolation
==
INTER_AREA
&&
fabs
(
scale_x
-
cvRound
(
scale_x
))
<
FLT_EPSILON
&&
fabs
(
scale_y
-
cvRound
(
scale_y
))
<
FLT_EPSILON
?
INTER_LANCZOS4
+
1
:
interpolation
));
double
scale_x
=
static_cast
<
double
>
(
ssize
.
width
)
/
dsize
.
width
;
double
scale_y
=
static_cast
<
double
>
(
ssize
.
height
)
/
dsize
.
height
;
bool
area_fast
=
interpolation
==
INTER_AREA
&&
fabs
(
scale_x
-
cvRound
(
scale_x
))
<
FLT_EPSILON
&&
fabs
(
scale_y
-
cvRound
(
scale_y
))
<
FLT_EPSILON
;
if
(
area_fast
)
{
scale_y
=
cvRound
(
scale_y
);
scale_x
=
cvRound
(
scale_x
);
}
PRINT_TO_LOG
(
"Interpolation: %s
\n
"
,
interpolation_to_string
(
area_fast
?
INTER_LANCZOS4
+
1
:
interpolation
));
PRINT_TO_LOG
(
"Scale (x, y): (%lf, %lf)
\n
"
,
scale_x
,
scale_y
);
PRINT_TO_LOG
(
"Elemsize: %d
\n
"
,
src
.
elemSize1
());
PRINT_TO_LOG
(
"Channels: %d
\n
"
,
cn
);
...
...
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