Error in displaying .TIF images in MATLAB
29 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I tried to display a .tif image in MATLAB. The system is able to read it, but not able to display it.
pet=imread('13.tif');
imshow(pet);
Error using imageDisplayValidateParams>validateCData (line 113)
Multi-plane image inputs must be RGB images of size MxNx3.
Error in imageDisplayValidateParams (line 27)
common_args.CData = validateCData(common_args.CData,image_type);
Error in imageDisplayParseInputs (line 78)
common_args = imageDisplayValidateParams(common_args);
Error in imshow (line 219)
[common_args,specific_args] = ...
16 commentaires
Soumyadip Ray Cahudhuri
le 31 Juil 2019
this is my code
I=imread('pout.tif');
imshow(I)
figure
imshow(I>220)
this is thr error
Error using images.internal.imageDisplayValidateParams>validateCData (line 115)
Multi-plane image inputs must be RGB images of size MxNx3.
Error in images.internal.imageDisplayValidateParams (line 27)
common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 78)
common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 223)
[common_args,specific_args] = ...
Error in xd (line 2)
imshow(I)
what is the solution ?
Réponses (1)
Walter Roberson
le 5 Jan 2016
What does size(pet) report? If it shows a 4 dimensional image, and you have the Image Processing Toolkit, try implay(pet)
3 commentaires
Ronnie II Concepcion
le 17 Avr 2020
Hi! I am trying to extract RGB channels from a colored picture and the resulting size and data type of each RGB component is MxNx7 uint8. I need to change the size to MxNx3. I think we have the same challenge. May I know how you resolved it? Thanks.
Walter Roberson
le 17 Avr 2020
Please show imfinfo() of the file.
Possibly the code I showed above would work,
tiff_image = imread('AppropriateFileName.tif');
tiff_image = tiff_image(:,:,1:3);
However, in my experience, TIFF with 7 channels are typically multispectra and do not necessarily have RGB or the RGB might not be the first three channels. I have found that most people who have TIFF with 7 channels want to synthesize an RGB image from multispectra data, typically hoping to include two channels of infrared from satellites.
Voir également
Catégories
En savoir plus sur Image Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!