{"id":18574736,"url":"https://github.com/maxritter/sdc-vehicle-lane-detection","last_synced_at":"2025-10-08T21:28:42.683Z","repository":{"id":149103111,"uuid":"89685872","full_name":"maxritter/SDC-Vehicle-Lane-Detection","owner":"maxritter","description":"I am using an ensemble of classic computer vision and modern deep learning techniques, to detect the lane lines and the vehicles on a highway. This project was part of the Udacity SDC Nanodegree.","archived":false,"fork":false,"pushed_at":"2017-04-28T08:41:07.000Z","size":3778,"stargazers_count":48,"open_issues_count":0,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T21:04:29.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxritter.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-28T08:33:42.000Z","updated_at":"2024-06-11T21:24:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"36c8b416-0974-4be3-8445-ac5d789b76cd","html_url":"https://github.com/maxritter/SDC-Vehicle-Lane-Detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxritter/SDC-Vehicle-Lane-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxritter%2FSDC-Vehicle-Lane-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxritter%2FSDC-Vehicle-Lane-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxritter%2FSDC-Vehicle-Lane-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxritter%2FSDC-Vehicle-Lane-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxritter","download_url":"https://codeload.github.com/maxritter/SDC-Vehicle-Lane-Detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxritter%2FSDC-Vehicle-Lane-Detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268658105,"owners_count":24285633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:16:14.137Z","updated_at":"2025-10-08T21:28:37.227Z","avatar_url":"https://github.com/maxritter.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Vehicle and Lane Detection** \n\nIn this project, vehicles are detected using a deep learning approach with a full-convolutional network and lane lines are detected using classic computer vision techniques.\n\nThis project was part of the Udacity Self-Driving Car Engineer program. \n\nCheck out the final video here:\n\n[![Everything Is AWESOME](https://img.youtube.com/vi/YOwAQH2Mkpw/0.jpg)](https://www.youtube.com/watch?v=StTqXEQ2l-Y \"Everything Is AWESOME\")\n\n---\n\n**Vehicle detection**\n\nIn the first step, the dataset is explored. It is comprised of images taken from the GTI vehicle image database, the KITTI vision benchmark suite, and examples extracted from the project video itself. There are two classes, cars and non-cars. The cars have a label of 1.0, whereas the non-cars have a label of 0.0:\n\n\u003cimg src=\"./images/sample_images.PNG\" width=\"600\"\u003e\n\nThere is a total number of 17760 samples available, each image is colored and has a resolution of 64x64 pixels. The dataset is split into the training set (90%, 15984 samples) and validation set (10%, 1776 samples). The distribution shows, that the dataset is very balanced, which is important for training the neural network later. Otherwise, it would have a bias towards one of the two classes. The distribution looks like this:\n\n\u003cimg src=\"./images/distribution.png\" width=\"300\"\u003e\n\nA neural network is used as deep-learning approach, to decide which image is a car and which is a no-car. The fully-convolutional network looks like this:\n\n\u003cimg src=\"./images/model.PNG\" width=\"400\"\u003e\n\nAfter training for 20 epochs, we can use this model to make a prediction on a random sample:\n\n\u003cimg src=\"./images/prediction.PNG\" width=\"200\"\u003e\n\nNext, we feed a full 1280 x 720 test image into our network:\n\n\u003cimg src=\"./images/sample.jpg\" width=\"400\"\u003e\n\nThe nice thing is that we can use the same network we trained with our 64x64 images to detect cars everywhere in the frame. This is because there are no fully-connected neurons at the end, just convolutional layer with max pooling and dropout. They scale to whatever the input is, so now we do not have a one-neuron output, but something like a heatmap. We can then draw bounding boxes on the hot positions:\n\n\u003cimg src=\"./images/bboxes.PNG\" width=\"400\"\u003e\n\nThere may be some false positives, so we create a heatmap and add a little threshold to it. Then we draw one bounding box for every detected heat source:\n\n\u003cimg src=\"./images/detection.PNG\" width=\"600\"\u003e\n\n---\n\n**Lane detection**\n\nIn this section I will explain, how I detected the two lane lines on the road for each frame using computer vision techniques.\n\nThis is the test image we will be using:\n\n\u003cimg src=\"./images/pipeline_test.jpg\" width=\"400\"\u003e\n\nAt first we apply a region-of-interest mask to remove everything except for the interesting section:\n\n\u003cimg src=\"./images/pipeline_roi.png\" width=\"400\"\u003e\n\nThen we apply a perspective transformation to better detect the lanes:\n\n\u003cimg src=\"./images/pipeline_transformation.png\" width=\"400\"\u003e\n\nIn the next step, a HSV color mask is applied to detect the white and yellow lanes:\n\n\u003cimg src=\"./images/pipeline_hsv.png\" width=\"400\"\u003e\n\nA sobel filter is utilized to detect edges:\n\n\u003cimg src=\"./images/pipeline_sobel.png\" width=\"400\"\u003e\n\nAfterwards, those two masks are combined:\n\n\u003cimg src=\"./images/pipeline_colormask.png\" width=\"400\"\u003e\n\nA histogram is used to search for the starting points of the lanes on the bottom:\n\n\u003cimg src=\"./images/pipeline_hist.png\" width=\"400\"\u003e\n\nThose are handed over to a sliding window, which tracks the lanes to the top and creates a function approximation:\n\n\u003cimg src=\"./images/pipeline_slidingwindow.png\" width=\"400\"\u003e\n\nFinally, the functions are transformed back to our images and the area between the lanes is marked in blue:\n\n\u003cimg src=\"./images/pipeline_result.png\" width=\"400\"\u003e\n\n---\n\n**Further read**\n\nThere are a lot other fast approaches for the use of neural networks on the task of object detection. In 2014, the [\"R-CNN\"](https://arxiv.org/abs/1311.2524) was first announced, which adds region proposals to a CNN. R-CNN creates these bounding boxes, or region proposals, using a process called Selective Search. At a high level, Selective Search looks at the image through windows of different sizes, and for each size tries to group together adjacent pixels by texture, color, or intensity to identify objects. \n\nTo speed up and simplify R-CNNs, in 2015 a technique called [\"Fast R-CNN\"](https://arxiv.org/abs/1504.08083) was introduced. One year later, the region proposal was speeded up even further with [\"Faster R-CNN\"](https://arxiv.org/abs/1506.01497). The newest development from 2017 is [\"Mask R-CNN\"](https://arxiv.org/abs/1703.06870), which extends R-CNN for pixel level segmentation. Interesting approaches are also [\"SqueezeDet\"](https://arxiv.org/abs/1612.01051), a [\"SqueezeNet\"](https://arxiv.org/abs/1602.07360) adaptation for object detection in the field of autonomous driving and the [\"YOLO9000\"](https://arxiv.org/abs/1612.08242) object detection network, which is really fast and delivers astonishing results:\n\n\u003cimg src=\"./images/yolo.png\" width=\"400\"\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxritter%2Fsdc-vehicle-lane-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxritter%2Fsdc-vehicle-lane-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxritter%2Fsdc-vehicle-lane-detection/lists"}