December 2018
Intermediate to advanced
318 pages
8h 28m
English
In the first step, we will write a machine learning system using image-processing techniques that will be able to read letters from images.
We import the relevant packages; cv2 is the respective OpenCV package, as shown in the following code:
import osimport os.pathimport cv2import globimport imutils
We read in the images, but we will output the respective letters in the images:
CAPTCHA_IMAGES_PATH = "input_captcha_images"LETTER_IMAGES_PATH = "output_letter_images"
We list all of the CAPTCHA images that are present in the input folder and loop over all of the images:
captcha_images = glob.glob(os.path.join(CAPTCHA_IMAGES_PATH, "*")) counts = {} for (x, captcha_images) in enumerate(captcha_image_files): print("[INFO] processing image ...Read now
Unlock full access