I'm a beginner in Python and OpenCV. I want to read multiple images from a specific directory and preprocess them using CLAHE(Contrast Limited Adaptive histogram equalization) and finally save them (Preprocessed images) to another directory. I tried but it will work on a single image. How do I fix it? Here is my code below-
import numpy as np
import cv2
import glob
img = cv2.imread('00000001_000.png',0)
#create a CLAHE object (Arguments are optional).
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(20,20))
cl1 = clahe.apply(img)
cv2.imwrite('clahe_21.jpg',cl1)