-8
Quelqu'un peut-il me dire ce qui se passe dans le for
-loop?MATLAB Code explication
%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
.... .... ....
.... .... ....
Je l'ai écrit: tracer une ligne droite, pixel par pixel, sur une tableau de zéros – user2999345