擅长:python、mysql、java
<p>您可以使用scipy的<a href="https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.measurements.label.html" rel="nofollow noreferrer">^{<cd1>}</a>在图像中查找连接的组件:</p>
<pre><code>from scipy.ndimage.measurements import label
label_pred, numobj_pred = label(my_predictions)
label_true, numobj_true = label(my_groundtruth)
</code></pre>
<p>然后用你选择的标准来比较</p>
<p>PS:或者是scikit图片的,还有一个演示<a href="http://www.scipy-lectures.org/packages/scikit-image/auto_examples/plot_labels.html" rel="nofollow noreferrer">here</a></p>