1
votes

I am trying to implement CLAHE...I have already tried all solutions posted on similar posts, but nothing seems to work. I am using Python 3.7

import cv2

img=cv2.imread("orimg.jpg")

clahe=cv2.createCLAHE()

g_i=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

eh_i=clahe.apply(g_i)

cv2.imwrite('newimg.jpg','eh_i')

THIS IS THE ERROR I GET ON RUNNING THE CODE: TypeError: Expected Ptr<cv::UMat> for argument 'img'

1

1 Answers

-1
votes

i had the same problem.because opencv didn't read the picture.maybe, your path has non-English characters.Please try using numpy to read picture.