The article discusses an algorithm for recognizing the contour of fragments of a honeycomb block. The inapplicability of ready-made functions of the OpenCV library is shown. Two proposed algorithms are considered. The direct scanning algorithm finds the extreme white pixels in the binarized image, it works adequately on convex shapes of products, but does not find a contour on concave areas and in cavities of products. To solve this problem, a scanning algorithm using a sliding matrix is proposed, which works correctly on products of any shape.
翻译:文章讨论了识别蜂窝块碎片轮廓的算法。 演示了 OpenCV 库的现成功能的不适用性。 考虑了两种拟议的算法。 直接扫描算法在二进制图像中发现了极端的白色像素, 它在产品的二次曲线形状上充分发挥作用, 但是在相近区域和产品的空洞上却没有找到轮廓。 为了解决这个问题, 提出了一个使用滑动矩阵的扫描算法, 它对任何形状的产品都正确有效 。