我正在尝试计算图像中斑点的x和y坐标。
来自这个问题的以下建议:Connected-component labeling with ImageMagick
我有这段代码。
最终结果会正确地突出显示斑点。
但是,我无法以编程方式获得“详细”输出。我需要x,y坐标。我是不是遗漏了什么?
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`发布于 2017-04-05 13:29:12
我找到了从gm操作中获取输出的方法。
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
});https://stackoverflow.com/questions/43209499
复制相似问题