How to overlay a surf and a picture ?

5 views (last 30 days)
Dagan
Dagan on 29 Jul 2014
Answered: Image Analyst on 29 Jul 2014
Hello there, I'm trying to a cartography from a file and a picture.
file=importdata('file.dat');
img=imread('picture.png');
x=0:1:100; %fil row
y=0:1:100; %file column
figure
hold on
surf(x,y,file);
shading interp
view (0,270);
imshow(img);
hold off
But my problem is that I want a transparency on my picture. I want white pixels to be transparent..
Thank you very much for your help Dagan
  1 Comment
Geoff Hayes
Geoff Hayes on 29 Jul 2014
Dagan - you can start by looking at the following link Image Overlay Using Transparency which manipulates the AlphaData property of the graphics handle to allow certain regions of the image to be transparent. I think that you want to pay special attention to the second example.
From your question, is it the white pixels within your picture.png that you want to make transparent?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 29 Jul 2014
Take a look at Sean's meshCanopy and see if that's what you're looking for:

Community Treasure Hunt

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

Start Hunting!