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
0 件のコメント
回答 (1 件)
Image Analyst
2018 年 7 月 31 日
3 件のコメント
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
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

