linux - 脚本不工作。我究竟做错了什么?

标签 linux

首先,我找到了本指南,其中详细介绍了我所需要的内容。

https://imagemagick.org/script/connected-components.php

enter image description here

在我的一生中,我无法让它发挥作用。大家有什么想法吗?

我已经尝试了指南中列出的脚本的多种变体。

此外,当我运行convert/var/www/mailtovoice/audrey/sean_look_grey.png -defineconnected-components:verbose=true -connected-components 8/var/www/mailtovoice/audrey/sean_look4.png

我得到了 1000 个对象。当我将其转换为仅包含 3 个对象的图像时,我得到了 100 秒。

最佳答案

Mark 的想法是正确的,但解决方案比他发布的要简单得多,因为 ImageMagick -connected-components 可以直接进行过滤和输出。

输入: enter image description here

Unix 行结尾(对于 Windows 使用 ^ 而不是 \ )

convert image.png \
-define connected-components:area-threshold=100 \
-define connected-components:mean-color=true \
-connected-components 4 \
result.png


enter image description here

关于linux - 脚本不工作。我究竟做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52938385/

相关文章:

linux - 如何在本地开发中配置apache

linux - 如何在 Knoppix 中设置 PATH?

regex - 如何停止搜索单词(regex、grep)?

linux - 如何在 Linux 中用我编译的 boost 替换默认的 boost?

Python Netsnmp 和 snmpwalk

linux - 将两个单词列表合并到一个文件中

c - socket编程中如何正确拒绝客户端连接?

android找不到目标

在 Linux 中使用 signal.h 编译错误

linux - 通过 UDP 在端口上接收消息的非阻塞服务