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
a8a51db4
Commit
a8a51db4
authored
Dec 21, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10316 from terfendail:bitexact_c234
parents
70d49446
1eb2fa9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
11 deletions
+52
-11
resize.cpp
modules/imgproc/src/resize.cpp
+0
-0
test_resize_bitexact.cpp
modules/imgproc/test/test_resize_bitexact.cpp
+52
-11
No files found.
modules/imgproc/src/resize.cpp
View file @
a8a51db4
This diff is collapsed.
Click to expand it.
modules/imgproc/test/test_resize_bitexact.cpp
View file @
a8a51db4
...
...
@@ -26,18 +26,59 @@ TEST(Resize_Bitexact, Linear8U)
{
static
const
int64_t
fixedOne
=
(
1L
<<
fixedShiftU8
);
int
types
[]
=
{
CV_8UC1
,
CV_8UC4
};
// NOTICE: 2x downscaling ommitted since it use different rounding
// 1/2 1 1 1/2 1/2 1/2 1/4 1/4 1/256 1/256 1/3 1/2 1/3 1/3 1/2 1/3 1/7 1/7
Size
dstsizes
[]
=
{
Size
(
512
,
768
),
Size
(
1024
,
384
),
Size
(
512
,
384
),
Size
(
256
,
192
),
Size
(
4
,
3
),
Size
(
342
,
384
),
Size
(
342
,
256
),
Size
(
512
,
256
),
Size
(
146
,
110
),
// 10/11 10/11 10/12 10/12 251/256 2 2 3 3 7 7
Size
(
931
,
698
),
Size
(
853
,
640
),
Size
(
1004
,
753
),
Size
(
2048
,
1536
),
Size
(
3072
,
2304
),
Size
(
7168
,
5376
)
};
struct
testmode
{
int
type
;
Size
sz
;
}
modes
[]
=
{
{
CV_8UC1
,
Size
(
512
,
768
)
},
// 1/2 1
{
CV_8UC3
,
Size
(
512
,
768
)
},
{
CV_8UC1
,
Size
(
1024
,
384
)
},
// 1 1/2
{
CV_8UC4
,
Size
(
1024
,
384
)
},
{
CV_8UC1
,
Size
(
512
,
384
)
},
// 1/2 1/2
{
CV_8UC2
,
Size
(
512
,
384
)
},
{
CV_8UC3
,
Size
(
512
,
384
)
},
{
CV_8UC4
,
Size
(
512
,
384
)
},
{
CV_8UC1
,
Size
(
256
,
192
)
},
// 1/4 1/4
{
CV_8UC2
,
Size
(
256
,
192
)
},
{
CV_8UC3
,
Size
(
256
,
192
)
},
{
CV_8UC4
,
Size
(
256
,
192
)
},
{
CV_8UC1
,
Size
(
4
,
3
)
},
// 1/256 1/256
{
CV_8UC2
,
Size
(
4
,
3
)
},
{
CV_8UC3
,
Size
(
4
,
3
)
},
{
CV_8UC4
,
Size
(
4
,
3
)
},
{
CV_8UC1
,
Size
(
342
,
384
)
},
// 1/3 1/2
{
CV_8UC1
,
Size
(
342
,
256
)
},
// 1/3 1/3
{
CV_8UC1
,
Size
(
342
,
256
)
},
{
CV_8UC1
,
Size
(
342
,
256
)
},
{
CV_8UC1
,
Size
(
342
,
256
)
},
{
CV_8UC1
,
Size
(
512
,
256
)
},
// 1/2 1/3
{
CV_8UC1
,
Size
(
146
,
110
)
},
// 1/7 1/7
{
CV_8UC3
,
Size
(
146
,
110
)
},
{
CV_8UC4
,
Size
(
146
,
110
)
},
{
CV_8UC1
,
Size
(
931
,
698
)
},
// 10/11 10/11
{
CV_8UC2
,
Size
(
931
,
698
)
},
{
CV_8UC3
,
Size
(
931
,
698
)
},
{
CV_8UC4
,
Size
(
931
,
698
)
},
{
CV_8UC1
,
Size
(
853
,
640
)
},
// 10/12 10/12
{
CV_8UC3
,
Size
(
853
,
640
)
},
{
CV_8UC4
,
Size
(
853
,
640
)
},
{
CV_8UC1
,
Size
(
1004
,
753
)
},
// 251/256 251/256
{
CV_8UC2
,
Size
(
1004
,
753
)
},
{
CV_8UC3
,
Size
(
1004
,
753
)
},
{
CV_8UC4
,
Size
(
1004
,
753
)
},
{
CV_8UC1
,
Size
(
2048
,
1536
)
},
// 2 2
{
CV_8UC2
,
Size
(
2048
,
1536
)
},
{
CV_8UC4
,
Size
(
2048
,
1536
)
},
{
CV_8UC1
,
Size
(
3072
,
2304
)
},
// 3 3
{
CV_8UC3
,
Size
(
3072
,
2304
)
},
{
CV_8UC1
,
Size
(
7168
,
5376
)
}
// 7 7
};
for
(
int
dsizeind
=
0
,
_dsizecnt
=
sizeof
(
dstsizes
)
/
sizeof
(
dstsizes
[
0
]);
dsizeind
<
_dsizecnt
;
++
dsizeind
)
for
(
int
typeind
=
0
,
_typecnt
=
sizeof
(
types
)
/
sizeof
(
types
[
0
]);
typeind
<
_typecnt
;
++
typeind
)
for
(
int
modeind
=
0
,
_modecnt
=
sizeof
(
modes
)
/
sizeof
(
modes
[
0
]);
modeind
<
_modecnt
;
++
modeind
)
{
int
type
=
types
[
typeind
]
,
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
int
dcols
=
dstsizes
[
dsizeind
].
width
,
drows
=
dstsizes
[
dsizeind
]
.
height
;
int
type
=
modes
[
modeind
].
type
,
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
int
dcols
=
modes
[
modeind
].
sz
.
width
,
drows
=
modes
[
modeind
].
sz
.
height
;
int
cols
=
1024
,
rows
=
768
;
double
inv_scale_x
=
(
double
)
dcols
/
cols
;
...
...
@@ -111,7 +152,7 @@ TEST(Resize_Bitexact, Linear8U)
cv
::
resize
(
src
,
dst
,
Size
(
dcols
,
drows
),
0
,
0
,
cv
::
INTER_LINEAR_EXACT
);
EXPECT_GE
(
0
,
cvtest
::
norm
(
refdst
,
dst
,
cv
::
NORM_L1
))
<<
"Resize from "
<<
cols
<<
"x"
<<
rows
<<
" to "
<<
dcols
<<
"x"
<<
drows
<<
" failed with max diff "
<<
cvtest
::
norm
(
refdst
,
dst
,
cv
::
NORM_INF
);
<<
"Resize
"
<<
cn
<<
"-chan mat
from "
<<
cols
<<
"x"
<<
rows
<<
" to "
<<
dcols
<<
"x"
<<
drows
<<
" failed with max diff "
<<
cvtest
::
norm
(
refdst
,
dst
,
cv
::
NORM_INF
);
}
}
...
...
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