Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to use cv2.COLOR_BGR2GRAY

def main():
	imagePath = "img.jpg"
	
	img = cv2.imread(imagePath)
	gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
	
	generate_histogram(gray)
	
	cv2.imwrite("before.jpg", gray)

	gray = cv2.equalizeHist(gray)
	
	generate_histogram(gray)
	
	cv2.imwrite("after.jpg",gray)
	
	return 0 
Comment

PREVIOUS NEXT
Code Example
Python :: python 3 custom sort with compare 
Python :: tkinter simple notification 
Python :: python typing effect 
Python :: lerp function 
Python :: how to iterate through a list in python 
Python :: button in python 
Python :: python multiline comment 
Python :: git help 
Python :: python replace nth occurrence in string 
Python :: Python How To Check Operating System 
Python :: virtualenv specify python version 
Python :: flatten image python numpy 
Python :: dataframe string find count 
Python :: os.mkdir exceptions 
Python :: python password with special characters 
Python :: how to run python module every 10 sec 
Python :: python getattr 
Python :: python input integer only 
Python :: dictionary to list python 
Python :: how to map longitude and latitude in python 
Python :: read excel spark 
Python :: python pandas column where 
Python :: pandas print a single row 
Python :: soup findall table 
Python :: python 3d array 
Python :: how to make an empty variable in python 
Python :: sqlalchemy create engine MySQL 
Python :: scipy.cluster.hierarchy 
Python :: joining two lists in python 
Python :: xlabel and ylabel in python 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =