擅长:python、mysql、java
<p>你可以用<a href="https://en.wikipedia.org/wiki/Canny_edge_detector#Robust_method_to_determine_the_dual-threshold_value" rel="noreferrer">Otsu's robust method for determining the dual threshold value</a>试试精明的边缘检测器。</p>
<pre><code>im = cv2.imread('9WJTNaZ.jpg', 0)
th, bw = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
edges = cv2.Canny(im, th/2, th)
</code></pre>
<p>那你就可以用</p>
<ul>
<li>等高线的凸性缺陷</li>
</ul>
<p>或者</p>
<ul>
<li>填充轮廓到轮廓边框的区域</li>
</ul>
<p>区分十字记号和圆。</p>
<p>这就是我把精明运用到你的形象上所得到的。</p>
<p><a href="https://i.stack.imgur.com/uYwYB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uYwYB.png" alt="edges"/></a></p>