Polyurethane floor mat molding detection method and system
By performing the connection domain analysis and feature index calculation of the denoising image of polyurethane floor mats, and screening defect areas with clustering algorithms, the problem of low detection accuracy of polyurethane floor mats in the prior art is solved, and efficient and accurate detection and evaluation of defect areas is achieved.
Patent Information
- Application Number
- CN202410764390.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-06-14
AI Technical Summary
In the prior art, the defect detection accuracy of polyurethane floor mats is low, and it is prone to error detection and miss detection. Especially when the grayscale difference between the texture area and the background area is obvious, it is difficult for the traditional k-means clustering algorithm to effectively segment the defect area.
A polyurethane floor mat molding detection method is used to obtain denoising images and divide the connection domain, calculate the grayscale feature index and edge law index of the connection domain, combine the clustering algorithm to screen out the target connection domain, cluster according to the possibility and damage degree of the defect area, obtain the defect area and evaluate its impact degree.
It improves the accuracy of detection of defect areas of polyurethane floor mats, reduces the calculation complexity and processing volume, can quickly locate defect areas and quantify their impact, and improves detection efficiency and accuracy.
Smart Images

Figure CN118334030B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a polyurethane floor mat molding detection method and system. Background Art
[0002] Polyurethane is a polymer material with excellent mechanical properties and strong plasticity, making it widely used. Therefore, it is also used in the floor mat production industry, where it offers advantages such as anti-slip and fatigue resistance. However, due to issues with the processing environment, polyurethane casting equipment, material ratios, and labor, polyurethane mats often develop defects, resulting in damage and substandard product quality. Defects not only affect the appearance of polyurethane mats but also pose quality issues, and in severe cases, pose safety risks to users. Therefore, computer vision inspection technology is commonly used in polyurethane mat production to detect the molding quality of polyurethane mats. Prior art often uses clustering algorithms to determine whether polyurethane mats have defects. By clustering the grayscale of pixels in different regions, abnormal grayscale areas are identified, i.e., defect areas. However, polyurethane mats often have decorative patterns on their surfaces, resulting in significant grayscale differences between textured and background areas, with defect areas interspersed within them. Traditional k-means clustering algorithms segment defect areas, causing them to blend in with texture or background areas, leading to false detections and missed detections, reducing the accuracy of defect detection in polyurethane mats. Summary of the Invention
[0003] The present invention provides a polyurethane floor mat molding detection method and system to solve the existing problems.
[0004] The polyurethane floor mat molding detection method and system of the present invention adopt the following technical solutions:
[0005] One embodiment of the present invention provides a method for detecting the molding of a polyurethane floor mat, the method comprising the following steps:
[0006] Get the denoised image of the polyurethane floor mat;
[0007] Divide the denoised image of polyurethane floor mat into several connected domains;
[0008] The grayscale feature index of each connected domain is obtained according to the grayscale values of all pixels in each connected domain and the grayscale values of pixels on the straight line segment from the centroid of the connected domain to the edge;
[0009] Construct a rectangular coordinate system corresponding to the denoised image of the polyurethane mat. In this rectangular coordinate system, the edge regularity index of each connected domain is obtained based on the cross-intercept of the tangent line of all pixels on the edge of each connected domain and the number of pixels.
[0010] According to the gray feature index and edge regularity index of each connected domain, the possibility of each connected domain belonging to the defect area is obtained;
[0011] Recording a connected domain whose probability of belonging to a defect area is greater than a preset first judgment threshold as a target connected domain; obtaining the probability of any two target connected domains not being merged based on the probability of each target connected domain belonging to a defect area and the number of pixels on the common edge of any two target connected domains; using the probability of any two target connected domains not being merged as the clustering distance between any two target connected domains, performing a clustering operation on all target connected domains to obtain a number of defect areas;
[0012] The damage degree of each defect area is obtained according to the area of each defect area and the distance from the center of mass to the edge of the defect area;
[0013] The polyurethane floor mat molding test results are obtained based on the damage degree of each defective area.
[0014] Furthermore, the grayscale feature index of each connected domain is obtained according to the grayscale values of all pixels in each connected domain and the grayscale values of pixels on the straight line segment from the centroid to the edge of the connected domain, including the following specific steps:
[0015] The straight line segments from the centroid of each connected domain along several preset target directions to the edge of the connected domain are recorded as the target straight line segments of each connected domain;
[0016] The mean gray value of all pixels in each connected domain is recorded as the gray threshold of each connected domain;
[0017] Sort the grayscale thresholds of all connected domains from large to small to get a sequence, and sort the first to the The average value of the gray thresholds of the connected domains is recorded as the gray mean of the texture area; is the number of connected domains, is the floor function;
[0018] When When the gray threshold of the first connected domain is less than or equal to the gray mean of the texture area, the The grayscale feature index of each connected domain is set to the preset grayscale feature index;
[0019] When When the gray threshold of the first connected domain is greater than the gray mean of the texture area, the gray mean of the texture area, the The gray threshold of the connected component and the The grayscale values of all pixels on the target straight line segment of the connected domain are obtained. The gray feature index of a connected component.
[0020] Furthermore, the grayscale mean value of the texture area, the The gray threshold of the connected component and the The grayscale values of all pixels on the target straight line segment of the connected domain are obtained. The specific calculation formula of the gray feature index of a connected domain is:
[0021]
[0022] in, Indicates the The gray feature index of the connected domain, Indicates the The gray threshold of the connected components, represents the grayscale mean of the texture area, For the The first connected domain The variance of the grayscale values of all pixels on the target straight line segment, is the number of target straight line segments for each connected domain, Represents the normalization function.
[0023] Furthermore, the specific calculation formula for the edge regularity index of each connected domain is obtained based on the transverse intercept of the tangent line of all pixels on the edge of each connected domain and the number of pixels:
[0024]
[0025] in, Indicates the The edge regularity index of the connected domain, Indicates the first The first The cross-intercept of the tangent line at pixel points, Indicates the first The first The cross-intercept of the tangent line at pixel points, Indicates the first The first The intercept of the tangent line at pixel points, For the The number of pixels on the edge of a connected component.
[0026] Furthermore, the specific calculation formula for obtaining the possibility that each connected domain belongs to a defective area based on the grayscale feature index and edge regularity index of each connected domain is:
[0027]
[0028] in, For the The possibility that a connected region belongs to the defect area, Indicates the The gray feature index of the connected domain, Indicates the The edge regularity index of the connected domain, is the preset grayscale feature influence coefficient, is the preset edge feature influence coefficient.
[0029] Furthermore, the method of obtaining the possibility that any two target connected domains are not merged based on the possibility that each target connected domain belongs to a defect area and the number of pixels on the common edge of any two target connected domains includes the following specific steps:
[0030] When The target connected domain and When the target connected domains are not adjacent, The target connected domain and The probability that the target connected domains are not merged is set to a preset probability threshold;
[0031] When The target connected domain and When the target connected domains are adjacent, The target connected domain and The pixel points on the common edge of the target connected domain are recorded as target pixels;
[0032] The first The target connected domain and The area after the target connected domains are merged is recorded as the reference target area;
[0033] According to the method of obtaining the possibility that each connected domain belongs to the defect area, the possibility that the reference target area belongs to the defect area is obtained;
[0034] According to the number of target pixels corresponding to any two target connected domains, the grayscale values of pixels adjacent to the common edge, and the possibility that the reference target area belongs to the defect area, the possibility of not merging any two target connected domains when they are adjacent is obtained.
[0035] Furthermore, the specific calculation formula for obtaining the probability that any two target connected domains are not merged when they are adjacent is as follows based on the number of target pixels corresponding to any two target connected domains, the grayscale values of the pixels adjacent to the common edge, and the probability that the reference target region belongs to a defect region:
[0036]
[0037] in, Indicates the The target connected domain and The probability that the target connected domains are not merged, For the The target connected domain and The number of target pixels corresponding to the target connected domain, For the In the target connected domain, The target connected domain and The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected domain and The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected domain and The common edges of the target connected domains are adjacent to the The gray value of a pixel, For the In the target connected domain, The target connected domain and The common edges of the target connected domains are adjacent to the The gray value of a pixel, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The target connected domain and The possibility that the reference target area corresponding to the target connected domain belongs to the defect area, represents the normalization function, is the absolute value function, is an exponential function with a natural constant as its base.
[0038] Furthermore, the specific calculation formula for the damage degree of each defective area is obtained based on the area of each defective area and the distance from the center of mass to the edge of the defective area:
[0039]
[0040] in, Indicates the The damage degree of the defect area For the The area of the defective region, For the The length of the longest straight line segment from the centroid of a defect area to the edge of the defect area, For the The length of the shortest straight line segment from the centroid of the defect area to the edge of the defect area, is the normalization function.
[0041] Furthermore, the polyurethane floor mat molding test results are obtained according to the damage degree of each defective area, including the following specific steps:
[0042] The normalized value of the sum of the damage degrees of all defective areas is recorded as the quality threshold;
[0043] When the quality threshold is less than or equal to the preset first threshold, the floor mat quality is marked as excellent; when the quality threshold is greater than the preset first threshold and less than or equal to the preset second threshold, the floor mat quality is marked as good; when the quality threshold is greater than the preset second threshold and less than or equal to the preset third threshold, the floor mat quality is marked as poor.
[0044] The present invention also proposes a polyurethane floor mat forming detection system, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. The processor executes the computer program stored in the memory to implement the steps of the aforementioned polyurethane floor mat forming detection method.
[0045] The beneficial effects of the technical solution of the present invention are:
[0046] In an embodiment of the present invention, a denoised image of a polyurethane floor mat is obtained; the denoised image of the polyurethane floor mat is divided into several connected domains, and similar pixels are clustered together based on pixel analysis to highlight specific areas in the polyurethane floor mat. The grayscale feature index of each connected domain is obtained based on the grayscale values of all pixels in each connected domain and the grayscale values of pixels on the straight line segment from the centroid of the connected domain to the edge; the grayscale feature index of each connected domain is calculated based on the characteristics of the grayscale distribution within the connected domain, thereby more accurately describing the surface state or defect characteristics of the polyurethane floor mat. A rectangular coordinate system corresponding to the denoised image of the polyurethane floor mat is constructed. In the rectangular coordinate system, the edge regularity index of each connected domain is obtained based on the transverse intercept of the tangent of all pixels on the edge of each connected domain and the number of pixels. The edge features of each connected domain are quantified based on the transverse intercept of the tangent of all edge pixels in the connected domain, thereby better reflecting the changing trend and direction of the edge pixels. Based on the grayscale feature index and edge regularity index of each connected domain, the probability of each connected domain belonging to a defect region is determined. This method comprehensively considers the probability of each connected domain belonging to a defect region based on the grayscale feature index and edge regularity index of the connected domain, better adapting to different types of defects. Connected domains whose probability of belonging to a defect region is greater than a preset first judgment threshold are recorded as target connected domains. Based on the probability of each target connected domain belonging to a defect region and the number of pixels on the common edge of any two target connected domains, the probability of any two target connected domains not being merged is determined. Using the probability of any two target connected domains not being merged as the clustering distance between any two target connected domains, all target connected domains are clustered to obtain several defect regions. This method then filters each connected domain based on its probability of belonging to a defect region, allowing the target connected domain most likely to be a defect to be quickly located from a large number of connected domains. This significantly reduces the complexity and computational effort of subsequent processing, improving the targetedness and efficiency of defect detection. Finally, by comprehensively considering the probability of a target connected domain belonging to a defect region and the number of adjacent edge pixels, the probability of any two target connected domains being merged is determined, thereby determining the defect region. The damage level of each defective area is determined based on its area and the distance from its center of mass to its edge. Calculating the damage level based on the area and aspect ratio of each defective area helps quantitatively assess the impact of defects on polyurethane floor mats. The polyurethane floor mat molding test results are obtained based on the damage level of each defective area. Thus, the present invention distinguishes defective areas from normal areas by comprehensively analyzing the color and distribution characteristics of the defective areas, as well as the characteristics of the floor mat itself, thereby improving the accuracy of defect detection in polyurethane floor mats. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is a flow chart of the steps of a polyurethane floor mat molding detection method of the present invention;
[0049] Figure 2 This is a grayscale image of a polyurethane floor mat;
[0050] Figure 3 Denoised image of polyurethane floor mat. DETAILED DESCRIPTION
[0051] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a polyurethane floor mat molding detection method and system according to the present invention, including its specific implementation, structure, features, and effectiveness. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0052] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0053] The specific scheme of the polyurethane floor mat molding detection method and system provided by the present invention is described in detail below with reference to the accompanying drawings.
[0054] See also Figure 1 , which shows a flow chart of a polyurethane floor mat molding detection method provided by one embodiment of the present invention, the method comprising the following steps:
[0055] Step S001: Acquire a denoised image of a polyurethane floor mat.
[0056] Obtain the surface image of the polyurethane floor mat, perform grayscale processing on the surface image of the polyurethane floor mat, and obtain a grayscale image of the polyurethane floor mat, such as Figure 2 As shown, Figure 2 This is a grayscale image of the polyurethane floor mat obtained in this embodiment.
[0057] High-pass filtering is used to reduce the noise of the grayscale image of the polyurethane floor mat to obtain a denoised image of the polyurethane floor mat.
[0058] It should be noted that using high-pass filtering to process the noise of the grayscale image of the polyurethane floor mat can improve the contrast of the grayscale image of the polyurethane floor mat and make the defect area more obvious, such as Figure 3 As shown, Figure 3 This is a denoised image of the polyurethane floor mat in this embodiment. Grayscale conversion and high-pass filtering are both well-known techniques, and the specific methods are not introduced here.
[0059] Step S002: Divide the denoised image of the polyurethane floor mat into several connected domains.
[0060] The elbow method is used to operate on the denoised image of polyurethane floor mats to obtain the optimal number of clusters.
[0061] The k-means clustering algorithm is used to obtain several clusters of the polyurethane floor mat denoised image under the optimal number of clusters.
[0062] The continuous adjacent pixel points in each cluster form a connected domain, and several connected domains are obtained.
[0063] It should be noted that the k-means clustering algorithm and the elbow method are both well-known technologies, and the specific methods will not be introduced here.
[0064] Step S003: Obtaining the grayscale feature index of each connected domain according to the grayscale values of all pixels in each connected domain and the grayscale values of pixels on the straight line segment from the centroid to the edge of the connected domain.
[0065] The texture area in the denoised image of the polyurethane floor mat is a closed arc-shaped convex area with uniform and high grayscale. The background area is the area with uniform and low grayscale between different texture areas. The defect area is the concave area with significant grayscale changes and irregular edges between the texture area and the background area.
[0066] Several target directions are preset. In this embodiment, the upward, downward, leftward and rightward directions are preset target directions, and this is used as an example for description.
[0067] The straight line segments starting from the centroid of each connected domain along several preset target directions to the edge of the connected domain are recorded as the target straight line segments of each connected domain.
[0068] The mean gray value of all pixels in each connected domain is recorded as the gray threshold of each connected domain;
[0069] Calculate the grayscale thresholds of all connected domains in the denoised image of the polyurethane mat, sort the grayscale thresholds of all connected domains from large to small, and get a sequence. The average value of the gray thresholds of the connected domains is recorded as the gray mean value of the texture area;
[0070] The first to The average value of the gray thresholds of the connected domains is recorded as the gray mean of the background area;
[0071] What needs to be explained is: is the number of connected domains, is the floor function.
[0072] The grayscale feature index of each connected domain is obtained according to the grayscale mean value of the texture area, the grayscale threshold of each connected domain and the grayscale values of all pixels on the target straight line segment of each connected domain.
[0073] First For example, when the first connected domain When the gray threshold of the first connected domain is less than or equal to the gray mean of the texture area, the The grayscale feature index of each connected domain is set to the preset grayscale feature index.
[0074] It should be noted that the grayscale characteristic index preset in this embodiment is 0.2, and this is used as an example for description.
[0075] When When the gray threshold of the connected domain is greater than the gray mean of the texture area, calculate the The formula for the grayscale feature index of a connected domain is:
[0076]
[0077] in, Indicates the The gray feature index of the connected domain, Indicates the The gray threshold of the connected components, represents the grayscale mean of the texture area, For the The first connected domain The variance of the grayscale values of all pixels on the target straight line segment, is the number of target straight line segments for each connected domain, Represents the normalization function.
[0078] What needs to be explained is: For the The gray mean difference between the first connected domain and the texture area. The larger the gray mean difference, the The more obvious the grayscale features of the connected domain belonging to the defect area are; For the The first connected domain The variance of the grayscale values of all pixels on the target straight line segment. The larger the grayscale variance, the The first connected domain The more obvious the grayscale change on the straight line segment of the target, For the connected domain The mean of the grayscale variance of the target straight line segment. The larger the mean, the better the The more obvious the grayscale change on the target straight line segment of the connected domain, the more obvious the grayscale change on the target straight line segment of the connected domain. The larger the gray feature index of a connected domain is, the greater the gray feature index of a connected domain is.
[0079] According to the above method, this embodiment can obtain the grayscale feature index of each connected component.
[0080] Step S004: constructing a rectangular coordinate system corresponding to the denoised image of the polyurethane floor mat, and obtaining the edge regularity index of each connected domain in the rectangular coordinate system based on the transverse intercept of the tangent lines of all pixels on the edge of each connected domain and the number of pixels.
[0081] In the denoised image of the polyurethane mat, a rectangular coordinate system is constructed with the lower left corner vertex as the origin, the horizontal rightward as the horizontal axis, and the vertical upward as the vertical axis.
[0082] The transverse intercepts of the tangent lines of consecutive pixel points on the edge of the texture area and the background area on the horizontal axis continuously increase and decrease, while the transverse intercepts of the tangent lines of consecutive pixel points on the edge of the defect area on the horizontal axis are irregular.
[0083] Therefore, the edge regularity index of each connected region is determined based on the change in the horizontal intercept of the tangent lines of consecutive pixels on the edge of each connected region. Because the texture region and background region in the denoised polyurethane mat image are connected, their connected edges are the same smooth arc. Therefore, the edge regularity index of the texture region and the background region can be combined to form the edge regularity index of the normal region.
[0084] First For example, the first connected domain The calculation formula of the edge regularity index of a connected domain is:
[0085]
[0086] in, Indicates the The edge regularity index of the connected domain, Indicates the first The first The intercept of the tangent line at pixel points, Indicates the first The first The intercept of the tangent line at pixel points, Indicates the first The first The intercept of the tangent line at pixel points, For the The number of pixels on the edge of a connected component.
[0087] What needs to be explained is: Indicates the first The first The horizontal intercept of the tangent line of each pixel. In mathematics and geometry, the horizontal intercept of the tangent line refers to the intersection of the tangent line and the coordinate axis, usually referring to the horizontal coordinate value of the intersection of the tangent line and the coordinate axis. For the Among the three adjacent pixels on the edge of a connected domain, the Pixels and The cross-intercept of the tangent line of the pixel point is Pixels and The ratio of the cross-intercepts of the tangent lines of the pixel points represents the The closer the ratio of the distances between the tangent lines of three adjacent pixels on the edge of a connected domain is, the closer the ratio is to 1. The more regular the changes in the edges of a connected domain are, For the The average degree of regularity of all pixels on the edge of the connected domain, that is, The edge regularity index of the connected domain shows the The overall edge regularity of the connected domain. The smaller the edge regularity index, the The more the edge of a connected region is different from the arc shape of the edge of a normal region, the more The more irregular the edge of the connected domain is, the The greater the probability that a connected domain belongs to a defect area. The edge of the connected domain is a closed area, and each pixel on the edge must have two adjacent pixels. In order to ensure that the above formula is valid, the is 1 and situation.
[0088] According to the above method, this embodiment can obtain the edge regularity index of each connected region.
[0089] Step S005: According to the grayscale feature index and edge regularity index of each connected domain, the possibility of each connected domain belonging to a defective area is obtained.
[0090] The more obvious the grayscale features of a connected domain and the larger the grayscale feature index, the more likely it is that the connected domain belongs to a defect area. The more regular the edge changes of the connected domain and the larger the edge regularity index, the less likely it is that the connected domain belongs to a defect area. The likelihood of each connected domain belonging to a defect area is determined based on its grayscale feature index and edge regularity index.
[0091] First For example, the first connected domain The calculation formula for the possibility that a connected domain belongs to the defect area is:
[0092]
[0093] in, For the The possibility that a connected region belongs to the defect area, Indicates the The gray feature index of the connected domain, Indicates the The edge regularity index of the connected domain, is the preset grayscale feature influence coefficient, is the preset edge feature influence coefficient.
[0094] What needs to be explained is: Indicates the The gray feature index of the connected domain is larger. The greater the possibility that a connected domain belongs to a defect area; Indicates the The edge regularity index of the connected domain, the larger the edge regularity index, the The smaller the possibility that a connected domain belongs to a defective area, the grayscale feature influence coefficient preset in this embodiment is , the preset edge feature influence coefficient , take this as an example to describe.
[0095] According to the above method, this embodiment can obtain the possibility that each connected region belongs to a defect area.
[0096] Step S006: Record the connected domains whose probability of belonging to the defect area is greater than a preset first judgment threshold as target connected domains; obtain the probability of any two target connected domains not being merged based on the probability of each target connected domain belonging to the defect area and the number of pixels on the common edge of any two target connected domains; use the probability of any two target connected domains not being merged as the clustering distance between any two target connected domains, perform a clustering operation on all target connected domains, and obtain several defect areas.
[0097] When using the k-means clustering algorithm to cluster the denoised image of the polyurethane floor mat, the same defect area may be divided into two areas. Therefore, in order to ensure the integrity of the obtained defect area, it is also necessary to determine whether any two connected domains need to be merged.
[0098] A first judgment threshold is preset, and a connected domain whose possibility of belonging to a defect area is greater than the preset first judgment threshold is recorded as a target connected domain.
[0099] It should be noted that: the first judgment threshold preset in this embodiment is 0.5, and this is used as an example for description.
[0100] For two target connected domains belonging to the same defect area, the probability that each target connected domain belongs to the defect area should be similar, and the probability that the area formed by merging the two target connected domains belongs to the defect area should increase. In addition, the number of pixels on the common edge of the two target connected domains should be relatively large, and the grayscale values of adjacent pixels on the common edge should be relatively similar.
[0101] First The target connected domain and As an example, the target connected domain and Not equal, when The target connected domain and When the target connected domains are not adjacent, The target connected domain and The probability that the target connected domains are not merged is set to a preset probability threshold; wherein the preset probability threshold is 1, which is used as an example for description.
[0102] When The target connected domain and When the target connected domains are adjacent, The target connected domain and The pixel points on the common edge of the target connected domain are recorded as target pixels;
[0103] The first The target connected domain and The area after the target connected domains are merged is recorded as the reference target area.
[0104] According to the method for obtaining the possibility that each connected region belongs to the defect area, the possibility that the reference target area belongs to the defect area is obtained.
[0105] According to the number of target pixels corresponding to any two target connected domains, the grayscale values of pixels adjacent to the common edge, and the possibility that the reference target area belongs to the defect area, the possibility of not merging any two target connected domains when they are adjacent is obtained.
[0106] Therefore, it is the first The target connected domain and When the target connected domains are adjacent, calculate the The target connected domain and The formula for the probability that the target connected domains are not merged is:
[0107]
[0108] in, Indicates the The target connected domain and The probability that the target connected domains are not merged, For the The target connected domain and The number of target pixels corresponding to the target connected domain, For the In the target connected domain, The target connected domain and The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected domain and The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected domain and The common edges of the target connected domains are adjacent to the The gray value of a pixel, For the In the target connected domain, The target connected domain and The common edges of the target connected domains are adjacent to the The gray value of a pixel, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The target connected domain and The possibility that the reference target area corresponding to the target connected domain belongs to the defect area, represents the normalization function, is the absolute value function, is an exponential function with a natural constant as the base. To present the inverse proportional relationship and normalization processing, the implementer can set the inverse proportional function and normalization function according to the actual situation.
[0109] What needs to be explained is: For the The target connected domain and The number of target pixels corresponding to the target connected domain. The more target pixels there are, the The target connected domain and The higher the similarity of the target connected domains, the greater the possibility that they should be merged. For the The target connected domain and The difference between the mean gray values of the pixels adjacent to the common edge of the target connected domain represents the The target connected domain and The overall grayscale difference of the target connected domain is greater. The target connected domain and The more dissimilar the target connected domains are, the less likely they are to be merged. At the same time, to avoid meaningless fractions, the denominator is +1, forming .
[0110] According to the above method, this embodiment can obtain the possibility that any two target connected domains are not merged.
[0111] The probability that any two target connected domains are not merged is used as the clustering distance between any two target connected domains. The K-means clustering algorithm is used to perform clustering operations on all target connected domains to obtain several final clusters.
[0112] All target connected domains in each final cluster are combined into a defect region, and several defect regions are obtained;
[0113] It should be noted that the number of clusters when performing clustering operations on all target connected domains is obtained using the elbow method. Both the K-means clustering algorithm and the elbow method are well-known technologies, and the specific methods will not be introduced here.
[0114] Step S007: Obtain the damage degree of each defective region based on the area of each defective region and the distance from the centroid to the edge of the defective region.
[0115] The damage of the defect area is quantified according to the area of the defect area and the distance from the centroid of each defect area to the edge of the defect area.
[0116] First For example, the defect area The calculation formula for the damage degree of a defect area is:
[0117]
[0118] in, Indicates the The damage degree of the defect area For the The area of the defective region, For the The length of the longest straight line segment from the centroid of a defect area to the edge of the defect area, For the The length of the shortest straight line segment from the centroid of the defect area to the edge of the defect area, is the normalization function.
[0119] What needs to be explained is: For the The larger the area of the defective area, the more the defective area occupies on the polyurethane mat, and the more serious the damage to the polyurethane mat. Indicates the The aspect ratio of the defect area, the larger the aspect ratio, the The more dispersed the defect areas are, the wider the impact range is, and the more serious the damage to the corresponding polyurethane floor mat is.
[0120] According to the above method, this embodiment obtains the damage degree of all defective areas.
[0121] Step S008: Obtaining the polyurethane floor mat molding test result according to the damage degree of each defective area.
[0122] The normalized value of the sum of the damage levels of all defective areas is recorded as the quality threshold, where Normalize the sum of the damage levels of all defective areas;
[0123] A preset first threshold, a preset second threshold and a preset third threshold are set. When the quality threshold is less than or equal to the preset first threshold, the quality of the floor mat is marked as excellent. When the quality threshold is greater than the preset first threshold and less than or equal to the preset second threshold, the quality of the floor mat is marked as good. When the quality threshold is greater than the preset second threshold and less than or equal to the preset third threshold, the quality of the floor mat is marked as poor.
[0124] It should be noted that in this embodiment, the first threshold is preset to 0.1, the second threshold is preset to 0.4, and the third threshold is preset to 1. Polyurethane floor mats marked as poor are recycled and remade, polyurethane floor mats marked as good are repaired, and polyurethane floor mats marked as excellent do not require any operation.
[0125] So far, the present invention is completed.
[0126] In summary, in an embodiment of the present invention, a denoised image of a polyurethane floor mat is obtained, and the denoised image of the polyurethane floor mat is divided into a plurality of connected domains. The grayscale feature index of each connected domain is obtained based on the grayscale values of all pixels in each connected domain and the grayscale values of pixels on a straight line segment from the centroid of the connected domain to the edge. A rectangular coordinate system corresponding to the denoised image of the polyurethane floor mat is constructed. In the rectangular coordinate system, the edge regularity index of each connected domain is obtained based on the cross-intercept of the tangent of all pixels on the edge of each connected domain and the number of pixels. Based on the grayscale feature index and the edge regularity index of each connected domain, the possibility of each connected domain belonging to a defective area is obtained, and the connected domain belonging to the defective area is determined. Connected domains whose probability of being defective regions is greater than a preset first judgment threshold are recorded as target connected domains; based on the probability of each target connected domain being a defective region and the number of pixels on the common edge of any two target connected domains, the probability of any two target connected domains not merging is obtained; using the probability of any two target connected domains not merging as the clustering distance between any two target connected domains, a clustering operation is performed on all target connected domains to obtain a number of defective regions; based on the area of each defective region and the distance from the center of mass to the edge of the defective region, the degree of damage of each defective region is obtained; and based on the degree of damage of each defective region, a polyurethane floor mat molding detection result is obtained. The present invention distinguishes defective regions from normal regions by comprehensively analyzing the color characteristics and distribution characteristics of the defective regions and the characteristics of the floor mat itself, thereby improving the accuracy of defective region detection in polyurethane floor mats.
[0127] The present invention also provides a polyurethane floor mat forming detection system, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. The processor executes the computer program stored in the memory to implement the steps of the aforementioned polyurethane floor mat forming detection method.
[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A polyurethane floor mat molding detection method, characterized in that: The method comprises the following steps: Get the denoised image of the polyurethane floor mat; Divide the denoised image of polyurethane floor mat into several connected domains; The grayscale feature index of each connected domain is obtained according to the grayscale values of all pixels in each connected domain and the grayscale values of pixels on the straight line segment from the centroid of the connected domain to the edge; Construct a rectangular coordinate system corresponding to the denoised image of the polyurethane mat. In this rectangular coordinate system, the edge regularity index of each connected domain is obtained based on the cross-intercept of the tangent line of all pixels on the edge of each connected domain and the number of pixels. According to the gray feature index and edge regularity index of each connected domain, the possibility of each connected domain belonging to the defect area is obtained; Recording a connected domain whose probability of belonging to a defect area is greater than a preset first judgment threshold as a target connected domain; obtaining the probability of any two target connected domains not being merged based on the probability of each target connected domain belonging to a defect area and the number of pixels on the common edge of any two target connected domains; using the probability of any two target connected domains not being merged as the clustering distance between any two target connected domains, performing a clustering operation on all target connected domains to obtain a number of defect areas; The damage degree of each defect area is obtained according to the area of each defect area and the distance from the center of mass to the edge of the defect area; According to the damage degree of each defective area, the polyurethane floor mat molding test results are obtained; The grayscale feature index of each connected domain is obtained by tracing the straight line segments from the centroid of each connected domain along several preset target directions to the edge of the connected domain, which are recorded as the target straight line segments of each connected domain. The mean gray value of all pixels in each connected domain is recorded as the gray threshold of each connected domain; Sort the grayscale thresholds of all connected domains from large to small to get a sequence, and sort the first to the The average value of the gray thresholds of the connected domains is recorded as the gray mean of the texture area; is the number of connected domains, is the floor function; When When the gray threshold of the first connected domain is less than or equal to the gray mean of the texture area, the The grayscale feature index of each connected domain is set to the preset grayscale feature index; When When the gray threshold of the first connected domain is greater than the gray mean of the texture area, the gray mean of the texture area, the The gray threshold of the connected component and the The grayscale values of all pixels on the target straight line segment of the connected domain are obtained. Gray feature index of connected domains; Among them, The specific calculation formula of the gray feature index of a connected domain is: in, Indicates the The gray feature index of the connected domain, Indicates the The gray threshold of the connected components, represents the grayscale mean of the texture area, For the The first connected domain The variance of the grayscale values of all pixels on the target straight line segment, is the number of target straight line segments for each connected domain, represents the normalization function; The specific calculation formula of the edge regularity index of each connected domain is: in, Indicates the The edge regularity index of the connected domain, Indicates the first The first The cross-intercept of the tangent line at pixel points, Indicates the first The first The cross-intercept of the tangent line at pixel points, Indicates the first The first The cross-intercept of the tangent line at pixel points, For the The number of pixels on the edge of a connected component.
2. A polyurethane floor mat molding detection method according to claim 1, characterized in that: The specific calculation formula for obtaining the possibility that each connected domain belongs to a defect area according to the grayscale feature index and edge regularity index of each connected domain is: in, For the The possibility that a connected region belongs to the defect area, Indicates the The gray feature index of the connected domain, Indicates the The edge regularity index of the connected domain, is the preset grayscale feature influence coefficient, is the preset edge feature influence coefficient.
3. A polyurethane floor mat molding detection method according to claim 1, characterized in that: The method of obtaining the possibility that any two target connected domains are not merged based on the possibility that each target connected domain belongs to a defect area and the number of pixels on the common edge of any two target connected domains includes the following specific steps: When The target connected domain and When the target connected domains are not adjacent, The target connected area and the The probability that the target connected domains are not merged is set to a preset probability threshold; When The target connected area and the When the target connected domains are adjacent, The target connected area and the The pixel points on the common edge of the target connected domain are recorded as target pixels; The first The target connected area and the The area after the target connected domains are merged is recorded as the reference target area; According to the method of obtaining the possibility that each connected domain belongs to the defect area, the possibility that the reference target area belongs to the defect area is obtained; According to the number of target pixels corresponding to any two target connected domains, the grayscale values of pixels adjacent to the common edge, and the possibility that the reference target area belongs to the defect area, the possibility of not merging any two target connected domains when they are adjacent is obtained.
4. A polyurethane floor mat molding detection method according to claim 3, characterized in that: The specific calculation formula for obtaining the probability of not merging any two target connected domains when they are adjacent is as follows: in, Indicates the The target connected area and the The probability that the target connected domains are not merged, For the The target connected area and the The number of target pixels corresponding to the target connected domain, For the In the target connected domain, The target connected area and the The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected area and the The number of pixels adjacent to the common edge of the target connected domain, For the In the target connected domain, The target connected area and the The common edges of the target connected domains are adjacent to the The gray value of a pixel, For the In the target connected domain, The target connected area and the The common edges of the target connected domains are adjacent to the The gray value of a pixel, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The probability that the target connected domain belongs to the defect area, Indicates the The target connected area and the The possibility that the reference target area corresponding to the target connected domain belongs to the defect area, represents the normalization function, is the absolute value function, is an exponential function with a natural constant as its base.
5. A polyurethane floor mat molding detection method according to claim 1, characterized in that: The specific calculation formula for the damage degree of each defect area is obtained based on the area of each defect area and the distance from the center of mass to the edge of the defect area: in, Indicates the The damage degree of the defect area For the The area of the defective region, For the The length of the longest straight line segment from the centroid of a defect area to the edge of the defect area, For the The length of the shortest straight line segment from the centroid of the defect area to the edge of the defect area, is the normalization function.
6. A polyurethane floor mat molding detection method according to claim 1, characterized in that: The polyurethane floor mat molding test results are obtained according to the damage degree of each defect area, including the following specific steps: The normalized value of the sum of the damage degrees of all defective areas is recorded as the quality threshold; When the quality threshold is less than or equal to the preset first threshold, the floor mat quality is marked as excellent; when the quality threshold is greater than the preset first threshold and less than or equal to the preset second threshold, the floor mat quality is marked as good; when the quality threshold is greater than the preset second threshold and less than or equal to the preset third threshold, the floor mat quality is marked as poor.
7. A polyurethane floor mat molding detection system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the polyurethane floor mat molding detection method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Artificial Intelligence-Based Defect Detection Method for Rotary Furnace Inner Wall
CN116805317A
Wallboard production quality detection method based on image processing
CN117853493A