答案 0 :(得分:6)
仅for this question
,为了检测horizontal lines
,morph-op
已足够。
import cv2
img = cv2.imread("test.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
kernel = np.ones((1,100), np.uint8)
morphed = cv2.morphologyEx(gray, cv2.MORPH_CLOSE, kernel)
cv2.imshow("res", morphed);cv2.waitKey();cv2.destroyAllWindows()
更新,类似的问题: