I am new to Python.
I want to determine the rotation of a text using the Fourier transform.
import cv2
import numpy as np
import matplotlib.pyplot as plot
img = cv2.imread ('Text_rot.bmp', cv2.CV_LOAD_IMAGE_GRAYSCALE)
afterFourier = np.log (np.abs(np.fft.fft2 (img)))
ret1, th1 = cv2.threshold (afterFourier, 127, 255, cv2.THRESH_BINARY)
But this code does not work:
ret1, th1 = cv2.threshold (afterFourier, 127, 255, cv2.THRESH_BINARY)
error: ..\..\..\src\opencv\modules\imgproc\src\thresh.cpp:783: error: (-210)
Why does this cause a "-210" error?
source
share