Loading tutorials
cv2, index NumPy arrays, and convert an image to grayscale. It also assumes you have seen thresholding. You will learn when to feed cv2.findContours an edge map instead of a thresholded mask, how the Canny detector works inside, and how to a5 min readcv2.threshold and can load, save and index images with cv2 and NumPy. You should also know what a grayscale image is. The goal is to turn a noisy mask into one that cv2.findContours can turn into a few clean contours.5 min readcv2, index NumPy arrays, and know what grayscale and binary images are. It uses the Python API of OpenCV 4. The previous chapter produced a binary image. Here you turn that image into contours.5 min readcv2.findContours takes a fourth argument that controls how many points are stored for each contour. This chapter covers what the four options do and what each one changes in the numbers you measure afterward. It also covers when the choice matters.5 min readcv2, produce a clean binary mask (grayscale, blur, threshold), and call cv2.findContours to get a list of contours. Here you learn how the retrieval mode argument controls which contours you get back, and how to read the hierarchy array that describe5 min readcv2.drawContours and a few habits for checking what cv2.findContours returned. I assume you can run OpenCV 4 in Python, know that findContours returns a list of point arrays plus a hierarchy array, and can read a NumPy array's shape and dtype. The chapter on retrieval m5 min readcv2.findContours in OpenCV 4, as covered in the earlier chapters. You should also be comfortable with NumPy array shapes. Here you will turn each contour into numbers: area, perimeter, centroid and a bounding box. These num5 min readcv2.findContours on a binary image and read its return values. It also assumes you know what area, perimeter and bounding box mean for a contour. Everything here uses OpenCV 4 and the Python API.5 min readcv2, index NumPy arrays, and have already produced a binary mask and extracted contours with cv2.findContours. Here you learn how cv2.approxPolyDP reduces a contour with hundreds of points to a polygon with a handful of vertices, how to choose its 5 min readcv2, index NumPy arrays, and already produce a clean binary mask and extract contours with cv2.findContours. Here you turn contours into shape names by counting vertices and measuring circularity.5 min readcv2.findContours, read a contour as an (N, 1, 2) array of points, and compute contour area with cv2.contourArea. It uses the Python API of OpenCV 4.5 min readcv2.findContours from a clean binary image, and that you know what area, perimeter and image moments are. It covers how cv2.matchShapes scores the similarity of two shapes, how to read that score, and where it fails.6 min readcv2, index NumPy arrays, and have already used cv2.threshold, cv2.findContours, cv2.contourArea and cv2.approxPolyDP. It collects the failures that show up most often in contour pipelines and gives a repeatable way to find the cause.6 min read