八度误差在试图研究图像压缩
-
12-09-2019 - |
题
让我先说我爱你开始。谢谢你。
业务的下一顺序:
octave-3.2.3:8> xin = imread('3Phone.png');
octave-3.2.3:9> colormap(gray(256));
octave-3.2.3:10> image(xin);
error: invalid value for array property "cdata"
error: set: expecting argument 2 to be a property name
error: set: expecting argument 4 to be a property name
error: set: expecting argument 6 to be a property name
error: called from:
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/image/__img__.m at line 57, column 7
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/image/image.m at line 75, column 5
error: A(I): Index exceeds matrix dimension.
error: called from:
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/plot/__go_draw_axes__.m at line 383, column 22
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/plot/__go_draw_figure__.m at line 92, column 3
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/plot/gnuplot_drawnow.m at line 91, column 5
octave-3.2.3:10>
我在Mac OS X(Snow Leopard)上使用倍频程3.2.3。这是为了显示已读和存储存储器中的图像一个非常基本的尝试。在解决这个问题的任何帮助,将不胜感激。谢谢!
解决方案
我的猜测,当你阅读PNG文件 - 确保它是一个灰度文件。 否则,有3点矩阵(RGB)。 Therfore不能使用灰色色彩映射表。
如果2Phone.png是彩色图像,尝试(至少这是我会在Matlab做):
xin = imread('3Phone.png');
image(xin(:, :, 1);
colormap(gray(256));
此将只显示R矩阵。
或者更好,使用 RGB2Gray (中当然,使用八度的等价物)。
不隶属于 StackOverflow