Code Monkey home page Code Monkey logo

dsp6414 / car-speed-detection-opencv-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harshyp47/car-speed-detection-opencv-python

0.0 0.0 0.0 1.03 MB

In this tutorial, you will learn how to detect the speed of a car using Python OpenCV library and some basic mathematical calculations. In the area of traffic management, checking the speed of a vehicle passing through a road becomes very crucial when there is the rule of speed limitations. This Python program exactly checks the speed of the car passing through a specified lane and prints it on the console window.

Python 100.00%

car-speed-detection-opencv-python's Introduction

In this tutorial, you will learn how to detect the speed of a car using Python OpenCV library and some basic mathematical calculations. In the area of traffic management, checking the speed of a vehicle passing through a road becomes very crucial when there is the rule of speed limitations. This Python program exactly checks the speed of the car passing through a specified lane and prints it on the console window.

To do this, you need the footage of cars passing through the road or you can directly take input from any camera device. The camera must be fixed at a specific position so that it can not move in any direction.

In this tutorial, we are using a trained model that can detect the car. These type of files contains the features of a car and provides the advantage to detect a car.

Speed= distance/time. We all know this little formula. Now we are going to implement that in our code. We need to draw a polygon in our footage and we must know the distance (In our case it is 3 meters)  between the two horizontal lines provided in the image link below.

When (x,y) coordinate of detected car strikes to the first line the program will be going to print “Car Entered.” in the console and start to calculate time till (x,y) of a car reaches to the second horizontal line and prints “Car left.” and also prints the speed by using simple formula distance covered(3m in our case)/time taken(which is being calculated). Here (x,y) refers to the coordinate of the top left corner of the rectangle which is being drawn after a successful detection of a car.

See image for better understanding.

car-speed-detection-opencv-python's People

Contributors

harshyp47 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.