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
46d128e0
Commit
46d128e0
authored
Feb 20, 2014
by
Matti Picus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test (needs updated opencv_extra repo)
parent
64fd54ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
test_grfmt.cpp
modules/highgui/test/test_grfmt.cpp
+42
-0
No files found.
modules/highgui/test/test_grfmt.cpp
View file @
46d128e0
...
...
@@ -419,4 +419,46 @@ TEST(Highgui_Tiff, decode_tile16384x16384)
remove
(
file3
.
c_str
());
remove
(
file4
.
c_str
());
}
class
CV_GrfmtReadTifTiledWithNotFullTiles
:
public
cvtest
::
BaseTest
{
public
:
void
run
(
int
)
{
try
{
/* see issue #3472 - dealing with tiled images where the tile size is
* not a multiple of image size.
* The tiled images were created with 'convert' from ImageMagick,
* using the command 'convert <input> -define tiff:tile-geometry=128x128 -depth [8|16] <output>
* Note that the conversion to 16 bits expands the range from 0-255 to 0-255*255,
* so the test converts back but rounding errors cause small differences.
*/
cv
::
Mat
img
=
imread
(
string
(
ts
->
get_data_path
())
+
"readwrite/non_tiled.tif"
,
-
1
);
if
(
img
.
empty
())
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
ASSERT_TRUE
(
img
.
channels
()
==
3
);
cv
::
Mat
tiled8
=
imread
(
string
(
ts
->
get_data_path
())
+
"readwrite/tiled_8.tif"
,
-
1
);
if
(
tiled8
.
empty
())
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
ASSERT_PRED_FORMAT2
(
cvtest
::
MatComparator
(
0
,
0
),
img
,
tiled8
);
cv
::
Mat
tiled16
=
imread
(
string
(
ts
->
get_data_path
())
+
"readwrite/tiled_16.tif"
,
-
1
);
if
(
tiled16
.
empty
())
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
ASSERT_TRUE
(
tiled16
.
elemSize
()
==
6
);
tiled16
.
convertTo
(
tiled8
,
CV_8UC3
,
1.
/
256.
);
ASSERT_PRED_FORMAT2
(
cvtest
::
MatComparator
(
2
,
0
),
img
,
tiled8
);
// What about 32, 64 bit?
}
catch
(...)
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_EXCEPTION
);
}
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
}
};
TEST
(
Highgui_Tiff
,
decode_tile_remainder
)
{
CV_GrfmtReadTifTiledWithNotFullTiles
test
;
test
.
safe_run
();
}
#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