[EDIT: 20110519 14:00 CDT – reformat – WDR]
Hi all ,
I am trying to estimate the value of Z for each pixel value of Disp image . When I am executing it , It stuck in infinite loop . Here Z= (focallength*baseline)/Disp so that in each iteration i can estimate a value of Z for the corresponding Disparity pixel value .
focallength = 1.0 ;baseline = 10.0 ;Disp=imread('D1_000000.png');Disp=(double(Disp)/.256);[height width] = size(Disp);%X = zeros (height,width);
%Y = zeros (height,width);
Z = zeros (height,width);for j=1:height for i=1:width if (Disp(j,i)==0) Disp(j,i)=NaN; X(j,i)=NaN; Y(j,i)=NaN; Z(j,i)=NaN; else Z = (focallength * baseline )./ Disp(j,i) end end end
Best Answer