【发布时间】:2015-02-07 04:33:57
【问题描述】:
我有以下代码来读取 CIF 序列中的 Y 分量,这会引发此错误。
使用整形出错 要 RESHAPE,元素的数量不能改变。
foremanOne 中的错误(第 12 行) img_y = reshape(img_y, nColumn, nRow);
代码是
clc;
file = 'foreman.cif';
nFrame = 10;
[fid,message]= fopen(file,'rb');
nRow = 288;
nColumn = 352;
for i = 1: nFrame
%reading Y component
img_y = fread(fid, nRow * nColumn, 'uchar');
img_y = reshape(img_y, nColumn, nRow);
img_y = img_y';
imshow(uint8(img_y));
end
fclose(fid);
disp('OK');
可能出了什么问题?
【问题讨论】: