how can i view a digital surface model which is in tiff format?,

조회 수: 5 (최근 30일)
Salma Makuti
Salma Makuti 2017년 9월 7일
답변: Ben Drebing 2017년 9월 13일
i have tried using imshow(img) but i get a black and white results. any one to help please

답변 (1개)

Ben Drebing
Ben Drebing 2017년 9월 13일
The way that this file works is that the color of each pixel represents the elevation at a given point. So, the lighter the pixel the higher the elevation, etc. You can read in this image and plot the elevations by doing something like:
>> A = imread('myDSMFile.tif'); % Get elevation data
>> [X, Y] = meshgrid(1:size(A,2), 1:size(A,1)); % Create all (x,y) points to plot
>> mesh(X,Y,A); % Plot the data
The mapping toolbox has a function called "geotiffread" which acts very similarly but it also extracts different information out of the file like geographic location and scale.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by