A method for stent detection based on multi-dimensional perspective images

By employing multi-dimensional perspective image processing technology, threshold segmentation, region growing, and fuzzy clustering algorithms are used to separate stems from tobacco shreds, solving the problems of low efficiency and low accuracy in cigarette detection and achieving rapid and non-destructive stem detection.

CN116245820BActive Publication Date: 2025-10-21CHINA TOBACCO GUANGDONG IND
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310067107.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-12
Publication Date
2025-10-21
Estimated Expiration
2043-01-12

AI Technical Summary

Technical Problem

Existing cigarette stick detection methods mainly rely on manual inspection, which has problems such as low detection efficiency, low accuracy, and large material loss, and makes it difficult to effectively identify cigarette sticks.

Method used

A detection method based on multi-dimensional perspective images is adopted. By acquiring perspective projection images of cigarettes in multiple dimensions, threshold segmentation, region growing algorithm and fuzzy clustering algorithm are used to separate the stem and tobacco shreds. The shape and size of the stem are determined by combining voting strategy and minimum bounding rectangle.

Benefits of technology

The invention realizes the rapid and non-destructive detection of cigarette stems, improves the detection precision and accuracy, overcomes the shortcomings of traditional methods, and provides a scientific and fast detection means.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116245820B_ABST
    Figure CN116245820B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on multi-dimension perspective image's stem signature detection method, it is related to cigarette detection technical field.Wherein, the method includes: the multiple dimensions of perspective projection image of the to-be-inspected cigarette is collected;Stem signature feature in perspective projection image is strengthened, and the to-be-inspected cigarette gray scale chart that only retains foreground information is constructed;Based on threshold segmentation algorithm, the to-be-inspected cigarette gray scale chart is handled, and the image about suspected stem signature is generated;Based on region growing algorithm, the attribution judgment of suspected stem signature region pixel is carried out, and based on fuzzy clustering algorithm, the interference point of suspected stem signature in image is filtered, and suspected stem signature perspective image is generated;Based on voting strategy, according to multiple dimensions suspected stem signature perspective image, the suspected stem signature that relative position information is matched is marked as detected stem signature;The minimum circumscribed rotating rectangle is used to determine the shape and size of detected stem signature, and the edge end point position of minimum circumscribed rotating rectangle is extracted, and detected stem signature is labeled in image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cigarette detection, and more particularly to a stem detection method based on multi-dimensional perspective images. Background Art

[0002] In cigarette manufacturing, stems are a type of homogeneous impurity that requires significant control during tobacco processing. During the cigarette manufacturing process, stemmed tobacco leaves are inevitably present due to the similar suspension velocity between some stemmed leaves and free, pure leaves after threshing, and the limited grading accuracy of air separation equipment. These stems then form in the tobacco leaves during the subsequent silk-making process. These stems can increase odor and irritation, causing punctures and leaks, potentially leading to cracking or flameout during smoking. These effects not only affect the combustibility of the cigarette but also reduce the sensory quality of the smoke.

[0003] Current methods for inspecting cigarette stems primarily rely on manual stripping. As the tobacco industry increasingly demands accuracy and timeliness in the testing and control of key processing quality indicators, manual inspection methods present increasingly prominent challenges, including low efficiency, inaccurate results, high cigarette waste, and significant labor costs. Summary of the Invention

[0004] In order to overcome the problems of low efficiency, high missed detection rate and destructive detection in the manual detection of stem signatures in the above-mentioned prior art, the present invention provides a stem signature detection method based on multi-dimensional perspective images.

[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:

[0006] A method for detecting stem labels based on multi-dimensional perspective images, comprising:

[0007] Collect perspective projection images of multiple dimensions for the cigarettes to be inspected;

[0008] The stem features in the perspective projection images of multiple dimensions are enhanced, while the tobacco features are weakened, to construct a grayscale image of the cigarette to be inspected that only retains the foreground information.

[0009] Based on the threshold segmentation algorithm, the grayscale images of the cigarettes to be inspected in multiple dimensions are processed respectively to generate multiple dimensions of candidate images of suspected stem labels;

[0010] Based on the region growing algorithm, the pixels in the suspected stem sign area in the multiple-dimensional candidate images are judged to belong to each other. Based on the fuzzy clustering algorithm, the interference points of the suspected stem sign in the multiple-dimensional candidate images are filtered out to generate the suspected stem sign perspective images in multiple dimensions.

[0011] Based on the voting strategy, according to the perspective images of suspected stem signs in multiple dimensions, the suspected stem signs with matching relative position information are found and marked as detected stem signs;

[0012] The shape and size of the detected stem mark are determined by using the minimum circumscribed rotated rectangle, the edge endpoint positions of the minimum circumscribed rotated rectangle are extracted, and the detected stem mark is marked in the relevant images of the detected stem mark.

[0013] In this technical solution, the stem and tobacco in the cigarette are finally separated by multiple processing and analysis of the perspective projection image of the cigarette.

[0014] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0015] This method, based on the image feature differences between stem and non-stem cigarettes in multi-dimensional perspective projection images, enables rapid, non-destructive detection of stems in cigarettes. This method effectively overcomes the shortcomings of traditional methods, such as high material loss, time-consuming testing, and low accuracy, providing a more scientific, rapid, and effective technical approach for cigarette quality testing. Compared to traditional methods involving manual tobacco stripping and stem selection, this method significantly improves detection precision and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flowchart of a method for detecting stem marks based on multi-dimensional perspective images;

[0017] Figure 2 It is a schematic diagram of the minimum circumscribed rotated rectangle;

[0018] Figure 3 Schematic diagram of the segmented inscribed circle algorithm;

[0019] Figure 4 Schematic diagram of the segment center point algorithm;

[0020] Figure 5 is a perspective projection image of the cigarette sample to be inspected in Example 2;

[0021] Figure 6 Schematic diagram of the perspective projection image processing information process in Example 2;

[0022] Figure 7 Schematic diagram of the threshold segmentation process in Example 2;

[0023] Figure 8 Schematic diagram of the process of determining the ownership of pixels in the suspected signature area and filtering out interference points in Example 2;

[0024] Figure 9 Schematic diagram of the voting process for suspected meme-signing perspective images in multiple dimensions in Example 2;

[0025] Figure 10 Schematic diagram of the stem labeling results detected in Example 2. DETAILED DESCRIPTION

[0026] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting this patent;

[0027] In order to better illustrate this embodiment, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product size;

[0028] It is understandable to those skilled in the art that some well-known structures and descriptions thereof may be omitted in the drawings.

[0029] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.

[0030] Example 1

[0031] This embodiment proposes a method for detecting stem marks based on multi-dimensional perspective images. Figure 1 ,include:

[0032] Collect perspective projection images of multiple dimensions for the cigarettes to be inspected;

[0033] The stem features in the perspective projection images of multiple dimensions are enhanced, while the tobacco features are weakened, to construct a grayscale image of the cigarette to be inspected that only retains the foreground information.

[0034] Based on the threshold segmentation algorithm, the grayscale images of the cigarettes to be inspected in multiple dimensions are processed respectively to generate multiple dimensions of candidate images of suspected stem labels;

[0035] Based on the region growing algorithm, the pixels in the suspected stem sign area in the multiple-dimensional candidate images are judged to belong to each other. Based on the fuzzy clustering algorithm, the interference points of the suspected stem sign in the multiple-dimensional candidate images are filtered out to generate the suspected stem sign perspective images in multiple dimensions.

[0036] Based on the voting strategy, according to the perspective images of suspected stem signs in multiple dimensions, the suspected stem signs with matching relative position information are found and marked as detected stem signs;

[0037] The shape and size of the detected stem mark are determined by using the minimum circumscribed rotated rectangle, the edge endpoint positions of the minimum circumscribed rotated rectangle are extracted, and the detected stem mark is marked in the relevant images of the detected stem mark.

[0038] By processing and analyzing the perspective projection image of the cigarette multiple times, the stem and shredded tobacco in the cigarette are finally separated according to the image characteristics of the stem and non-stem pieces in the cigarette to be inspected.

[0039] In a specific implementation process, the perspective projection image is obtained by performing X-ray projection imaging on the cigarette to be inspected.

[0040] In a specific implementation process, images in multiple dimensions can be obtained by rotating the cigarette to be inspected by multiple angles, or taking the cigarette to be inspected as the central axis and rotating the image acquisition device around the central axis to acquire multiple images. As a non-limiting example, the image acquisition device is an X-ray machine.

[0041] In a preferred embodiment, strengthening the stem signature features and weakening the cut tobacco features in the perspective projection images of multiple dimensions, and constructing a grayscale image of the cigarette to be inspected that only retains foreground information includes:

[0042] Adopting a bilateral filtering algorithm to remove image noise in the perspective projection image;

[0043] Statistical probability of occurrence corresponding to each gray level in the perspective projection image and the gray average value of the perspective projection image, and according to the statistical results, strengthening the stem signature features and weakening the cut tobacco features in the perspective projection image;

[0044] Cropping the image, removing background information, and retaining foreground information to construct a grayscale image of the cigarette to be inspected with only foreground information.

[0045] The bilateral filtering algorithm adopted in this preferred embodiment combines the characteristics of a Gaussian filter and an α-trimmed mean filter, taking into account both the spatial domain and the value domain, performing smoothing while retaining boundaries, and ensuring that the stem signature information is not lost.

[0046] The bilateral filtering algorithm constructs different weight templates for each position according to the neighborhood of that position. The detailed process is as follows:

[0047] First, construct a spatial distance weight template of winH*winW. Similar to the process of constructing a Gaussian convolution kernel, both winH and winW are odd numbers.

[0048]

[0049] Where 0 ≤ h < winH, 0 ≤ w < winW, and the spatial distance weight template at each position is the same.

[0050] Then, construct a similarity weight template of winH*winW, which is measured by the exponent of the difference between the value at (r, c) and its neighborhood.

[0051]

[0052] Finally, multiply the corresponding positions of closenessWeight and similarityWeight (i.e., dot product), and then perform normalization to obtain the weight template at that position. Multiply the obtained weight template by the corresponding positions in the neighborhood of that position, and then sum to obtain the output value at that position.

[0053] Considering that the grayscale values ​​of stems and tobacco differ after grayscale binarization: stems have smaller grayscale values ​​and darker colors, while tobacco has larger grayscale values ​​and lighter colors, a specific implementation utilizes a histogram equalization algorithm. Based on the statistical results of the probability of occurrence of each grayscale level in the perspective projection image and the average grayscale value of the perspective projection image, a grayscale threshold T0 is set. Values ​​greater than the grayscale threshold are increased, resulting in lighter colors overall, while values ​​less than the grayscale threshold are decreased, resulting in darker colors overall. This enhances the characteristics of the stems and weakens the characteristics of the tobacco in the perspective projection image.

[0054] The histogram equalization algorithm converts the histogram of a given image into a uniformly distributed histogram, thereby expanding the dynamic range of pixel grayscale values ​​and achieving the effect of enhancing image contrast. The detailed process is as follows:

[0055] Let r and s represent the normalized original image grayscale and the image grayscale after histogram equalization, respectively. All r and s values ​​are between 0 and 1. When r = s = 0, it represents black; when r = s = 1, it represents white; when r, s∈(0,1), it means that the pixel grayscale varies between black and white.

[0056] Histogram equalization actually transforms the grayscale values ​​of pixels based on the histogram, which falls within the scope of point operations. That is, given r, find its corresponding s.

[0057] For any r in the interval [0,1], a corresponding s can be generated by the transformation function T(r), and

[0058] s=T(r)

[0059] Where T(r) should satisfy the following two conditions:

[0060] 1. In the range 0≤r≤1, T(r) is a monotonically increasing function;

[0061] 2. In 0≤r≤1, 0≤T(r)≤1.

[0062] The inverse transformation relationship is:

[0063] r=T -1 ()

[0064] Where, T -1 () also satisfies the above two conditions for s.

[0065] According to probability theory, if the probability density of a random variable r is known to be p r (), and the random variable s is a function of r, then the probability density of s p s () can be obtained by p r () is calculated. Assume that the distribution function of the random variable s is Fs () indicates that according to the definition of the distribution function:

[0066]

[0067] And because the probability density function is the derivative of the distribution function, we can derive s on both sides of the above formula to get:

[0068]

[0069] It can be seen from the above formula that the probability density function p of the image gray level can be controlled by the transformation function T(r) s (), thereby improving the grayscale level of the image.

[0070] In a preferred embodiment, the threshold segmentation algorithm is used to process the grayscale images of the cigarette to be inspected in multiple dimensions to generate multiple dimensions of candidate images of suspected stems, including:

[0071] Initialize the threshold, perform threshold segmentation on the grayscale image of the cigarette to be inspected, generate a segmented image, and calculate the inter-class variance of the segmented image; the grayscale of the segmented image includes the grayscale of the foreground class and the grayscale of the background class;

[0072] Based on supervised iteration, the threshold is adaptively adjusted until the inter-class variance between the foreground class grayscale and the background class grayscale is maximized. The corresponding threshold is taken as the optimal threshold, and the grayscale image of the cigarette to be inspected is threshold segmented according to the optimal threshold to generate a candidate image of the suspected stem label.

[0073] In this preferred embodiment, since there is a certain similarity between the grayscale levels of some stem textures and the grayscale levels of tobacco in the grayscale image of the cigarette to be inspected, the image can be divided into several specific areas with unique properties and the targets of interest can be proposed through the adaptive threshold segmentation algorithm.

[0074] In a specific implementation process, the grayscale image of the cigarette to be inspected contains L grayscale levels, and the number of pixels with grayscale value i is N. i , the total number of pixels is N, and the pixel probability of each gray value is P i , the grayscale mean is u T , using the basic threshold T to segment the image into two categories: foreground c0 and background c1, then:

[0075]

[0076] w1()=1-w0()

[0077] Among them, w0() and w1() represent the probability of c0 and c1 occurring when the threshold is T;

[0078] The means of c0 and c1 are u0() and u1() respectively, and their expressions are:

[0079]

[0080]

[0081] Define σ 2 () represents the inter-class variance with a threshold of T in the histogram, and we have:

[0082]

[0083] The T value corresponding to the maximum inter-class variance is the optimal threshold, that is:

[0084]

[0085] In a preferred embodiment, the method of performing attribution judgment on pixels in suspected signature regions in multiple dimensions of the selected images based on a region growing algorithm includes:

[0086] Constructing a dilation result set and initializing at least one descriptor for selecting pixels;

[0087] In each candidate image, at least one pixel is selected as a seed point according to different segmentation areas of the image, and the seed point is placed in the expansion result set;

[0088] Expand outward from the seed point until all pixels of the selected image are traversed, and use the expanded result set as the suspected stem-signed area to complete the attribution judgment of the pixels in the suspected stem-signed area: Among them, for the pixels within the expanded range of the seed point, determine whether there are pixels that meet the descriptor and are adjacent to the pixels in the expanded result set: if so, place the corresponding pixel in the expanded result set; otherwise, do not add the pixel to the expanded result set.

[0089] In this preferred embodiment, pixels with similar properties are grouped together to form connected regions through a region growing algorithm, and broken regions are integrated to complete the pixel attribution determination in the signature region.

[0090] In a preferred embodiment, the method of filtering out interference points of suspected stem marks in the selected images of multiple dimensions based on the fuzzy clustering algorithm to generate perspective images of suspected stem marks of multiple dimensions includes:

[0091] For any suspected stem sign in any candidate image processed by the region growing algorithm, a fuzzy clustering algorithm is used to filter out multiple point interference points in the candidate image based on the membership degree of the pixels in the suspected stem sign area to the center of the suspected stem sign, and generate a perspective image of the suspected stem sign.

[0092] In this preferred embodiment, not only are the broken stems integrated, but also the breakpoint interference points are eliminated, thereby filtering out the pseudo stems and broken stems caused by shredded tobacco.

[0093] In the specific implementation process, the following fuzzy clustering algorithm based on the objective function is adopted:

[0094] Assume that the data set is X={x1,x2,…,x c}, divide these data into c categories, then there are c class centers with c i , each sample X j Belong to a certain category C i The membership degree is u ij , define an objective function J and its constraints:

[0095]

[0096]

[0097] The objective function (Formula 1) is composed of the membership of the corresponding sample multiplied by the distance from the sample to each class center. Formula 2 is the constraint condition, that is, the sum of the membership of a sample to all classes must be 1.

[0098] The m in formula 1 is a membership factor, usually 2, ||x j -c i || represents x j To the center point c i The Euclidean distance of .

[0099] The smaller the objective function J is, the better, that is, to obtain the minimum value of the objective function J.

[0100] u ij The iterative formula is:

[0101]

[0102] c i The iterative formula is:

[0103]

[0104] In a preferred embodiment, the voting strategy is used to search for suspected stem signs with matching relative position information based on the perspective images of suspected stem signs in multiple dimensions and mark them as detected stem signs, including:

[0105] Based on the relative position information of any suspected stem marker in the suspected stem marker perspective images of multiple dimensions, a vote is performed on whether the suspected stem marker should be marked as a detected stem marker: if a suspected stem marker exists at the same relative position in any suspected stem marker perspective image, the suspected stem marker perspective image of the corresponding dimension votes for the suspected stem marker; otherwise, the suspected stem marker perspective image of the corresponding dimension does not vote for the suspected stem marker;

[0106] The voting results of all suspected stalker signatures are traversed in sequence. For any suspected stalker signature, determine whether the number of votes obtained by any suspected stalker signature is not less than the preset threshold. If so, mark the corresponding suspected stalker signature as a detected stalker signature. Otherwise, do not mark it.

[0107] This preferred embodiment converts a single two-dimensional space into a multi-angle three-dimensional information space through a voting method of multi-dimensional perspective images of suspected stems, thereby realizing comprehensive analysis and discrimination of the cigarettes to be inspected in different dimensions, effectively avoiding missed detections and false detections due to differences in observation angles, and solving the problem of high-density imaging caused by overlapping upper tobacco leaves in two-dimensional space or the stems just being on one side of the cigarette to be inspected with an imaging area too small to be effectively identified.

[0108] In a specific implementation, the cigarette to be inspected is rotated five times around the axis of rotation, obtaining perspective projection images in five dimensions, which are recorded as I1, I2, ..., I5. The Y-axis position of the suspected stem mark area in each dimension of the image is recorded as:

[0109] I1P={I1P|I1P1,...,I1Pn};

[0110] I2P={I2P|I2P1,...,I2Pn};

[0111]

[0112] I5P={I5P|I5P1,...,I5Pn};

[0113] The preset threshold is 4, and the position values ​​in the above 5 sets are compared: only when the corresponding suspected stem signature area has more than 4 identical position values ​​will it be finally marked as a detected stem signature, otherwise it will not be marked as a detected stem signature.

[0114] In a preferred embodiment, for any detected stem, determining the shape and size of the detected stem using the minimum circumscribed rotated rectangle includes:

[0115] The minimum circumscribed rotation rectangle is used to determine the overall outline of the detected stem tag;

[0116] The width of the detected stem label is calculated using the segmented inscribed circle algorithm;

[0117] The segment center point algorithm is used to calculate the length of the detected stem label.

[0118] In this preferred embodiment, since the shape of the tobacco stems is mostly curled, the minimum circumscribed rotated rectangle is used to skeletonize the tobacco, and the skeletons of each part are statistically calculated.

[0119] In an alternative embodiment, see Figure 2 For any detected stem sign, the minimum circumscribed rotated rectangle is used to determine the overall outline structure of the detected stem sign, specifically:

[0120] Get the detected signature area boundary and initialize the circumscribed rotated rectangle. The center point of the circumscribed rotated rectangle is (x, y), the width is height, the length is width, and the rotation angle is θ.

[0121] Detect the rotation angle of the circumscribed rotated rectangle and determine whether adjustment is needed based on the rotation angle: if the rotation angle θ<-45°, then θ is decremented by 270°; if 45°<θ≤90°, then θ is incremented by 270°; if -45°<θ<45° or 90°<θ, no adjustment is made;

[0122] The current circumscribed rotation rectangle is determined to be the minimum circumscribed rotation rectangle, which is used to determine the overall outline structure of the detected stem label.

[0123] In an optional embodiment, for any detected stem sign, the width of the detected stem sign is calculated using the segmented inscribed circle algorithm, see Figure 3 ,include:

[0124] Divide the minimum circumscribed rotated rectangle of the detected stem into several segments, and set an inscribed circle for each segment;

[0125] Count the diameters of all inscribed circles;

[0126] The average of the diameters of all inscribed circles is taken as the width of the detected stem.

[0127] In a specific implementation process, the segmented inscribed circle method is used to obtain the size of each segment of the detected stem signature, that is, the diameter d1, d2, d3, ..., d n , n represents the number of inscribed circles, and the width D of the stem is calculated by taking the average value of the sizes of each segment. The expression is as follows:

[0128]

[0129] In an optional embodiment, for any detected stem signature, the segment center point algorithm is used to calculate the length of the detected stem signature, see Figure 4 ,include:

[0130] Divide the detected stem into several sampling areas according to the extension direction of the outline;

[0131] Calculate the contour center point of each sampling area based on the spatial moment of the contour to determine the contour center point;

[0132] Connect the center points of the contours of several sampling areas, and use the connecting line as the skeleton of the detected stem sample, and its length is the length of the detected stem sample.

[0133] In this optional embodiment, taking into account the curvature of the stem shape, the central contour line is depicted to obtain a central axis that conforms to the curvature.

[0134] The contour center point algorithm is as follows:

[0135] Moment is a statistical concept, defined as f(x)*(x) being the definite integral of x. In a binary graph, its zero-order moment is defined as follows:

[0136]

[0137] V(i,j) is the grayscale value of point (i,j). The original meaning of this definition is the sum of the grayscale values ​​of all pixels. However, because in a binary image, white is 1 and black is 0, so M 00 The result is the sum of the pixel values ​​of all white areas, which can also be used as the area of ​​the white area.

[0138] Its first-order moment is defined as follows:

[0139]

[0140]

[0141] i, j are the x and y coordinates of each pixel respectively. This definition is essentially the sum of the x and y coordinates of all pixels multiplied by the pixel value, and then summed. The same M 10 The result is the sum of the x coordinates of all pixels in the white area, M 01 is the sum of the y coordinates of all white areas.

[0142] Using the first-order moment, we can find the coordinates of the center of gravity (center) of the image. The formula is:

[0143]

[0144] In an optional embodiment, for any detected stem sign, extracting the edge endpoint positions of the minimum circumscribed rotated rectangle and marking the detected stem sign in the image related to the detected stem sign includes:

[0145] Get the coordinates of the upper left corner and lower right corner of the minimum bounding rectangle;

[0146] According to the endpoint coordinates, the outline, width and length of the detected stem label are marked in the grayscale image of the cigarette to be inspected in any dimension to complete the mapping of the detected stem label.

[0147] In a specific implementation process, for a detected stem signature, the upper left point (X n , Y n ) and the coordinates of the lower right point (X m , Y m ), and finally the position of the detected stem tag is mapped to the grayscale image of the cigarette to be inspected according to the coordinates of the stem tag's circumscribed rectangle.

[0148] Example 2

[0149] To verify the feasibility, this embodiment tests the stem signature detection method based on multi-dimensional perspective images proposed in Example 1. The test process is as follows:

[0150] Place the cigarette sample to be inspected under the X-ray machine, unload and rotate the cigarette to be inspected, and collect X-ray images in multiple dimensions, namely perspective projection images, see Figure 5 ;

[0151] The stem features in the perspective projection images of multiple dimensions are enhanced, and the tobacco features are weakened, to construct a grayscale image of the cigarette to be inspected that only retains the foreground information. Figure 6 ;

[0152] Based on the threshold segmentation algorithm, the grayscale images of the cigarettes to be inspected in multiple dimensions are processed respectively, the stems and tobacco in the cigarettes to be inspected are segmented by thresholds, and multiple dimensions of candidate images of suspected stems are generated. Figure 7 ;

[0153] Based on the region growing algorithm, the pixels in the suspected stem sign area in the multiple-dimensional candidate images are judged to belong to each other. Based on the fuzzy clustering algorithm, the interference points of the suspected stem sign in the multiple-dimensional candidate images are filtered out to generate the suspected stem sign perspective images in multiple dimensions. Figure 8 ;

[0154] Based on the voting strategy, according to the perspective images of suspected stem signs in multiple dimensions, the suspected stem signs with matching relative position information are found and marked as detected stem signs. Figure 9 ,Finally 2 detected stem labels were marked;

[0155] Use the minimum circumscribed rotated rectangle to determine the shape and size of the detected stem mark, extract the edge endpoint position of the minimum circumscribed rotated rectangle, and mark the detected stem mark in the relevant image of the detected stem mark. Figure 10 , to achieve the visualization of the stem label in the image of the cigarette to be inspected.

[0156] Example 3

[0157] This embodiment provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform the method for detecting stem marks based on multi-dimensional perspective images proposed in Example 1.

[0158] The same or similar reference numerals correspond to the same or similar components;

[0159] The terms used in the drawings to describe positional relationships are for illustrative purposes only and should not be construed as limiting this patent;

[0160] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting stem marks based on multi-dimensional perspective images, characterized in that: include: Collect perspective projection images of multiple dimensions for the cigarettes to be inspected; The stem features in the perspective projection images of multiple dimensions are enhanced, while the tobacco features are weakened, to construct a grayscale image of the cigarette to be inspected that only retains the foreground information. Based on the threshold segmentation algorithm, the grayscale images of the cigarettes to be inspected in multiple dimensions are processed respectively to generate multiple dimensions of candidate images of suspected stem labels; Based on the region growing algorithm, the pixels in the suspected stem sign area in the multiple-dimensional candidate images are judged to belong to each other. Based on the fuzzy clustering algorithm, the interference points of the suspected stem sign in the multiple-dimensional candidate images are filtered out to generate the suspected stem sign perspective images in multiple dimensions. Based on the voting strategy, according to the perspective images of suspected stem signs in multiple dimensions, the suspected stem signs with matching relative position information are found and marked as detected stem signs; Using the minimum circumscribed rotated rectangle, determine the shape and size of the detected stem mark, extract the edge endpoints of the minimum circumscribed rotated rectangle, and mark the detected stem mark in the relevant images of the detected stem mark; For any detected stem sign, determining the shape and size of the detected stem sign using the minimum circumscribed rotated rectangle includes: The minimum circumscribed rotation rectangle is used to determine the overall outline of the detected stem tag; The width of the detected stem label is calculated using the segmented inscribed circle algorithm; Use the segment center point algorithm to calculate the length of the detected stem label; Furthermore, the step of calculating the width of the detected stem label using a segmented inscribed circle algorithm includes: Divide the minimum circumscribed rotated rectangle of the detected stem into several segments, and set an inscribed circle for each segment; Count the diameters of all inscribed circles; The average of the diameters of all inscribed circles is taken as the width of the detected stem; Furthermore, the segment center point algorithm is used to calculate the length of the detected stem signature, including: Divide the detected stem into several sampling areas according to the extension direction of the outline; Calculate the contour center point of each sampling area based on the spatial moment of the contour to determine the contour center point; Connect the center points of the contours of several sampling areas, and use the connecting line as the skeleton of the detected stem sample, and its length is the length of the detected stem sample.

2. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: The method of enhancing the stem features and weakening the tobacco features in the perspective projection images of multiple dimensions to construct a grayscale image of the cigarette to be inspected that retains only foreground information includes: Use bilateral filtering algorithm to remove image noise in perspective projection images; Calculate the probability of occurrence of each grayscale level in the perspective projection image and the grayscale average value of the perspective projection image, and based on the statistical results, strengthen the stem characteristics and weaken the tobacco characteristics in the perspective projection image; Crop the image, remove background information, retain foreground information, and construct a grayscale image of the cigarette to be inspected containing only foreground information.

3. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: The threshold segmentation algorithm is based on processing the grayscale images of the cigarettes to be inspected in multiple dimensions respectively to generate multiple dimensions of candidate images of suspected stem labels, including: Initialize the threshold, perform threshold segmentation on the grayscale image of the cigarette to be inspected, generate a segmented image, and calculate the inter-class variance of the segmented image; the grayscale of the segmented image includes the grayscale of the foreground class and the grayscale of the background class; Based on supervised iteration, the threshold is adaptively adjusted until the inter-class variance between the foreground class grayscale and the background class grayscale is maximized. The corresponding threshold is taken as the optimal threshold, and the grayscale image of the cigarette to be inspected is threshold segmented according to the optimal threshold to generate a candidate image of the suspected stem label.

4. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: The region growing algorithm is used to determine the attribution of pixels in the suspected signature area in the candidate images of multiple dimensions, including: Constructing a dilation result set and initializing at least one descriptor for selecting pixels; In each candidate image, at least one pixel is selected as a seed point according to different segmentation areas of the image, and the seed point is placed in the expansion result set; The algorithm expands outward from the seed point until all pixels of the selected image are traversed. The expanded result set is used as the suspected stem-signed area to complete the attribution judgment of the pixels in the suspected stem-signed area. For the pixels within the expanded range of the seed point, it is determined whether there are pixels that meet the descriptor and are adjacent to the pixels in the expanded result set. If so, the corresponding pixel is placed in the expanded result set. Otherwise, the pixel is not added to the expanded result set.

5. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: The method of filtering out interference points of suspected stem marks in the selected images of multiple dimensions based on the fuzzy clustering algorithm to generate perspective images of suspected stem marks of multiple dimensions includes: For any suspected stem sign in any candidate image processed by the region growing algorithm, a fuzzy clustering algorithm is used to filter out multiple point interference points in the candidate image based on the membership degree of the pixels in the suspected stem sign area to the suspected stem sign center, and generate a perspective image of the suspected stem sign.

6. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: The voting strategy is based on the perspective images of suspected stem signs in multiple dimensions, and searching for suspected stem signs with matching relative position information and marking them as detected stem signs, including: Based on the relative position information of any suspected stem marker in the suspected stem marker perspective images of multiple dimensions, a vote is performed on whether the suspected stem marker should be marked as a detected stem marker: if a suspected stem marker exists at the same relative position in any suspected stem marker perspective image, the suspected stem marker perspective image of the corresponding dimension votes for the suspected stem marker; otherwise, the suspected stem marker perspective image of the corresponding dimension does not vote for the suspected stem marker; The voting results of all suspected stalker signatures are traversed in sequence. For any suspected stalker signature, determine whether the number of votes obtained by any suspected stalker signature is not less than the preset threshold. If so, mark the corresponding suspected stalker signature as a detected stalker signature. Otherwise, do not mark it.

7. The method for detecting stem marks based on multi-dimensional perspective images according to claim 1, characterized in that: For any detected stem sign, extracting the edge endpoint positions of the minimum circumscribed rotated rectangle and marking the detected stem sign in the image related to the detected stem sign includes: Get the coordinates of the upper left corner and lower right corner of the minimum bounding rectangle; According to the endpoint coordinates, the outline, width and length of the detected stem label are marked in the grayscale image of the cigarette to be inspected in any dimension to complete the mapping of the detected stem label.

Citation Information

Patent Citations

  • Approximate rectangular plane-shaped industrial product surface defect detection method

    CN107301637A

  • Image processing method and system, and computer readable storage medium

    US20220301115A1