1
讀取GIF動畫文件,我在下面的方式讀取GIF文件:錯誤在Matlab
[image, map] = imread(imagePath, 'frames', 1);
然而,讀取GIF圖像下面貼我收到以下錯誤信息:
Subscripted assignment dimension mismatch.
Error in readgif>read_multiframe_gif (line 117)
[X(:,:,:,j) undisposed_index] =
handle_positive_base_frame(data{j},info(j),X(:,:,:,undisposed_index),X(:,:,:,j-1),undisposed_index,j);
Error in readgif (line 36)
[X,map] = read_multiframe_gif(filename);
Error in imread (line 435)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
是它是因爲GIF文件已損壞還是存在另一個問題?
我得到與該文件完全相同的錯誤(Matlab R2012b,OS X 10.8.3)。其他動畫GIF(例如[這一個](http://en.wikipedia.org/wiki/File:Rotating_earth_(large).gif))打開罰款。在十六進制查看器中打開文件看起來像是可能是錯誤的 - 可能在標題中。某些程序可能容忍格式錯誤的標題,但我想Matlab不是。圖像是如何創建的?你可以在另一個程序中打開並重新保存嗎? – horchler
@MarvinTheParanoidAndroid:我認爲你完全誤解了'imread'的幫助。 'idx'是一個用戶指定的變量,可以是標量或矢量範圍的幀。 – horchler
我還沒有創建它。保留它可能是一個解決方案;然而,我想知道我處理它的方式或文件本身是否有問題。 –