Imagesc() shows blank image?!

조회 수: 2 (최근 30일)
Sara Salimi
Sara Salimi 2016년 10월 13일
댓글: Sara Salimi 2016년 10월 13일
Hello,
I have a vector that I am using reshape() to create images matrices and show it using imagesc() function every one second; however, it shows a blank images. The result of two classifiers is in Class_T and Class_F. First subplot shows image produced from Class_T, the second subplot shows image produced from Class_F, and the third one shows both.
Does anyone know how can I fix this issue? The code is as follows:
Lx = length(X2); % the number of rows 512
Ly = length(Y2); % the number of columns 512
X_F = []; Y_F = []; Class_F = [];
X_T = []; Y_T = []; Class_T = [];
Class_T = (Score_T_Test(:,2)>0.5)&(Score_T_Test(:,2)>=Score_F_Test(:,2));
Class_F= 0.5*((Score_F_Test(:,2)>0.5)&(Score_T_Test(:,2)<Score_F_Test(:,2)));
for i = 1:length(Z2) %Z2=number of images
subplot(1,3,1)
imagesc(reshape(Class_T((i-1)*Lx*Ly+1:i*Lx*Ly),Lx,Ly)), colormap('gray')
title('T Segmentation')
subplot(1,3,2)
imagesc(reshape(Class_F((i-1)*Lx*Ly+1:i*Lx*Ly),Lx,Ly)), colormap('gray')
title('F Segmentation')
subplot(1,3,3)
Im_Class = max([Class_T Class_F],[],2);
imagesc(reshape(Im_Class(end-Lx*Ly+1:end),Lx,Ly)), colormap('gray')
title('Segmentation')
pause(1)
end
Your help is appreciated.
  댓글 수: 1
KSSV
KSSV 2016년 10월 13일
Check the indices which you have used inside imagesc(). I suspect, the indices are not upto the mark.

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 10월 13일
Your subplots 1, 3, 2 and 1, 3, 3 have invalid code. The semi-colon is not valid syntax there.
  댓글 수: 1
Sara Salimi
Sara Salimi 2016년 10월 13일
Sorry it was typo mistake. It is not working gain.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by