# 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
#Note: The technique (image processing) used to solve this Machine Learning problem is outdated now. You would be able to achieve better results if you use YOLOv3 (https://pjreddie.com/yolo/) object detector for truck detection and character recognition and fine-tuning of VGG16 model for character segmentation.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
项目的主要目标是使用深度学习和机器学习算法识别超速车辆。从视频中采集一系列图像后,使用Haar级联分类器检测卡车。分类器的模型使用大量正反图像进行训练,生成一个XML文件。然后跟踪车辆,并根据其各自的位置、ppm(每米像素数)和fps(每秒帧数)估计其速度。现在,已识别卡车的裁剪图像被发送用于车牌检测。CCA(连通成分分析)有助于车牌检测和字符分割。SVC模型使用字符图像(20X20)进行训练,为了提高精度,还进行了4次交叉验证(机器学习)。该模型有助于识别分割字符。识别后,计算出的卡车速度与车牌号一起输入excel表格。这些卡车还分配了一些ID,以生成一个系统化的数据库。
资源推荐
资源详情
资源评论
收起资源包目录
Speed-Estimation-of-Vehicles-with-Plate-Detection-master.zip (8个子文件)
Speed-Estimation-of-Vehicles-with-Plate-Detection-master
myhaar.xml 367KB
Images
License_Plate_Detection.jpg 90KB
Speed_estimation.jpg 80KB
Truck_detected.jpg 38KB
Characters_segmentation.jpg 42KB
Speed_Estimation_&_License_Plate_Detection.py 35KB
finalized_model.sav 1.95MB
README.md 5KB
共 8 条
- 1
资源评论
- m0_541589782023-11-30资源很受用,资源主总结的很全面,内容与描述一致,解决了我当下的问题。
- liuxinhubei2022-10-27内容与描述一致,超赞的资源,值得借鉴的内容很多,支持!
自不量力的A同学
- 粉丝: 47
- 资源: 2711
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 历届(第1-21届)希望杯数学竞赛初一试题及答案(最新整理).doc全国数学邀请赛(264页资料)
- 水滴.psd
- TokenPocket_V2.1.2_release.apk
- Apache-druid-kafka-rce.yaml
- 基于C#的ASP.NET数据库原理及应用技术课程指导平台的开发
- 基于ROS的智能车轨迹跟踪算法的仿真与设计源码运用PID跟踪算法.zip.zip
- Bug Bounty Tip - i春秋Self-XSS变废为宝的奇思妙想
- 1991-2015年全国初中化学竞赛复赛试题汇编(212页)(24年竞赛复赛真题).docx天原杯
- Apache Flink 未授权访问+远程代码执行.pdf
- hadoop-基于hive的聊天数据分析报表可视化案例数据源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功