A method for detecting production quality of a lighting assembly
By extracting the skeletal outline of the lantern decorations using edge detection and corner detection algorithms, and combining curvature and intersection relationship analysis, the problem of inaccurate detection of lantern decorations with large shape changes by traditional detection methods is solved, and higher-precision quality assessment is achieved.
Patent Information
- Application Number
- CN202410051820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2044-01-15
AI Technical Summary
Traditional lantern inspection methods are difficult to accurately assess the quality of lanterns with large shape variations, lack flexibility, and thus lead to inaccurate test results.
Edge detection and corner detection algorithms are used to extract the skeleton outline of the lantern. Combined with curvature and intersection relationship analysis, the skeleton outline trend coefficient and cross index are constructed to evaluate the production quality of the lantern components.
This improves the accuracy of quality inspection for lanterns and lighting fixtures with significant shape variations, avoids overly sensitive defects, and ensures the accuracy and stability of the inspection.
Smart Images

Figure CN117726619B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image data processing technology, specifically to a method for quality inspection of lighting components. Background Technology
[0002] Lanterns are a type of decorative item in traditional Chinese culture, typically used to celebrate festivals or special occasions. They consist of a frame made of bamboo, wood, or steel strips, covered with paper or silk cloth as the outer skin. Waterproof LED bulbs are installed inside, displaying elaborate patterns or images when lit. After the lanterns are completed, their appearance, integrity, and stability must be inspected for quality.
[0003] Different lanterns and decorative lights present unique patterns and images, resulting in significant differences in their display effects. Lantern designs may incorporate diverse skeletal shapes, and traditional detection algorithms struggle to accurately assess the quality of lanterns with non-traditional shapes. Current lantern detection methods primarily rely on shape features and predefined criteria for comparison. However, this method has limitations when handling lanterns with significant shape variations. Because traditional image processing methods lack sufficient flexibility, they may exhibit relatively high sensitivity to lanterns with complex shapes. This means that when processing lanterns with intricate shapes, their quality may not be accurately assessed. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method for quality inspection in the production of lighting components, thereby resolving the existing issues.
[0005] The present invention provides a method for quality inspection of lighting components during production, which adopts the following technical solution:
[0006] One embodiment of the present invention provides a method for quality inspection in the production of lighting components, the method comprising the following steps:
[0007] Obtain visual images of the lantern decorations from all angles;
[0008] The lighting fixture portion of the exterior image is designated as the Region of Interest (ROI). Edge detection is performed on the ROI to obtain a contour map. Windows are divided based on the contour distribution characteristics of the windows containing each contour pixel in the contour map. The contrast coefficient between the inner and outer contours of each pixel is obtained based on the pixel value differences in the window division results. The skeleton lines of the lighting fixture's exterior image are obtained by combining the contour map, the normalized values of the contrast coefficients between the inner and outer contours of each contour pixel, and a corner detection algorithm. The curvature variation richness of each skeleton line is obtained based on the degree of contour bending. The trend coefficient of the lighting fixture's skeleton contour is obtained based on the distribution of the contrast coefficients between the inner and outer contours of the contour pixels on each skeleton line, combined with the curvature variation richness. Adjacent lines of each skeleton line are obtained based on their intersection relationships. The cross-index of the lighting fixture's skeleton contour trend is obtained based on the similarity between each skeleton line and its adjacent lines, combined with the trend coefficient.
[0009] The production quality index of the lighting components is obtained by analyzing the distribution characteristics of the cross-index of the outline trend of all skeleton lines in the various appearance images of the lighting fixture; the production quality inspection of the lighting components is then completed based on the production quality index of the lighting components.
[0010] Preferably, the step of dividing the window according to the contour distribution characteristics of the window containing each contour pixel in the contour result image includes the following steps:
[0011] With each contour pixel as the center pixel, the preset window size is N×N, where N is a preset value;
[0012] Save the outline that passes through the center pixel as the center outline, and the number of pixels of the center outline is greater than or equal to N.
[0013] When the number of center outlines of the window area is less than 1, the window area is not divided.
[0014] When the number of central outlines in the window area is equal to 1, the two window areas divided by the outlines are taken as the first window and the second window.
[0015] When the number of central outlines in the window area is greater than 1, the two window areas divided by the shortest central outline are taken as the first window and the second window.
[0016] Preferably, the step of obtaining the in-skeletal contour contrast coefficient of each pixel based on the pixel value difference features in the window division result is specifically expressed as follows:
[0017]
[0018] Na = min(N(pu), N(pd))
[0019] In the formula, con a Let represent the contrast coefficient between the inside and outside of the skeleton contour at the x-th contour pixel of the appearance image F, and pu(i) and pd(i) represent the i-th pixel values of the first window and the second window, respectively. Let represent the average pixel values of the first window and the second window respectively, let Na represent the minimum number of pixels in the first window and the second window respectively, let pu(Na) and pd(Na) represent the first Na values of the pixel value sequence of the first window and the second window respectively, let N(pu) and N(pd) represent the number of pixels in the first window and the second window respectively, let min() represent the minimum value function, and let C() represent the cosine similarity function.
[0020] Preferably, the step of obtaining the skeleton lines of the lighting fixture appearance image based on the contour result image and the normalized value of the contrast coefficient between the inner and outer contours of each contour pixel point, combined with the corner detection algorithm, specifically involves:
[0021] The Shi-Tomasi corner detection algorithm is used to obtain each corner point on the contour result map; contour lines with corner points at both ends are saved as suspected skeleton lines.
[0022] Calculate the normalized mean of the contrast coefficients between the inner and outer contours of all contour pixels on each suspected skeleton line; set a skeleton line threshold; and use the suspected skeleton lines whose mean value is greater than the skeleton line threshold as the skeleton lines of the lighting fixture appearance image.
[0023] Preferably, the step of obtaining the curvature variation richness of each skeleton line based on the degree of contour bending of each skeleton line specifically involves:
[0024] For each skeleton line, the curvature value of each contour pixel on the skeleton line is calculated, and the sequence of all the curvature values on the skeleton line is taken as the curvature sequence of the skeleton line; the mean, variance, and range of all elements of the curvature sequence are calculated respectively; the difference between each element of the curvature sequence and the mean is calculated; the product of the difference and the range is calculated; the negative of the variance is taken as the exponent of an exponential function with the natural constant as the base; the ratio of the product to the result of the exponential function is calculated; the mean of the ratios of all elements of the curvature sequence is taken as the curvature variation richness of the skeleton line.
[0025] Preferably, the step of obtaining the lighting skeleton contour trend coefficient of each skeleton line based on the distribution of the contrast coefficient between the inner and outer contours of the contour pixels on each skeleton line and the richness of curvature change is specifically as follows:
[0026] For each skeleton line, the sequence of skeleton contour inward and outward contrast coefficients of all contour pixels on the skeleton line is taken as the skeleton contour inward and outward contrast coefficient sequence of the skeleton line; the range and minimum value of all elements of the skeleton contour inward and outward contrast coefficient sequence are obtained; the difference between each element of the skeleton contour inward and outward contrast coefficient sequence and the minimum value is calculated; the ratio of the difference to the range is calculated; the mean of the ratios of all elements of the skeleton contour inward and outward contrast coefficient sequence of the skeleton line is calculated; the product of the mean of the skeleton line and the curvature variation richness of the skeleton line is taken as the lighting skeleton contour trend coefficient of the skeleton line.
[0027] Preferably, the adjacent lines of each skeleton line are each skeleton line that intersects with the skeleton line.
[0028] Preferably, the specific steps for obtaining the cross-index of the lighting frame contour trend of each skeleton line based on the similarity between each skeleton line and its adjacent lines and the trend coefficient of the lighting frame contour include:
[0029] For each skeleton line, calculate the slope of each contour pixel on the skeleton line, and take the sequence of all the slopes on the skeleton line as the slope sequence of the skeleton line; obtain the Pearson correlation coefficient between the slope sequences of the skeleton line and each adjacent line; take the Pearson correlation coefficient as the exponent of an exponential function with the natural constant as the base; calculate the sum of the trend coefficients of the lighting skeleton contour of the skeleton line and each adjacent line; calculate the ratio of the calculation result of the exponential function to the sum; take the sum of the ratios of the skeleton line and all adjacent lines as the cross-index of the trend of the lighting skeleton contour of each skeleton line.
[0030] Preferably, the step of obtaining the lighting component production quality index based on the distribution characteristics of the cross-index of the lighting skeleton contour trends of all skeleton lines in each appearance image of the lighting fixture specifically involves:
[0031] For each appearance image of the lighting fixture, calculate the normalized value of the mean of the cross-index of the lighting fixture skeleton contour trend of all skeleton lines in each appearance image; and use the sum of the normalized values of all appearance images of the lighting fixture as the production quality index of the lighting fixture component.
[0032] Preferably, the step of completing the production quality inspection of the lighting components based on the production quality index of the lighting components specifically includes:
[0033] A preset quality pass threshold is set; if the production quality index of the lighting component is greater than or equal to the quality pass threshold, the production quality of the lighting component is qualified; if the production quality index of the lighting component is less than the quality pass threshold, the production quality of the lighting component is unqualified.
[0034] The present invention has at least the following beneficial effects:
[0035] This invention first extracts the outline of the lamp's appearance image. Based on the color contrast of the lamp's skeleton and decorations, it constructs a contrast coefficient between the inside and outside of the skeleton outline to measure the probability of each pixel on the skeleton outline. Furthermore, it combines a corner detection algorithm to extract the skeleton lines of the lamp, effectively distinguishing the outline areas of the lamp's skeleton and decorations. This improves the accuracy of lamp skeleton extraction.
[0036] Furthermore, the inner and outer contours of the lighting fixture frame and the trend of its lines are analyzed. A contour trend coefficient and a cross-index of the contour trend of the lighting fixture frame are constructed to evaluate the stability of the lighting fixture frame, thereby achieving the purpose of production quality inspection. This avoids the shortcomings of existing inspection methods that are too sensitive to lighting fixture components with large shape changes, and thus improves the accuracy of production quality inspection of lighting fixture components. Attached Figure Description
[0037] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A flowchart of a method for quality inspection in the production of lighting components provided by the present invention;
[0039] Figure 2 This is a flowchart for the quality inspection of lighting components. Detailed Implementation
[0040] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a method for quality inspection in the production of lighting components according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0041] Unless otherwise defined, 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 pertains.
[0042] The following description, in conjunction with the accompanying drawings, details a specific scheme for a method for inspecting the production quality of lighting components provided by the present invention.
[0043] An embodiment of the present invention provides a method for quality inspection of lighting components during production.
[0044] Specifically, the following method for quality inspection of lighting component production is provided; please refer to [link / reference]. Figure 1 The method includes the following steps:
[0045] Step S001: Use an industrial camera to capture images of the appearance of the lanterns from various angles, and preprocess the acquired images.
[0046] The production process of lantern lighting components includes the following parts: 1. The designer designs the pattern, determines the style, size, and color of the lantern, and assembles the steel frame into the planar outline of the pattern according to the proportions. 2. The planar outline of the steel frame is bent into a three-dimensional appearance, and overall shaping is performed. 3. Waterproof lamp holders and LED bulbs are installed inside the bent frame. 4. Finally, different colored silk fabrics are pasted on different parts of the exterior of the frame, and production is complete.
[0047] Considering that in the lantern manufacturing process, after the frame is completed, further processing is required both inside and outside the lantern frame; and that the lantern components are relatively large for large-scale events and are displayed outdoors, insufficient stability could easily lead to collapse, affecting the display effect and even causing safety accidents. Therefore, this embodiment mainly focuses on the quality inspection of the completed lantern frame to determine the quality of the lantern.
[0048] The assembled lanterns were placed in a dimly lit indoor environment to conduct multi-directional quality inspection. An industrial CCD camera was used to capture images of the lanterns from four directions: front, back, left, and right, obtaining four surface images for each lantern. To improve image quality, this embodiment employs a bilateral filtering algorithm to denoise the four captured surface images. The bilateral filtering algorithm is a well-known existing technology and will not be described in detail here.
[0049] At this point, we have obtained images of the lantern's appearance from all angles.
[0050] Step S002: Extract the outline of the lantern's appearance image, extract the skeleton lines in the outline based on the characteristics of the lantern skeleton, further analyze the trend of the lantern skeleton and the degree of intersection of the skeleton trends, and construct the lantern skeleton outline trend cross index.
[0051] Since the image analysis method is consistent across all positions, this embodiment uses an image of the lantern's appearance taken directly in front of it as an example for analysis and processing. The appearance image includes not only the illuminated area but also a non-illuminated area. To avoid interference from the non-illuminated area, the illuminated portion is manually extracted from the image as a Region of Interest (ROI). Then, the lantern's skeleton is extracted from the ROI.
[0052] The lantern's frame plays a crucial role in shaping it. The outline of its pattern is fixed by steel bars, while the silk fabric has a certain degree of light transmission. The steel frame tightly attached to the silk fabric is considered part of the outline; therefore, some of the lantern's stylistic outlines are actually part of the frame's shape. To obtain the outline information in the appearance image, the Canny edge detection algorithm is used. The output is a contour result image, which includes the outline of the frame and the outline of the lantern pattern. The Canny edge detection algorithm is a well-known existing technology and will not be described in detail in this embodiment.
[0053] Further analysis of the skeleton outline involves dividing the outline pattern in the resulting image into two parts: the outermost boundary of the shape region, which definitely belongs to the skeleton outline; and the inner boundary of the closed region, which may be caused by changes in pattern color or by light transmission through the skeleton. If the inner boundary is caused by changes in pattern, the textures on both sides of the boundary will differ significantly. If the inner boundary is caused by skeleton shadows, it will be approximately a straight line locally, with the gradient directions of the edge points being relatively similar.
[0054] First, a skeleton contour analysis is performed on the contour result image. Using each contour pixel as the center pixel, a window size of N×N is preset, where N is 7 in this embodiment. Each contour line passing through the center pixel is saved as a center contour line, where the number of pixels constituting the center contour line is greater than or equal to N. When the number of center contour lines in the window region is equal to 1, the two window regions divided by the contour line are designated as the first window and the second window. When the number of center contour lines in the window region is greater than 1, the two window regions divided by the shortest center contour line are designated as the first window and the second window. When the number of center contour lines in the window region is less than 1, the window is not divided. Based on the pixel value difference between these two parts, an inward and outward contrast coefficient of the skeleton contour is constructed.
[0055]
[0056] Na = min(N(pu), N(pd))
[0057] In the formula, con a Let represent the contrast coefficient between the inside and outside of the skeleton contour at the x-th contour pixel of the appearance image F, and pu(i) and pd(i) represent the i-th pixel values of the first window and the second window, respectively. Let represent the average pixel values of the first and second windows, respectively. Let Na represent the minimum number of pixels in the first and second windows. Let pu(Na) and pd(Na) represent the first Na values of the pixel value sequence in the first and second windows, respectively. Let N(pu) and N(pd) represent the number of pixels in the first and second windows, respectively. Let min() represent the minimum value function, and C() represent the cosine similarity function. Taking the minimum value of Na ensures the consistency of the number of pixel values during the calculation process. The pixel value sequence is obtained by arranging the pixels from left to right and from top to bottom according to their spatial position. Considering that the range of cosine similarity is (-1, 1), in order to avoid negative numbers during the calculation, the result of cosine similarity is incremented by 1, and the range becomes (0, 2).
[0058] If the pixel values differ significantly between the two sides of the contour, the calculated pu(i)-pd(i) value will be larger. Simultaneously, the pixel values within the contour will vary less, and the pixel values at each point will be closer to the mean of its corresponding window region. and The smaller the value, the more obvious the color difference between the two sides of the lantern outline. The higher the cosine similarity between the pixel value sequences of the two window regions, the higher the similarity between the inside and outside of the outline. The larger the calculated contrast coefficient between the inside and outside of the skeleton outline, the more likely that point belongs to the lantern skeleton.
[0059] Therefore, the corresponding skeleton contour in-south contrast coefficient value is calculated for each contour pixel. During lantern production, to enhance the decorative effect and create more vibrant patterns, the lantern skeleton requires more complex bends to achieve various shapes. Different skeletons are fixed by welding; the more welding nodes there are, the more corner points appear in the edge detection results. The Shi-Tomasi algorithm is used to detect corner points on the contour result image, defining lines with corner points at both ends as suspected skeleton lines. It should be noted that the Shi-Tomasi algorithm is a well-known existing technology and will not be elaborated upon in this embodiment. Furthermore, the skeleton contour in-south contrast coefficient values of all contour pixels are normalized using a minimax method. If the average normalized value of the skeleton contour in-south contrast coefficients of all contour pixels on a suspected skeleton line is greater than the skeleton line threshold, the suspected skeleton line is determined to be a skeleton line. In this embodiment, the skeleton line threshold is set to 0.5.
[0060] Taking the t-th skeleton line as an example, the corresponding sequence of contrast coefficients between the inside and outside of the skeleton contour can be obtained, denoted as: Then, the curvature value of each contour pixel of the t-th skeleton line is calculated, and the resulting curvature sequence is denoted as . The calculation of curvature is a well-known technique and will not be elaborated upon in this embodiment. The more bends in the lantern's frame, the higher the potential risk for large lighting fixtures. Therefore, the contour trend coefficient of the lighting fixture frame is constructed as follows:
[0061]
[0062]
[0063] In the formula, dire t wk represents the trend coefficient of the lighting fixture skeleton outline for the t-th skeleton line. t The curvature variation richness of the t-th skeleton line is represented by Nt, where Nt represents the number of pixels in the t-th skeleton line, and con t Let represent the sequence of contrast coefficients between the inside and outside of the skeleton contour on the t-th skeleton line, and max() and min() represent the maximum value function and minimum value function, respectively. This represents the a-th value of the sequence of contrast coefficients between the inside and outside of the skeleton contour on the t-th skeleton line. Ek represents the a-th value of the curvature sequence on the t-th skeleton line. t , Let r represent the mean and variance of the curvature sequence on the t-th skeleton line, respectively. t Let be the range of the curvature sequence on the t-th skeleton line, and exp() denotes an exponential function with the natural constant e as the base.
[0064] The greater the degree of bending in the lantern frame, the greater the fluctuation in the curvature value of the corresponding frame lines, and the greater the difference between the curvature sequence value and the mean. The larger the value, the larger the curvature variance, and the more pronounced the effect of the exponential function. The smaller the value, the greater the richness of curvature variation wk. t The higher the value, the greater the degree of bending of the skeleton lines. Furthermore, if the skeleton lines are at the edge of a bend, the contrast coefficient between the inner and outer contours of each pixel on the lines will be larger, making the range of the contrast coefficient sequence of the skeleton contour smaller, while the sequence element values remain at a consistently high level. This means that the higher the trend coefficient value of the lighting skeleton contour, the higher the risk of the skeleton falling off due to bending, and the greater the possibility of production quality problems.
[0065] As mentioned above, different frames are fixed together by welding. During transportation, the components of the lantern may deform due to unstable welding points. The higher the degree of intersection of the lantern frame lines, the more stable the quality of the lantern. If two lines intersect at a point, these two lines are called adjacent lines. The slope of each line at each contour pixel is calculated, and the resulting slope sequence is denoted as... Based on this feature, a cross-index is constructed to represent the trend of the lighting fixture's skeleton outline.
[0066]
[0067] In the formula, cro t Let exp() represent the cross-index of the lighting skeleton outline trend of the t-th skeleton line, where exp() represents the exponential function with the natural constant e as the base, M represents the number of skeleton lines adjacent to the t-th skeleton line, and g_t represents the number of skeleton lines adjacent to the t-th skeleton line. t Let gra represent the slope sequence of the t-th skeleton line. t,j This represents the slope sequence of the j-th adjacent line to the t-th skeleton line, PCC() represents the calculation of the Pearson correlation coefficient between the two sequences, dire t , These represent the trend coefficients of the lighting skeleton outline of the t-th skeleton line and the j-th skeleton line adjacent to the t-th skeleton line, respectively. The Pearson correlation coefficient is a well-known technique and will not be described further in this embodiment.
[0068] If the slope sequence similarity between adjacent skeleton lines is higher, the calculated PCC(gra) will be higher. t ,gra t,j The larger the value, the greater the linear correlation between the two skeleton lines in their trends, meaning the higher the probability that they are on the same straight line. When the sum of the trend coefficients of the lamp frame outline is higher, the calculated trend cross-index of the lamp frame outline is smaller, indicating that the trend cross-degree of the two skeleton lines at the node is lower, which means that the welding of the lamp frame is less firm and the stability is lower.
[0069] Step S003: Evaluate the production quality of the lighting components based on the cross-index of the lighting frame outline.
[0070] For each skeleton line of the lantern lighting component, a cross-index of the lantern skeleton contour trend was obtained. This index indicates the stability of the lantern; a higher cross-index value indicates better quality, and vice versa. Finally, the mean cross-index of the lantern skeleton contour trend for all skeleton lines in the appearance images from all directions was calculated, denoted as V. The normalized sum of the V values from all appearance images was used as the production quality index of the lighting component. A quality pass threshold was set. If the production quality index of the lighting component is greater than or equal to the quality pass threshold, the lighting component is considered to be of qualified quality; if it is less than the production quality index, it is considered unqualified. In this embodiment, the quality pass threshold is 3. The quality inspection process for the lighting component is as follows: Figure 2 As shown.
[0071] At this point, the quality inspection of the lighting components production is complete.
[0072] In summary, this embodiment of the invention first extracts the outline of the lamp's appearance image, constructs an in-south contrast coefficient of the skeleton outline based on the color contrast of the lamp's frame and decorations, and measures the probability of each pixel on the skeleton outline; further, it combines a corner detection algorithm to extract the skeleton lines of the lamp, effectively distinguishing the outline areas of the lamp's frame and decorations. This improves the accuracy of lamp frame extraction.
[0073] Furthermore, the inner and outer contours of the lighting fixture frame and the trend of its lines are analyzed. A contour trend coefficient and a cross-index of the contour trend of the lighting fixture frame are constructed to evaluate the stability of the lighting fixture frame, thereby achieving the purpose of production quality inspection. This avoids the shortcomings of existing inspection methods that are too sensitive to lighting fixture components with large shape changes, and thus improves the accuracy of production quality inspection of lighting fixture components.
[0074] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0075] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0076] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions of some of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for quality inspection in the production of lighting components, characterized in that, The method includes the following steps: Obtain visual images of the lantern decorations from all angles; The lighting fixture portion of the exterior image is designated as the Region of Interest (ROI). Edge detection is performed on the ROI to obtain a contour map. Based on the contour distribution characteristics of the windows containing each contour pixel in the contour map, the windows are divided into a first window and a second window. The contrast coefficient between the inner and outer contours of each pixel is obtained based on the pixel value differences in the window division results. The skeleton lines of the lighting fixture exterior image are obtained by combining the contour map, the normalized values of the contrast coefficients between the inner and outer contours of each contour pixel, and a corner detection algorithm. The curvature variation richness of each skeleton line is obtained based on the degree of contour bending. The trend coefficient of the lighting fixture skeleton contour of each skeleton line is obtained based on the distribution of the contrast coefficients between the inner and outer contours of the contour pixels on each skeleton line, combined with the curvature variation richness. Adjacent lines of each skeleton line are obtained based on the intersection relationships between the skeleton lines. The cross-index of the lighting fixture skeleton contour trend of each skeleton line is obtained based on the similarity between each skeleton line and its adjacent lines, combined with the trend coefficient of the lighting fixture skeleton contour. The production quality index of the lighting components is obtained based on the distribution characteristics of the cross-index of the outline trend of all skeleton lines in the various appearance images of the lighting fixture; the production quality inspection of the lighting components is completed based on the production quality index of the lighting components. The method for obtaining the in-skeletal contour contrast coefficient of each pixel based on the pixel value difference features in the window division result is specifically expressed as follows: In the formula, This represents the contrast coefficient between the inside and outside of the skeleton contour at the x-th contour pixel in the appearance image F. , These represent the i-th pixel values of the first window and the second window, respectively. , These represent the average pixel values of the first and second windows, respectively. This represents the minimum number of pixels in the first and second windows. , These represent the first and second pixel value sequences of the first and second windows, respectively. One value, , These represent the number of pixels in the first window and the second window, respectively. Describes the minimum value function. This represents the cosine similarity function.
2. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The specific steps for dividing the window into a first window and a second window based on the contour distribution characteristics of each contour pixel in the contour result image include: With each contour pixel as the center pixel, the preset window size is... ,in ; The contour line passing through the center pixel is saved as the center contour line, and the number of pixels in the center contour line is greater than or equal to... ; When the number of center outlines of the window area is less than 1, the window area is not divided. When the number of central outlines in the window area is equal to 1, the two window areas divided by the outlines are taken as the first window and the second window. When the number of central outlines in the window area is greater than 1, the two window areas divided by the shortest central outline are taken as the first window and the second window.
3. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The process of obtaining the skeleton lines of the lighting fixture's appearance image based on the contour result image and the normalized value of the contrast coefficient between the inner and outer contours of each contour pixel, combined with a corner detection algorithm, is as follows: The Shi-Tomasi corner detection algorithm is used to obtain each corner point on the contour result map; contour lines with corner points at both ends are saved as suspected skeleton lines. Calculate the normalized mean of the contrast coefficients between the inner and outer contours of all contour pixels on each suspected skeleton line; set a skeleton line threshold; and use the suspected skeleton lines whose mean value is greater than the skeleton line threshold as the skeleton lines of the lighting fixture appearance image.
4. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The method of obtaining the curvature variation richness of each skeleton line based on the degree of contour bending of each skeleton line is as follows: For each skeleton line, calculate the curvature value of each contour pixel on the skeleton line, and take the sequence of all the curvature values on the skeleton line as the curvature sequence of the skeleton line; calculate the mean, variance and range of all elements of the curvature sequence respectively. Calculate the difference between each element of the curvature sequence and the mean; Calculate the product of the difference and the range; take the negative of the variance as the exponent of an exponential function with the natural constant as the base; Calculate the ratio of the product to the result of the exponential function; use the mean of the ratios of all elements in the curvature sequence as the richness of curvature variation of the skeleton lines.
5. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The process involves obtaining the lighting skeleton contour trend coefficient of each skeleton line based on the distribution of the contrast coefficients between the inner and outer contours of the contour pixels on each skeleton line, combined with the richness of curvature changes. Specifically: For each skeleton line, the sequence of skeleton contour inward and outward contrast coefficients of all contour pixels on the skeleton line is taken as the skeleton contour inward and outward contrast coefficient sequence of the skeleton line; the range and minimum value of all elements in the skeleton contour inward and outward contrast coefficient sequence are obtained. Calculate the sum of each element of the contrast coefficient sequence between the inner and outer contours of the skeleton and the minimum value; calculate the ratio of the difference to the range value; Calculate the mean of the ratios of all elements in the contrast coefficient sequence between the inner and outer sides of the skeleton outline; multiply the mean of the skeleton outline by the richness of the curvature variation of the skeleton outline as the trend coefficient of the lighting skeleton outline.
6. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The adjacent lines of each skeleton line are specifically the skeleton lines that intersect with the skeleton lines.
7. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The specific steps for obtaining the cross-index of the lighting skeleton contour trend of each skeleton line based on the similarity between each skeleton line and its adjacent lines, combined with the trend coefficient of the lighting skeleton contour, include: For each skeleton line, calculate the slope of each contour pixel on the skeleton line, and take the sequence of all the slopes on the skeleton line as the slope sequence of the skeleton line; obtain the Pearson correlation coefficient between the slope sequences of the skeleton line and each adjacent line; take the Pearson correlation coefficient as the exponent of an exponential function with the natural constant as the base; calculate the sum of the trend coefficients of the lighting skeleton contour of the skeleton line and each adjacent line; calculate the ratio of the calculation result of the exponential function to the sum; take the sum of the ratios of the skeleton line and all adjacent lines as the cross-index of the trend of the lighting skeleton contour of each skeleton line.
8. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The production quality index of the lighting components is obtained based on the distribution characteristics of the cross-index of the lighting skeleton contour trends of all skeleton lines in each appearance image of the lighting fixture. Specifically: For each appearance image of the lighting fixture, calculate the normalized value of the mean of the cross-index of the lighting fixture skeleton contour trend of all skeleton lines in each appearance image; and use the sum of the normalized values of all appearance images of the lighting fixture as the production quality index of the lighting fixture component.
9. The method for quality inspection of lighting component production as described in claim 1, characterized in that, The process of conducting production quality inspection of lighting components based on their production quality index specifically includes: A preset quality pass threshold is set; if the production quality index of the lighting component is greater than or equal to the quality pass threshold, the production quality of the lighting component is qualified; if the production quality index of the lighting component is less than the quality pass threshold, the production quality of the lighting component is unqualified.
Citation Information
Patent Citations
Plane space contour skeleton line extraction method
CN113963369A
Regional ecological bearing capacity boundary threshold detection method and device
CN114626965A