problem in function imshow figure
Afficher commentaires plus anciens
I wante to use the following function
figure, imshow(I , []), title('Image'); I is image
but this command give error with some images not all images
I observed this error occure where the image have big size as 530 KB but if its size is 263 KB do not give error
please help me
**************************************************************
error is :-
??? Error using ==> imageDisplayValidateParams>validateCData at 114
Unsupported dimension
Error in ==> imageDisplayValidateParams at 31
common_args.CData = validateCData(common_args.CData,image_type);
Error in ==> imageDisplayParseInputs at 79
common_args = imageDisplayValidateParams(common_args);
Error in ==> imshow at 199
[common_args,specific_args] = ...
Error in ==> code1_new at 6
figure, imshow(I , []), title('Image');
Réponses (3)
Walter Roberson
le 12 Août 2012
0 votes
On one of the cases that fails, please check size(I) . If somehow you had a 4 dimensional array then that message would appear.
You could end up with a 4D array if you were doing something like Array(i,:,:,:) as in that case the singular first dimension would not automatically be removed.
Image Analyst
le 12 Août 2012
Set a break point on that line. When it stops, in the command window, type this:
>> whos I
Tell us what it says.
4 commentaires
Aseel H
le 12 Août 2012
Image Analyst
le 13 Août 2012
I don't know what those 2 image planes mean. It's not an RGB image because those have 3 image planes, and it's not a gray scale image because those have only 1 plane. Your image has 2 - a very unusual number. Nonetheless, try this:
[rows columns numberOfColorChannels] = size(I);
image3D = cat(3, I, zeros(rows, columns));
imshow(uint8(image3D));
assuming your data is in the 0-255 range. Otherwise, use mat2gray:
imshow(uint8(255*mat2gray(image3D)));
ANJALI VISHWAKARMA
le 7 Mai 2018
it also show error...
Image Analyst
le 7 Mai 2018
No it doesn't. Here is proof:
% Create a 512x512x2 array
I = 255*ones(512,512,2);
[rows, columns, numberOfColorChannels] = size(I);
% Append on third plane (blue plane) of all zeros.
image3D = cat(3, I, zeros(rows, columns));
% Cast to uint8 and display.
imshow(uint8(image3D)); % Shows yellow image, as it should.
You did something incorrectly.
Keshav Dev Singh
le 18 Déc 2015
0 votes
Hello, I have following code to plot 4 layers as, Clafimage= cat(3, A, B, C, D); figure, ClafImage=imshow(Clafimage,[],'InitialMagnification','fit');
But it is showing below error, Error using imageDisplayValidateParams>validateCData (line 117) Unsupported dimension.
Error in imageDisplayValidateParams (line 31) common_args.CData = validateCData(common_args.CData,image_type);
Error in imageDisplayParseInputs (line 79) common_args = imageDisplayValidateParams(common_args);
Error in imshow (line 220) [common_args,specific_args] = ...
Can anyone suggest how 4 or more layers can be show as a single classified image?
Thanks,
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!