the color on image segmented

조회 수: 1 (최근 30일)
nur hanani
nur hanani 2019년 11월 19일
답변: Image Analyst 2019년 11월 19일
below is a part of my coding, i had try insert gray scale image and for figure 2 it produce the image below,
i want to ask where it state about the color produce in figure 2
%Show the results
ifsize(im, 3)==1 % Gray-level image
img=zeros(sz(1),sz(2));
j=1;
imagesc(im); axis off; hold on; colormap gray;
fori=0:k_max-1
LL=(L_global_min==i);
is_zero=sum(sum(LL));
if is_zero
img(:,:,1)=img(:,:,1)+LL*c(j,1);
j=j+1;
end
if i~=i_ground
color=[rand rand rand];
contour(LL,[1 1],'LineWidth',2.5,'Color',color); hold on;
end
end
figure(2);
imagesc(img); axis off;
end

답변 (1개)

Image Analyst
Image Analyst 2019년 11월 19일
imagesc() applies it's own crazy idea of how it thinks you want the image pseudocolored, and it's almost always wrong. I suggest you don't use it -- I never do. Use imshow() instead. If you want a colormap, pick one of your own choosing with the colormap() function.

카테고리

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