Professional Documents
Culture Documents
Renew Process
Renew Process
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True,
help = "Path to the image")
args = vars(ap.parse_args())
9
10
11
image = cv2.imread(args["image"])
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
12
13
eq = cv2.equalizeHist(image)
14
15
16
cv2.imshow("Histogram Equalization", np.hstack([image, eq]))
cv2.waitKey(0)