필터 지우기
필터 지우기

error in displaying an image in axes of GUI

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2013년 3월 18일
댓글: Walter Roberson 2015년 12월 19일
sir.... i cant load the image in the following link....
it is showing error as
??? 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 ==> denoisemain>Select_Callback at 87
imshow(image);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> denoisemain at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)denoisemain('Select_Callback',hObject,eventdata,guidata(hObject))
please can anyone help me to rectify this error....
  댓글 수: 6
Walter Roberson
Walter Roberson 2013년 3월 18일
The image is an RGB image that contains alpha data. You will need to use
if size(inputImage,3) == 4 %alpha
inputImage = inputImage(:,:,1:3); %strip alpha
end
if size(inputImage,3) == 3
inputImage = rgb2gray(inputImage); %convert to grayscale
end
Elysi Cochin
Elysi Cochin 2013년 3월 18일
thank u sir.... saved lot of my time.... thank u sir...

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

채택된 답변

Keshav Dev Singh
Keshav Dev Singh 2015년 12월 19일
편집: Walter Roberson 2015년 12월 19일
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,
Keshav
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 12월 19일
Keshav,
In MATLAB, the third dimension is interpret as color channels, and MATLAB currently only supports displaying in RGB (though Alpha can also be used in calling sequences.)
To show multiple layers, you need to image() or imagesc() or imshow() all of them into the same place, and you need to specify AlphaData so that the parts below them are transparent in appropriate places.
For example,
image(A);
hold on
image(B, 'AlphaData', double(B~=0));
image(C, 'AlphaData', double(C~=0));
image(D, 'AlphaData', double(D~=0));
hold off
Here, D will show up in the places that D is non-zero, and in the places that D is 0 you will be able to see what is underneath. Underneath will show C in the places it is non-zero and it will show underneath that for the places C is zero, and so on.
In the special case where the images are all the same size and none of them are non-zero where any of the others are non-zero, then you can use
image(A+B+C+D);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by