Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Finding Lane Lines using Python and OpenCV
| Date | Stars |
|---|---|
| 2026-07-24 | 346 |
| 2026-07-25 | 346 |
| 2026-07-28 | 346 |
| 2026-07-30 | 346 |
| 2026-08-06 | 346 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Finding Lane Lines on the Road
***
[](https://youtu.be/HTPEWC-fjCQ)
[Video Link](https://youtu.be/HTPEWC-fjCQ)
[Digest on Medium](https://medium.com/@naokishibuya/finding-lane-lines-on-the-road-30cf016a1165#.en7kaxeq4)
In this project, I used Python and OpenCV to find lane lines in the road images.
The following techniques are used:
- Color Selection
- Canny Edge Detection
- Region of Interest Selection
- Hough Transform Line Detection
Finally, I applied all the techniques to process video clips to find lane lines in them.
## How to Reproduce the results
To set up the conda environment, execute the following:
```python
conda env create -f environment.yaml
```
Then, activate the environment:
```python
conda activate car-finding-lane-lines
```
Start the jupyter notebook:
```bash
jupyter notebook Finding_Lane_Lines_on_the_Road.ipynb
```
Execute all the cells in the jupyter notebook. The output videos are generated in the `output_videos` folder.
---
The following explains what the codes in the notebook do.
## Test Images
Let's load and examine the test images.

Lines are in white or yellow. A white lane is a series of alternating dots and short lines, which we need to detect as one line.
## Color Selection
### RGB Color Space
The images are loaded in RGB color space. Let's try selecting only yellow and white colors in the images using the RGB channels.
Reference: [RGB Color Code Chart](http://www.rapidtables.com/web/color/RGB_Color.htm)
```python
# image is expected be in RGB color space
def select_rgb_white_yellow(image):
# white color mask
lower = np.uint8([200, 200, 200])
upper = np.uint8([255, 255, 255])
white_mask = cv2.inRange(image, lower, upper)
# yellow color mask
lower = np.uint8([190, 190, 0])
upper = np.uint8([255, 255, 255])
yellow_mask = cv2.inRange(image, lower, upper)
# combine the mask
mask = cv2.bitwise_or(white_mask, yellow_mask)
masked = cv2.bitwise_and(image, image, mask = mask)
return masked
```

It looks pretty good except the two in which the yellow lines are not clear due to the dark shade from the tree on the left.
### HSL and HSV Color Space
Using `cv2.cvtColor`, we can convert RGB image into different color space. For example, [HSL and HSV color space](https://en.wikipedia.org/wiki/HSL_and_HSV).
<img src='images/hsl-hsv.png' width='50%'>
Image Source: [https://commons.wikimedia.org/wiki/File:Hsl-hsv_models.svg](https://commons.wikimedia.org/wiki/File:Hsl-hsv_models.svg)
### HSV Color Space
How does it look when RGB images are converted into HSV color space?
```python
def convert_hsv(image):
return cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
```

The yellow lines are very clear including the ones under the shades but the white lines are less clear.
### HSL Color Space
How does it look like when images are converted from RGB to HSL color space?
```python
def convert_hls(image):
return cv2.cvtColor(image, cv2.COLOR_RGB2HLS)
```

Both the white and yellow lines are clearly recognizable. Also, the yellow lines under the shades are clearly shown.
Let's build a filter to select those white and yellow lines. I want to select particular range of each channels (Hue, Saturation and Light).
- Use `cv2.inRange` to filter the white color and the yellow color seperately.
The function returns 255 when the filter conditon is satisfied. Otherwise, it returns 0.
- Use `cv2.bitwise_or` to combine these two binary masks.
The combined mask returns 255 when either white or yellow color is detected.
- Use `cv2.bitwise_and` to apply the combined mask onto the original RGB image
```python
def select_white_yellow(image):
converted = convert_hls(image)
# white color mask
lower = np.uint8([ 0, 200, 0])
upper = np.uint8([255, 255, 255])
white_Excerpt of 19,130 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:8a45cf2190b4aec5, topic:opencv
matched fp:8a45cf2190b4aec5, topic:self-driving-car