Giter Site home page Giter Site logo

guptaaniket261 / traffic-density-analyser Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.68 MB

This repository is made to complete Assignment 1 of COP290 (2020-21). It shows the variation of traffic density with time based on some traffic video

C++ 89.42% Makefile 10.24% Gnuplot 0.34%
traffic-analysis opencv cpp video-processing

traffic-density-analyser's Introduction

Steps to run the code of Part1:

  1. Clone this repository using git clone https://github.com/aayushgoyal443/COP290Assignment1 or download as Zip and extract.

  2. To run the code, open the Directory in which Assignment1.cpp file is present.

  3. Put the images whose perspective or view needs to be changed in the same directory as Assignment1.cpp

  4. Build and install OpenCV in your machine if you already haven't. Here are guides to do the same:

  5. Launch the terminal in that directory.

  6. Give the make allpart1 command. This should produce a binary file named "part1" in the same directory.
    (Make sure the Makefile is present in the directory)

  7. Now run the command ./part1 <file_name> . Replace <file_name> with the name of your image file.

  8. If your image file is empty an exception will be raised, otherwise a window named "Original Image" will open.

  9. Click 4 points on this window to choose the points about which you want to change the Homography.
    (You don't need to worry about the order in which you choose the points, the code automatically arranges them in the required order)

  10. You should see 2 new windows on the screen namely, "Projected Image" and "Cropped Image". These images also get saved in the same directory.

  11. Press Escape key to close the windows.

  12. Run make clean to delete the part1 file.

    Note: while changing the homography of an image, you will need to change the values of destination points in the Assignment1.cpp file. This can be done by changing the values stored in the 'a' vector in line 109.

Steps to run the code of Part2:

  1. To run the code, open the Directory in which assignment1_2.cpp file is present.
  2. Put the videos whose Queue Density and Dynamic Density needs to be found in the same directory as assignment1_2.cpp
  3. Launch terminal in that directory.
  4. Give the make allpart2 command. This should produce a binary file named "part2" in the same directory.
    (Make sure the Makefile is present in the directory)
  5. Now run the command ./part2 <file_name> . Replace <file_name> with the name of your video file.
  6. You should see the output in a "out.txt" file. This out.txt has three entries namely Frame number, Queue density, Dynamic density which denote the respective values in this order.
  7. Run make clean to delete the part2 file.

traffic-density-analyser's People

Contributors

aayushgoyal443 avatar guptaaniket261 avatar

Watchers

James Cloos 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.