Created
July 6, 2015 16:41
-
-
Save lucidfrontier45/96f6e2331f8b0fa751ea to your computer and use it in GitHub Desktop.
calculate image histogram
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
| def colorHist(img): | |
| size = img.size / 3.0 | |
| ret = {} | |
| color = ('b','g','r') | |
| for i,col in enumerate(color): | |
| histr = cv2.calcHist([img],[i],None,[100],[0,256]) | |
| ret[col] = histr.flatten() / size | |
| return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment