Imagemagick 或类似的脚本图像增强
我发现以下算法对于增强白板的各种图像等效果相当好:
- 重复图层,确保顶层处于活动状态
- (高斯)模糊新图层。您应该无法再阅读文本了。
- 将图层模式设置为闪避
- 反转图层
我在 gimp 中尝试过,看起来很有希望。我想对大量图像进行集体尝试,并将其作为命令行工具使用。
我意识到我可以编写 gimp 脚本,但对于这个目的来说感觉太重了。 Imagemagick 似乎非常适合此目的,但我不知道是否可以用它进行分层。
所以问题是:
- 有没有一种方法可以在不使用临时文件的情况下编写 imagemagick 脚本来执行上述算法?
- 是否有一个合理的替代库/工具可以与Python集成?
I found the following algorithm to work fairly well for enhancement of various images of whiteboards, etc:
- duplicate the layer, make sure the top layer is active
- (gaussian)blur the new layer. You shouldn't be able to read the text anymore.
- set the layer mode to dodge
- invert the layer
I tried it out in gimp and it looks promising. I'd like to try it en-masse for a large number of images and make it available as a command line tool.
I realize I can script gimp, but that feels too heavy for this purpose. Imagemagick seems ideal for this, but I don't know if I can do the layering with it.
So the question is:
- Is there a way to script imagemagick to do the above algorithm without the use of a temporary file?
- Is there a reasonable alternative library/tool that can be integrated with Python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一个用于白板清理的 ImageMagick 脚本 - http://www.fmwconcepts.com/imagemagick /whiteboard/index.php
There is a ImageMagick script for whiteboard cleanup here - http://www.fmwconcepts.com/imagemagick/whiteboard/index.php