how to plot rgb image in 3D dimension?

13 ビュー (過去 30 日間)
Elsie
Elsie 2014 年 6 月 20 日
コメント済み: Image Analyst 2018 年 11 月 9 日
Hi, i want to plot a rgb image in 3D dimension. Z axes is for the color data. Currently, i have something like this
but i don't want the z-line to be plotted, ijust want to see how the surface looks. Maybe something like this
How can i make it? Thanks a lot. Here is my code for now:
img= imread([imdir,filename]);
if size(img,3)>1
img = rgb2gray(img);
end
[x,y]= meshgrid(1:size(img,2),1:size(img,1));
z = double(img);
min_x = min(min(x));
min_y = min(min(y));
max_x = max(max(x));
max_y = max(max(y));
figure; hold on;
surface(x,y,z,'edgecolor','none');
imgzposition = -100;
surf([min_x max_x],[min_y max_y],repmat(imgzposition, [2 2]),...
img,'facecolor','texture','edgecolor','none')
view(45,30);
xlabel('x');
ylabel('y');
zlabel('z');

回答 (2 件)

Image Analyst
Image Analyst 2014 年 6 月 20 日
Try sc: http://www.mathworks.com/matlabcentral/fileexchange/16233-sc-powerful-image-rendering from the same guy (Oliver) who brought us export_fig.

Ronnie Reyes
Ronnie Reyes 2018 年 11 月 9 日
I know its too long of time. But do you still have the code for your initial work?
  1 件のコメント
Image Analyst
Image Analyst 2018 年 11 月 9 日
This doesn't seem like an answer to the original question, so who are you asking this of? I see code and links to code so I don't know what you're really asking.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by