Loading tutorials
cv2 is installed (pip install opencv-python). You should also know what a pixel is, and the difference between a grayscale image and a color image. Every later chapter in this tutorial builds on the array facts covered here.5 min readcv2) installed. It also assumes you know that a grayscale image is a 2D uint8 array and a color image has a third channel axis in BGR order. Everything later in this tutorial (smoothing, sharpening, gradients) 5 min readcv2) is installed, and that you know how cv2.blur, cv2.GaussianBlur, cv2.medianBlur and cv2.bilateralFilter are called. The previous chapter introduced those four filters. Here you learn how to choose among th5 min readcv2.imread, that you know NumPy array shapes and dtypes, and that you have seen cv2.GaussianBlur from the smoothing chapters. It covers how unsharp masking works, how to control it, and where it fails.5 min readcv2.imread, that you know the difference between uint8 and float32 arrays, and that you know what convolution with a small kernel does. Later chapters build gradient ma5 min readcv2.Sobel is called, and understand dtypes such as uint8 and float32. The previous chapter produced two images, gx and gy. Here you combine them into two more useful quantities: how strong an intensity change is, and whi5 min readcv2.Laplacian works, why the output depth matters, and how to turn its output 5 min readcv2.imread, convert it to grayscale, and use NumPy arrays. It also assumes you have met Gaussian smoothing and Sobel gradients from the earlier chapters. Here you will see how cv2.Canny combines those pieces into a thin, connected edge map. You wil6 min readcv2.threshold, the function that turns a grayscale image into a binary or partly binary one using a single cutoff value. It assumes you can read an image with OpenCV, know that a grayscale image is a 2D uint8 array, and are comfortable with NumPy indexing and dtypes. Smoothin5 min readcv2.imread, know that a grayscale image is a 2-D uint8 array, and have seen cv2.threshold with a fixed value. You also need the smoothing filters from earlier chapters, because Otsu's method works best on a pre-blurred image.4 min readcv2.imread, that you know NumPy dtypes (uint8), and that you have seen cv2.threshold with a fixed value and with Otsu's method. It also assumes you know what a Gaussian blur does. If a global threshold is new to you, review that chapter 6 min readcv2.imread, know that a binary mask is a uint8 array holding only 0 and 255, and have already produced a mask with cv2.threshold or cv2.adaptiveThreshold. Thresholding rarely gives a clean result. You usually get isolated white specks in the ba5 min readcv2.imread, know that OpenCV stores color in BGR order with uint8 values, and have met the smoothing, Sobel, Canny, thresholding and morphology calls from earlier chapters. Here you will chain them into one tested function, and you will see where c5 min readcv2 and numpy installed. It collects the parameters that most affect your results, the mistakes that most often cause silent failures, and 4 min read