feature to determine image too dark opencv

Solutions on MaxInterview for feature to determine image too dark opencv by the best coders in the world

showing results for - "feature to determine image too dark opencv"
Gabriele
02 Jan 2020
1blur = cv2.blur(image, (5, 5))  # With kernel size depending upon image size
2if cv2.mean(blur) > 127:  # The range for a pixel's value in grayscale is (0-255), 127 lies midway
3    return 'light' # (127 - 255) denotes light image
4else:
5    return 'dark' # (0 - 127) denotes dark image
6