Giter Site home page Giter Site logo

lane_detection_matlab's People

Watchers

 avatar

lane_detection_matlab's Issues

Questions about the understanding of the program

%% Turn Prediction

%------------------Turn Prediction---------------

Yellow_dir = cross([left_plot(1,1), left_plot(1,2), 1], [left_plot(2,1), left_plot(2,2), 1]);
Yellow_dir = Yellow_dir ./ sqrt(Yellow_dir(1)^2 + Yellow_dir(2)^2);
theta_y = atan2(Yellow_dir(2), Yellow_dir(1));
rho_y = Yellow_dir(3);
yellow_line = [cos(theta_y), sin(theta_y), rho_y];

%-------------Finding vanishing point using cross poduct---------------
white_dir = cross([right_plot(1,1),right_plot(1,2),1], [right_plot(2,1),right_plot(2,2),1]);
white_dir = white_dir ./ (sqrt(white_dir(1)^2 + white_dir(2)^2));
theta_w = atan2(white_dir(2),white_dir(1));
rho_w = white_dir(3);
white_line = [cos(theta_w), sin(theta_w), rho_w];

line1 = [0, 1, -left_plot(2,1)];
point_on_w_lane = cross(line1,white_line);
point_on_w_lane = point_on_w_lane ./ point_on_w_lane(3);
line2 = [0, 1, -left_plot(2,2)];
point_on_w_lane_2 = cross(line2,white_line);
point_on_w_lane_2 = point_on_w_lane_2 ./ point_on_w_lane_2(3);

vanishing_point = cross(yellow_line, white_line);
vanishing_point = vanishing_point ./ vanishing_point(3);
vanishing_ratio = vanishing_point(1) / size(frame, 2);

if vanishing_ratio > 0.47 && vanishing_ratio < 0.49
    direction = 'Turn Left';
elseif vanishing_ratio >= 0.49 && vanishing_ratio <= 0.51
    direction = 'Go Straight';
else
    direction = 'Turn Right';
end

This program is similar to what you wrote, although the program has a module annotation, but I can't understand how it shows that algorithm through a program. ,I really need your help. You can also send it to my email [email protected], thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.