-8
誰能告訴我for
-loop中發生了什麼?MATLAB代碼說明
%find slopes of each line
m1 = diff(line1_start_end_points(:,2))/ diff(line1_start_end_points(:,1))+0.1/(2*pi);
m2 = diff(line2_start_end_points(:,2))/ diff(line2_start_end_points(:,1))+0.1/(2*pi);
m3 = diff(line3_start_end_points(:,2))/ diff(line3_start_end_points(:,1))+0.1/(2*pi);
%====================find longest scratch on each line==========================
if (line1_flag==0)
x = line1_start_end_points(1,1);
y = line1_start_end_points(1,2);
% iterate through the height of the image
for i=1:COLS
final_line1(:,i)=[y + m1*(i-x) i]';
gray_image_copy1(floor(y+m1*(i-x)), i) = 255;
hough_in_new1(:,i)=0;
hough_in_new1(floor(y+m1*(i-x)),i)=1;
end
end
.... .... ....
.... .... ....
我寫:繪製直線,逐像素,上零數組 – user2999345