Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
511 views
in Technique[技术] by (71.8m points)

python - OpenCV自适应阈值边界(OpenCV Adaptive thresholding borders)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...