March 2018
Beginner to intermediate
306 pages
9h 54m
English
For this recipe, you need to perform the following steps:
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('--path', default='../data/Lena.png', help='Image path.')
params = parser.parse_args()
img = cv2.imread(params.path)
assert img is not None # check if the image was successfully loaded
print('read {}'.format(params.path))
print('shape:', img.shape)
print('dtype:', img.dtype)
img = cv2.imread(params.path, cv2.IMREAD_GRAYSCALE) ...