Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Morphological top-hat 操作来纠正文本文档中不均匀的背景照明。
应用 Top hat 后,我得到的分析结果比原始图像更差。
img=rgb2gray(imread("test2.png")); se=strel("square",100); imshow(imtophat(img,se));
你能告诉我我做错了什么吗?
顶帽过滤器适用于黑色背景上的浅色文本。您可以imcomplement在应用大礼帽之前反转图像 ( ),或者imbothat改用。
imcomplement
imbothat
在任何一种情况下,输出都是相同的:黑色背景上的浅色文本。您可以在操作后反转图像以在白色背景上获得深色文本。