Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Python :: remove from string python 
Python :: detect character in string python 
Python :: python b string 
Python :: pass a list to a function in python 
Python :: string format zero padded int python 
Python :: np array to list 
Python :: print inline output in python 
Python :: python integer to string 
Python :: plt text matplotlib white background 
Python :: def extract_title(input_df): 
Python :: django form list option 
Python :: zip python 
Python :: merging df vertically 
Python :: python create a grid of points 
Python :: python list comprehension 
Python :: how to create a set from a list in python 
Python :: get last n in array python 
Python :: os.execl 
Python :: find string in string python 
Python :: how to get all possible combinations in python 
Python :: merge 2 dataframes pythom 
Python :: python print format 
Python :: how to take multiple line input in python 
Python :: tweepy aut code 
Python :: sentiment analysis french python 
Python :: Iniciar servidor en Django 
Python :: start a django project 
Python :: prime number using python 
Python :: python split string into floats 
Python :: how to select rows with specific values in pandas 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =