Skip to content

AmmarKothari/python-examples-cv

 
 

Repository files navigation

Python Computer Vision OpenCV Teaching Examples

OpenCV Python computer vision examples used for teaching within the undergraduate Computer Science programme at Durham University (UK) by Prof. Toby Breckon.

All tested with OpenCV 3.x and Python 3.x.

# Example : <................................> processing from a video file
# specified on the command line (e.g. python FILE.py video_file) or from an
# attached web camera

Background:

Directly adapted (and in some cases extended/added to) from the C++ and earlier C language teaching examples used to generate the video examples within the ebook version of:

Dictionary of Computer Vision and Image Processing (R.B. Fisher, T.P. Breckon, K. Dawson-Howe, A. Fitzgibbon, C. Robertson, E. Trucco, C.K.I. Williams), Wiley, 2014. [Google Books] [doi]

Notably, the C++ examples may contain further speed optimizations in some cases.

A related supporting set of Python Image Processing OpenCV Teaching Examples are also available covering basic image processing operations.


How to download and run:

Download each file as needed or to download the entire repository and run each try:

git clone https://github.com/tobybreckon/python-examples-cv.git
cd python-examples-cv
python3 ./<insert file name of one of the examples>.py [optional video file]

Demo source code is provided "as is" to aid learning and understanding of topics on the course and beyond.

Most run with a webcam connected or from a command line supplied video file of a format OpenCV supports on your system (otherwise edit the script to provide your own image source).

N.B. you may need to change the line near the top that specifies the camera device to use on some examples below - change "0" if you have one webcam, I have it set to "1" to skip my built-in laptop webcam and use the connected USB camera.


If referencing these examples in your own work please use:

@Book{solomonbreckon10fundamentals,
  author = 	 {Solomon, C.J. and Breckon, T.P.},
  title = 	 {Fundamentals of Digital Image Processing: A Practical Approach with Examples in Matlab},
  publisher = 	 {Wiley-Blackwell},
  year = 	 {2010},
  isbn = {0470844736},
  doi = 	 {10.1002/9780470689776},
  note = {ISBN-13: 978-0470844731},
}

If you find any bugs raise an issue (or much better still submit a git pull request with a fix) - toby.breckon@durham.ac.uk

"may the source be with you" - anon.

About

OpenCV Python Computer Vision Examples used for Teaching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%