• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vehicle detection, tracking and counting by blob detection with OpenCV on c++.

Vehicle Detection, Tracking and Counting

This project focuses on detecting, tracking and counting vehicles by using "Blob Detection" method. The unique ID is assigned to the each vehicle so it can not be counted more than once. This project was developed by OpenCV library (version 2.4.10).

The accuray is approximately 95% and developing of the accuracy is in progress.

Click to see another vehicle counting project which is developed by "trained SVM classifier using HOG features".

Theory

Target representation and localization is mostly a bottom-up process. These methods give a variety of tools for identifying the moving object. Locating and tracking the target object successfully is dependent on the algorithm. For example, using blob tracking is useful for identifying, tracking human/vehicle movement because a person's/vehicle's profile changes dynamically. Typically the computational complexity for these algorithms is low. The project utlizes the Blob Tracking module which provides various parameters for connecting blobs on video frames in order to determine movements of vehicles.

What is Blob Detection?

A Blob is a group of connected pixels in an image that share some common property ( E.g grayscale value ). Blob detection methods are aimed at detecting regions in a digital image that differ in properties, such as brightness or color, compared to surrounding regions. Informally, a blob is a region of an image in which some properties are constant or approximately constant; all the points in a blob can be considered in some sense to be similar to each other. The most common method for blob detection is convolution.

How does Blob detection work ?

The algorithm for extracting blobs from an image:

  1. Convert the source image to binary images by applying thresholding with several thresholds from minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between neighboring thresholds.

  2. Extract connected components from every binary image by findContours and calculate their centers.

  3. Group centers from several binary images by their coordinates. Close centers form one group that corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter.

  4. From the groups, estimate final centers of blobs and their radiuses and return as locations and sizes of keypoints.

Project Demo

Installation

Building the project using CMake from the command-line:

Linux:

export OpenCV_DIR="~/OpenCV/build"
mkdir build
cd build
cmake -D OpenCV_DIR=$OpenCV_DIR ..
make 

MacOSX (Xcode):

export OpenCV_DIR="~/OpenCV/build"
mkdir build
cd build
cmake -G Xcode -D OpenCV_DIR=$OpenCV_DIR ..    

Windows (MS Visual Studio):

set OpenCV_DIR="C:\OpenCV\build"
mkdir build
cd build
cmake -G "Visual Studio 12 2013" -D OpenCV_DIR=%OpenCV_DIR% ..  

Citation

If you use this code for your publications, please cite it as:

@ONLINE{vdtc,
    author = "Ahmet ร–zlรผ",
    title  = "Vehicle Detection, Tracking and Counting",
    year   = "2017",
    url    = "https://github.com/ahmetozlu/vehicle_counting"
}

Author

Ahmet ร–zlรผ

License

This system is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

tensorflow_object_counting_api

๐Ÿš€ The TensorFlow Object Counting API is an open source framework built on top of TensorFlow and Keras that makes it easy to develop object counting systems!
Python
1,305
star
2

vehicle_counting_tensorflow

๐Ÿš˜ "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.
Python
851
star
3

signature_extractor

A super lightweight image processing algorithm for detection and extraction of overlapped handwritten signatures on scanned documents using OpenCV and scikit-image.
Python
414
star
4

color_recognition

๐ŸŽจ Color recognition & classification & detection on webcam stream / on video / on single image using K-Nearest Neighbors (KNN) is trained with color histogram features by OpenCV.
Python
301
star
5

augmented_reality

๐Ÿ’Ž "Marker-less Augmented Reality" with OpenCV and OpenGL.
C++
204
star
6

defi_yield_farming

๐Ÿšœ ๐ŸŒพ A DeFi app, which provides staking & farming functions are deploy-able with a website, for yield farming.
JavaScript
142
star
7

face_recognition_crop

Multi-view face recognition, face cropping and saving the cropped faces as new images on videos to create a multi-view face recognition database.
Python
141
star
8

vehicle_counting_hog_svm

Vehicle detection, tracking and counting by SVM is trained with HOG features using OpenCV on c++.
C++
96
star
9

aipa

AIPA (A.I. Personal Assistant): Speech, Vision, Machine Learning and IoT based intelligent personal assistant for Ubuntu based Linux distributions.
Python
48
star
10

real_time_circle_detection_android

Real time circle detection and tracking by Hough Circle Transform with OpenCV on Android OS.
Java
44
star
11

human_computer_interaction

Fist, palm and hand detection & tracking for intelligent human-computer interaction game character movement control with OpenCV on Java (Processing sketchbook).
Processing
44
star
12

unity_calendar_ui

This is a well defined-basic "Calendar UI" for Unity.
C#
24
star
13

arlo_traffic_analysis

Vehicle detection, tracking, counting and speed prediction on videos with OpenCV.
Python
19
star
14

nonlinear_regression_keras

Training of a neural network for nonlinear regression prediction with TensorFlow and Keras API.
Jupyter Notebook
15
star
15

tcp_socket_programming_android_client

TCP Socket Programming implementation of client side on Android.
Java
12
star
16

decentralized_banking_system

๐Ÿฆ Decentralized banking system is a DApp built on Ethereum blockchain with smart contract on solidity.
Solidity
9
star
17

object_detection_chooch

A sample project for super fast real time object detection and counting using CHOOCH AI API and OpenCV.
Python
9
star
18

smart_contract_helloworld

๐Ÿ”ฅ Smart contract hello world tutorial: write and deploy your first Ethereum smart contract!
Solidity
9
star
19

unity_camera_movements

"Main Camera" movements scripts for Unity (for Desktop and Gear VR platforms).
C#
8
star
20

tcp_socket_programming_c_server

TCP Socket Programming implementation of server side in c programming language.
C
8
star
21

the_smart_contract_burger_store

๐Ÿ” ๐ŸŸ A real life case study for developing Ethereum smart contract for businesses: Building a smart contract to manage a burger store.
JavaScript
8
star
22

tensorflow_blob_analysis

A sample project to perform blob analysis on images with TensorFlow and Keras to detect blobs and analyze their shape features such as the presence, number, area, position, length, and direction of lumps.
Python
8
star
23

family_tree_warehouse_app

Ask relation, add/delete/update person, get information of any person, print the family tree, control under 18 age marriage and more...
Python
7
star
24

EncryptedMessengerApplication

Encrypted Messenger App: Sending and receiving messages (over TCP Socket) with high security (powered by RSA and AES).
Java
5
star
25

android_power_monitor

๐Ÿ”‹ Android power monitor hardware with Arduino.
C++
4
star
26

java_native_interface

Java Native Interface to call "Java Code" from "C++ Program".
C++
3
star
27

family_tree

Ask relation, add/delete/update person, get information of any person, print the family tree, control under 18 age marriage and more...
Prolog
3
star
28

pattern_matching

Implementation and performance comparison of Boyer Moore, Horspool and Brute Force in c programming language.
C
1
star
29

ahmetozlu.github.io

1
star
30

ethereum-smart-contract-samples

๐Ÿ’ก Small smart contract examples to understand basics and some details of developing Ethereum smart contracts!
Solidity
1
star
31

SimpleShell

This program is about a simple shell. The shell accepts user commands and then executes each command in a separate process.
C
1
star
32

sample_spring_microservice_case_study

๐Ÿฆ… An inventory management project for providing a sample microservice case study which contains Spring Cloud Eureka server & client, feign client, error handling & fault tolerance, API gateway, Spring Actuator, distributed log trace with Zipkin, centralized configuration and vault integration with Spring Cloud Config.
Java
1
star