Skip to content

Instantly share code, notes, and snippets.

@non117
Created July 2, 2014 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save non117/353a054f1e7671079ed6 to your computer and use it in GitHub Desktop.
Save non117/353a054f1e7671079ed6 to your computer and use it in GitHub Desktop.
zoizoi
import cv2
import numpy as np
def main():
f = 'hoge.png'
im = cv2.imread(f)
im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
hist = cv2.calcHist([im_gray],[0],None,[256],[0,256])
cv2.normalize(hist, hist, 0, 255, cv2.NORM_MINMAX)
im_out = cv2.equalizeHist(im_gray, hist)
cv2.imwrite('poe.png', im_out)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment