How can I remove the nan value (with index code -1) while reading a tiff image in Matlab

조회 수: 3 (최근 30일)
How can I remove the blue background (shown in attachment) which is representing nan values with index code -1 while reading a tiff image in Matlab
I am using the following code for reading a tiff image
filename = 'D:\Rainfall\Rainfall.tif';
[A, cmap] = imread(filename);
imshow(A, cmap)
caxis ([0 3500])
Cbar_tick = 0:500:3500;
Cbar_ticklabel = string(Cbar_tick);
cb = colorbar('southoutside', 'Ticks',Cbar_tick, 'TickLabels',Cbar_ticklabel);
cb.Position = [0.25 0.07 0.5 0.018];
cb.FontSize = 8.5;
cb.Color = 'k';
cb.TickLength = 0.019;
cb.TickDirection = 'out';
cb.Label.String = 'Rainfall (mm)';
cb.Label.FontSize = 9;
cb.Label.FontWeight = 'normal';

답변 (1개)

Rishik Ramena
Rishik Ramena 2021년 5월 31일
You can try using the read function to read the tiff image. This function takes in a tiff obejct as input, so create a tiff object and pass it as a parameter to this function. Have a look at the examples here.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by