How to render a realistic panorama view of a terrain?

6 views (last 30 days)
Could you help me properly render a panorama view using DEM (Digital Elevation Model) data, please?
This summer I went to the Mountains called Tatras in Slovakia. I walked to the location:
Latitude = 49.232230688571
Longitude = 20.221235240000
Altitude = 1868.8
and I took an image (the first one):
I tried to render the same view in Google Earth (the second image) which was quite successful.
I tried the same in Matlab (the last image) but the result is disappointing. How could I make it more realistic?
I don't care about textures; I am more interested in correct location of the peaks from current viewpoint. Just looking at horizon, it is clear that it is not accurate.
To create the last image I used this code:
dem = readhgt(49, 20);
dem.z(dem.z < 0) = 0;
latlim = [min(dem.lat(:)) max(dem.lat(:))];
lonlim = [min(dem.lon(:)) max(dem.lon(:))];
R = georasterref('RasterSize',size(dem.z),'Latlim',latlim, 'Lonlim', lonlim);
worldmap(latlim, lonlim)
geoshow(double(dem.z), R, 'DisplayType', 'surface')
demcmap(double(dem.z))
daspectm('m',1)
view(3);
camva(20); % had to play with this value because the real camera has around 40 or 50
camposm(49.232230688571,20.221235240000,1868.8);
camtargm(49.195833, 20.194778, 2034);
Thank you for any help.

Answers (2)

Chad Greene
Chad Greene on 13 Sep 2015
Use some sort of lighting to create hills. You should be able to follow all your Matlab commands with shadem, which I wrote to make the process easy. Then it'll make it look a lot more like realistic topography. Or you can skip shadem and edit lighting manually.

Chad Greene
Chad Greene on 13 Sep 2015
Alternatively, you can drape a satellite image over your topography. Something like what I did here. Just swap my DEM for yours.
  1 Comment
Peter
Peter on 14 Sep 2015
Thank you for the suggestion. After using shadem command I have realized that maybe the virtual camera is not on the correct GPS location.
Is it possible that there is some longitude/latitude shift (offset) of the DEM data? Comparing the Google Earth rendered view with the one I have made in matlab, it looks like I were looking at the mountains from some distant and shifted location.
I would like to achieve a view where the peaks and mountains are rendered on exact positions with as minimal distortion as possible. Maybe I should use some sort of projection or other adjustments to make it as exact as Google Earth one…I am just a beginner and don't know where to start. The colors and textures are not important for me.
I downloaded the DEM data from viewfinderpanoramas exactli DEM 3" as the data downloaded with readhgt command have a lot of holes.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!