Created
November 13, 2021 13:33
-
-
Save samyumobi/3d40214592a01bf83ccfebf5b350c088 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Load the image | |
| f3 = sys.argv[1] | |
| img3 = img | |
| ## convert image to grayscale and display img | |
| img3_gray = cv2.cvtColor(img3, cv2.COLOR_BGR2GRAY) | |
| cv2_imshow(img3_gray) | |
| ## histogram equalization of color images | |
| img3c = cv2.cvtColor(img3,cv2.COLOR_BGR2YUV) | |
| ## equalize the pixels across y channel and display | |
| img3c[:,:,0] = cv2.equalizeHist(img3c[:,:,0]) | |
| ## convert equalized image to grey scale | |
| img3h = cv2.cvtColor(img3c,cv2.COLOR_YUV2BGR) | |
| cv2_imshow(img3) | |
| cv2_imshow(img3h) | |
| cv2.waitKey() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment