开启左侧

消除红蓝颜色字体

[复制链接]
lyf 发表于 2021-6-11 21:30:31 | 显示全部楼层 |阅读模式
文档类图片上红蓝批注的自动清除.jpg

求大佬帮忙!!!

halcon2016 发表于 2021-6-16 18:09:16 | 显示全部楼层
截图00.jpg
read_image (Image212932m0xgog96g065z9yn, 'C:/Users/Administrator/Desktop/新建文件夹/212932m0xgog96g065z9yn.jpg')
decompose3 (Image212932m0xgog96g065z9yn, Image1, Image2, Image3)
trans_from_rgb (Image1, Image2, Image3, ImageResult11, ImageResult22, ImageResult33, 'cielab')
mean_image (ImageResult22, ImageMean, 29, 29)
dyn_threshold (ImageResult22, ImageMean, RegionDynThresh, 4, 'light')
connection (RegionDynThresh, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10, 99999)
union1 (SelectedRegions, RegionUnion)
dilation_rectangle1 (RegionUnion, RegionDilation, 31, 21)
paint_region (RegionDilation, Image1, ImageResult4, 176, 'fill')
paint_region (RegionDilation, Image2, ImageResult5, 172, 'fill')
paint_region (RegionDilation, Image3, ImageResult6, 163, 'fill')
compose3 (ImageResult4, ImageResult5, ImageResult6, MultiChannelImage)

zeroplants 发表于 2021-7-1 10:38:23 | 显示全部楼层
建議使用inpainting_texture比較來得穩定。

read_image (Image, 'C:/Users/yoyo/Desktop/1.jpg')

get_image_size (Image, Width, Height)
decompose3 (Image, ImageR, ImageG, ImageB)
trans_from_rgb (ImageR, ImageG, ImageB, ImageH, ImageS, ImageV, 'yiq')
threshold (ImageV, Regions, 132, 255)

dilation_rectangle1 (Regions, RegionDilation, 25, 15)
inpainting_texture (Image, RegionDilation, InpaintedImage, 5, 20, 0, 'none', 0)

分析結果.zip

291.98 KB, 下载次数: 11

halcon2016 发表于 2021-7-5 11:12:01 | 显示全部楼层
zeroplants 发表于 2021-7-1 10:38
建議使用inpainting_texture比較來得穩定。

read_image (Image, 'C:/Users/yoyo/Desktop/1.jpg')

厉害了,这个方法效果真不错!!
canicula233 发表于 2021-7-7 09:31:15 | 显示全部楼层
zeroplants 发表于 2021-7-1 10:38
建議使用inpainting_texture比較來得穩定。

read_image (Image, 'C:/Users/yoyo/Desktop/1.jpg')

厉害了!
stq002285 发表于 2021-7-18 16:45:03 | 显示全部楼层
本帖最后由 stq002285 于 2021-7-18 16:46 编辑

将zeroplants的方法转为OpenCV实现:Halcon转OpenCV实例--去除纸张中的颜色笔迹/墨迹(附源码)https://mp.weixin.qq.com/s?__biz=MzU5NDM1MjU5Mg==&tempkey=MTEyMl9YRnVPSGQ5bmtvaHZBWC8rWWdyMUJCVHd6b3ZCMjBNRm5ZMjRHclpfQXNvRjl5TUR3ZW85U3hjaTJsdkNWSXd3WWd0clhCeTlKcm0wbm1YT09sR0U0c1BuMVNuMm1wemVsSjQ5MFJpS25qVFVwa2htRlVlVW5JQi1RRUlSY2xsREl3b0tSNTZsbUN2dmZncjdJZ05pa1FHSzlFbUUyd0FHbjY5bkF3fn4%3D&chksm=7e03cbf3497442e581358b895b8da7e7e88744c89ca2194ce91f890a686668824ee2f6a976ab#rd
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表