Furniture surface quality inspection method based on machine vision
In the detection of wooden furniture surfaces, the significance detection method of machine vision technology is used to identify scratched areas using the parameter values of target pixel points, which solves the problem of inaccurate detection in the prior art and achieves higher detection accuracy and reliability.
Patent Information
- Application Number
- CN202411314735.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In the prior art, it is difficult to obtain accurate detection results when detecting scratches on the surface of wooden furniture, mainly because the threshold value in the grayscale histogram is relatively fixed, and the influence of noise in the image cannot be effectively considered.
Using a machine vision-based method, by acquiring the target grayscale image, the first parameter value and the second parameter value of the target pixel point are determined, and these parameter values are used for significance detection to identify the scratched area in the image. The first parameter value represents the difference in grayscale values between the target pixel point and other pixel points in the neighborhood, and the second parameter value represents the probability of noise, thereby more accurately identifying the scratched area.
It improves the accuracy of detection of scratches on furniture surfaces, can more effectively distinguish scratched areas and non-scratch areas, reduces the impact of noise, and improves the reliability of detection results.
Smart Images

Figure CN118823029B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, and in particular to a furniture surface quality detection method based on machine vision. Background Art
[0002] Wooden furniture is usually assembled from multiple parts. For example, a table can be assembled from panels, frames, drawers and supporting structures. During the assembly process of wooden furniture, scratches may occur on the panels and other surfaces of the wooden furniture; or, when the assembled wooden furniture is transported from the seller to the buyer, scratches may occur on the surface of the wooden furniture during transportation, affecting the buyer's perception of the wooden furniture, thereby causing an increase in the rate of customer complaints from the buyer to the seller.
[0003] In order to facilitate the detection of surface scratches on an object, in the relevant technology, for example, in the Chinese patent application document with publication number CN106770330A, a detection method for a device for detecting scratches on an object surface is provided, including: filtering an image of the surface of the object to be detected; performing edge processing on the filtered image, and performing image segmentation on the edge-processed image; performing convolution smoothing processing on the histogram through a Gaussian filter, and using the maximum and minimum values in the histogram as segmentation thresholds; extracting connected areas from the segmented areas, expanding the obtained connected areas through the Minkowski addition and dilation method, and merging several independent areas containing scratches into a complete connected area; corroding the connected areas, and corroding the scratch areas through a circular area with a radius of 4 pixels.
[0004] In the related art, the threshold value obtained by the grayscale histogram is used to segment the scratches on the surface of the object to obtain the scratches existing on the surface of the object. However, since the threshold value in the grayscale histogram is relatively fixed, it is difficult to obtain a more accurate scratch area when segmenting using the threshold value determined by the grayscale histogram. Therefore, it is difficult for the related art to obtain accurate detection results for surface scratches on furniture. Summary of the invention
[0005] In order to overcome the problem that it is difficult to obtain accurate detection results for surface scratches of furniture in related technologies, the present application provides a furniture surface quality detection method based on machine vision, including: obtaining a target grayscale image of the surface to be detected of the target furniture, and determining a first number of other pixels in the target grayscale image that have the same grayscale value as the target pixel; the target pixel is any pixel in the target grayscale image; determining a first parameter value of the target pixel based on the grayscale values and the first number of other pixels in the neighborhood of the target pixel, the first parameter value being used to characterize the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood; determining a gradient feature difference value between the target pixel and other pixels in the neighborhood, and determining a second parameter value of the target pixel based on the first parameter value and the gradient feature difference value, the second parameter value being used to characterize the probability that the target pixel belongs to noise; the second parameter value of the target pixel , Q is the first parameter value of the target pixel, F is the gradient feature difference value between the target pixel and other pixels in the neighborhood, is the gradient direction value of the target pixel, is the average value of the gradient direction values of R other pixels with the smallest grayscale difference with the target pixel in the neighborhood of the target pixel, R is the preset second number, b is the first preset value, The absolute value operation is performed; the second parameter value of the target pixel point is used to perform saliency detection on the target grayscale image, and a salient area in the target grayscale image is obtained, and the salient area is used as the scratch area of the surface to be detected.
[0006] In this way, the second parameter value of the target pixel is used to perform saliency detection on the target grayscale image, and the salient area in the target grayscale image is obtained, and the salient area is used as the scratch area of the surface to be detected; since the second parameter value of the target pixel is determined according to the first parameter value and the gradient feature difference value, the second parameter value is used to characterize the probability that the target pixel belongs to noise, and the first parameter value is used to characterize the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood, compared with using the threshold of the grayscale histogram to determine the segmentation threshold of the scratch area, it can take into account the influence of noise that may exist in the target grayscale image, and therefore, it can determine a more accurate scratch area on the surface of the furniture.
[0007] Optionally, determining the first parameter value of the target pixel point according to the grayscale values and the first quantity of other pixels in the neighborhood of the target pixel point includes: , where Q is the first parameter value of the target pixel, is the gray value of the target pixel, is the average grayscale value of pixels in the neighborhood of the target pixel, G is the first number of other pixels in the target grayscale image that have the same grayscale value as the target pixel, and a is a second preset value.
[0008] Optionally, determining the gradient feature difference value between the target pixel and other pixels in the neighborhood includes: , F is the gradient feature difference value between the target pixel and other pixels in the neighborhood, R is a preset second number, R is less than the total number of pixels in the neighborhood of the target pixel, L is the gradient magnitude value of the target pixel, is the gradient value of the rth pixel among the R other pixels with the smallest grayscale difference with the pixel in the neighborhood of the target pixel, b is the first preset value, To take the absolute value operation.
[0009] Optionally, the method uses the second parameter value of the target pixel to perform significance detection on the target grayscale image to obtain a significant area in the target grayscale image, including: taking the average value of the first parameter value of the target pixel within an adjacent range of a preset size where the target pixel is located as the characteristic value of the target pixel at the preset size; determining the target weight corresponding to other pixels of the target pixel at the preset size based on the average value of the second parameter value of the pixels within the range of the preset size where the target pixel is located; determining the significance value of the target pixel based on the characteristic value of the target pixel at different preset sizes and the target weights corresponding to other pixels of the target pixel at the preset size, so as to determine the significant area based on the significance value.
[0010] In this way, the saliency value is determined based on the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels of the target pixel at the preset size. The obtained saliency value can contain richer information of the target pixel, so as to distinguish between the scratch area and the area outside the scratch area through the saliency value, thereby obtaining a more accurate scratch area.
[0011] Optionally, determining the significance value of the target pixel according to the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels at the preset sizes of the target pixel includes: , Z is the significance value of the target pixel, norm is the normalization function, E is the number of types of multiple preset sizes, is the number of pixels other than the target pixel at the xth preset size, is the characteristic value of the target pixel at the xth preset size, is the characteristic value of the kth pixel other than the target pixel at the xth preset size, is the target weight of the kth pixel point other than the target pixel point at the xth preset size.
[0012] In this way, through the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels at the preset size of the target pixel, in the calculation formula of the significance value, the contribution of other pixels with higher target weights at the preset size to the calculation of the significance value can be improved, thereby determining a more accurate significance value.
[0013] Optionally, determining the target weight corresponding to other pixels at the preset size of the target pixel according to the average value of the second parameter of the pixels at the preset size where the target pixel is located includes: ,in, is the target weight of the kth pixel other than the target pixel at the xth preset size, exp is an exponential function with a natural constant as the base, is the average value of the second parameter value of all pixels within the range of the preset size of the kth pixel other than the target pixel under the xth preset size, is the number of pixels other than the target pixel at the xth preset size.
[0014] In this way, other pixel points with a higher probability of noise can be set with a smaller target weight, and other pixel points with a lower probability of noise can be set with a larger target weight, thereby avoiding the adverse effect of noise in the target grayscale image on the calculation result of the significance value.
[0015] Optionally, determining the significant region according to the significance value includes: taking a region consisting of target pixel points in the target grayscale image whose significance value is greater than a preset significance threshold as the significant region in the target grayscale image.
[0016] Optionally, the method further includes: when the area of the scratch region on the surface to be detected of the target furniture is smaller than a preset area threshold, marking the scratch detection status of the surface to be detected as a qualified status; when the scratch detection status of all surfaces to be detected of the target furniture is a qualified status, marking the scratch detection status of the target furniture as accepted.
[0017] In this way, when the scratch detection of all surfaces to be detected is completed, if the scratch detection status of all surfaces to be detected has been marked as qualified, it means that the area of the scratch region in all surfaces to be detected of the furniture is relatively small, or there is no scratch region in all surfaces to be detected. The scratch detection status of the target furniture is marked as accepted, which can realize the acceptance of the scratch detection of the furniture and avoid the waste caused by repeated scratch detection of the same furniture.
[0018] The technical solution provided by the embodiments of the present application may include the following beneficial effects: performing saliency detection on a target grayscale image using the second parameter value of a target pixel point, obtaining a salient area in the target grayscale image, and using the salient area as the scratch area of the surface to be detected; since the second parameter value of the target pixel point is determined based on the first parameter value and the gradient feature difference value, the second parameter value is used to characterize the probability that the target pixel point belongs to noise, and the first parameter value is used to characterize the degree of difference in grayscale value between the target pixel point and other pixels in the neighborhood, compared to determining the segmentation threshold of the scratch area using the threshold of the grayscale histogram, the influence of noise that may exist in the target grayscale image can be considered, and therefore a more accurate scratch area on the surface of the furniture can be determined.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] Figure 1 The present invention is a flowchart of a method for detecting furniture surface quality based on machine vision according to an exemplary embodiment. DETAILED DESCRIPTION
[0022] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0023] First, the application scenario of the embodiment of the present application is briefly introduced. In the application scenario of the present application, wooden furniture may have scratches on the surface of the furniture due to assembly or transportation, which affects the appearance of the wooden furniture and causes an increase in the customer complaints rate of the buyers of the wooden furniture against the sellers.
[0024] In order to detect possible scratches on the surface of wooden furniture, in the related art, the grayscale histogram of the grayscale image of the surface of the wooden furniture can be used to determine the segmentation threshold, so as to segment the scratch area using the determined segmentation threshold. However, the threshold in the grayscale histogram is relatively fixed, and the segmentation effect of the scratches on the surface of the wooden furniture is not good, which affects the segmentation accuracy of the scratches on the surface of the wooden furniture.
[0025] In view of the above technical problems, the present application provides a furniture surface quality detection method based on machine vision. Figure 1is a flow chart of a furniture surface quality detection method based on machine vision according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.
[0026] In step S101, a target grayscale image of a surface to be detected of a target piece of furniture is acquired, and a first number of other pixels in the target grayscale image having the same grayscale value as the target pixel is determined.
[0027] The target pixel is any pixel in the target grayscale image. The image acquisition device can be used to acquire the visible light image of the surface to be detected of the target furniture, and the target grayscale image of the surface to be detected of the wooden furniture can be obtained by graying the visible light image.
[0028] The surface to be detected may be the top, side, and front of wooden furniture. For example, when the target furniture is a wardrobe, the surface to be detected may be the external front, external side, and internal surfaces of the wardrobe.
[0029] For the target pixel point in the target grayscale image of the furniture surface to be inspected, although there may be some scratches, the area of the scratches is usually smaller than the area without scratches. Therefore, the number of other pixels in the target grayscale image with the same grayscale value as the target pixel point can provide a valuable reference for determining whether the target pixel point in the target grayscale image is a pixel point with defects such as scratches.
[0030] For example, if for a target pixel in a target grayscale image, the number of other pixels in the target grayscale image that have the same grayscale value as the target pixel accounts for 50% of the total number of pixels in the target grayscale image, it indicates that the probability that the target pixel has a defect is low.
[0031] In step S102, a first parameter value of the target pixel is determined according to the grayscale values and the first number of other pixels in the neighborhood of the target pixel.
[0032] The first parameter value is used to characterize the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood. When there is a defect in the target pixel, the grayscale value of the target pixel usually shows a large difference from the grayscale values of other surrounding pixels. For example, when there is a scratch on the surface of a wooden wardrobe, there is a certain difference between the pixel in the scratch area and other surrounding pixels.
[0033] The first parameter value of the target pixel is determined according to the grayscale values of other pixels in the neighborhood of the target pixel and the first number. The obtained first parameter value can more accurately characterize the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood, so as to determine the possible scratches on the surface of the wooden furniture; the neighborhood of the target pixel can refer to a range of areas of 3×3, 5×5, and 7×7 centered on the pixel.
[0034] In one embodiment, determining the first parameter value of the target pixel point according to the grayscale values and the first quantity of other pixels in the neighborhood of the target pixel point includes: , where Q is the first parameter value of the target pixel, is the gray value of the target pixel, is the average grayscale value of pixels in the neighborhood of the target pixel, G is the first number of other pixels in the target grayscale image that have the same grayscale value as the target pixel, and a is a second preset value.
[0035] The greater the difference between the grayscale values of the target pixel and the pixels in its neighborhood, the lower the similarity between the target pixel and other surrounding pixels, and the greater the probability that the target pixel is the pixel where the defect is located; conversely, the smaller the difference between the grayscale values of the target pixel and the pixels in its neighborhood, the higher the similarity between the target pixel and other surrounding pixels, and the smaller the probability that the target pixel is the pixel where the defect is located.
[0036] The second preset value a is a value greater than 0. For example, a can be a value greater than 0 such as 0.01, 0.02, and 0.03. The existence of the second preset value can avoid the situation where the first parameter value is equal to 0. The second preset value may be involved in the multiplication operation later to avoid the situation where the first parameter value is equal to 0, thereby ensuring that each parameter involved in the subsequent multiplication operation can play its respective role.
[0037] In this way, by comparing the pixel value of the target pixel with the average grayscale value of the pixels in the neighborhood, and combining the first number of other pixels in the target grayscale image that have the same grayscale value as the target pixel to obtain a first parameter value, the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood can be better characterized by the obtained first parameter value.
[0038] In step S103, a gradient feature difference value between the target pixel and other pixels in the neighborhood is determined, and a second parameter value of the target pixel is determined according to the first parameter value and the gradient feature difference value.
[0039] The second parameter value is used to characterize the probability that the target pixel point belongs to noise; since the second parameter value is determined based on the first parameter value and the gradient feature difference value, the gradient difference value can characterize the degree of difference between the gradient magnitude value of the target pixel point and the gradient magnitude values of other pixels in the neighborhood, the second parameter value can reflect the degree of difference between the target pixel point and other pixels in the neighborhood from two dimensions: the difference in the gradient magnitude value of the target pixel point and the difference in the grayscale value.
[0040] For example, when there is a scratch on the surface of wooden furniture, the second parameter value can represent the degree of difference between the scratch pixel point on the surface of the wooden furniture and other pixel points other than the scratch pixel point.
[0041] In one embodiment, determining the gradient feature difference value between the target pixel and other pixels in the neighborhood includes: , F is the gradient feature difference value between the target pixel and other pixels in the neighborhood, R is a preset second number, R is less than the total number of pixels in the neighborhood of the target pixel, L is the gradient magnitude value of the target pixel, is the gradient value of the rth pixel among the R other pixels with the smallest grayscale difference with the pixel in the neighborhood of the target pixel, b is the first preset value, To take the absolute value operation.
[0042] The first preset value is a preset value greater than 0. The first preset value and the second preset value may be preset values independent of each other. The second preset value and the first preset value may be the same, or the second preset value and the first preset value may be different. The first preset value may be, for example, preset values such as 0.01, 0.02, and 0.03.
[0043] The existence of the first preset value greater than 0 can avoid the situation where the gradient feature difference value is 0. The gradient feature value may be multiplied with other parameter values in the subsequent calculation process. By avoiding the situation where the gradient feature difference value is 0, it can be ensured that the parameter values involved in the multiplication operation of the gradient feature value can play their respective roles.
[0044] Using gradient operators such as the Sobel operator, Prewitt operator, and Scharr operator, the horizontal gradient value of a pixel in a grayscale image in the horizontal direction and the vertical gradient value in the vertical direction can be determined. Based on the horizontal gradient value and vertical gradient value of the pixel, the gradient magnitude value and gradient direction value of the pixel in the grayscale image can be determined.
[0045] The scratches on the surface of wooden furniture have a certain degree of extensibility. For example, there is at least one other adjacent scratched pixel point around the scratched pixel point. Therefore, by comparing the gradient magnitude values of the target pixel point with those of other surrounding pixels to determine the gradient feature difference value between the target pixel point and other pixels in the neighborhood, the probability of a defect at a position point on the surface of the wooden furniture can be reflected through the gradient feature difference value.
[0046] R is a preset second number. For example, when the range of the neighborhood is equal to 3×3, the total number of pixels in the neighborhood of the target pixel is 9, and the number of other pixels in the neighborhood of the target pixel except the target pixel is 8. The value of R can be 4 or 5.
[0047] By comparing the gradient magnitude value of a target pixel with the gradient magnitude values of multiple other pixels in a neighborhood whose grayscale values are closest to the pixel, the number of gradient magnitude values that need to be compared can be reduced compared to comparing the gradient magnitude value of the target pixel with the gradient magnitude values of all other pixels in the neighborhood.
[0048] Compared with comparing the grayscale values of pixels, the amount of calculation required for calculating the gradient magnitude values of pixels and comparing the gradient values of pixels is greater. Therefore, by reducing the number of pixels whose gradient magnitude values need to be compared, the amount of calculation required can be reduced, which helps to reduce the operating power consumption of the device.
[0049] Moreover, since the object for comparison of gradient magnitude values is other pixels in the neighborhood whose grayscale values are closest to the target pixel, if the gradient magnitude values of other pixels in the neighborhood whose grayscale values are closest to the target pixel differ greatly from the gradient magnitude value of the target pixel, it means that the gradient magnitude values of pixels other than the pixel in the neighborhood whose grayscale values are closest to the target pixel differ even more from the gradient magnitude value of the target pixel, and the target pixel has a higher probability of being abnormal, which helps to confirm the existence of abnormal pixels in the target grayscale image.
[0050] In one embodiment, determining the second parameter value of the target pixel point according to the first parameter value and the gradient feature difference value includes: , T is the second parameter value of the target pixel, Q is the first parameter value of the target pixel, and F is the gradient feature difference value between the target pixel and other pixels in the neighborhood. is the gradient direction value of the target pixel, is the average value of the gradient direction values of R other pixels with the smallest grayscale difference with the target pixel in the neighborhood of the target pixel, R is the preset second number, b is the first preset value, To take the absolute value operation.
[0051] In addition to considering the gradient magnitude value of the target pixel point, the gradient direction of the target pixel point can also reflect the direction of change of the pixel value of the target pixel point. Compared with the normal pixels on the furniture surface, the pixels where the defects on the furniture surface are located have a certain gradient direction. Therefore, the gradient direction of the target pixel point can be used to effectively determine the abnormal pixels in the target grayscale image, so as to determine the scratch pixels.
[0052] The second parameter value is determined based on the first parameter value and the gradient direction values of multiple other pixels in the neighborhood of the target pixel whose grayscale value is closest to the target pixel, so that the second parameter value can comprehensively reflect the differences between the target pixel and other pixels in the neighborhood in three dimensions: gradient direction value, gradient magnitude value and grayscale value, and the differences between the scratch pixel and other pixels other than the scratch pixel are mainly concentrated in these three dimensions. Therefore, the second parameter value can effectively characterize the probability that the pixel belongs to noise, so as to determine the scratch area on the surface of the wooden furniture.
[0053] In step S104, a saliency detection is performed on the target grayscale image using the second parameter value of the target pixel point to obtain a salient region in the target grayscale image, and the salient region is used as the scratch region of the surface to be detected.
[0054] Image saliency testing is an important research direction in the field of computer vision. Its purpose is to simulate the attention mechanism in the human visual system and automatically identify the most eye-catching parts of the image.
[0055] The salient area in the image can be determined through the saliency test. The color, brightness, shape or texture of the salient area is usually quite different from the surrounding environment. The saliency value corresponding to the pixel in the target grayscale image can be determined through the saliency test. The saliency value can be used to characterize the degree to which the pixel can attract the user's attention. The processed saliency value can be between 0 and 1 through normalization.
[0056] Since the significance detection in the embodiment of the present application is performed based on the second parameter value of the target pixel point, the second parameter value can characterize the probability that the target pixel point belongs to noise. Therefore, the significance area obtained by the significance test based on the second parameter value can fully reflect the difference between the scratch area and the area outside the scratch, which is convenient for users to understand the specific location of the scratches on the surface of wooden furniture.
[0057] When the scratched area in the target grayscale image of wooden furniture is determined, the scratched area in the target grayscale image can be marked. For example, a marking frame can be used to mark the location of the scratched area, so that users can view the specific location of the scratches on the surface of the wooden furniture.
[0058] In one embodiment, a saliency detection is performed on a target grayscale image using a second parameter value of a target pixel to obtain a salient area in the target grayscale image, including: taking an average value of a first parameter value of a target pixel within an adjacent range of a preset size where the target pixel is located as a characteristic value of the target pixel at the preset size; determining a target weight corresponding to other pixels of the target pixel at the preset size based on an average value of a second parameter value of pixels within the range of the preset size where the target pixel is located; determining a saliency value of the target pixel based on the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels of the target pixel at the preset size, so as to determine a salient area based on the saliency value.
[0059] For example, in order to facilitate determination of the performance of target pixels at different scales, different preset sizes may be pre-configured, and different preset sizes correspond to different scales. For example, different preset sizes may be 3×3, 5×5, 7×7, 9×9, and 11×11.
[0060] The first parameter value of the target pixel can characterize the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood. The average value of the first parameter value of the target pixel in the adjacent range of the preset size where the target pixel is located is used as the eigenvalue of the target pixel at the preset size. The eigenvalue can comprehensively reflect the grayscale characteristics of the target pixel at the preset size.
[0061] Since the second parameter value is determined by comparing the gradient magnitude value and the gradient direction value of the target pixel with other pixels in the neighborhood, the target weight corresponding to other pixels at the preset size of the target pixel is determined according to the average value of the second parameter value of the pixels within the preset size where the target pixel is located. The target weights of other pixels at the preset size of the target pixel can be used to provide a reference for the significance of the target pixel.
[0062] In this way, the saliency value is determined based on the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels of the target pixel at the preset size. The obtained saliency value can contain richer information of the target pixel, so as to distinguish between the scratch area and the area outside the scratch area through the saliency value, thereby obtaining a more accurate scratch area.
[0063] In one embodiment, determining the significance value of the target pixel point according to the characteristic values of the target pixel point at different preset sizes and the target weights corresponding to other pixels of the target pixel point at the preset sizes includes: , Z is the significance value of the target pixel, norm is the normalization function, E is the number of types of multiple preset sizes, is the number of pixels other than the target pixel at the xth preset size, is the characteristic value of the target pixel at the xth preset size, is the characteristic value of the kth pixel other than the target pixel at the xth preset size, is the target weight of the kth pixel point other than the target pixel point at the xth preset size.
[0064] The same preset size includes multiple pixel points. For example, when the preset size is 3×3, the preset size includes a target pixel point and 8 other pixel points except the target pixel point. The significance value of the target pixel point can be determined by referring to the difference between the characteristic value of the target pixel point at the preset size and the characteristic values of other pixels at the preset size. The significance value can characterize the significance degree of the pixel point in the target grayscale image.
[0065] In the application scenario of the present application, the significance value can represent the degree of difference between the surface pixel points of the wooden furniture and other pixel points outside the scratch area.
[0066] In this way, through the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels at the preset size of the target pixel, in the calculation formula of the significance value, the contribution of other pixels with higher target weights at the preset size to the calculation of the significance value can be improved, thereby determining a more accurate significance value.
[0067] In one embodiment, determining the target weight corresponding to other pixels of the target pixel at the preset size according to the average value of the second parameter of the pixels within the preset size where the target pixel is located includes: ,in, is the target weight of the kth pixel other than the target pixel at the xth preset size, exp is an exponential function with a natural constant as the base, is the average value of the second parameter value of all pixels within the range of the preset size of the kth pixel other than the target pixel under the xth preset size, is the number of pixels other than the target pixel at the xth preset size.
[0068] In the calculation formula of the target weight corresponding to other pixels of the target pixel within the preset size, the larger the average value of the second parameter values of all pixels within the preset size of other pixels, the smaller the target weight corresponding to other pixels of the target pixel within the preset size. Since the second parameter value is used to characterize the probability that the target pixel is noise, the larger the average value of the second parameter values of all pixels within the preset size of other pixels, the greater the probability that noise exists within the range where other pixels in the target grayscale image are located.
[0069] In this way, other pixel points with a higher probability of noise can be set with a smaller target weight, and other pixel points with a lower probability of noise can be set with a larger target weight, thereby avoiding the adverse effect of noise in the target grayscale image on the calculation result of the significance value.
[0070] At the same time, by processing the average value of the second parameter values of all pixels within the preset size of the kth pixel other than the target pixel under the xth preset size, the value of the obtained target weight can be between 0 and 1, which is convenient for comparison or calculation between parameters.
[0071] In one embodiment, determining the significant region according to the significance value includes: taking a region consisting of target pixels in the target grayscale image whose significance value is greater than a preset significance threshold as the significant region in the target grayscale image.
[0072] When the significance value of the target pixel is greater than the preset significance threshold, it indicates that the target pixel is more different from other pixels in the target image. The region composed of the target pixels whose significance value is greater than the preset significance threshold can be used as the significance region in the target grayscale image, thereby obtaining the significance region in the target image. Since the significance value is normalized to a value between 0 and 1, the preset significance threshold can be between 0.5 and 0.8.
[0073] In this way, according to the saliency value of the target pixel point in the target grayscale image, the saliency region can be determined, thereby realizing the acquisition of the scratch region in the target grayscale image.
[0074] In one embodiment, when the area of the scratch region on the surface to be detected of the target furniture is smaller than a preset area threshold, the scratch detection status of the surface to be detected can be marked as qualified; when the scratch detection status of all surfaces to be detected of the target furniture is qualified, the scratch detection status of the target furniture can be marked as accepted.
[0075] For example, the database of the furniture manager may store first identification information corresponding to the target furniture and multiple second identification information, where the first identification information corresponds to the target furniture, the second identification information corresponds to the surface to be detected of the target furniture, and different second identification information corresponds to different surfaces to be detected of the target furniture.
[0076] The first identification information may be, for example, the code or number of the target furniture among all furniture, and the second identification information may be the code or number of the surface to be detected of the target furniture among all surfaces to be detected. The database may also store the scratch detection status corresponding to the first identification information and the scratch detection status corresponding to the second identification information.
[0077] By detecting the scratch detection status of different furniture and different surfaces to be detected of furniture in the database, it is possible to facilitate the scratch detection of surfaces to be detected whose scratch detection status is not marked as qualified, and to avoid the waste caused by repeated scratch detection of surfaces to be detected whose scratch detection status is marked as qualified.
[0078] Furniture may include multiple surfaces to be detected. For example, the surfaces to be detected of a wardrobe may be the front of the wardrobe, the side of the wardrobe, and the facade of the wardrobe. Since surface scratches are the most common and most intuitive defects on the surface of furniture, if the area of the scratched area on the surface to be detected of the target furniture is less than the preset area threshold, it means that the scratched area on the surface to be detected of the target furniture is small, or there are no scratches on the surface to be detected of the target furniture, and the scratch detection status of the surface to be detected can be marked as qualified. The facade of the furniture refers to the visible surface or side of the furniture.
[0079] The preset area threshold may be determined according to the total area of the surface to be detected. For example, the preset area threshold may be between 1% and 2% of the total area of the surface to be detected.
[0080] When the scratch detection of all surfaces to be detected is completed, if the scratch detection status of all surfaces to be detected has been marked as qualified, it means that the area of the scratch region in all surfaces to be detected of the furniture is small, or there is no scratch region in all surfaces to be detected. In order to realize the scratch detection of furniture and avoid the waste caused by repeated scratch detection of the same furniture, the scratch detection status of the target furniture can be marked as accepted.
[0081] Through the furniture surface quality detection method based on machine vision provided by the embodiment of the present application, the second parameter value of the target pixel point is used to perform significance detection on the target grayscale image, and the significant area in the target grayscale image is obtained, and the significant area is used as the scratch area of the surface to be detected; since the second parameter value of the target pixel point is determined based on the first parameter value and the gradient feature difference value, the second parameter value is used to characterize the probability that the target pixel point belongs to noise, and the first parameter value is used to characterize the degree of difference in grayscale value between the target pixel point and other pixels in the neighborhood, compared with using the threshold of the grayscale histogram to determine the segmentation threshold of the scratch area, it can take into account the influence of noise that may exist in the target grayscale image, and therefore, it can determine a more accurate scratch area on the surface of the furniture.
[0082] It should be understood that the features of some embodiments of the various applications described herein may be combined with each other, unless specifically stated otherwise.
[0083] Although terms such as "first", "second", and "third" may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Instead, these terms are only used to distinguish one component, part, region, layer, or section from another component, part, region, layer, or section. Therefore, without departing from the teachings of the examples described herein, the first component, part, region, layer, or section mentioned in the examples may also be referred to as the second component, part, region, layer, or section.
[0084] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description herein, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0085] In addition, the word "exemplary" is used herein to mean serving as an example, instance, or diagram. Any aspect or design described herein as "exemplary" is not necessarily to be understood as being advantageous over other aspects or designs. Instead, the use of the word exemplary is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or".
[0086] Likewise, although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the accompanying drawings. With particular regard to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise noted, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if not structurally equivalent to the disclosed structures.
[0087] Additionally, while particular features of the present application may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and advantageous for any given or particular application.
[0088] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application, and the specification and embodiments are only considered as exemplary.
[0089] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A furniture surface quality detection method based on machine vision, characterized in that: include: Acquire a target grayscale image of the surface to be detected of the target furniture, and determine a first number of other pixel points in the target grayscale image having the same grayscale value as the target pixel point; The target pixel is any pixel in the target grayscale image; Determining a first parameter value of the target pixel according to the grayscale values of other pixels in the neighborhood of the target pixel and the first quantity includes: , where Q is the first parameter value of the target pixel, is the gray value of the target pixel, is the average grayscale value of pixels in the neighborhood of the target pixel, G is the first number of other pixels in the target grayscale image that have the same grayscale value as the target pixel, and a is a second preset value; The first parameter value is used to characterize the difference in grayscale value between the target pixel and other pixels in the neighborhood; Determine the gradient feature difference value between the target pixel and other pixels in the neighborhood, and determine the second parameter value of the target pixel based on the first parameter value and the gradient feature difference value, the second parameter value is used to characterize the probability that the target pixel belongs to noise; the second parameter value of the target pixel , Q is the first parameter value of the target pixel, F is the gradient feature difference value between the target pixel and other pixels in the neighborhood, is the gradient direction value of the target pixel, is the average value of the gradient direction values of R other pixels with the smallest grayscale difference with the target pixel in the neighborhood of the target pixel, R is the preset second number, b is the first preset value, To take the absolute value operation; The second parameter value of the target pixel is used to perform saliency detection on the target grayscale image to obtain a salient area in the target grayscale image, including: taking the average value of the first parameter value of the target pixel in the adjacent range of the preset size where the target pixel is located as the characteristic value of the target pixel at the preset size; determining the target weight corresponding to other pixels of the target pixel at the preset size according to the average value of the second parameter value of the pixels within the range of the preset size where the target pixel is located; determining the saliency value of the target pixel according to the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels of the target pixel at the preset size, so as to determine the saliency area according to the saliency value, and taking the saliency area as the scratch area of the surface to be detected.
2. The furniture surface quality detection method based on machine vision according to claim 1 is characterized in that: The step of determining the gradient feature difference value between the target pixel and other pixels in the neighborhood includes: , F is the gradient feature difference value between the target pixel and other pixels in the neighborhood, R is a preset second number, R is less than the total number of pixels in the neighborhood of the target pixel, L is the gradient magnitude value of the target pixel, is the gradient value of the rth pixel among the R other pixels with the smallest grayscale difference with the pixel in the neighborhood of the target pixel, b is the first preset value, To take the absolute value operation.
3. The furniture surface quality detection method based on machine vision according to claim 1, characterized in that: According to the characteristic values of the target pixel at different preset sizes and the target weights corresponding to other pixels at the preset size, the significance value of the target pixel is determined, including: , Z is the significance value of the target pixel, norm is the normalization function, E is the number of types of multiple preset sizes, is the number of pixels other than the target pixel at the xth preset size, is the characteristic value of the target pixel at the xth preset size, is the characteristic value of the kth pixel other than the target pixel at the xth preset size, is the target weight of the kth pixel point other than the target pixel point at the xth preset size.
4. The furniture surface quality detection method based on machine vision according to claim 1, characterized in that: Determining the target weights corresponding to other pixels of the target pixel within the preset size according to the average value of the second parameter of the pixels within the preset size where the target pixel is located includes: ,in, is the target weight of the kth pixel other than the target pixel at the xth preset size, exp is an exponential function with a natural constant as the base, is the average value of the second parameter value of all pixels within the range of the preset size of the kth pixel other than the target pixel under the xth preset size, is the number of pixels other than the target pixel at the x-th preset size.
5. The furniture surface quality detection method based on machine vision according to claim 1, characterized in that: Determining the significant region according to the significant value includes: The region formed by target pixel points whose significance values in the target grayscale image are greater than a preset significance threshold is taken as the significant region in the target grayscale image.
6. The furniture surface quality detection method based on machine vision according to any one of claims 1 to 5, characterized in that: The method further comprises: When the area of the scratch region on the surface to be detected of the target furniture is smaller than a preset area threshold, marking the scratch detection state of the surface to be detected as a qualified state; When the scratch detection status of all the surfaces to be detected of the target furniture is in a qualified state, the scratch detection status of the target furniture is marked as accepted.
Citation Information
Patent Citations
Object surface scratch detection device and detection method thereof
CN106770330A
Illuminator accessory defect detection method based on machine vision
CN116363133A
Power adapter appearance quality detection method based on multi-feature fusion
CN117408995A
Cited By
Furniture structure quality detection method and device based on image recognition
CN119832399A
Image recognition-based furniture structure quality detection method and device
CN119832399B
A Machine Learning-Based Method for Detecting Surface Defects in Folding Tables
CN123118447A
