作者immortaler (cloud)
看板MATLAB
标题[问题]维度的读取问题
时间Fri Dec 27 18:03:32 2013
大家好,
我是之前问过spe档案读取连续图片偏移问题的同学,
现在判别他是1024*1024的大小共计19张,每次读取x轴偏移两个pixel的状况,
1st =
http://ppt.cc/l9T1
10th =
http://ppt.cc/olNm
19th =
http://ppt.cc/c8su
请问是否可以用"多读取两行的方法但是不显示在图片上"的方法来解决偏移的问题,
尝试新增A来读取stripDim会有一个dimension mismatch的问题,
想请问版友该怎麽修改或者我应该从别的地方下手,
以下为READSPE档的部分程式,完整档网页=>
http://ppt.cc/D0ag
stripDim = getData(fd, '2A', 'uint16'); %first dim
pixelDim = getData(fd, '290', 'uint16'); %second dim
nDim = getData(fd, '5A6', 'uint32'); %third dim
dataType = getData(fd, '6C', 'uint16'); % Get the pixel data type
fseek(fd, hex2dec('1004'), 'bof'); % Get the image
image = zeros([pixelDim,stripDim,nDim]);
A = zeros([pixelDim,2,nDim]); %尝试新增的部分
switch dataType
case 0 % single precision float (4 bytes)
image = single(image); %maintain datatype in function output
for i=1:nDim
image(:,:,i) = fread(fd, [stripDim,pixelDim], 'float32')';
A(:,:,i) = fread(fd, [2,pixelDim], 'float32')'; %尝试新增的部分
end
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.106.71
1F:→ immortaler:已解决问题(藉由换掉A的形式) 01/02 13:57