필터 지우기
필터 지우기

how to overlay the image on the surface?

조회 수: 1 (최근 30일)
Elite cada
Elite cada 2013년 3월 26일
i want to overlay an image on the generated surface (which we generate by algorithms)
the problem is that when we try to overlay the image on generated surface, the result is coming but when i execute it again without the surface code the result is still same. i don't understand where this generated surface is getting saved so image automatically comes in that shape.
% make dummy test data%
N = 400;
X = 1:N;
Y = 1:N;
[X, Y] = meshgrid(X,Y);
Z = (X+Y)/20;
%mesh(Z);
%colormap(red);
%surf(X,Y,Z);
%axis([0 10 0 10 0 40]);
% read jpg and make same size as grid
im = imread('cameraman.tif');
% convert image to indexed colours
[im, map] = rgb2ind(im, 256);
% make figure
figure(1),clf
% make image same size as grid
subimage = im(1:N,1:N);
colormap(map)
% plot surf and use image as texture
s = surf(X,Y,Z);
set(s, 'faceColor', 'texture',...
'edgecolor', 'none',...
'cdata', subimage)

답변 (0개)

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by