June 2018
Beginner to intermediate
280 pages
6h 58m
English
The first example will load an image in grayscale and display it on the screen.
In the following section of code, we will import the numpy module for handling the image array. The cv2 module is the OpenCV wrapper for Python, which we can use to access OpenCV Python APIs. NumPy is an extension to the Python programming language, adding support for large multidimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays (see https://pypi.python.org/pypi/numpy for more information):
#!/usr/bin/env python import numpy as np import cv2
The following function will read the robot.jpg image and load this image in grayscale. ...