how to use createCLAHE in python's namesapce cv2?

asked 2014-10-17 01:36:43 -0600

lancelod gravatar image

updated 2018-10-26 16:08:57 -0600

I've read the opencv-python-toturial and saw a example as below:

import numpy as np
import cv2
img = cv2.imread('tsukuba_l.png',0)
# create a CLAHE object (Arguments are optional).
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
cl1 = clahe.apply(img)
cv2.imwrite('clahe_2.jpg',cl1)

I've installed opencv but cannot find the cv2.createCLAHE method, is this a bug? My opencv version is 2.4.2 and Python 2.7.5.

edit retag flag offensive close merge delete

Comments

2

"My opencv version is 2.4.2" - there is your problem.

there is no CLAHE in 2.4.2, to use it, you will have to update.

berak gravatar imageberak ( 2014-10-17 01:55:16 -0600 )edit
1

thank you, i will try 3.0.

lancelod gravatar imagelancelod ( 2014-10-17 02:37:11 -0600 )edit
1

hmm, 3.0 only if you want to try the alpha version. (there are a couple of hiccups currently)

unless you're out for adventure, consider 2.4.10 (the stable release) for now

berak gravatar imageberak ( 2014-10-17 02:40:53 -0600 )edit