Tuesday, April 7, 2015

Matlab visualization

hold on;
plot(y,x,'o',color,marker,'markersize',msz);
clf;

drawBoundary([],regions,color,width);

[x,y]=find(ucm>.1);plot(y,x,'r.','markersize',1)

h=iimagesc(b);
set(h,'AlphaData',0.5);



clf;
id=125;
name=ds.imnames{id};
mat=load(fullfile(ds.spdirs.slic,[name,'_slic_k600_m15.mat']));
im=mat.im;
p=load(['/share/data/vision-greg/harry/aeroplane/',name,'_pos.mat']);
pos_res=p.pos_res;
pos_res=pos_res';
t=cell2mat(pos_res);
t1=t(:,1);
t2=t(:,2);
imshow(im);
hold on;
plot(t2+17,t1+17,'o','Color','magenta','Marker','x','MarkerSize',8);
ucm=ds.loadUCM(id);
ucm=ucm>0.1;
hold on;
h=imagesc(ucm);
set(h,'AlphaData',0.4);

clf;
im2=rgb2gray(im);
samples=GetSamplePointsUCM(im2,ucm);
t3=samples(:,1);
t4=samples(:,2);
imshow(im);
hold on;
plot(t4,t3,'o','Color','magenta','Marker','x','MarkerSize',8);

clf;
gt=ds.loadGT(id);
gt=gt.groundTruth{1}.Segmentation;
gt(gt==255)=0;
gt=gt>1;
imshow(im);
hold on;
h2=imagesc(gt);
set(h2,'AlphaData',0.4);

No comments:

Post a Comment