function img=compensated_image(img1,disparity)
[m,n]=size(img1);
img=zeros(m,n);
for i=1:m
    for j=1:n
        if (j+ disparity(i,j)>n)
            j
            disparity(i,j)
        end
        img(i,j)=img1(i,j+disparity(i,j));
    end
end
end

