Error in displaying .TIF images in MATLAB
조회 수: 29 (최근 30일)
이전 댓글 표시
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
Soumyadip Ray Cahudhuri
2019년 7월 31일
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 ?
답변 (1개)
Walter Roberson
2016년 1월 5일
What does size(pet) report? If it shows a 4 dimensional image, and you have the Image Processing Toolkit, try implay(pet)
댓글 수: 3
Ronnie II Concepcion
2020년 4월 17일
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
2020년 4월 17일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!