필터 지우기
필터 지우기

How to create MASK from "image.tiff"?

조회 수: 19 (최근 30일)
reyadh Albarakat
reyadh Albarakat 2016년 5월 3일
댓글: reyadh Albarakat 2016년 5월 3일
Hi Everybody,
I tried to MASK the shapefile of my study area but the matrix of the MASK is only NaN data. so please I need your help. I have attached the script_MASK.
Thank you in advance.
Reyadh

채택된 답변

Image Analyst
Image Analyst 2016년 5월 3일
What are the values of your tiff file? It's probably in the range 0-255 so most values will be set to nan because you set all values more than 1 to nan. You might want to set the to nan only if they're outside the range 0-255, or use im2double() to change the range of your image from 0-255 to 0-1.
  댓글 수: 3
Image Analyst
Image Analyst 2016년 5월 3일
If you pass an array into mat2gray() it will scale it to the 0-1 range.
reyadh Albarakat
reyadh Albarakat 2016년 5월 3일
Thank you so much
I have question I want to save the output images.tiff in same name of the original images. suppose the names of files are 1981_07_15.n07-VI3g and 1981_07_16.n07-VI3g respectively SO how can I save outputs in same names of inputs.
Thank you
Reyadh
if true
for i=1:length(Ii)
set(0,'DefaultFigureRenderer','zbuffer')
[Plg,Plt]=meshgrid(lg,lt);
LATLIMS=[30.952 32.01];
LONLIMS=[47.09 47.818];
m_proj('Equidistant Cylindrical','lon',LONLIMS,'lat',LATLIMS);
img=Ii{i}.*MASK;
map=m_pcolor(Plg,Plt,img);
a=colormap(jet);
% a=fliplr(a);
set(gcf,'colormap',a);
shading flat;
m_grid('linewi',2,'tickdir','out');
str=num2str(i);
saveas(map,str,'tif');
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by