【发布时间】:2014-05-09 19:11:40
【问题描述】:
我是 Python 新手。
我想借助傅里叶变换来定义文本旋转。
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)
但是这段代码失败了:
ret1, th1 = cv2.threshold (afterFourier, 127, 255, cv2.THRESH_BINARY)
error: ..\..\..\src\opencv\modules\imgproc\src\thresh.cpp:783: error: (-210)
为什么会导致“-210”错误?
【问题讨论】:
-
这是完整的错误吗?我希望不是。但通常 fft 适用于浮点数据,而 cv2.threshold 想要 uchar
-
@berak:完全错误
标签: python opencv image-processing computer-vision