Help Topics

Thank you for your interest in LaneIdentificationPro. This page will cover some general topics that will help you better understand how lane identifiation works in the app and explain how you can play with some of the advanced settings to suit your needs.

Mounting your phone/tablet

Mount your phone/tablet horizontally near the center of your windscreen so the camera lens is facing the middle of the lane. Make sure you place it as high as possible with the camera tilted slightly downward so the lanes are clearly visible on screen. The bottom edge of the screen should be just above the hood of your car such that you cannot see any part of your car but the road visible just beyond your hood is captured on screen. Now proceed to setup the Region of Interest as explained below.

Region of Interest

The Region of Interest represents the area of the screen where we expect lane lines to be present. To view what this looks like, check the "Display Region of Interest" checkbox on the Display Settings menu and go back to the camera view. It should look like a trapezoid on your screen. This is because from your perspective inside a vehicle, the edges of the lanes converge towards an imaginary point in the center.

It is important to make sure the Region of Interest is large enough so it covers the area of the screen where the driving lane is usually present. However, making this as large as possible will have a negative impact on performance as well as lead to bad lane detection. You don't expect to find road lanes in the sky or in the trees, so why even try to look for them there?

You can configure the size of the Region of Interest under the "Basic Line Identification Settings" using the following three parameters:

Display Settings

The Display Settings allows you to configure the type of information you want to view on your screen. The information from the camera can be displayed to you in the following three formats:

Image Filtering

The image filtering process involves taking our input image and manipulating it with the goal of highlighting the lane markers to make it easier for the canny edge detection algorithm to identify the lane lines. We select everything that either looks yellow or very white in the input image. The "Auto Detect White Threshold" under the "Advanced Lane Identification Settings" looks at the pixel intensities in the input image to determine what the brightest pixels on screen look like. The target percentile represents how bright the lane marker pixels need to be. For example, a value of 90 here means any pixel in the image should be brighter than 90% of all pixels in the region of interest to be considered a candidate for a lane marker.

We strongly recommend you leave the auto detect white threshold setting on. It will help the algorithm automatically adjust itself between input images of lanes in bright sunlight vs shade. However if you have severe performance issues, you can try disabling this option and specify a custom threshold level. We also apply a gaussian blur to the image to even out edges. Again, if you are experiencing performance issues, you can try reducing the kernel size or disabling it.

Canny Edge Detection

The Canny edge detection algorightm is a very popular and efficient method to detect edges in an image. We allow you to configure all parameters of this algorithm including its low threshold, high threshold, aperture size and whether to use an L1 or L2 gradient. If you are interested in the details of this algorithm, please refer to documentation available on the internet for what these parameters mean.

With respect to our LaneIdentificationPro App, changing the low and high thresholds will not make much of a difference because we are already applying a binary threshold in creating our filtered image. However if you are applying a lot of gaussian blur, you can try playing with this setting. You can also try disabling the L2 gradient if you are experiencing performance issues.

Probabilistic Hough Line Transform

We use a probabilistic Hough Line Transform to detect lane lines from the canny edge detection output. We also make some of the settings of this algorithm such as the Hough Threshold, Min Line Length and Max Line gap configurable in our advanced settings. You can find more documentation about the algorithm and what these parameters mean on the internet.

In general, if you are not seeing lanes being identified, try reducing the Hough Threshold and Min Line Length and increasing the Max Line gap. Note this will also increase the probability of false positives. If you are seeing too many false positivies or lanes are very "jerky" try a higher value of Hough Treshold and Min Line Length and reduce the Max Line gap.

Slope Thresholds

The idea behind slope thresholds comes from the fact that any valid lane line is expected to have a certain orientation from the perspective inside the car. The App lets you set the mininum slope for the left and right lanes to exclude any horizontal lines that cannot possibly represent the real lane markers. Note the coordinate system here has the origin at the top left corner and because of this the left lane will have a negative slope and the right lane will have a positive slope.

We also allow users to specify a maximum total slope computed by adding the absolute slope values of each lane to exclude bad lane identification. The idea here again has to do with perspective. For a lane with equal width, the lane lines identified should converge at some point. If the total slope here is very high (ie the lines are close to vertical), we are either out of the lane or the lane is widening which is unlikely.

Lane Stabilizer and Sanity Checks

The Lane Stabilizer settings let you specify how much the identified lane lines are allowed to shift between frames. Remember lanes in the real world are expected to be fairly stable. So if our algorithm is detecting lanes jumping around a lot, it is more likely that our line identification algorithm is seeing the impact of noise in the data and we want to try and smoothen this out.

The "Smoothening Threshold Top" and "Smoothening Threshold Bottom" represent the maximum number of pixels the top and bottom of the lane lines are allowed to move along the x-axis between frames. The "Smoothening Threshold Depth" represents how far the lane lines are drawn along the y-axis.

The sanity checks just represents a more extreme version of the smoothening where if the new lane identified is outside this threshold, it is discarded as a bad identification. The "Lane Shift Threshold" represent the threshold number of pixels the new line has to be within (along the x-axis) compared to the old line in order to be considered as valid. The "Bad Lane Discard Threshold" represents the threshold number of frames after which the last known lane line is discarded as being out of date. For example, if the Lane Shift Threshold is set to 50 pixels and the Bad Lane Discard Threshold is set to 5 frames, then the old lane is discarded if have seen more than 5 frames where the new lane identified was outside the 50 pixel threshold of the old lane. Finally the "Lane Disable Threshold" represents the number of frames after which we stop drawing the lane on screen if no new lane has been identified. For example, if this threshold is set to 48, it means the lane currently drawn on screen will disapper if we go through 48 frames without identifying the new lane lines.

Lane Departure Warning

The app also offers a simple Lane Departure Warning alert based on the identified lanes. The visual alert is on by default and an audio alert can also be enabled by setting the "Enable LDW Audio Alert" parameter under the Basic Lane Identification settings.

The alert works by looking for identified lanes with a given set of bounds around the center of the screen. The bounds for an LDW event can be updated using the "Lane Departure Threshold" setting under the Advanced Lane Identification Setting. This value is represented as a perentage of the screen width from the center on either side. To view the current bounds, enable the "Display LDW Bounds" setting under the Display settings and go back to the camera view. You should see two vertical lines representing the bounds as specified by the "Lane Departure Threshold" parameter.

Once a Lane has been identified within these bounds, a LDW event is said to be in progress. If the number of times such an event is observed exceeds the value noted in the "LDW Trigger Thresold" setting under the Advanced Lane Identification Settings, a LDW alarm is triggered.