# Speed-Estimation-of-Vehicles-with-Plate-Detection
The main objective of this project is to identify overspeed vehicles, using Deep Learning and Machine Learning Algorithms. After acquisition of series of images from the video, trucks are detected using Haar Cascade Classifier. The model for the classifier is trained using lots of positive and negative images to make an XML file. This is followed by tracking down the vehicles and estimating their speeds with the help of their respective locations, ppm (pixels per meter) and fps (frames per second). Now, the cropped images of the identified trucks are sent for License Plate detection. The CCA (Connected Component Analysis) assists in Number Plate detection and Characters Segmentation. The SVC model is trained using characters images (20X20) and to increase the accuracy, 4 cross fold validation (Machine Learning) is also done. This model aids in recognizing the segmented characters. After recognition, the calculated speed of the trucks is fed into an excel sheet along with their license plate numbers. These trucks are also assigned some IDs to generate a systematized database.
To run Speed_Detection_&_License_Plate_Detection.py, follow these steps below:
1. Download IDLE python from this site: 'https://www.python.org/downloads/'
2. Install OpenCV and dlib libraries from: 'https://www.learnopencv.com/install-dlib-on-windows/'
3. Install these other libraries as well: skimage, sklearn, openpyxl, threading, time, joblib, numpy, matplotlib, datetime, & os.
4. Through Command Prompt, run this code. (Make sure to change the directories)
Methodology:
1. Image Acquisition: Extracting series of images from a video one by one, then reading them using cv2 (Open Source Computer Vision) library.
2. Trucks Detection: Using Haar Cascade CLassifier
This Algorithm includes 4 stages:
a. Haar Feature Selction
b. Creating Integral Images
c. Adaboost (Adaptive boosting) Training
d. Cascading Classifiers
Functions Used: CascadeClassifier and detectMultiScale
3. Training a machine to make an XML file():
I WAY: Command Prompt Method
a. Collection of Image Database
b. Augmentation: for boosting image database
c. Crop and mark positive images using Objectmarker or Image Clipper
d. Haar Training
Refernce: 'www.cs.auckland.ac.nz/~m.rezaei/Downloads.html'
II WAY: Cascade Trainer (Graphical User Interface)
Install GUI software and specify the values of parameters.
Reference: 'http://amin-ahmadi.com/cascade-trainer-gui/'
4. Tracking the detected trucks using dlib library:
Functions Used:
a. dlib.correlation_tracker()
b. dlib.correlation_tracker().start_track()
c. dlib.rectangle
5. Speed Estimation:
Speed (in km/hr) = Distance Travelled by the detected trucks (in meters) * fps * 3.6
6. CCA (Connected Component Analysis): for detecting License Plate and segmenting Characters
Functions Used: skimage.measure.label and skimage.measure.regionprops
Assumptions used in this code: (change it accordingly)
height of the license plate = 6% - 18% of the height of the cropped truck image
width of the license plate = 8.5% - 20% of the width of the cropped truck image
height of the characters to be segmented = 18.75% - 37.5% of the height of the license plate
width of the characters to be segmented = 5% - 40% of the width of the license plate
7. Support Vector Classifier and Cross Validation (4-fold): for predicting Characters
8. Working with Excel Sheet: Using 'openpyxl' library, the calculated speed of trucks can be fed into the excel sheet along with their license plate numbers. These trucks are assigned some IDs to generate a systemized database.
9. Overspeed Vehicle Enumeration
Limitations:
1. Sometimes, the dlib correlation tracker fails when the scale of the object keeps on changing.
2. The estimated speed is not so authentic because of the expensive scanning and processing time.
3. A good resolution camera ought to be used for predicting non-erroneous license plate characters. Neural Enhance – Super Resolution of images (Deep Learning) can also be used, instead. However it increases the processing time.
4. The license plate, occasionally, are covered with dust or are veiled by a rod in the front or are not even there, thereby not letting the detection possible.
5. Old trucks cannot be identified because the machine is trained using only new models of trucks.
Inspired by https://github.com/apoorva-dave/LicensePlateDetector/blob/master/DetectPlate.py
Reference: https://github.com/kraten/vehicle-speed-check
https://github.com/kraten/vehicle-speed-check/blob/master/myhaar.xml
没有合适的资源?快使用搜索试试~ 我知道了~
Speed-Estimation-of-Vehicles-with-Plate-Detection:该项目的主要目标是使用深度学...
共8个文件
jpg:4个
py:1个
xml:1个
13 下载量 80 浏览量
2021-05-10
17:46:21
上传
评论
收藏 411KB ZIP 举报
温馨提示
带板检测的车辆速度估算 该项目的主要目标是使用深度学习和机器学习算法来识别超速车辆。 从视频中获取一系列图像后,使用Haar Cascade分类器检测卡车。 使用大量正负图像训练分类器模型,以制作XML文件。 接下来是跟踪车辆并借助其各自的位置,ppm(每米像素)和fps(每秒帧)来估计车辆的速度。 现在,已识别卡车的裁剪图像将被发送以进行车牌检测。 CCA(连接组件分析)有助于进行车牌检测和字符分割。 使用字符图像(20X20)对SVC模型进行训练,并且为了提高准确性,还完成了4次交叉折叠验证(机器学习)。 该模型有助于识别分段字符。 识别后,将卡车的计算出的速度及其车牌号一起输入到excel表中。 还为这些卡车分配了一些ID,以生成系统化的数据库。 要运行Speed_Detection _&_ License_Plate_Detection.py,请按照以下步骤操作: 从此站点下载
资源详情
资源评论
资源推荐
收起资源包目录
speed-estimation-of-vehicles-with-plate-detection-master.zip (8个子文件)
Speed-Estimation-of-Vehicles-with-Plate-Detection-master
Speed_Estimation_&_License_Plate_Detection.py 35KB
myhaar.xml 367KB
README.md 5KB
Images
License_Plate_Detection.jpg 90KB
Speed_estimation.jpg 80KB
Truck_detected.jpg 38KB
Characters_segmentation.jpg 42KB
finalized_model.sav 1.95MB
共 8 条
- 1
九九长安
- 粉丝: 20
- 资源: 4534
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0