LaneDetection

LaneDetection

CODE: LaneDetection

车道线检测的方法步骤:

(1)选择感兴趣的区域(ROI也就是车道线存在的区域):我们利用架好相机的特点,使得相机拍摄的车道线位于图像的下半部分,也就是图像的下半部分是道路。

        通过这样做,我们不需要找到消失点,并且图像的下半部分被考虑用于进一步处理。 考虑到计算消失点所需的计算开销,它给出了一个很好的近似。

(2)ROI的预处理:

        与日间图像不同,夜视几乎不提供图像的任何颜色属性,而是为我们提供车道线的唯一的颜色集合(也就是说夜间就是单纯的黑白图像)。 除了仅仅微小的色调变化和低饱和度水平,甚至这样的图像的亮度变化是非常弱并且高度依赖于外部照明(如路灯,车辆的尾灯/头灯,信号和眩光,因为所有这些)。

        要获得每个像素的强度值,我们将颜色空间从RGB更改为黑白(彩色图像-> 二值图像)。

        这有助于更快的计算,而不拒绝任何有价值的信息。 不良的照明条件可能会使图像更难以处理,并可能导致错误的结果。 为了避免这种情况,应用中值滤波。 获取窗口大小为5的方核,并在整个图像上通过。

(3)大概的车道线分割:在车道线检测之前去识别大概的车道标记部分。

              Eq 1:

基于上述参数选择可能的车道标线。 δ表示车道宽度。 车道相对于其侧面的强度更亮,只有当两侧都较暗并且任一侧的强度值差的和在给定范围之间时,则仅将像素视为车道分段的一部分。 使用多个样品点计算范围并绘制它们。 基于输出图像的照明条件,发现其在0.25和0.75之间变化,其在预处理之后,用于更好的对比度和亮度的图像可以理想地选择为大约0.5。 任何差异小于噪声或非车道部分。 由于透视,车道宽度基于距离而变化。 在基地附近是最大的,而在消失点附近,它是最小的。 使用以下公式计算图像的任何行(r)处的通道宽度:

Eq 2:

max和min表示给定图像中可能的最大和最小车道宽度。 保持ε值5有助于避免噪声。 最大值取决于图像尺寸和安装的相机位置。 如果照相机保持非常低,则由于高透视并且更接近车道,与照相机安装在顶部上的时间相比,在基座附近的车道宽度将更大。 默认最小值在消失点始终保持为0; 否则可以根据需要进行调整。 一旦设置了max,上述公式可用于动态地在不同距离处获得车道宽度。 动态改变车道宽度有助于准确选择车道。

(4)从上面的预处理仅能获取大概车道线的部分:

上述分割过程通常选择其他不需要的噪声或类似于车道的区域(例如,里程碑,车辆的边缘,栏杆,树木,灯柱,车头灯眩光等)。

我们利用了一个车道段的几何特征,并基于它的属性,我们只选择了有效段。 首先使用[Suzuki85]算法1从上述二值图像中选择轮廓。然后在其周围绘制最小面积矩形以获得其取向,长度和宽度性质。

车道线性质的考虑:

段区域。 minArea阈值以下的段的面积表示不需要的对象,因此被拒绝。

考虑的车道段性质是:

段区域。 minArea阈值以下的段的面积表示不需要的对象,因此被拒绝。

边的比率。作为线段,其长度与宽度的比率应当至少大于4:1。仅考虑具有较高比率的区段。具有小于某个阈值但大于minArea的区域的片段可能表示小的断裂的中心车道标记,并且因此它们的比率被降低到2:1。

方向。车道段凭借其性质从不接近水平(除非遇到非常陡的转弯)。这个属性帮助我们删除突出的车辆保险杠和其他部分,否则被视为误报。

只有当车辆在车道上时,垂直车道段才是可能的,在这种情况下,车道段将仅靠近图像的底部中心区域。检测到的每隔一个垂直段不能是通道,因此被丢弃。

最小区域矩形被限制到检测到的段。车道非常接近矩形,如果段区域不接近边界矩形的区域,则段被拒绝。

RESULT:


  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
# Author: Mohamed Aly <malaa@caltech.edu> # Date: 10/7/2010 ============================================================================ REAL TIME LANE DETECTOR SOFTWARE ============================================================================ This package contains source code and dataset that implements the work in the paper [1]. ========= Contents ========= src/: contains the C/C++ source files |_ CameraInfo.conf: contains the camera calibration ifo |_ CameraInfoOpt.*: contain gengetopt files for parsing the camera info files |_ cmdline.*: contains gengetopt files for parsing command lines |_ InversePerspectiveMapping.*: code for obtainig the IPM of an image |_ LaneDetector.*: code for the bulk of the algorithm, including Hough Transforms, Spline fitting, Post processing, ... |_ Lanes.conf: the typical configuration file for lane detection |_ main.*: code for the main binary |_ Makefile: the Make file |_ mcv.*: contain utility functions |_ ranker.h: code for obtaining the median of a vector |_ run.sh: Shell script for running the detector on the four clips in Caltech Lanes Dataset matlab/: contains the Matlab source files |_ ccvCheckMergeSplines.m: checks if two splines are matching |_ ccvEvalBezSpline.m: returns points on a spline given its control points |_ ccvGetLaneDetectionStats.m: computes stats from detections and ground truth |_ ccvLabel.m: handles the ground truth labels |_ ccvReadLaneDetectionResultsFile.m: reads a detection file output from the binary file LaneDetector32/64 |_ Stats.m: computes stats for the detections on the Caltech Lanes Dataset and its ground truth labels ============== Prerequisites ============== 1. OpenCV 2.0 or higher http://sourceforge.net/projects/opencvlibrary/ 3. (Optional) Gengetopt http://www.gnu.org/software/gengetopt/ =========== Compiling =========== Unzip the archive somewhere, let's say ~/lane-detector: unzip lane-detector.zip -d ~/lane-detector cd ~/lane-detector/src make release This will generate LaneDetector32 or LaneDetector64 depending on your system. ====================== Caltech Lanes Dataset ====================== To view the lane detector in action, you can download the Caltech Lanes Dataset available at http://www.vision.caltech.edu/malaa/datasets/caltech-lanes =========== Running =========== To run the detector on the Caltech Lanes dataset, which might be in ~/caltech-lanes/ cd ~/lane-detector/ ln -s ~/caltech-lanes/ clips cd ~/lane-detector/src/ bash run.sh This will create the results files inside ~/caltech-lanes/*/list.txt_results.txt To view the statistics of the results, open Matlab and run the file: cd ~/lane-detector/matlab/ matlab& >>Stats ====================== Command line options ====================== LinePerceptor 1.0 Detects lanes in street images. Usage: LinePerceptor [OPTIONS]... [FILES]... -h, --help Print help and exit -V, --version Print version and exit Basic options: --lanes-conf=STRING Configuration file for lane detection (default=`Lanes.conf') --stoplines-conf=STRING Configuration file for stopline detection (default=`StopLines.conf') --no-stoplines Don't detect stop lines (default=on) --no-lanes Don't detect lanes (default=off) --camera-conf=STRING Configuration file for the camera paramters (default=`CameraInfo.conf') --list-file=STRING Text file containing a list of images one per line --list-path=STRING Path where the image files are located, this is just appended at the front of each line in --list-file (default=`') --image-file=STRING The path to an image Debugging options: --wait=INT Number of milliseconds to show the detected lanes. Put 0 for infinite i.e. waits for keypress. (default=`0') --show Show the detected lines (default=off) --step Step through each image (needs a keypress) or fall through (waits for --wait msecs) (default=off) --show-lane-numbers Show the lane numbers on the output image (default=off) --output-suffix=STRING Suffix of images and results (default=`_results') --save-images Export all images with detected lanes to the by appending --output-suffix + '.png' to each input image (default=off) --save-lanes Export all detected lanes to a text file by appending --output-suffix + '.txt' to --list-file (default=off) --debug Show debugging information and images (default=off) =========== References =========== [1] Mohamed Aly, Real time Detection of Lane Markers in Urban Streets, IEEE Intelligent Vehicles Symposium, Eindhoven, The Netherlands, June 2008.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MachineLP

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值