Tie-positioning method based on improved convex hull defect algorithm
Objective Aiming at difficult detection,missed detection,difficulty in locating the position of ties and slow speed in conventional algorithms when detecting ties due to the color similarity between ties and woven bags,as well as the small area occupied by ties,the conventional vision is difficult to detect the position of ties,and deep learning algorithms are difficult to create datasets.Therefore,a strap positioning method based on improved convex hull defect algorithm is proposed.Method An adaptive histogram equalization image enhancement algorithm was adopted to increase the contrast between the woven bag contour area and the background,and to improve the extraction accuracy of the woven bag contour.A fast convex hull algorithm was then adopted to obtain the convex hull of the woven bag contour,aiming at reducing the time required to obtain the convex hull of the woven bag contour.Consequently,an improved convex hull defect algorithm was established and used for defect detection of woven bags.Based on the location and depth of the convex hull defect points in the detection results,defect points were screened to obtain the final required defect point,which is the tie positioning point.Results In order to verify the accuracy and robustness of the algorithm,experiments were conducted in an environment with complex background interference,based on the fact that the number of ties commonly used for bundling woven bags is 2 or 3 in practice.In order to fit the actual situation,three types of woven bag images were captured using a ZED camera with a number of 2-4 ties.Due to the small pixel difference between the woven bag and the surrounding environment,direct image pre-processing may result in low accuracy of the subsequently extracted woven bag contour.In order to retain more details of the woven bag contour,the image was first processed using adaptive histogram equalization,and then the woven bag contour was obtained by image pre-processing,morphological processing,contour rendering and filtering.Afterwards,a fast convex hull algorithm was adopted to solve the convex hull of the woven bag contour,reducing the time required to solve the convex hull of the woven bag contour.Three algorithms were adopted to solve the convex hull of woven bags.The Andrew algorithm took 0.07 s,the Graham algorithm took 0.04 s,and the fast convex hull algorithm took 0.02 s,which is 0.05 s faster than the Andrew algorithm and 0.02 s faster than the Graham algorithm,verifying the feasibility of the fast convex hull algorithm.Next,the conventional convex hull defect algorithm and the improved convex hull defect algorithm were adopted,respectively to detect the convex hull of the woven bag contour.The conventional convex hull defect algorithm only detects the deepest defect point between the defect starting point and the defect ending point.In the case of multiple defects between the defect starting point and the defect ending point,some defects may not be detected leading to the increased number of missed detection.Where the positioning points of the ties cannot be fully detected with conventional methods,the improved algorithm demonstrated that all defects cpuld be detected with a missed detection rate of 0.The positioning error was less than 4 mm,and could accurately locate the positions of all ties.The feasibility and robustness of the algorithm were verified.Conclusion The experimental results show that the improved convex hull defect algorithm can solve the problem of missed detection in conventional convex hull defect methods,detect all defects in woven bags,accurately locate the position of ties,and the algorithm can be applied to the positioning of various colored ties,indicating the effectiveness and applicability of the algorithm.
tie positioningconvex hulldefect detectionimage enhancementhistogram equalizationcylinder yarn packaging