November 2019
Intermediate to advanced
346 pages
9h 36m
English
In the following steps, we'll process a CAPTCHA dataset to make it amenable to training a machine learning model:
import oscaptcha_images_folder = "captcha_images"captchas = [ os.path.join(captcha_images_folder, f) for f in os.listdir(captcha_images_folder)]
import cv2def preprocess_CAPTCHA(img): """Takes a CAPTCHA image and thresholds it.""" gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ...