addpath ( genpath ( 'BRISQUE_release' ) );
dir='C:\Documents and Settings\ruigangfang\My Documents\MATLAB\3d\database\livephase2\Phase2';
load ([dir,'\3DDmosRelease.mat'])

dir_save='C:\Documents and Settings\ruigangfang\My Documents\MATLAB\3d\disparity_method4\';

%num=[2 20 21 29 30];
num=[28 29];
[m,n]=size(num);
for i=1:n
    load([dir_save,'data\phase2\disparity_similarity_L\',num2str(num(i)),'.mat']);
    disparity{i}=data{1};
    clear data 
    load([dir_save,'data\phase2\cyclopean_image\',num2str(num(i)),'.mat']);
    img{i}=image;
    clear image
end

for i=1:n
    mins=min(min(disparity{i}));
    maxs=max(max(disparity{i}));
    depth{i}=(disparity{i}-mins)/(maxs-mins)*256;
end

for i=1:n
    figure(2*i-1)
    imshow(img{i})
    figure(2*i)
    imshow(uint8(depth{i}))
end
