I can't use mapping toolbox functions fully on this geotiff image. I got some errors..

2 次查看(过去 30 天)
% Reads the geotiff file
[boston1, R1] = geotiffread('G:\bhvan\rad.tif');
Reg=R1;
figure
mapshow(boston1, Reg);
axis image off
but I got below errors...
Error using checkImage>checkRGBImage (line 52)
RGB images must be size M-by-N-by-3.
Error in checkImage (line 37)
RGB = checkRGBImage(A);
Error in validateMapRasterData>parseImageInputs (line 128)
A = checkImage(mapfcnname, A, cmap, 1, 2);
Error in validateMapRasterData>validateImageComponent (line 93)
[A, R] = parseImageInputs(mapfcnname, dataArgs{:}, cmap, rules );
Error in validateMapRasterData (line 27)
[Z, SpatialRef] = validateImageComponent(mapfcnname, ...
Error in maprastershow (line 127)
[Z, SpatialRef, displayType, HGpairs] = ...
Error in mapshow (line 231)
h = showFcn(varargin{:});

回答(1 个)

Image Analyst
Image Analyst 2014-1-3
What does it say if you do
whos boston1
right after you read it in?
  2 个评论
D.Regan
D.Regan 2014-1-3
if true
% code
endok. Actually variable R1 is R1=[1 2]. It shows error in display. but I inspired this from matlab help page as
Example ------- % Read and display the Boston GeoTIFF image. % Includes material (c) GeoEye, all rights reserved. [boston, R] = geotiffread('boston.tif'); figure mapshow(boston, R) axis image off
But R here is R=[1 1], shows display. but in my script, if R1 size R1=[1 2], I got error.. help me to find error...
Image Analyst
Image Analyst 2014-1-3
Alright, but same question just different variable name:
What does it say if you do
whos R1
whos boston
right after you read it in? Simply giving it a variable name of R1 instead of R for the return argument is not going to cause it to fail.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by