function z = getLinePoint(row,frame,Ishadow,Icontrast,sizex) str = sprintf('output_%05d.jpg',frame); img = rgb2gray(imread(str)); imshad = (double(img) - Ishadow).*im2bw(1/256*Icontrast,30/256); for i = sizex:1 if imshad(row,i) > 0 z = [i,row]; return; end end z = [-1, -1]; return;