The OpenCV error codes can be looked up in types_c.h
.
Error code -210 is defined as:
CV_StsUnsupportedFormat= -210, /**< the data format/type is not supported by the function*/
So, you'll need to coerce your image into uint8
data type before passing it to cv2.threshold
. This can be done with numpy using the astype
method:
afterFourier = afterFourier.astype(np.uint8)
This will truncate all of the float values in afterFourier
to 8 bit values, so you may want to do some scaling/rounding to the array before you do this, depending on your application.