基于Image Analyst在“3d plot of an image”问题的回答中给出的代码(http://www.mathworks.com/matlabcentral/answers/48532-3d-plot-of-an-image),我有一个后续问题:
我简化了代码,并想知道是否可以根据灰度强度(Z轴)将其应用于jet色图,并使其适合图像尺寸(x,y)(例如,在此图像示例中,尺寸为628x600,因此max x = 628和max y = 600)。
谢谢。
代码:
我简化了代码,并想知道是否可以根据灰度强度(Z轴)将其应用于jet色图,并使其适合图像尺寸(x,y)(例如,在此图像示例中,尺寸为628x600,因此max x = 628和max y = 600)。
谢谢。
代码:
I = imread('E:\Temp\Canadian_maple_leaf_2.jpg'); % http://en.wikipedia.org/wiki/File:Canadian_maple_leaf_2.jpg
I=rgb2gray(I);
I = imcomplement(I);
[rows columns numberOfColorBands] = size(I);
surf(double(I));