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

조회 수: 3 (최근 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.

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

Community Treasure Hunt

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

Start Hunting!

Translated by