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

2 visualizzazioni (ultimi 30 giorni)
% 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{:});

Risposte (1)

Image Analyst
Image Analyst il 3 Gen 2014
What does it say if you do
whos boston1
right after you read it in?
  2 Commenti
D.Regan
D.Regan il 3 Gen 2014
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 il 3 Gen 2014
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.

Accedi per commentare.

Categorie

Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by