A method for inspecting the appearance of plastic Christmas trees
By performing multiple Gaussian smoothing and feature point analysis on the Christmas tree part images, the quality subcoefficient and structural normal coefficient are calculated, the problems of excessive feature points and interference in the appearance quality inspection of Christmas tree are solved, and a more accurate and reliable quality assessment is achieved.
Patent Information
- Application Number
- CN202510388131.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing Christmas tree appearance quality inspection methods are disturbed by the excessive characteristic points and morphological diversity of Christmas trees, resulting in inaccurate and unreliable quality inspection results.
By obtaining the part images and product images of the Christmas tree parts, selecting the target part images for multiple Gaussian smoothing, extracting feature points and calculating the mass sub-coefficient and structural normal coefficients, fusing these coefficients to obtain the mass coefficient of the parts, and then evaluating the quality of the parts and the overall Christmas tree.
It effectively reduces the interference of excessive feature points and morphological diversity on quality inspection results, improves the accuracy and reliability of appearance quality evaluation, ensures that defective parts are not assembled, and improves production efficiency.
Smart Images

Figure CN119904457B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of Christmas tree image feature analysis, and in particular to an appearance quality inspection method for the production of plastic Christmas trees. Background Art
[0002] The appearance quality of a plastic Christmas tree is an important indicator of the product. When conducting quality inspection on the appearance of a plastic Christmas tree, the image data of the completed Christmas tree can be captured by a camera, and features can be extracted from the image data. The appearance quality of the Christmas tree can be judged based on the extracted image features.
[0003] However, when conducting quality inspection of Christmas trees through images, since there are many leaves of the Christmas trees themselves (fake leaves made of PC material) and the qualified shapes of the Christmas trees themselves are also diverse (the products produced for the same type of Christmas tree cannot be completely consistent), it is easy to be subject to more interference when extracting features through images, which affects the accuracy and reliability of the quality inspection results. Summary of the invention
[0004] In order to solve the technical problem that the appearance quality inspection of existing Christmas trees is disturbed by too many characteristic points and diverse shapes of Christmas trees, resulting in unsatisfactory quality inspection results, the purpose of the present invention is to provide an appearance quality inspection method for plastic Christmas trees. The technical scheme adopted is as follows:
[0005] Obtaining the part image of each Christmas tree part and the product image of the current Christmas tree; selecting any kind of Christmas tree part as a target category, and selecting any part image of the target category as a target image;
[0006] Perform Gaussian smoothing on the target image multiple times to obtain multiple smoothed images; the smoothed images contain the target image; obtain feature points of each of the smoothed images, and obtain the quality sub-coefficient of each feature point in the target image according to the local distribution characteristics of each feature point in the target image in all the smoothed images; match the target image with feature points of a preset part image set of similar parts to obtain a feature point fusion image; obtain the structural normality coefficient of each feature point in the target image according to the deviation characteristics of the feature point in the target image in the feature point fusion image;
[0007] The quality coefficient of each feature point of the target image and the structural normal coefficient are integrated to obtain the quality coefficient of the part corresponding to the target image; the part score of the Christmas tree parts is obtained based on the quality coefficient and the part assembly is controlled; according to the quality coefficient and the part score corresponding to all parts of the current Christmas tree, the product image of the current Christmas tree is Gaussian smoothed to obtain a complete smoothed image of the current Christmas tree; the complete smoothed image of the current Christmas tree is matched with the feature points of the product image set of historical excellent Christmas trees to obtain the structural normal coefficient of each feature point in the complete smoothed image;
[0008] According to all the structural normal coefficients corresponding to the complete smoothed image of the current Christmas tree, a quality score of the current Christmas tree is obtained.
[0009] Furthermore, the method for obtaining the mass sub-coefficient includes:
[0010] Taking the sum of the reciprocals of the local reachable distances of any feature point in the target image in all the smoothed images as the quality sub-coefficient corresponding to the feature point in the target image;
[0011] When the feature point in the target image does not exist in the smoothed image, the reciprocal value of the local reachable distance is set to 1.
[0012] Furthermore, the method for obtaining the structural normal coefficient includes:
[0013] Density clustering is performed on the feature points in the feature point fusion image; any feature point in the target image is selected as a target feature point;
[0014] The Euclidean distance between the target feature point and the nearest cluster center is negatively correlated with the exp(-x) function and then multiplied by the number of data points in the cluster to which the target feature point belongs and the local reachable density of the target feature point to serve as the structural normal coefficient of the target feature point.
[0015] Furthermore, the method for obtaining the quality coefficient includes:
[0016] The sum of the products of the quality sub-coefficients and the structural normal coefficients of all feature points of the target image is used as the quality coefficient of the target image.
[0017] Furthermore, the method for obtaining the component scores of the Christmas tree components based on the quality coefficient and controlling the component assembly includes:
[0018] When the quality coefficient of the Christmas tree parts is less than the first preset threshold, it is judged as defective and the Christmas tree is not assembled; when the quality coefficient is greater than or equal to the first preset threshold and less than the second preset threshold, the Christmas tree parts are judged as good and the Christmas tree is assembled; when the quality coefficient of the Christmas tree parts is greater than or equal to the second preset threshold, it is judged as excellent and the Christmas tree is assembled.
[0019] Furthermore, the method for obtaining the complete smoothed image includes:
[0020] The minimum quality coefficient of all parts in the current Christmas tree is negatively mapped by the exp(-x) function as the first strict sub-coefficient; the ratio of the number of good parts to the number of excellent parts in the parts is used as the second strict sub-coefficient; the reciprocal of the sum of the quality coefficients of all parts is used as the third strict sub-coefficient; the product of the first strict sub-coefficient, the second strict sub-coefficient and the third strict sub-coefficient is linearly normalized as the detection strict coefficient of the current Christmas tree;
[0021] The product of the detection strict coefficient and the preset maximum Gaussian smoothing coefficient is used as the subtrahend, the preset maximum Gaussian smoothing coefficient is used as the minuend, and the difference is used as the smoothing coefficient to perform Gaussian smoothing on the product image of the current Christmas tree to obtain a complete smoothed image of the current Christmas tree.
[0022] Furthermore, the method for obtaining the quality score includes:
[0023] The sum of the structural normal coefficients of all feature points of the current Christmas tree is linearly normalized to obtain the quality score of the current Christmas tree;
[0024] When the quality score is less than the third preset threshold, the Christmas tree is judged to have appearance defects; when the quality score is greater than or equal to the third preset threshold and less than the fourth preset threshold, the Christmas tree is judged to have good appearance; when the quality score is greater than or equal to the fourth preset threshold, the Christmas tree is judged to have excellent appearance.
[0025] Furthermore, the method of performing Gaussian smoothing on the target image multiple times to obtain multiple smoothed images includes:
[0026] Gaussian smoothing is performed on the target image according to a preset smoothing coefficient; the preset smoothing coefficients are 0, , , , ;in , .
[0027] Furthermore, the method for acquiring the feature points includes:
[0028] The feature points in the image are extracted through SIFT corner detection.
[0029] Furthermore, both the part image and the product image are pre-processed by semantic segmentation.
[0030] The present invention has the following beneficial effects:
[0031] The present invention first selects any part image of any kind of part as the target image; further performs Gaussian smoothing on the target image for multiple times to obtain multiple smoothed images, wherein the smoothed images contain the target image, which is convenient for subsequent analysis of the changes in the performance characteristics of feature points in images of different smoothing scales; further uses different degrees of smoothing to highlight the difference characteristics between defect points and normal points, identifies possible quality problems from the changes in feature points, obtains the quality sub-coefficient of each feature point in the target image, and characterizes the part quality from the perspective of a single feature point; further obtains a feature point fusion image to represent the ideal morphological space of the target part; obtains a structural normal coefficient to characterize the structural normal possibility of the feature point according to the deviation characteristics of the feature points in the target image in the feature point fusion image, adapts to the morphological diversity of Christmas tree parts, and reduces the possibility of false detection; further fuses the quality sub-coefficient and the structural normal coefficient to obtain the target image. The quality coefficient of the parts should be obtained; based on the quality coefficient, the parts score of the Christmas tree parts is obtained and the parts assembly is controlled to avoid defective parts being assembled into the Christmas tree, providing a basis for controlling the Gaussian smoothing scale of the product image; further adaptive Gaussian smoothing is performed to ensure that the smoothing effect matches the part quality, and the complete smoothed image of the current Christmas tree is obtained, which can reduce the interference caused by too many detail feature points, thereby making the real defect points more prominent; further matching the complete smoothed image of the current Christmas tree with the feature points of the product image set of historical excellent Christmas trees, obtaining the structural normal coefficient of each feature point in the complete smoothed image, making up for the subtle differences between different samples, not easily affected by accidental errors or sample characteristic differences, and improving the reliability of appearance quality evaluation; finally, according to all the structural normal coefficients corresponding to the complete smoothed image of the current Christmas tree, the quality score of the current Christmas tree is obtained. The present invention evaluates the quality of a single part, performs adaptive Gaussian smoothing on the product image based on the quality of all parts in the product, reduces the interference of too many detail feature points, and uses historical product images to evaluate the quality of the current product, reduces the interference of morphological diversity, and improves the reliability of appearance quality evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. 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 creative work.
[0033] Figure 1 A flow chart of a method for inspecting the appearance of plastic Christmas trees provided by one embodiment of the present invention;
[0034] Figure 2 A parts image of a leaf region of a plastic Christmas tree provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the appearance quality inspection method for the production of a plastic Christmas tree according to the present invention, its specific implementation method, structure, characteristics and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0036] 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.
[0037] The specific scheme of the appearance quality inspection method for the production of plastic Christmas trees provided by the present invention is described in detail below with reference to the accompanying drawings.
[0038] See also Figure 1 , which shows a flow chart of a method for appearance quality inspection of plastic Christmas tree production provided by an embodiment of the present invention, specifically comprising:
[0039] Step S1: Obtain the part image of each Christmas tree part and the product image of the current Christmas tree; select any kind of Christmas tree part as the target category, and select any part image of the target category as the target image.
[0040] The embodiment of the present invention analyzes the qualification status of each part of the Christmas tree, and performs adaptive Gaussian smoothing on the product image according to the qualification status of all parts of the complete Christmas tree, thereby reducing the interference of the number of feature points; then, the structural normal features of the feature points in the complete smoothed image of the current Christmas tree are analyzed with the help of historical product images, and finally a quality score for the appearance quality inspection of the current Christmas tree is obtained, thereby reducing the interference of the diversity of Christmas trees and improving the accuracy of the detection results.
[0041] In one embodiment of the present invention, a high-definition camera is used to capture images of parts of a Christmas tree at a top-down angle; after the parts of the Christmas tree are assembled, a high-definition camera is used to capture images of the rotating Christmas tree at a front-view angle and the images are stitched together to obtain a product image, wherein the rotation of the Christmas tree is to avoid occlusion problems in a single direction.
[0042] It should be noted that both the part images and product images are pre-processed with semantic segmentation to remove the background area in the image and eliminate the interference of the complex background; semantic segmentation to remove the image background is already a prior art and will not be repeated here; the types of parts of the plastic Christmas tree are determined by the production process and include at least leaves and trunks.
[0043] See also Figure 2 , which shows a part image of a leaf region of a plastic Christmas tree provided by an embodiment of the present invention.
[0044] Select any kind of Christmas tree part as the target category, and select any part image of the target category as the target image, so as to analyze the part images one by one.
[0045] It should be noted that the analysis method for all part images is the same, and only one target image is used as an example for description.
[0046] Step S2: perform Gaussian smoothing on the target image multiple times to obtain multiple smoothed images; the smoothed images contain the target image; obtain the feature points of each smoothed image, and obtain the quality sub-coefficient of each feature point in the target image according to the local distribution characteristics of each feature point in the target image in all smoothed images; match the target image with the feature points of a preset part image set of similar parts to obtain a feature point fusion image; obtain the structural normality coefficient of each feature point in the target image according to the deviation characteristics of the feature points in the target image in the feature point fusion image.
[0047] There are a large number of feature points in the target image, which will interfere with the identification of feature points of defects such as exposed wires. Considering that the performance characteristics of feature points in the image change after different degrees of Gaussian smoothing are applied to the target image, different degrees of smoothing can highlight the difference between defective points and normal points, and identify possible quality problems from the changes in feature points, so Gaussian smoothing is performed on the target image multiple times to obtain multiple smoothed images. The feature points of each smoothed image are obtained, and the quality sub-coefficient of each feature point in the target image is obtained according to the local distribution characteristics of each feature point in the target image in all smoothed images.
[0048] Preferably, in one embodiment of the present invention, Gaussian smoothing is performed on the target image according to a preset smoothing coefficient; the preset smoothing coefficients are: 0, , , , ;in , .
[0049] It should be noted that when the smoothing coefficient of Gaussian smoothing is 0, the corresponding smoothed image is the target image itself, which is the result with the minimum smoothing degree. The smoothed image contains the target image. Taking the feature point distribution of the original target image as a benchmark helps to compare the changing characteristics of the feature points during the analysis process and distinguish normal feature points from interference points.
[0050] Preferably, in one embodiment of the present invention, considering that the feature points corresponding to Christmas tree parts such as leaves are distributed more concentratedly in the image, and the local reachable distance is small; since the grayscale and texture of the normal area of the parts are relatively close, such as the grayscale between the leaves is close, the normal feature points will disappear with the scale change of Gaussian smoothing; if the continuity of the feature point in the smoothed image of different Gaussian smoothing is stronger, and it still remains obvious after multiple smoothing, it means that this feature point has obvious abnormal characteristics;
[0051] Based on this, the sum of the reciprocals of the local reachable distances of any feature point in the target image in all smooth images is taken as the quality sub-coefficient of the corresponding feature point in the target image;
[0052] When the feature point in the target image does not exist in the smoothed image, the reciprocal of the local reachable distance is set to 1.
[0053] As an example, the calculation formula of the mass sub-coefficient includes:
[0054] ;
[0055] Where i represents the serial number of the feature point in the target image; represents the quality coefficient of the i-th feature point in the target image; M represents the number of smoothed images obtained; z represents the sequence number of the smoothed image; Represents the local reachable distance of the i-th feature point in the z-th smoothed image.
[0056] In the calculation formula of the quality sub-coefficient, the local distribution characteristics of the feature point are expressed by the local reachable distance. The larger the local reachable distance, the more likely the feature point is to be in an outlier position and the more likely it is to be an abnormal point, reflecting that there are abnormal feature points in the target image. The worse the quality of the corresponding Christmas tree parts is, the smaller the quality sub-coefficient is. At the same time, when the feature point in the target image does not exist in a smoothed image, it means that the local grayscale and texture of this feature point are similar. After Gaussian smoothing, the feature point disappears, and it is more likely to be a normal area in the Christmas tree parts, and the better the quality of the Christmas tree parts is, so it is assigned The value is 1, the larger the mass sub-coefficient.
[0057] It should be noted that, in one embodiment of the present invention, feature points in an image are extracted by SIFT corner detection. SIFT corner detection, Gaussian smoothing and local reachability distance are all existing technologies and will not be described in detail.
[0058] Due to the production process, assembly method, material properties and other reasons, the feature point distribution of Christmas tree parts (such as leaves and trunks) is different even for parts of the same target type. By matching the target image with the feature points of a preset part image set of the same type of parts, a feature point fusion image is obtained. The fusion image is a set of feature points of the target type of parts in diverse forms, which includes the range of morphological changes that may occur in the parts during different production processes and represents the "ideal morphological space" of the target parts. According to the deviation characteristics of the feature points in the target image in the feature point fusion image, abnormal feature points with large deviations can be effectively identified, and the structural normal coefficient of each feature point of the target image can be obtained to adapt to the morphological diversity of Christmas tree parts, reduce the possibility of false detection, and provide more basis for subsequent evaluation of the quality of parts corresponding to the target image.
[0059] Preferably, in one embodiment of the present invention, considering that density clustering can identify outliers and reflect the deviation characteristics of data, density clustering is performed on the feature points in the feature point fusion image; any feature point in the target image is selected as the target feature point;
[0060] Considering that the more data points there are in the cluster where the target feature point is located, the closer it is to the cluster center, and the greater the local reachable density, it reflects that the closer the local data points of the target feature point are, the less obvious the deviation feature is, and the more likely the target feature point is a normal feature point of the part; based on this, the Euclidean distance between the target feature point and the nearest cluster center is negatively correlated with the exp(-x) function, and the product of the number of data points in the cluster to which the target feature point belongs and the local reachable density of the target feature point is used as the structural normal coefficient of the target feature point, which is expressed by the formula:
[0061] ;
[0062] Among them, r represents the serial number of the target structure point; represents the structural normal coefficient of the rth target feature point; represents the structural normal coefficient of the rth target feature point; Represents the Euclidean distance between the rth target feature point and the nearest cluster center; Represents the local reachable density of the rth target feature point.
[0063] In the calculation formula of the structural normal coefficient, The larger it is, the more likely it is that the target feature point is a feature point of a normal structure, and the larger the structural normality coefficient is. The smaller it is, the closer the target cluster is to the cluster center, and the less likely it is to be an abnormal feature point. After adjusting the logical relationship through the negative correlation mapping of the exp(-x) function, the larger the structural normal coefficient is. The larger it is, the smaller the deviation characteristics of the target feature points are from the perspective of local reachable density, and the larger the structural normal coefficient is.
[0064] It should be noted that exp(-x) is an exponential function with the natural constant e as the base; density clustering specifically adopts the DBSCAN clustering algorithm; the DBSCAN clustering algorithm, obtaining the Euclidean distance, feature point matching, clustering center of the cluster cluster and local reachable density are all existing technologies and will not be elaborated here.
[0065] It should be noted that, considering that the number of target types of Christmas tree parts continues to increase with continuous production, when acquiring feature point fusion images, implementers can limit the number of part images participating in feature point matching, such as limiting the matching to the latest 50 part images including the target image, that is, presetting the part image set to the latest 49 part images, to avoid excessive calculation.
[0066] Step S3: Fuse the quality coefficient and structural normal coefficient of each feature point of the target image to obtain the quality coefficient of the corresponding part of the target image; obtain the part score of the Christmas tree parts based on the quality coefficient and control the part assembly; perform Gaussian smoothing on the product image of the current Christmas tree according to the quality coefficient and part score corresponding to all parts of the current Christmas tree to obtain a complete smoothed image of the current Christmas tree; match the complete smoothed image of the current Christmas tree with the feature points of the product image set of historical excellent Christmas trees to obtain the structural normal coefficient of each feature point in the complete smoothed image.
[0067] The quality sub-coefficient characterizes the possibility that the feature points are normal from the perspective of the distribution characteristics of the image feature points changing with the Gaussian smoothing scale; the structural normal coefficient characterizes the possibility that the feature points are normal from the perspective of the deviation characteristics of the feature points in the range of morphological changes that may occur in different production processes. Therefore, the quality sub-coefficient and the structural normal coefficient of each feature point of the target image are further integrated to obtain the quality coefficient of the part corresponding to the target image, and to characterize the quality characteristics of the part from the perspective of all feature points.
[0068] Preferably, in one embodiment of the present invention, considering that the larger the quality sub-coefficient is, the more normal the feature point is and the better the part quality is; the larger the structural normal coefficient is, the more normal the feature point is and the better the part quality is, the sum of the products of the quality sub-coefficients and the structural normal coefficients of all feature points of the target image is taken as the quality coefficient of the target image.
[0069] Based on the quality coefficient, the parts score of the Christmas tree parts is obtained and the parts assembly is controlled. The quality coefficient is further summarized to prevent defective parts from being assembled into the Christmas tree, reduce unnecessary rework or repairs, and improve production efficiency.
[0070] Preferably, in one embodiment of the present invention, when the quality coefficient of the Christmas tree parts is less than the first preset threshold, it is judged as defective and the Christmas tree is not assembled; when the quality coefficient is greater than or equal to the first preset threshold and less than the second preset threshold, the Christmas tree parts are judged as good and the Christmas tree is assembled; when the quality coefficient of the Christmas tree parts is greater than or equal to the second preset threshold, it is judged as excellent and the Christmas tree is assembled.
[0071] As an example, the quality coefficient is linearly normalized, the first preset threshold is 0.3, and the second preset threshold is 0.7.
[0072] Considering that a Christmas tree is assembled from multiple parts, the quality coefficient and part score of each part reflect the detail quality of the part. By summarizing the quality coefficients and part scores corresponding to all the parts of the current Christmas tree, the overall appearance quality of the Christmas tree can be preliminarily evaluated; according to the quality coefficients and part scores corresponding to all the parts of the current Christmas tree, Gaussian smoothing is performed on the product image of the current Christmas tree to ensure that the smoothing effect matches the part quality. Obtaining a complete smoothed image of the current Christmas tree can reduce the interference caused by too many detail feature points, thereby making the real defect points more prominent, which is convenient for subsequent acquisition of the quality score of the current Christmas tree.
[0073] Preferably, in one embodiment of the present invention, considering the minimum quality coefficient of all parts in the current Christmas tree, it represents the parts with the worst quality in the Christmas tree. Following the barrel principle, the stricter the quality inspection is, the smaller the Gaussian smoothing degree should be; therefore, the minimum quality coefficient of all parts in the current Christmas tree is negatively correlated with the exp(-x) function and is used as the first strict sub-coefficient;
[0074] Considering that there are more good parts than excellent parts among all parts, it means that there are more good parts among all parts of the Christmas tree, and stricter quality inspection is required, and the Gaussian smoothing degree should be smaller; therefore, the ratio of the number of good parts to the number of excellent parts among all parts is used as the second strict sub-coefficient;
[0075] Considering that the smaller the overall quality coefficient of all parts of the Christmas tree is, the worse the overall quality of the parts of the Christmas tree is, the more stringent the quality inspection is required, and the smaller the Gaussian smoothing degree should be, so the reciprocal of the sum of the quality coefficients of all parts is taken as the third strict sub-coefficient;
[0076] Further, the product of the first strict sub-coefficient, the second strict sub-coefficient and the third strict sub-coefficient is linearly normalized and used as the detection strict coefficient of the current Christmas tree;
[0077] The product of the detection strict coefficient and the preset maximum Gaussian smoothing coefficient is used as the subtrahend, the preset maximum Gaussian smoothing coefficient is used as the minuend, and the difference is used as the smoothing coefficient to perform Gaussian smoothing on the product image of the current Christmas tree to obtain a complete smoothed image of the current Christmas tree.
[0078] It should be noted that the preset maximum Gaussian smoothing coefficient is ;in , .
[0079] Similarly, the complete smooth image of the current Christmas tree is matched with the feature points of the product images of all historical excellent Christmas trees to obtain the structural normal coefficient of each feature point in the complete smooth image. The current product image is compared with the past product images, and the position and distribution of the feature points in the current image are analyzed to make up for the slight differences between different samples, making it less susceptible to accidental errors or differences in sample characteristics, thereby improving the reliability of appearance quality assessment and providing a basis for the final quality score.
[0080] It should be noted that the method for obtaining the structural normal coefficient of each feature point in the complete smooth image is similar to the method for obtaining the structural normal coefficient of each feature point in the target image. Clustering is also performed to obtain the number of data points in the cluster where the feature point is located, the Euclidean distance from the nearest cluster center, and the local reachable density, which will not be repeated here.
[0081] It should be noted that a certain number of excellent Christmas trees in the past can be manually selected, such as selecting 50 product images of Christmas trees with excellent appearance to form a fixed product image set, to provide a reference basis for the current Christmas trees; or before conducting the appearance quality inspection of plastic Christmas trees through images, a certain number of product images of Christmas trees can be manually selected, and with continuous production and appearance quality inspection, a certain number of the latest product images of Christmas trees with excellent appearance, such as 50, can be used to form a product image set, and the product image set can be continuously updated.
[0082] Step S4: Obtain the quality score of the current Christmas tree according to all structural normal coefficients corresponding to the complete smoothed image of the current Christmas tree.
[0083] With the help of the feature point distribution of historical excellent Christmas tree images, the structural normality coefficient of the feature points in the current Christmas tree is evaluated to characterize the normality of the current Christmas tree in appearance. Therefore, the quality score of the current Christmas tree is obtained according to all the structural normality coefficients corresponding to the complete smooth image of the current Christmas tree.
[0084] Preferably, in one embodiment of the present invention, considering that a higher value of the structural normality coefficient indicates that the shape of the current Christmas tree is more in line with the historical standard, the structure is more normal, and the quality is better, the sum of the structural normality coefficients of all feature points of the current Christmas tree is linearly normalized and used as the quality score of the current Christmas tree;
[0085] When the quality score of a Christmas tree is less than the third preset threshold, it is judged as having appearance defects; when the quality score is greater than or equal to the third preset threshold and less than the fourth preset threshold, it is judged as having good appearance; when the quality score is greater than or equal to the fourth preset threshold, it is judged as having excellent appearance.
[0086] As an example, the third preset threshold is 0.3; the fourth preset threshold is 0.7.
[0087] It should be noted that the implementer can set the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold by himself; but the first preset threshold is smaller than the second preset threshold, and the third preset threshold is smaller than the fourth preset threshold.
[0088] In summary, in order to solve the technical problem that the appearance quality inspection of existing Christmas trees is disturbed by too many Christmas tree feature points and morphological diversity, resulting in unsatisfactory quality inspection results, the present invention proposes a method for appearance quality inspection of plastic Christmas trees. The present invention first selects a target image in a part image, performs Gaussian smoothing on the target image multiple times, and obtains multiple smoothed images; further, based on the local distribution characteristics of each feature point in the target image in all smoothed images, the deviation characteristics in the image obtained by matching the feature point with the feature point of a similar preset part image set are combined to obtain the quality coefficient of the part corresponding to the target image; further, Gaussian smoothing is performed on the product image of the current Christmas tree; further, the complete smoothed image of the current Christmas tree is matched with the feature points of the product image set of historical excellent Christmas trees to obtain the structural normality coefficient of each feature point in the complete smoothed image; finally, the quality score of the current Christmas tree is obtained based on all structural normality coefficients corresponding to the complete smoothed image of the current Christmas tree.
[0089] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for inspecting the appearance of plastic Christmas trees, characterized in that: The method comprises: Obtaining the part image of each Christmas tree part and the product image of the current Christmas tree; selecting any kind of Christmas tree part as a target category, and selecting any part image of the target category as a target image; Perform Gaussian smoothing on the target image multiple times to obtain multiple smoothed images; the smoothed images contain the target image; obtain feature points of each of the smoothed images, and obtain the quality sub-coefficient of each feature point in the target image according to the local distribution characteristics of each feature point in the target image in all the smoothed images; match the target image with feature points of a preset part image set of similar parts to obtain a feature point fusion image; obtain the structural normality coefficient of each feature point in the target image according to the deviation characteristics of the feature point in the target image in the feature point fusion image; The quality coefficient of each feature point of the target image and the structural normal coefficient are integrated to obtain the quality coefficient of the part corresponding to the target image; the part score of the Christmas tree parts is obtained based on the quality coefficient and the part assembly is controlled; according to the quality coefficient and the part score corresponding to all parts of the current Christmas tree, the product image of the current Christmas tree is Gaussian smoothed to obtain a complete smoothed image of the current Christmas tree; the complete smoothed image of the current Christmas tree is matched with the feature points of the product image set of historical excellent Christmas trees to obtain the structural normal coefficient of each feature point in the complete smoothed image; Obtaining a quality score of the current Christmas tree according to all the structural normal coefficients corresponding to the complete smoothed image of the current Christmas tree; The method for obtaining the mass sub-coefficient comprises: Taking the sum of the reciprocals of the local reachable distances of any feature point in the target image in all the smoothed images as the quality sub-coefficient corresponding to the feature point in the target image; When the feature point in the target image does not exist in the smoothed image, the reciprocal value of the local reachable distance is set to 1; The method for obtaining the structural normal coefficient includes: Density clustering is performed on the feature points in the feature point fusion image; any feature point in the target image is selected as a target feature point; The Euclidean distance between the target feature point and the nearest cluster center is negatively correlated with the exp(-x) function and then multiplied by the number of data points in the cluster to which the target feature point belongs and the local reachable density of the target feature point to serve as the structural normal coefficient of the target feature point.
2. The appearance quality inspection method for plastic Christmas tree production according to claim 1, characterized in that: The method for obtaining the quality coefficient includes: The sum of the products of the quality sub-coefficients and the structural normal coefficients of all feature points of the target image is used as the quality coefficient of the target image.
3. The appearance quality inspection method for the production of plastic Christmas trees according to claim 2, characterized in that: The method for obtaining the part score of the Christmas tree parts based on the quality coefficient and controlling the part assembly includes: When the Christmas tree parts whose quality coefficient is less than the first preset threshold are judged as defective, the Christmas tree will not be assembled; when the Christmas tree parts whose quality coefficient is greater than or equal to the first preset threshold and less than the second preset threshold are judged as good, the Christmas tree will be assembled; when the Christmas tree parts whose quality coefficient is greater than or equal to the second preset threshold are judged as excellent, the Christmas tree will be assembled.
4. The appearance quality inspection method for the production of plastic Christmas trees according to claim 3, characterized in that: The method for obtaining the complete smoothed image comprises: The minimum quality coefficient of all parts in the current Christmas tree is negatively mapped by the exp(-x) function as the first strict sub-coefficient; the ratio of the number of good parts to the number of excellent parts in the parts is used as the second strict sub-coefficient; the reciprocal of the sum of the quality coefficients of all parts is used as the third strict sub-coefficient; the product of the first strict sub-coefficient, the second strict sub-coefficient and the third strict sub-coefficient is linearly normalized as the detection strict coefficient of the current Christmas tree; The product of the detection strict coefficient and the preset maximum Gaussian smoothing coefficient is used as the subtrahend, the preset maximum Gaussian smoothing coefficient is used as the minuend, and the difference is used as the smoothing coefficient to perform Gaussian smoothing on the product image of the current Christmas tree to obtain a complete smoothed image of the current Christmas tree.
5. The appearance quality inspection method for plastic Christmas tree production according to claim 1, characterized in that: The method for obtaining the quality score includes: The sum of the structural normal coefficients of all feature points of the current Christmas tree is linearly normalized to obtain the quality score of the current Christmas tree; When the quality score is less than the third preset threshold, the Christmas tree is judged to have appearance defects; when the quality score is greater than or equal to the third preset threshold and less than the fourth preset threshold, the Christmas tree is judged to have good appearance; when the quality score is greater than or equal to the fourth preset threshold, the Christmas tree is judged to have excellent appearance.
6. The appearance quality inspection method for plastic Christmas tree production according to claim 1, characterized in that: The method of performing Gaussian smoothing on the target image multiple times to obtain multiple smoothed images includes: Gaussian smoothing is performed on the target image according to a preset smoothing coefficient; the preset smoothing coefficients are 0, , , , ;in , .
7. The appearance quality inspection method for plastic Christmas tree production according to claim 1, characterized in that: The method for acquiring the feature points includes: The feature points in the image are extracted through SIFT corner detection.
8. The appearance quality inspection method for plastic Christmas tree production according to claim 1, characterized in that: The part image and the product image are both pre-processed by semantic segmentation.
Citation Information
Patent Citations
Wine bottle appearance defect detection method based on multi-view image fusion
CN114677356A
Visual detection method and system for surface quality of shaving board
CN118941516A