Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

feature to determine image too dark opencv

blur = cv2.blur(image, (5, 5))  # With kernel size depending upon image size
if cv2.mean(blur) > 127:  # The range for a pixel's value in grayscale is (0-255), 127 lies midway
    return 'light' # (127 - 255) denotes light image
else:
    return 'dark' # (0 - 127) denotes dark image
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #feature #determine #image #dark #opencv
ADD COMMENT
Topic
Name
6+6 =