The function/feature is not implemented (Odd-size DCT's are not implemented) in dct

asked 2015-08-11 09:12:21 -0600

updated 2015-08-11 13:44:19 -0600

I've built a pre-processing script in OpenCV that takes user uploaded images as input. While trying to take DCT of an image, I get the following error

OpenCV Error: The function/feature is not implemented (Odd-size DCT's are not implemented) in dct, file /tmp/opencv-hd06/opencv-2.4.4/modules/core/src/dxt.cpp, line 2339

Here is how I'm taking the DCT:

img = cv2.imread(filepath)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret,thresholded = cv2.threshold(gray,200,255,cv2.THRESH_BINARY)
img = cv2.cvtColor(thresholded, cv2.COLOR_GRAY2BGR)
gray = thresholded
gray = gray.astype('float32')
dct=cv2.dct(gray) #this line throws error

The above error happens on this image:

[![enter image description here][1]][1]

The above code works fine on certain other images.

edit retag flag offensive close merge delete

Comments

imho sample image is not suitable. upload another image.

sturkmen gravatar imagesturkmen ( 2015-08-11 13:52:31 -0600 )edit