首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Node.js使用连接的组件在图像上查找blob

Node.js使用连接的组件在图像上查找blob
EN

Stack Overflow用户
提问于 2017-04-04 22:02:29
回答 1查看 244关注 0票数 0

我正在尝试计算图像中斑点的x和y坐标。

来自这个问题的以下建议:Connected-component labeling with ImageMagick

我有这段代码。

最终结果会正确地突出显示斑点。

但是,我无法以编程方式获得“详细”输出。我需要x,y坐标。我是不是遗漏了什么?

代码语言:javascript
复制
gm('difference.png')
.out('-colorspace')
.out('gray')
.out('-threshold')
.out('90%')
.out('-define')
.out('connected-components:verbose=true')
.out('-connected-components')
.out('4')
.out('-auto-level')
.write("out.png", function(err){
        console.log(err);
        //how to get the verbose output about the blob positions??
    });`enter code here`
EN

回答 1

Stack Overflow用户

发布于 2017-04-05 13:29:12

我找到了从gm操作中获取输出的方法。

代码语言:javascript
复制
gm(imagePath)
.out('-define')
.out('connected-components:verbose=true')
.out('-connected-components')
.out('4')
.out('-auto-level')
.write('out.png', function(err, stdout){
    //details in stdout
});
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43209499

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档