Skip to content

1uk4/object-tracking-opencv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Object Tracking Open Cv

A set of projects to learn about Computer Vision

Table of Contents
  1. Getting Started
  2. Car Counter
  3. Poker Hand

Getting Started

This is a python project

Prerequisites

  1. Install all the requirements
pip install -r requirements.txt

Installation

step by step series of examples that tell you how to get a development env running

  1. Install all the requirements
git clone https://github.com/LukaFlores/object-tracking-opencv.git
  1. Change into specific Project Directory (e.g /Car-Counter)
cd Car-Counter
  1. Run the Program
./build.sh

(back to top)

Car Counter

Inspired by youtube project in which goal of the car counter is to track the number of cars that pass north and south on the freeway

How it was done

  1. A mask was overlaid on the video to the area in which the vehicles could be identified. A bitwise * and * function was used to find the shared space of the mask and the video frame Code
Logo
  1. The current frame (with the mask) is then assessed by the Yolo Model, which tries to identify one of the labels in this list, after detection it will produce a list of boxes bounding the object. We are left with the image recognition of vehicles after filtering for objects and confidence.

  2. Abewley's realtime tracking algorithm assesses the age in which the object is not seen throughout frames (max_age), the is the minimum value of hit streak to continue tracking (min_hits) and the common characteristics of a specific object across frames (iou_threshold) Which as a results tracks a specific object across multiple frames.

  3. Finally, to keep counter an origin is placed at the center of each object, once it crosses the respective line it is added to the overall tally.

Car Counter Result

Result

(back to top)

Poker Hand

Inspired by youtube project in which goal is to identify a 5 card poker hand

How it was trained

  1. Dataset was taken from roboflow

  2. The model is trained with ultralytics Yolo using these labels.

  3. I used an Apple M1 Pro Laptop for training using these settings

    • Epochs signify the number of times the model has been through the training data

    • Batch signifies the number of images used for one iteration, the image below is an example of what the model sees batch image

    • Device MPS signifies the setting used to identify the device as an Apple Silicon Computer

How it identified cards

  1. It identified card using the model it was trained on, in which it surrounds the card number with a bounding box

How it identified hands

  1. The hand is then passed to findPokerHand where it deduces the hand base on a series of conditions

Poker Hand Result

Result

(back to top)

About

A set of projects to learn about Computer Vision πŸ’»πŸ‘€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors