Why do I get a border without an image when saving and image as tiff after using geoshow?

2 views (last 30 days)
I am experiencing some problems when trying to save an image file (im) as a tiff after I used GEOSHOW. The results is a blank image. I use the following code
axesm utm
setm(gca,'zone','45u')
geoshow(y,x,im,'DisplayType','image')
with im being uint8. This all works fine, and the image is nicely shown.
I then used the save image as gui, to save as a non compressed tiff, which results in a blank image.
However if plot for example a border on it
hold on
geoshow([border.Lat],[border.Lon],'Color','black','linewidth',1);
This border is printed, without image.
What am I doing wrong?

Accepted Answer

Kelly Luetkemeyer
Kelly Luetkemeyer on 28 Jan 2011
I don't have sufficient information from your question to give a precise answer to it, but I can provide some insight into some possible answers.
The first step is to verify that the image was saved correctly.
How did you save the image? Did you use something like:
saveas(gcf,'saved_image.tif')
or
print(gcf,'-dtiff','saved_image.tif')
And can you view your saved image with either imshow or image?
figure;imshow('saved_image.tif')
figure;X = imread('saved_image.tif');image(X)
If the image in the TIFF file can be viewed, then it was saved correctly. If not, then try a different renderer, i.e.
figure('renderer', 'zbuffer')
The other posssiblity is that the image was saved correctly, but there is a referencing problem. Did you use the same command to view the saved image as used for the uint8 image, i.e.:
im = imread('saved_image.tif');
geoshow(y,x,im, 'DisplayType', 'image')
This will not work because the saved image is now in projected coordinates (UTM). You need to create a new referencing matrix for the saved image. Look at the help for makerefmat. The image saved will contain the limits of the axes and is in UTM. Once you create a new referencing matrix, you need to use mapshow to view it.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!