Skip to content

An implementation of particle swarm optimization and its application to the computer vision task of object detection via template matching

Notifications You must be signed in to change notification settings

frallebini/particle-swarm-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particle Swarm Optimization

A Python implementation of Particle Swarm Optimization (PSO) — as suggested in [BrattonKennedy2007] — and its application to the Computer Vision task of Object Detection based on Template Matching.

Tested with:

matplotlib 3.3.2
numpy 1.19.2
python 3.8.5

Executable files

Run the files listed below to get the shown results. You will be asked whether to plot the animations or output textual information only.

  • PSO applied to non-convex artificial landscapes.

    rastrigin rosenbrock

  • PSO applied to Object Detection by Template Matching.

    quarto_stato arduino

Reproducibility

PSO is a nondeterministic algorithm; however, for the sake of reproducibility of the results, the random seed in swarm.py is set to a fixed value — 42, for obvious reasons.

Conversely, if you want to get a different outcome at each run, replace

self.rng = np.random.default_rng(seed=42)

with

self.rng = np.random.default_rng()

About

An implementation of particle swarm optimization and its application to the computer vision task of object detection via template matching

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages