【发布时间】:2016-04-19 16:55:19
【问题描述】:
我正在尝试在 MATLAB 中读取 RAW16 image。在经历了另一个question here on StackOverflow 之后,我想我可以像阅读文件一样阅读它,然后做一些简单的矩阵转置。但是,我遇到了一个奇怪的问题。下图是我得到的。我不明白为什么存在这种重叠,也不完全确定如何解决这个问题。有人可以帮忙吗?
代码:
fin = fopen('raw13.raw','r');
ima = fread(fin, [col*2 row],'uint8');
temp = zeros(col,row);
j=1;
for i=1:2:col*2-1
temp(j,:) = ima(i,:) + ima(i+1,:)*2^8; %The first element is the lower 8bits and the second element is the higher 8bits
j = j+1;
end
imshow(temp',[0 2^16-1])
【问题讨论】:
-
预期大小,即 col 和 row?
-
column = 1384 and rows = 1036. 我取 col*2 因为当我从缓冲区读取 MONO16 信息时,它是两个字节,即 stride = col*2
标签: image matlab binaryfiles