A method for identifying special-shaped filter tips based on machine vision technology

Through the polar coordinate mapping idea and sequence matching method, the misjudgment problem of machine vision technology in the detection of special-shaped filter tips is solved, and the effective detection of the type and integrity of the special-shaped filter tips pattern is achieved.

CN115797671BActive Publication Date: 2025-09-16THE 41ST INST OF CHINA ELECTRONICS TECH GRP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211539518.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2025-09-16
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

Existing machine vision technology cannot effectively detect the integrity and pattern type of special-shaped filters, and is prone to misjudgment, especially when the lighting changes and the angle rotates.

Method used

Using the idea of ​​polar coordinate mapping, the graphics are converted into a sequence representation of the distance from each contour point to the center point. Normalized matching is performed by expanding and sliding the polar coordinate system sequence, and the best matching coefficient is judged to be within the set threshold range to determine the consistency of the graphics.

Benefits of technology

It effectively distinguishes the patterns of different shaped filters, improves the accuracy and robustness of detection, and solves the problem of misjudgment caused by lighting changes and angle rotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797671B_ABST
    Figure CN115797671B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for recognizing special-shaped filter tips based on machine vision technology, which belongs to the field of machine vision technology. The present invention first searches for the center coordinates of the outlines of the template image and the target image, performs polar coordinate conversion on the outlines of the template image and the target image, and converts the sequence T C Copy and expand twice as much as T ctem , S C In T ctem Slide upward to perform normalized template matching and obtain the optimal matching coefficient. If the optimal matching coefficient does not meet the set threshold, the target image is considered to be significantly different from the template image; if the optimal matching coefficient meets the conditions, the target image and the template image are considered to be consistent. This invention utilizes polar coordinate mapping to convert the image into a sequence represented by the distance from each contour point to the center point. This effectively solves the problem of misjudgment caused by unclear distinction between different images and insufficient matching when the image is rotated. It can distinguish between different filter shapes, has good detection results, and has a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of machine vision, and in particular relates to a method for recognizing special-shaped filter tips based on machine vision technology. Background Art

[0002] With the development of the tobacco industry and tobacco technology, more and more cigarette companies have launched cigarettes with special-shaped filters featuring recessed patterns on the filter tip. During the production process of these special-shaped filter cigarettes, defects such as missing or damaged patterns or incorrect patterns may occur, resulting in substandard cigarette packs.

[0003] Currently, traditional mechanical contact, static infrared photoelectric, and dynamic infrared photoelectric methods used in packaging machines are unable to inspect irregular filters with recessed patterns. Some machine vision-based filter inspection methods simply detect the presence of recessed patterns and are unable to effectively determine the type and integrity of the irregular pattern. Currently, the more commonly used methods are grayscale template matching and geometric moment-based pattern matching. Grayscale template matching directly utilizes image grayscale information for matching, measuring the correlation between the template image and the target image by the difference in pixel grayscale values ​​between the template and target images within the search window. However, this method is sensitive to lighting variations and relies too heavily on the grayscale information of each pixel. Furthermore, when the angle of each cigarette within a pack varies and the pattern is rotated, its matching coefficient cannot meet the requirements for different types and integrity inspections. Geometric moment-based pattern matching methods can detect patterns with small rotation angles, but they cannot detect patterns with large rotation angles and are prone to misjudgment. Therefore, this paper proposes a novel irregular filter pattern recognition method based on existing visual filter inspection methods to inspect the integrity and pattern type of irregular filters. Summary of the Invention

[0004] In view of the above technical problems existing in the prior art, the present invention proposes a method for identifying special-shaped filter tips based on machine vision technology, which has a reasonable design, overcomes the shortcomings of the prior art, and has good effects.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for identifying special-shaped filter tips based on machine vision technology comprises the following steps:

[0007] Step 1: Find the template image contour and the target graphic contour;

[0008] Step 2: Calculate the center coordinates of the template image contour and the target image contour respectively;

[0009] Step 3: Taking the two center coordinates as the center, perform polar coordinate mapping transformation on the template image contour and the target image contour to obtain the polar coordinate system sequence T c and S c ;

[0010] Step 4: Convert the polar coordinate system sequence T c Expand by one time to form a new sequence T ctem ;

[0011] Step 5: Convert the polar coordinate sequence S c In T ctem Slide on the sequence to perform normalized template matching and obtain the best matching coefficient d1;

[0012] Step 6: Determine whether the best matching coefficient d1 is within the set matching threshold range;

[0013] If: the judgment result is that the best matching coefficient d1 is within the set matching threshold range, then the template image is consistent with the target image;

[0014] Or if the judgment result is that the best matching coefficient d1 is not within the set matching threshold range, then the template image is inconsistent with the target image;

[0015] Step 7: End.

[0016] The beneficial technical effects brought about by the present invention are:

[0017] The method of the present invention cleverly uses the idea of ​​polar coordinate mapping to convert the graphics into a sequence representation of the distance from each contour point to the center point, which better reflects the contour of the graphics; it can effectively solve the problems of grayscale-based template matching and geometric moment-based graphics matching, and can effectively solve the misjudgment problems caused by unclear distinction between different graphics and insufficient matching when the graphics have a rotation angle. It can effectively distinguish the graphics of different special-shaped filters, has good detection effect and a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Flow chart of the method of the present invention;

[0019] Figure 2 This is a schematic diagram of polar coordinate mapping;

[0020] Figure 3 Schematic diagram of the matching effect between a quadrilateral and different graphics;

[0021] Figure 4 This is a schematic diagram of the matching effect of the same graphics; DETAILED DESCRIPTION

[0022] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0023] The processing flow of the graphic recognition method based on polar coordinate mapping matching is as follows: Figure 1 The specific process is as follows:

[0024] 1. Calculate the contours of the template image T and the target image S by contour search, denoted as T cont and S cont .

[0025] 2. For a discrete digital image f(x,y) of size M×N, the origin moment m pq The calculation formula is as follows:

[0026]

[0027] Where x represents the horizontal coordinate, y represents the vertical coordinate, M is the width of the image, N is the height of the image, and f(x,y) is the grayscale distribution function of the image in the rectangular coordinate system. The center coordinates of the two contours are calculated using the first-order moment (p+q=1) and the zero-order moment (p+q=0). The calculation formula is as follows:

[0028]

[0029] Among them, (x0, y0) is the center point of the figure in the rectangular coordinate system, m 00 is the zero-order moment, m 10 and m 01 Is the first-order moment. The center points of the template image and the target image are (x t ,y t )、(x s ,y s ).

[0030] 3. Take point (x t ,y t )、(x s ,y s ) as the center and respectively divide the graphic outline T cont and S cont Perform polar coordinate mapping transformation. The formula for polar coordinate mapping transformation is as follows:

[0031]

[0032]

[0033] Among them, (x, y) is the coordinate of the contour point of the figure in the rectangular coordinate system, (x0, y0) is the center point of the figure in the rectangular coordinate system, and the conversion principle is as follows Figure 2 As shown. Arrange the r values ​​after polar coordinate transformation in order to form a new sequence T c and S c .

[0034] 4. The polar coordinate sequence T of the template image T c Do the expansion process and extend its length to T c Twice as much, the extended part of the data is still in T c Fill in to form a new sequence T ctem .

[0035] 5. S c In T ctem Slide on the sequence to perform normalized template matching and obtain the best matching coefficient d1, which is calculated as follows:

[0036]

[0037] Among them, S c (r ′ ,θ ′ ) is the sequence S c At point (r ′ ,θ ′ ), T ctem (r+r ′ ,θ+θ ′ ) is the sequence T ctem At point (r+r ′ ,θ+θ ′ ), (r ′ ,θ ′ ) is the sequence S c The coordinate range of (r,θ) is the sequence S c In sequence T ctem The offset distance of the upward slide.

[0038] 6. When d1 does not meet the set matching threshold, it is considered that the pattern on the target image S is significantly different from the pattern on the template image T; when d1 meets the set matching threshold, it is considered that the pattern on the target image S is normal.

[0039] Polar coordinate mapping is used to identify quadrilateral, pentagonal and hexagonal filter shapes. Figure 3 shown. Figure 3 In the figure, the solid line represents the arrangement of the template contour after polar coordinate mapping and expansion, and the dashed line represents the arrangement of the target contour after polar coordinate mapping. The value "Val" at the bottom of the coordinate axis represents the optimal match (0 is the optimal match). The figure clearly shows that the matching values ​​for identical shapes are low, such as 0.00 for T and A, while the matching values ​​for different shapes are larger, such as 0.47 for T and B and 0.39 for T and C, indicating good discrimination.

[0040] The matching effects of the same graphic shaped filter at different rotation angles are as follows: Figure 4 shown. Figure 4In the figure, the solid line shows the arrangement of the template contour after polar coordinate mapping and expansion, and the dashed line shows the arrangement of the target contour after polar coordinate mapping. The value "Val" at the bottom of the coordinate axis represents the best match (0 is the best match). In the figure, the matching value between T and D is 0.08, and the matching value between T and E is 0.07. It can be seen that the matching values ​​of the same shape after rotation are not much different.

[0041] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the scope of protection of the present invention.

Claims

1. A method for identifying irregular filter tip patterns based on machine vision technology, characterized by: The steps include: Step 1: Calculate the contours of the template image T and the target image S by contour search, denoted as T c0nt and S c0nt ; Step 2: For the M×N size discrete digital image f(x,y), the origin moment m pq The calculation formula is as follows: Where x represents the horizontal coordinate, y represents the vertical coordinate, M is the width of the image, N is the height of the image, and f(x,y) is the grayscale distribution function of the image in the rectangular coordinate system. The center coordinates of the two contours are calculated using the first-order moment and the zero-order moment. The calculation formula is as follows: Among them, (x0, y0) is the center point of the figure in the rectangular coordinate system, m 00 is the zero-order moment, m 10 and m 01 is the first-order moment; the center points of the template image and the target image are (x t ,y t )、(x s ,y s ); Step 3: Take point (x t ,y t )、(x s ,y s ) as the center and respectively divide the graphic outline T cont and S cont Perform polar coordinate mapping transformation. The formula for polar coordinate mapping transformation is as follows: Among them, (x, y) is the coordinate of the contour point of the figure in the rectangular coordinate system, (x0, y0) is the center point of the figure in the rectangular coordinate system, and the r values ​​after polar coordinate transformation are arranged in order to form a new sequence T c and S c ; Step 4: Transform the polar coordinate sequence T of the template image T c Do the expansion process and extend its length to T c Twice as much, the extended part of the data is still in T c Fill in to form a new sequence T ctem ; Step 5: S c In T ctem Slide on the sequence to perform normalized template matching and obtain the best matching coefficient d(r,θ), which is calculated as follows: Among them, S c (r ′ ,θ ′ ) is the sequence S c At point (r ′ ,θ ′ ), T ctem (r+r ′ ,θ+θ ′ ) is the sequence T ctem At point (r+r ′ ,θ+θ ′ ), (r ′ ,θ ′ ) is the sequence S c The coordinate range of (r,θ) is the sequence S c In sequence T ctem The offset distance of the upward slide; Step 6: Determine whether the optimal matching coefficient d(r,θ) is within the set matching threshold range; If: the judgment result is that the best matching coefficient d(r,θ) is within the set matching threshold range, then the template image is consistent with the target image; or the judgment result is that the best matching coefficient d(r,θ) is not within the set matching threshold range, then the template image is inconsistent with the target image.

Citation Information

Patent Citations

  • Visual processing method for strip steel processing production line

    CN105335973A