MATLAB: How to measure angle and flame speed from Picture ..

angleaxisflame

i would like to measure:
1) the angle (Θ)of the tip of the flame from the picture.
2) the flame speed from the following equation:
SL= V * sin(Θ) , knowing that V= 130 m/s, and the Θ is what im looking for in number (1)
i need help ASAP, please help!!!!!!

Best Answer

I used this documentation example to build this code:
% find lines
I = imread("5t.JPG");
I1 = rgb2gray(I);
I1 = imbinarize(I1,'adaptive','ForegroundPolarity','bright');
BW = edge(I1,'Sobel');
[H,theta,rho] = hough(BW);
P = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));
lines = houghlines(BW,theta,rho,P,'FillGap',5,'MinLength',100);
% Angle from lines objects
angle_between_lines = abs(lines(1).theta) + abs(lines(2).theta);
fprintf('Angle between lines from Lines objects: %.2f°\n',angle_between_lines);
% calculate angle by the endpoints of the lines for more accurate results
angle_calc = atand((abs(lines(1).point1(1) - lines(1).point2(1))) /...
(abs(lines(1).point1(2) - lines(1).point2(2)))) +...
atand((abs(lines(2).point1(1) - lines(2).point2(1))) /...
(abs(lines(2).point1(2) - lines(2).point2(2))));
fprintf('Angle between lines calculated from endpoints: %.2f°',angle_calc);
% show results
figure(1)
imshow(I)
hold on
for k = 1:length(lines)
xy = [lines(k).point1; lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');
end
hold off
ends in:
and result:
Angle between lines from Lines objects: 67.00°
Angle between lines calculated from endpoints: 67.14°