Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
f1857030
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 8 个月
通知
982
Star
71100
Fork
55581
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f1857030
编写于
1月 15, 2022
作者:
S
Suleyman TURKMEN
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bigtiff images reading
上级
60228d30
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
28 addition
and
1 deletion
+28
-1
modules/imgcodecs/src/grfmt_tiff.cpp
modules/imgcodecs/src/grfmt_tiff.cpp
+5
-1
modules/imgcodecs/test/test_tiff.cpp
modules/imgcodecs/test/test_tiff.cpp
+23
-0
未找到文件。
modules/imgcodecs/src/grfmt_tiff.cpp
浏览文件 @
f1857030
...
...
@@ -112,6 +112,8 @@ static bool cv_tiffSetErrorHandler()
static
const
char
fmtSignTiffII
[]
=
"II
\x2a\x00
"
;
static
const
char
fmtSignTiffMM
[]
=
"MM
\x00\x2a
"
;
static
const
char
fmtSignBigTiffII
[]
=
"II
\x2b\x00
"
;
static
const
char
fmtSignBigTiffMM
[]
=
"MM
\x00\x2b
"
;
TiffDecoder
::
TiffDecoder
()
{
...
...
@@ -140,7 +142,9 @@ bool TiffDecoder::checkSignature( const String& signature ) const
{
return
signature
.
size
()
>=
4
&&
(
memcmp
(
signature
.
c_str
(),
fmtSignTiffII
,
4
)
==
0
||
memcmp
(
signature
.
c_str
(),
fmtSignTiffMM
,
4
)
==
0
);
memcmp
(
signature
.
c_str
(),
fmtSignTiffMM
,
4
)
==
0
||
memcmp
(
signature
.
c_str
(),
fmtSignBigTiffII
,
4
)
==
0
||
memcmp
(
signature
.
c_str
(),
fmtSignBigTiffMM
,
4
)
==
0
);
}
int
TiffDecoder
::
normalizeChannelsNumber
(
int
channels
)
const
...
...
modules/imgcodecs/test/test_tiff.cpp
浏览文件 @
f1857030
...
...
@@ -455,6 +455,29 @@ TEST(Imgcodecs_Tiff, read_multipage_indexed)
}
}
TEST
(
Imgcodecs_Tiff
,
read_bigtiff_images
)
{
const
string
root
=
cvtest
::
TS
::
ptr
()
->
get_data_path
();
const
string
filenamesInput
[]
=
{
"readwrite/BigTIFF.tif"
,
"readwrite/BigTIFFMotorola.tif"
,
"readwrite/BigTIFFLong.tif"
,
"readwrite/BigTIFFLong8.tif"
,
"readwrite/BigTIFFMotorolaLongStrips.tif"
,
"readwrite/BigTIFFLong8Tiles.tif"
,
"readwrite/BigTIFFSubIFD4.tif"
,
"readwrite/BigTIFFSubIFD8.tif"
};
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
const
Mat
bigtiff_img
=
imread
(
root
+
filenamesInput
[
i
],
IMREAD_UNCHANGED
);
ASSERT_FALSE
(
bigtiff_img
.
empty
());
EXPECT_EQ
(
64
,
bigtiff_img
.
cols
);
EXPECT_EQ
(
64
,
bigtiff_img
.
rows
);
ASSERT_EQ
(
CV_8UC3
,
bigtiff_img
.
type
());
}
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录