Overlaying surface with Image using GUIDE

3 次查看(过去 30 天)
Hello,
I am trying to overlay a graphic (surface S) over an image I found on the web using GUIDE. The surface appears on the top left very small... I tried changing the xlim et ylim but with no success. This is the code I used (I tried converting cm to pixels so that the surface and the image have the same scale). I resized the image to fit the maximum length and width of the surface too. S is the matrix I used S=[2.3 2.9 3 3 3 4]. Could you please help me out?
if true
axes=handles.body;
xlim([0 (L.*96)/2.56]); %Length
ylim([0 (W.*96)/2.56]); %Width
img=imread('thigh1.jpg');
img=imresize(img, [(L.*96)/2.56 (W.*96)/2.56]);
I=image(img);
hold (handles.body,'on');
s=(S.*96)/2.56;
surf(s,'FaceAlpha','interp','AlphaDataMapping','scaled','AlphaData',gradient(s),'FaceColor','interp');
view(0,90);
hold (handles.body,'off');
I.AlphaData=0.5;
end
Thank you in advance

回答(1 个)

Image Analyst
Image Analyst 2018-7-31
  3 个评论
Image Analyst
Image Analyst 2018-8-1
Not sure what you want. What I showed was a 2-D image with a 2.5-D surface over it all rendered in "3-D". What do you want? Or do you just want to visualize one image over the top of another but all in 2-D, not a 3-D rendering like above? Like this http://www.mathworks.com/matlabcentral/answers/104889-how-to-overlay-a-foreground-image-over-a-background-image
theofania giota
theofania giota 2018-8-1
Hello, I am trying to visualize a surface that is projected only in 2D with the view (0.90) command and put an image in the background... When I tried overlaying the graphic and the image i got that:
The graphic is small in the corner ...
Thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by