January 2019
Intermediate to advanced
342 pages
9h 17m
English
The raw pixels of the images don't work well with the CNN architecture. It's always a good idea to normalize the images for the CNN to converge faster. Two methods that are generally used as normalizing schemes is the mean pixel subtraction method or scaling the pixels to lie in the range of [0,1] by dividing the pixel values by 255. For our CNN network, we are going to normalize the images to lie in the range of [0,1]. We are also going to process the grayscale images of the CAPTCHA, which means that we would be dealing with only one color channel. The load_img function can be used to load and pre-process the CAPTCHA image, as shown in the following code:
def load_img(path,dim=(100,40)): img = cv2.imread(path,cv2.IMREAD_GRAYSCALE) ...
Read now
Unlock full access