Skip to content

A simple code to detect and track an object. It is base on image processing and Euclidean distance.

License

Notifications You must be signed in to change notification settings

macinj1/Object_Tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Tracking

The present repository containts a simple code to detect and track an object. Image processing is based on thresholding after deleting background and particle tracking on Euclidean distance calculation.

We want to detect and track objects in a image, few examples marked with blue circles in figure 1.

Alt text

The code runs using the main_particle_tracking.m script. Set the parameters in Define Parameters section:

  • file name and location
  • First, Last and Frame rate
  • time convertion, from frame to time [s, min,..]

Running the code

The code starts, one frame of the video pops up and you must select the area of interest, blue rectangle in next figure. Once you select the place, right click, and select Crop Image.

Alt text

Next, on the Command Window, you receive the following requests:

The number is needed to convert pixels to space units, then insert a known dimension of the blue box you selected before (figure 2).

Code output

The results are listed as a set of cells in the variable Particles, where each one of them represents one particle with the following information

time x position y position
t1 x1 y1
. . .
. . .
. . .
. . .
tn xn yn

A second variable is listed as Particle_Velocity with the following information

time x velocity y velocity net velocity
t1 vx1 vy1 v1
. . . .
. . . .
. . . .
. . . .
tn-1 vxn-1 vyn-1 vn-1

It is calculated as first-orden difference.

Citation

Mac Intyre J., Simple Object Tracking (2023), GitHub repository, https://github.com/macinj1/Object_Tracking

About

A simple code to detect and track an object. It is base on image processing and Euclidean distance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages