The graph point is judged by the position of the line (the point is between the two lines)

Source: Internet
Author: User
Application situation:

Give a series of lane lines (end ends), hoping to find out which lane the car is in. Lane lines are not parallel to each other because the data originates from image projections.

Scenario A:

assuming that the lane line is around 90 degrees, you can directly use the x-coordinate of the point and the average x-coordinate distance at both ends of the lane line. Take the two closest lines from the x-coordinate

Programme B:

Further extended to a straight line in any direction, you can find the distance from the point to the lane line. Take points to the nearest two lines from the line

Reference: point to line y = kx + b Distance distance = ABS (k * point.x-point.y + b)/sqrt (k * k + 1);

Programme c:

After you remove the proportional relationship between segments, the previous method will not work.

This calculates the angle between the point and the 4 endpoint of the adjacent segment. If 4 angles (between adjacent lines) and 360 degrees, the pair of segments.

Reference: Vertex (x, y) with an angle of 2 points (xa, ya), (XB, YB) on the Edge a = ABS (Arctan ((ya-y)/(Xa-x)) –arctan ((yb-y)/(xb-x));

The graph point is judged by the position of the line (the point is between the two lines)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.