OpenCV 3 Computer Vision with Python Cookbook
上QQ阅读APP看书,第一时间看更新

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The cv2.flip function is used for mirroring images."

A block of code is set as follows:

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)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

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)

Any command-line input or output is written as follows:

read ../data/Lena.png
shape: (512, 512, 3)
dtype: uint8

read ../data/Lena.png as grayscale
shape: (512, 512)
dtype: uint8

Bold: Indicates a new term, an important word, or words that you see onscreen.

Warnings or important notes appear like this.
Tips and tricks appear like this.