I'm having some issues with adaptive thresholding on OpenCV.
(我在OpenCV自适应阈值方面遇到一些问题。)
My images have both light text in dark background and dark text over light background, sometimes in the same image, I can have both at the same time.
(我的图像在深色背景中都有浅色文字,而在浅色背景中则有深色文字,有时在同一张图像中,我可以同时具有两个文字。)
When the text is white on a dark background, it generates borders around it instead of marking the text itself, here is an example:
(当文本在深色背景上为白色时,它会在其周围生成边框,而不是标记文本本身,这是一个示例:)
I understand this is how the adaptive threshold should work, but is there a way to close it, filling the cap inside the borders?
(我知道这是自适应阈值应该如何工作的方法,但是有没有办法关闭它,在边界内填满上限?)
I tried cv.morphologyEx(img, cv.MORPH_CLOSE, kernel)
but with no success.
(我尝试了cv.morphologyEx(img, cv.MORPH_CLOSE, kernel)
但没有成功。)
ask by gcstr translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…