• Stars
    star
    362
  • Rank 117,671 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

Mastering OpenCV 4 with Python, published by Packt

Mastering OpenCV 4 with Python

This is the code repository for Mastering OpenCV 4 with Python, published by Packt.

Mastering OpenCV 4 with Python

A practical guide covering topics from image processing, augmented reality to deep learning with OpenCV 4 and Python 3.7

What is this book about?

OpenCV is considered to be one of the best Open Source Computer Vision and machine learning software libraries. It helps developers build complete projects on image processing, motion detection, and image segmentation. OpenCV for Python enables you to run computer vision algorithms smoothly in real time, combining the best of the OpenCV C++ API and the Python language.

This book covers the following exciting features:

  • Handle files and images, and explore various image processing techniques
  • Explore image transformations like translation, resizing, and cropping
  • Gain insights into building histograms
  • Brush up on contour detection, filtering, and drawing
  • Work with augmented reality and 3D visualization frameworks
  • Work with machine learning, deep learning, and neural network algorithms

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

channels = cv2.split(img)
eq_channels = []
for ch in channels:
    eq_channels.append(cv2.equalizeHist(ch))

Code Testing Specifications

Mastering OpenCV 4 with Python requires some installed packages, which you can see next.

  • Chapter01 (Setting Up OpenCV): opencv-contrib-python
  • Chapter02 (Image Basics in OpenCV): opencv-contrib-python matplotlib
  • Chapter03 (Handling Files and Images): opencv-contrib-python matplotlib
  • Chapter04 (Constructing Basic Shapes in OpenCV): opencv-contrib-python matplotlib
  • Chapter05 (Image Processing Techniques): opencv-contrib-python matplotlib
  • Chapter06 (Constructing and Building Histograms): opencv-contrib-python matplotlib
  • Chapter07 (Thresholding Techniques): opencv-contrib-python matplotlib scikit-image, scipy
  • Chapter08 (Contours Detection, Filtering, and Drawing): opencv-contrib-python matplotlib
  • Chapter09 (Augmented Reality): opencv-contrib-python matplotlib
  • Chapter10 (Machine Learning with OpenCV): opencv-contrib-python matplotlib
  • Chapter11 (Face Detection, Tracking, and Recognition): opencv-contrib-python matplotlib dlib face-recognition cvlib requests progressbar keras tensorflow
  • Chapter12 (Introduction to Deep Learning): opencv-contrib-python matplotlib tensorflow keras
  • Chapter13 (Mobile and Web Computer Vision with Python and OpenCV): opencv-contrib-python matplotlib flask tensorflow keras requests pillow

Make sure that the version numbers of your installed packages are equal to, or greater than, versions specified below to ensure the code examples run correctly. If you want to install the exact versions this book was tested on, include the version when installing from pip.

  • Install opencv-contrib-python:
pip install opencv-contrib-python==4.0.0.21

It should be noted that OpenCV requires: numpy

numpy-1.16.1 has been installed when installing opencv-contrib-python==4.0.0.21

  • Install matplotlib:
pip install matplotlib==3.0.2

It should be noted that matplotlib requires: kiwisolver pyparsing six cycler python-dateutil

cycler-0.10.0 kiwisolver-1.0.1 pyparsing-2.3.1 python-dateutil-2.8.0 six-1.12.0 have been installed when installing matplotlib==3.0.2

  • Install scikit-image:
pip install scikit-image==0.14.2

It should be noted that scikit-image requires: cloudpickle decorator networkx numpy toolz dask pillow PyWavelets six

PyWavelets-1.0.1 cloudpickle-0.8.0 dask-1.1.1 decorator-4.3.2 networkx-2.2 numpy-1.16.1 pillow-5.4.1 six-1.12.0 toolz-0.9.0 have been installed when installing scikit-image==0.14.2

  • Install scipy:
pip install scipy==1.2.1 

It should be noted that scipy requires: numpy

numpy-1.16.1 has been installed when installing scipy==1.2.1

  • Install dlib:
pip install dlib==19.8.1 
  • Install face-recognition:
pip install face-recognition==1.2.3

It should be noted that face-recognition requires: dlib Click numpy face-recognition-models pillow

dlib-19.8.1 Click-7.0 face-recognition-models-0.3.0 pillow-5.4.1 have been installed when installing face-recognition==1.2.3

  • Install cvlib:
pip install cvlib==0.1.8
  • Install requests:
pip install requests==2.21.0

It should be noted that requests requires: urllib3 chardet certifi idna

urllib3-1.24.1 chardet-3.0.4 certifi-2018.11.29 idna-2.8 have been installed when installing requests==2.21.0

  • Install progressbar:
pip install progressbar==2.5 
  • Install keras:
pip install keras==2.2.4

It should be noted that keras requires: numpy six h5py keras-applications scipy keras-preprocessing pyyaml

h5py-2.9.0 keras-applications-1.0.7 keras-preprocessing-1.0.9 numpy-1.16.1 pyyaml-3.13 scipy-1.2.1 six-1.12.0 have been installed when installing keras==2.2.4

  • Install tensorflow:
pip install tensorflow==1.12.0 

It should be noted that tensorflow requires: termcolor numpy wheel gast six setuptools protobuf markdown grpcio werkzeug tensorboard absl-py h5py keras-applications keras-preprocessing, astor

termcolor-1.1.0 numpy-1.16.1 wheel-0.33.1 gast-0.2.2 six-1.12.0 setuptools-40.8.0 protobuf-3.6.1 markdown-3.0.1 grpcio-1.18.0 werkzeug-0.14.1 tensorboard-1.12.2 absl-py-0.7.0 h5py-2.9.0 keras-applications-1.0.7 keras-preprocessing-1.0.9 astor-0.7.1 have been installed when installing tensorflow==1.12.0

  • Install flask:
pip install flask==1.0.2

It should be noted that flask requires: Werkzeug click itsdangerous MarkupSafe Jinja2

Jinja2-2.10 MarkupSafe-1.1.1 Werkzeug-0.14.1 click-7.0 itsdangerous-1.1.0 have been installed when installing flask==1.0.2

Following is what you need for this book: This book is designed for computer vision developers, engineers, and researchers who want to develop modern computer vision applications. Basic experience of OpenCV and Python programming is a must.

With the following software and hardware list you can run all code files present in the book (Chapter 1-13).

Software and Hardware List

Chapter Software required Hardware required
1-13 Python Either 32-bit or 64-bit architecture, 2+ GHz CPU, 4 GB RAM, At least 10 GB of hard disk space available
1-13 OpenCV Either 32-bit or 64-bit architecture, 2+ GHz CPU, 4 GB RAM, At least 10 GB of hard disk space available
1-13 PyCharm Either 32-bit or 64-bit architecture, 2+ GHz CPU, 4 GB RAM, At least 10 GB of hard disk space available

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Referencing

If you use the code samples or book content in your study/work or want to cite the book, please use:

FernΓ‘ndez VillΓ‘n Alberto. Mastering OpenCV 4 with Python. Packt Publishing Ltd, 2019.

@book{fernandez2019mastering,
 author = {Fern{\'a}ndez, Alberto},
 title = {Mastering OpenCV 4 with Python},
 year = {2019},
 isbn = {978-1789344912},
 publisher = {Packt Publishing Ltd},
}

Related products

Get to Know the Author

Alberto FernΓ‘ndez VillΓ‘n is a software engineer with more than 12 years of experience in developing innovative solutions. In the last couple of years, he has been working in various projects related to monitoring systems for industrial plants, applying both Internet of Things (IoT) and big data technologies. He has a Ph.D. in computer vision (2017), a deep learning certification (2018), and several publications in connection with computer vision and machine learning in journals such as Machine Vision and Applications, IEEE Transactions on Industrial Informatics, Sensors, IEEE Transactions on Industry Applications, IEEE Latin America Transactions, and more. As of 2013, he is a registered and active user (albertofernandez) on the Q&A OpenCV forum.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781789344912

More Repositories

1

Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
Python
2,831
star
2

The-Kaggle-Book

Code Repository for The Kaggle Book, Published by Packt Publishing
Jupyter Notebook
2,144
star
3

Advanced-Deep-Learning-with-Keras

Advanced Deep Learning with Keras, published by Packt
Python
1,790
star
4

Hands-On-Machine-Learning-for-Algorithmic-Trading

Hands-On Machine Learning for Algorithmic Trading, published by Packt
Jupyter Notebook
1,424
star
5

Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original

Machine Learning for Algorithmic Trading, Second Edition - published by Packt
Jupyter Notebook
1,207
star
6

Node.js-Design-Patterns-Third-Edition

Node.js Design Patterns Third Edition, published by Packt
JavaScript
1,162
star
7

Deep-Reinforcement-Learning-Hands-On-Second-Edition

Deep-Reinforcement-Learning-Hands-On-Second-Edition, published by Packt
Jupyter Notebook
1,122
star
8

Deep-Learning-with-Keras

Code repository for Deep Learning with Keras published by Packt
Jupyter Notebook
1,047
star
9

Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition

Learning JavaScript Data Structures and Algorithms (Third Edition), published by Packt
JavaScript
1,037
star
10

Learn-CUDA-Programming

Learn CUDA Programming, published by Packt
Cuda
975
star
11

40-Algorithms-Every-Programmer-Should-Know

40 Algorithms Every Programmer Should Know, published by Packt
Python
949
star
12

3D-Graphics-Rendering-Cookbook

3D Graphics Rendering Cookbook, published by Packt.
C++
847
star
13

Vulkan-Cookbook

Code repository for Vulkan Cookbook by Packt
C++
823
star
14

Linux-Kernel-Programming

Linux Kernel Programming, published by Packt
Makefile
819
star
15

Django-4-by-example

Django 4 by example (4th Edition) published by Packt
Python
800
star
16

Learn-Algorithmic-Trading

Learn Algorithmic Trading, Published by Packt
Python
793
star
17

Causal-Inference-and-Discovery-in-Python

Causal Inference and Discovery in Python by Packt Publishing
Jupyter Notebook
734
star
18

Django-3-by-Example

Django 3 by Example (3rd Edition) published by Packt
Python
715
star
19

Python-for-Finance-Cookbook

Python for Finance Cookbook, published by Packt
Jupyter Notebook
709
star
20

Node.js_Design_Patterns_Second_Edition_Code

Code repository for Node.js Design Patterns Second Edition, published by Packt
JavaScript
706
star
21

Modern-Computer-Vision-with-PyTorch

Modern Computer Vision with PyTorch, published by Packt
Jupyter Notebook
704
star
22

Hands-On-Graph-Neural-Networks-Using-Python

Hands-On Graph Neural Networks Using Python, published by Packt
Jupyter Notebook
690
star
23

Hands-on-Exploratory-Data-Analysis-with-Python

Hands-on Exploratory Data Analysis with Python, published by Packt
Jupyter Notebook
676
star
24

Hands-On-Domain-Driven-Design-with-.NET-Core

Hands-On Domain-Driven Design with .NET Core, published by Packt
C#
636
star
25

Pandas-Cookbook

Pandas Cookbook, published by Packt
Jupyter Notebook
623
star
26

Java-Coding-Problems

Java Coding Problems, published by Packt
Java
615
star
27

Data-Engineering-with-Python

Data Engineering with Python, published by Packt
Python
613
star
28

Learn-Data-Structures-and-Algorithms-with-Golang

Learn Data Structures and Algorithms with Golang, published by Packt
Go
604
star
29

Learning-OpenCV-4-Computer-Vision-with-Python-Third-Edition

Learning OpenCV 4 Computer Vision with Python 3 – Third Edition, published by Packt
Python
593
star
30

Hands-On-GPU-Accelerated-Computer-Vision-with-OpenCV-and-CUDA

Hands-On GPU Accelerated Computer Vision with OpenCV and CUDA, published by Packt
C++
593
star
31

Mastering-Embedded-Linux-Programming-Third-Edition

Mastering Embedded Linux Programming Third Edition, published by Packt
C
572
star
32

Django-2-by-Example

Django 2 by Example (2nd Edition) published by Packt
Python
567
star
33

TensorFlow-Machine-Learning-Cookbook

Code repository for TensorFlow Machine Learning Cookbook by Packt
Python
552
star
34

Transformers-for-Natural-Language-Processing

Transformers for Natural Language Processing, published by Packt
Jupyter Notebook
547
star
35

Clean-Code-in-Python

Clean Code in Python, published by Packt
Python
541
star
36

Mastering-Graphics-Programming-with-Vulkan

C++
539
star
37

Mastering-OpenCV-4-Third-Edition

Mastering OpenCV 4, Third Edition, published by Packt publishing
Assembly
531
star
38

Cpp17-STL-Cookbook

Code files by Packt
C++
524
star
39

Hands-On-Data-Structures-and-Algorithms-with-Rust

Hands-On Data Structures and Algorithms with Rust, published by Packt
Rust
504
star
40

Software-Architecture-with-Cpp

Software Architecture with C++, published by Packt
C++
493
star
41

Getting-Started-with-TensorFlow

Getting Started with TensorFlow, published by Packt
Python
491
star
42

Linux-Device-Drivers-Development

Linux Device Drivers Development, published by Packt
C
482
star
43

Python-Machine-Learning-Second-Edition

Python Machine Learning - Second Edition, published by Packt
Jupyter Notebook
477
star
44

Modern-CMake-for-Cpp

Modern CMake for C++, published by Packt
Dockerfile
472
star
45

Learn-LLVM-12

Learn LLVM 12, published by Packt
C++
471
star
46

Python-3-Object-Oriented-Programming-Third-Edition

Python 3 Object-Oriented Programming – Third Edition, published by Packt
Python
469
star
47

Full-Stack-React-Projects-Second-Edition

Full-Stack React Projects - Second Edition, published by Packt
JavaScript
463
star
48

Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

Hands-On Microservices with Spring Boot and Spring Cloud, published by Packt
Java
459
star
49

Python-Feature-Engineering-Cookbook

Python Feature Engineering Cookbook, published by Packt
Jupyter Notebook
458
star
50

Deep-Learning-with-PyTorch

Deep Learning with PyTorch, published by Packt
Jupyter Notebook
451
star
51

Interpretable-Machine-Learning-with-Python

Interpretable Machine Learning with Python, published by Packt
Jupyter Notebook
439
star
52

Mastering-Python-for-Finance-Second-Edition

Mastering Python for Finance – Second Edition, published by Packt
Jupyter Notebook
432
star
53

Modern-Time-Series-Forecasting-with-Python

Modern Time Series Forecasting with Python, published by Packt
Jupyter Notebook
428
star
54

Hands-On-Machine-Learning-with-CPP

Hands-On Machine Learning with C++, published by Packt
C++
425
star
55

Hands-On-Software-Engineering-with-Golang

Hands-On Software Engineering with Golang, published by Packt
Go
425
star
56

Python-Machine-Learning-Cookbook

Code files for Python-Machine-Learning-Cookbook
Python
416
star
57

Artificial-Intelligence-with-Python

Code repository for Artificial Intelligence with Python, published by Packt
Python
408
star
58

Mastering-Python-Design-Patterns-Second-Edition

Mastering-Python-Design-Patterns-Second-Edition, published by Packt
Python
404
star
59

Go-Design-Patterns

This is the code repository for the book, Go Design Patterns, published by Packt
Go
399
star
60

Python-Algorithmic-Trading-Cookbook

Python Algorithmic Trading Cookbook, published by Packt
Jupyter Notebook
395
star
61

Mastering-Go-Second-Edition

Mastering Go Second Edition, published by Packt
Go
394
star
62

Learn-OpenCV-4-By-Building-Projects-Second-Edition

Learn OpenCV 4 By Building Projects, Second Edition, published by Packt
C++
378
star
63

Hands-On-Computer-Vision-with-TensorFlow-2

Hands-On Computer Vision with TensorFlow 2, published by Packt
Jupyter Notebook
366
star
64

Hands-On-Design-Patterns-with-CPP

Hands-On Design Patterns with C++, published by Packt
C
362
star
65

Hands-On-Microservices-with-Rust

Hands-On Microservices with Rust 2018, published by Packt
Rust
357
star
66

Machine-Learning-for-Finance

Machine Learning for Finance, published by Packt
Jupyter Notebook
355
star
67

Python-Machine-Learning-Blueprints

Code repository for Python Machine Learning Blueprints, published by Packt
Jupyter Notebook
349
star
68

Practical-Time-Series-Analysis

Practical Time-Series Analysis, published by Packt
Jupyter Notebook
345
star
69

Machine-Learning-for-Algorithmic-Trading-Bots-with-Python

Jupyter Notebook
337
star
70

Python-Artificial-Intelligence-Projects-for-Beginners

Python Artificial Intelligence Projects for Beginners, published by Packt
Jupyter Notebook
337
star
71

Effective-Python-Penetration-Testing

Effective Python Penetration Testing by Packt Publishing
Python
334
star
72

Micro-State-Management-with-React-Hooks

Micro State Management with React Hooks, published by Packt
TypeScript
329
star
73

Event-Driven-Architecture-in-Golang

Event-Driven Architecture in Golang, published by Packt
Go
329
star
74

The-Azure-Cloud-Native-Architecture-Mapbook

The Azure Cloud Native Architecture Mapbook, published by Packt
C#
324
star
75

Hands-On-Intelligent-Agents-with-OpenAI-Gym

Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Python
322
star
76

Hands-On-Reactive-Programming-in-Spring-5

Hands-On Reactive Programming in Spring 5, published by Packt
Java
320
star
77

Python-GUI-Programming-Cookbook-Second-Edition

Python GUI Programming Cookbook, Second Edition, published by Packt
Python
316
star
78

Godot-Game-Engine-Projects

Godot Game Engine Projects, published by Packt
GDScript
315
star
79

Computer-Vision-with-OpenCV-3-and-Qt5

Computer Vision with OpenCV 3 and Qt5, published by Packt
C++
314
star
80

Deep-Learning-with-TensorFlow-2-and-Keras

Deep Learning with TensorFlow 2 and Keras, published by Packt
Jupyter Notebook
312
star
81

Mastering-Transformers

Mastering Transformers, published by Packt
Jupyter Notebook
307
star
82

OpenGL-4-Shading-Language-Cookbook-Third-Edition

OpenGL 4 Shading Language Cookbook - Third Edition, published by Packt
C
307
star
83

Building-Data-Science-Applications-with-FastAPI

Building Data Science Applications with FastAPI, Published by Packt
Python
306
star
84

PyTorch-Computer-Vision-Cookbook

PyTorch Computer Vision Cookbook, Published by Packt
Jupyter Notebook
306
star
85

Hands-on-Python-for-Finance

Hands-on Python for Finance published by Packt.
Jupyter Notebook
304
star
86

Learning-PySpark

Code repository for Learning PySpark by Packt
Jupyter Notebook
303
star
87

Neural-Network-Projects-with-Python

Neural Network Projects with Python, Published by Packt
Python
303
star
88

Building-Python-Microservices-with-FastAPI

Building Python Microservices with FastAPI, published by Packt
Python
301
star
89

Machine-Learning-for-Cybersecurity-Cookbook

Machine Learning for Cybersecurity Cookbook, published by Packt
Jupyter Notebook
301
star
90

Mastering-Machine-Learning-for-Penetration-Testing

Mastering Machine Learning for Penetration Testing, published by Packt
Python
298
star
91

Learning-Vuejs-2

This is the code repository for Learning Vue.js 2, published by Packt.
JavaScript
296
star
92

CPP-Data-Structures-and-Algorithms

C++ Data Structures and Algorithms, published by Packt
C++
295
star
93

Full-Stack-React-TypeScript-and-Node

Full-Stack React, TypeScript, and Node, published by Packt
TypeScript
289
star
94

Bioinformatics-with-Python-Cookbook-Second-Edition

Bioinformatics with Python Cookbook Second Edition, published by Packt
OpenEdge ABL
287
star
95

Kotlin-Design-Patterns-and-Best-Practices

Kotlin Design Patterns and Best Practices - Second Edition, published by Packt
Kotlin
285
star
96

Pandas-Cookbook-Second-Edition

Pandas Cookbook Second Edition, published by Packt
Jupyter Notebook
283
star
97

The-Modern-Cpp-Challenge

The Modern C++ Challenge, published by Packt
C
276
star
98

Network-Programming-with-Rust

Network Programming with Rust, published by Packt
Rust
275
star
99

Full-Stack-React-Projects

Full-Stack React Projects, published by Packt
JavaScript
274
star
100

JavaScript-from-Beginner-to-Professional

JavaScript from Beginner to Professional, Published by Packt
HTML
274
star