Wood-plastic plate product color sorting method and system based on machine vision

By using machine vision technology combined with color and shape characteristics in wood-plastic board product sorting, the problem of insufficient sorting accuracy in the existing technology is solved, high-precision product classification and identification is achieved, and sorting efficiency and accuracy are improved.

CN119810546AInactive Publication Date: 2025-04-11SHANDONG LVKANG DECORATION MATERIALS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411901197.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing machine vision technology has insufficient accuracy in color recognition and shape feature extraction of wood-plastic board products, especially in complex production environments, where factors such as lighting and color interference make sorting accuracy difficult to ensure.

Method used

Machine vision technology is used to combine color features and shape features to perform high-precision positioning of wood-plastic board products. By extracting color features and shape features from the pre-processed image information, a feature data set is formed, and key feature points are positioned with high-precision, position information is output, and finally, a combination of color features and shape features is used to classify and identify, class attributes are determined and sorted.

Benefits of technology

It improves the sorting accuracy of wood-plastic board products, reduces the occurrence of wrong sorting, realizes automated operations, improves the stability and reliability of the production line, and has flexibility and adaptability, and is suitable for sorting wood-plastic board products of different specifications and colors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810546A_ABST
    Figure CN119810546A_ABST
Patent Text Reader

Abstract

The invention discloses a wood-plastic plate product color sorting method and system based on machine vision, and belongs to the technical field of machine vision sorting. The wood-plastic plate product color sorting method comprises the steps that real-time image information of wood-plastic plate products is collected; the image information is preprocessed; extracting color features and shape features of the wood-plastic plate product from the preprocessed image information to form a feature data set; performing high-precision positioning on key feature points in the feature data set, and outputting position information; converting the position information into physical coordinates in an actual working environment; the color features and the shape features are combined, the wood-plastic plate products are classified and recognized, and category attributes are determined; and based on the category attributes and the physical coordinates, the wood-plastic plate products are sorted to preset positions. According to the method, the machine vision technology is combined with the color features and the shape features, high-precision positioning is conducted on key feature points, the sorting accuracy can be improved, and wrong sorting is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of machine vision sorting, and in particular to a method and system for color sorting of wood-plastic board products based on machine vision. Background Art

[0002] Machine vision is a technology that uses machines to replace human eyes for measurement and judgment. The image capture device converts the captured target into an image signal, which is transmitted to a dedicated image processing system to obtain the morphological information of the captured target. According to the pixel distribution, brightness, color and other information, it is converted into a digital signal. Machine vision technology has been widely used in the field of industrial automation due to its high precision and high efficiency, especially in product sorting, which can significantly improve the accuracy and efficiency of sorting.

[0003] At present, in the production process of wood-plastic board products, due to the diversity of color, shape and other characteristics, effective sorting is required to ensure product quality and production efficiency. In a complex production environment, due to factors such as lighting and color interference, the existing machine vision technology still has the problem of insufficient accuracy in color recognition. The shapes of wood-plastic board products are diverse, and there may be problems such as blurred edges and deformation, which makes it difficult to extract shape features. Summary of the invention

[0004] To solve the above problems, the present invention provides a method and system for color sorting of wood-plastic board products based on machine vision. By adopting machine vision technology in combination with color features and shape features, key feature points can be located with high precision, which can improve the accuracy of sorting and reduce the occurrence of erroneous sorting.

[0005] The above objectives can be achieved through the following solutions: The method for color sorting of wood-plastic board products based on machine vision comprises: collecting real-time image information of wood-plastic board products; preprocessing the image information; extracting color features and shape features of wood-plastic board products from the preprocessed image information to form a feature data set; high-precision positioning of key feature points in the feature data set and outputting position information; converting the position information into physical coordinates in an actual working environment; combining the color features and the shape features to classify and identify the wood-plastic board products and determine category attributes; and sorting the wood-plastic board products to a preset position based on the category attributes and the physical coordinates.

[0006] Optionally, extracting color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set includes: converting the preprocessed image information from an RGB color space to an HSV color space to extract color features; performing color segmentation on the converted image information in the HSV color space according to a preset color threshold; extracting shape features of the wood-plastic board product from the color-segmented image information; and integrating the color features and the shape features to obtain a feature data set.

[0007] Optionally, the converting the preprocessed image information from the RGB color space to the HSV color space to extract the color features comprises: obtaining a red component value, a green component value and a blue component value from the preprocessed image information; normalizing the red component value, the green component value and the blue component value; calculating a hue value using the normalized red component value, the green component value and the blue component value, and for the hue value ,have , In the formula, Represents the normalized red component value. Represents the green component value after normalization. Represents the normalized blue component value. represents the remainder operation, represents a minimum value operation; the saturation value is calculated using the normalized red component value, the green component value and the blue component value, and for the saturation value ,have , In the formula, represents a maximum value operation; the brightness value is calculated using the normalized red component value, the green component value and the blue component value, and for the brightness value ,have ; The hue value, the saturation, and the brightness are integrated into a color feature.

[0008] Optionally, the extracting of shape features of the wood-plastic board product from the color segmented image information includes: smoothing the color segmented image information through a Gaussian filter to output denoised image information; calculating the gradient amplitude and gradient direction of the pixel point according to the denoised image information, and for the gradient amplitude ,have , In the formula, The pixel point is The gradient component of the direction, The pixel point is The gradient component of the direction, is the square root function; for the gradient direction ,have , In the formula, is an inverse tangent function; according to the gradient amplitude and the gradient direction, the pixel points are refined by non-maximum suppression to obtain an edge image; the edge points of the edge image are screened by setting a high threshold and a low threshold to obtain strong edge points and weak edge points; the strong edge points and the weak edge points are connected and corrected by contour tracking to obtain a complete edge image; shape features are extracted according to the complete edge image to obtain shape features.

[0009] Optionally, the high-precision positioning of the key feature points in the feature data set and outputting the position information includes: performing preliminary positioning in the feature data set to find the key feature points; constructing a Gaussian model for characterizing the pixel grayscale value based on the preliminary located key feature points, and for the Gaussian model, , In the formula, represents the coordinates of the actual position of the pixel corresponding to the key feature point, represents the predicted gray value of the key feature point, represents the background gray value of the key feature point, represents the grayscale peak value of the key feature point, represents the coordinates of the pixel prediction position corresponding to the key feature point, represents the variance of the Gaussian model; by adjusting the model parameters, the Gaussian model is optimized and the position information is output.

[0010] Optionally, the step of optimizing the Gaussian model by adjusting the model parameters to output the position information comprises: establishing a residual function for representing the actual gray value of the pixel in the selected window and the gray value predicted by the Gaussian model, and for the residual function ,have , In the formula, Indicates the area within the selected window. Represents the actual grayscale value, where , , , are the model parameters of the Gaussian model to be optimized; an iterative algorithm is used to optimize the model parameters of the Gaussian model, a residual value is calculated according to the current model parameters, and the model parameters are updated; when the residual value reaches the residual threshold or the number of iterations reaches the iteration threshold, the coordinates of the pixel prediction position are output to obtain the position information.

[0011] Optionally, combining the color feature with the shape feature to classify and identify the wood-plastic board product and determining the category attribute includes: constructing a color feature database and a shape feature database to store standard color features and standard shape features of various categories; calculating the color similarity between the color feature and the standard color feature, and calculating the shape similarity between the shape feature and the standard shape feature; and determining the category attribute of the wood-plastic board product according to the color similarity and the shape similarity.

[0012] Optionally, sorting the wood-plastic board products to a preset position based on the category attributes and the physical coordinates includes: determining the position of a classification area according to the category attributes; and planning a sorting path according to the physical coordinates and the position of the classification area to ensure that the robotic arm can sort the wood-plastic board products to the position of the classification area.

[0013] Optionally, the method further includes: collecting various types of data generated during the sorting process in real time to obtain a sorting result for each wood-plastic board product; periodically classifying and counting the sorting results, and analyzing the causes of various types of erroneous sorting; based on the analysis results, evaluating the rationality of current system parameters, identifying system parameters that need to be optimized, and determining optimization targets; adjusting system parameters according to the optimization targets, and using the adjusted system parameters to perform sorting operations to obtain adjusted sorting results; judging the sorting accuracy of the adjusted sorting results; if the sorting accuracy is improved, retaining the adjusted system parameters; if the sorting accuracy is reduced, continuing to adjust the system parameters; wherein the system parameters include the color threshold, the high threshold, the low threshold, model parameters of the Gaussian model, the standard color features, and the standard shape features.

[0014] Based on the same inventive concept, the present invention also provides a color sorting system for wood-plastic board products based on machine vision, the system comprising: an image acquisition module for acquiring real-time image information of wood-plastic board products; an image processing module for preprocessing the image information; a feature extraction module for extracting color features and shape features of wood-plastic board products from the preprocessed image information to form a feature data set; a positioning module for high-precision positioning of key feature points in the feature data set and outputting position information; a coordinate conversion module for converting the position information into physical coordinates in an actual working environment; a classification and recognition module for classifying and identifying wood-plastic board products in combination with the color features and the shape features to determine category attributes; a sorting control module for sorting wood-plastic board products to a preset position based on the category attributes and the physical coordinates; a sorting optimization module for collecting various types of data generated during the sorting process for analysis, optimizing system parameters according to the analysis results, and verifying them; the sorting optimization module is also used to judge the sorting accuracy of the adjusted sorting results; if the sorting accuracy is improved, the adjusted system parameters are retained; if the sorting accuracy is reduced, the system parameters are continued to be adjusted.

[0015] Compared with the prior art, the present invention has the following advantages: 1. By using machine vision technology combined with color features and shape features, key feature points can be located with high precision, achieving detailed classification and accurate identification of wood-plastic board products, which can improve sorting accuracy and reduce the occurrence of incorrect sorting; 2. The entire sorting process is based on machine vision and system control, which realizes automated operation, reduces manual intervention, and improves the stability and reliability of the production line; 3. The present invention can adjust and optimize parameters according to actual needs, and is suitable for sorting wood-plastic board products of different specifications and colors, with strong flexibility and adaptability; 4. The present invention can optimize system parameters and realize automatic feedback adjustment by collecting and analyzing various types of data generated during the sorting process in real time, thereby further improving sorting efficiency and accuracy and realizing intelligent management.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are 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.

[0018] Figure 1 The figure is a flow chart of a method for color sorting of wood-plastic board products based on machine vision according to an embodiment of the present invention.

[0019] Figure 2 It is a flowchart of a method for extracting shape features according to an embodiment of the present invention.

[0020] Figure 3 It is a flowchart of a method for obtaining accurate pixel position information according to an embodiment of the present invention.

[0021] Figure 4 It is a flowchart of a system parameter feedback adjustment method according to an embodiment of the present invention.

[0022] Figure 5 The present invention is a flowchart of a color sorting system for wood-plastic board products based on machine vision according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Reference Figure 1 An embodiment of the present invention proposes a color sorting method for wood-plastic board products based on machine vision. By using machine vision technology in combination with color features and shape features, key feature points are positioned with high precision, thereby achieving detailed classification and accurate identification of wood-plastic board products, which can improve sorting accuracy and reduce the occurrence of erroneous sorting.

[0025] The method of this embodiment specifically includes: Collect real-time image information of wood-plastic board products; For example, a high-resolution industrial camera can be used to take real-time photos of wood-plastic board products on an assembly line; the camera is fixed in an appropriate position to ensure that a complete image of the wood-plastic board can be captured; and the captured image information is transmitted in real time for subsequent processing.

[0026] Preprocessing the image information; Exemplarily, preprocessing operations such as denoising and contrast enhancement are performed on the collected images; this can be achieved by using image processing software or algorithms, such as using a Gaussian filter for denoising, or using histogram equalization to enhance contrast; these preprocessing operations can improve image quality and make subsequent feature extraction more accurate and efficient.

[0027] Extract the color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set; Exemplarily, the preprocessed image is converted from the RGB color space to the HSV color space so as to more accurately extract color features; in the HSV color space, the image is color segmented according to a preset color threshold to distinguish the color area of ​​the wood-plastic board product from the background or other color areas; at the same time, an edge detection algorithm (such as Canny edge detection) is used to extract the shape features of the wood-plastic board product from the color-segmented image; the extracted color features and shape features are integrated to form a feature data set.

[0028] Perform high-precision positioning of key feature points in the feature data set and output position information; Exemplarily, in a feature data set, template matching or feature point detection algorithms (such as SIFT, SURF, etc.) can be used to preliminarily locate key feature points; then, a Gaussian model is constructed to characterize pixel grayscale values, and the Gaussian model is optimized by adjusting model parameters to achieve high-precision positioning of key feature points; the optimized Gaussian model can output accurate location information, including the coordinates of the feature points and the corresponding grayscale values.

[0029] Converting the position information into physical coordinates in an actual working environment; Exemplarily, based on the position and shooting angle of the camera, as well as the actual size and layout of the assembly line, the extracted position information is converted into physical coordinates in the actual working environment; this can be achieved by using camera calibration technology, that is, by establishing a mapping relationship between the camera and the working environment, the coordinates in the image are converted into actual physical coordinates; the converted physical coordinates can provide accurate spatial positioning information for the sorting operation.

[0030] Combining the color feature with the shape feature, classifying and identifying the wood-plastic board product, and determining the category attribute; Exemplarily, a color feature database and a shape feature database are constructed to store standard color features and standard shape features of various categories; then, the similarity between the extracted color features and shape features and the standard features is calculated (such as using measurement methods such as Euclidean distance and cosine similarity); based on the calculation results of the similarity, the category attributes of the wood-plastic board products are determined.

[0031] Based on the category attributes and the physical coordinates, the wood-plastic board products are sorted to a preset location.

[0032] For example, according to the determined category attributes, the location of the classification area to which the wood-plastic board products should be sorted is determined. Then, according to the converted physical coordinates and the location of the classification area, the sorting path is planned (such as using a path planning algorithm or a robotic arm control algorithm). Finally, by controlling automated equipment such as robotic arms, the wood-plastic board products are accurately sorted to the preset classification area location.

[0033] Furthermore, the extracting of color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set includes: Convert the preprocessed image information from the RGB color space to the HSV color space to extract color features; Specifically, the RGB color space is composed of color information of three channels: red, green, and blue. It is one of the most commonly used color representation methods. However, in image processing and computer vision, the HSV color space (Hue, Saturation, Value) is often more intuitive and useful because it separates the three relatively independent visual attributes of hue, saturation, and brightness, making it easier to extract and analyze the color features of the image.

[0034] For example, suppose there is a preprocessed image of a wood-plastic board product, and its pixel value in the RGB color space is (255, 105, 180); according to the RGB to HSV conversion formula, it can be converted into a value in the HSV color space, such as hue H=300 degrees, saturation S=100%, and brightness V=100%. In this way, the color feature of the pixel is obtained.

[0035] In the HSV color space, color segmentation is performed on the converted image according to a preset color threshold value to distinguish the color area of ​​the wood-plastic board product from the background or other color areas; Specifically, color segmentation is the process of extracting areas with specific color attributes in an image; in the HSV color space, the segmentation of specific color areas can be achieved by setting thresholds for hue H, saturation S, and brightness V.

[0036] For example, assuming that the wood-plastic board products in the red area are to be extracted, the thresholds of the hue H between 0-10 degrees and 350-360 degrees (indicating red), the saturation S greater than 50%, and the brightness V greater than 50% can be set; then, each pixel in the image is traversed to determine whether it meets these threshold conditions; if so, the pixel is regarded as a pixel in the red area, otherwise it is regarded as a pixel in other color areas.

[0037] Extract the shape features of the wood-plastic board product from the color segmented image; Specifically, in the image after color segmentation, the color region of the wood-plastic board product is obtained; next, the shape features of the wood-plastic board product, such as outline, edge, area, perimeter, etc., need to be extracted from this color region.

[0038] For example, it is assumed that a color-segmented image of a wood-plastic board product has been obtained, in which pixels in the red area have been extracted; an edge detection algorithm (such as the Canny algorithm) can be used to extract the edge contour of the red area; then, a contour tracking algorithm is used to obtain a complete edge image, and the shape features of the wood-plastic board product are extracted therefrom.

[0039] The color feature and the shape feature are integrated to obtain a feature data set.

[0040] Specifically, the extracted color features and shape features are integrated to form a feature data set containing color information and shape information; this feature data set will be used in subsequent classification and recognition steps to achieve detailed classification and accurate recognition of wood-plastic board products.

[0041] For example, for the above-mentioned wood-plastic board product image, its color features (such as hue H=300 degrees, saturation S=100%, brightness V=100%) and shape features (such as edge contour, area, perimeter, etc.) can be integrated to form a feature data set; then, this feature data set can be used to train a classifier or perform matching and recognition operations.

[0042] Furthermore, converting the preprocessed image information from the RGB color space to the HSV color space and extracting the color features includes: Acquire a red component value, a green component value, and a blue component value from the preprocessed image information; Specifically, the red component value (R), green component value (G), and blue component value (B) of each pixel are read from the preprocessed image; these values ​​are usually integers between 0 and 255.

[0043] Normalizing the red component value, the green component value, and the blue component value; Specifically, in order to perform HSV conversion, the RGB values ​​need to be normalized to between 0 and 1, which can be achieved by dividing each component value by 255.

[0044] The hue value is calculated by using the normalized red component value, the green component value and the blue component value. ,have , In the formula, Represents the normalized red component value. Represents the green component value after normalization. Represents the normalized blue component value. represents the remainder operation, Indicates the minimum value operation; Specifically, the hue value The calculation depends on the maximum value of the RGB value ( ) and the corresponding normalized component values, according to the hue value The calculation formula needs to consider the following three situations: the maximum value in the RGB value is equal to the normalized red component value, the maximum value in the RGB value is equal to the normalized green component value, and the maximum value in the RGB value is equal to the normalized blue component value.

[0045] The saturation value is calculated by using the normalized red component value, the green component value and the blue component value. ,have , In the formula, Indicates the maximum value operation; Specifically, the saturation value Is a measure of color purity.

[0046] The brightness value is calculated by using the normalized red component value, the green component value and the blue component value. ,have ; Specifically, the brightness value It is a measure of the brightness of a color.

[0047] The hue value, the saturation, and the brightness are integrated into a color feature.

[0048] For example, suppose there is a pixel whose RGB value is (200, 100, 50). For this pixel, the normalized RGB value is , that is (0.78, 0.39, 0.20); therefore ,at this time , , ; Therefore, for the above pixel, its HSV color feature is (19.66, 0.7436, 0.78); these features can be used in subsequent color segmentation, classification or recognition tasks.

[0049] Furthermore, the extracting of shape features of the wood-plastic board product from the image information after color segmentation includes: The image information after color segmentation is smoothed by a Gaussian filter, and the image information after noise reduction is output; Specifically, the image information after color segmentation is smoothed by a Gaussian filter to reduce the influence of noise on subsequent steps; the Gaussian filter is a linear smoothing filter, and its weight coefficient conforms to the Gaussian distribution.

[0050] According to the de-noised image information, the gradient amplitude and gradient direction of the pixel point are calculated. ,have , In the formula, The pixel point is The gradient component of the direction, The pixel point is The gradient component of the direction, is the square root function; For the gradient direction ,have , In the formula, is the inverse tangent function; Specifically, the gradient magnitude and gradient direction of the image information after smoothing are calculated. Represents the grayscale change rate at each pixel in the image information, and the gradient direction It indicates the direction of grayscale change.

[0051] According to the gradient amplitude and the gradient direction, the pixel points are refined by non-maximum suppression to obtain an edge image; Specifically, non-maximum suppression is an edge refinement technique that only retains the local maximum in the gradient direction, thereby suppressing pixels that are not edges; the purpose of this step is to obtain a finer edge image.

[0052] By setting a high threshold and a low threshold, edge points of the edge image are screened to obtain strong edge points and weak edge points; Specifically, the set high threshold and low threshold are used to screen edge points in the edge image. The high threshold is used to screen out strong edge points, while the low threshold is used to screen out weak edge points that may belong to the edge but are not certain.

[0053] Connecting and correcting the strong edge points and the weak edge points by contour tracking to obtain a complete edge image; Shape features are extracted according to the complete edge image to obtain shape features.

[0054] Specifically, the strong edge points and the weak edge points are connected and corrected by a contour tracking algorithm to obtain a complete edge image; the purpose of this step is to construct a complete contour of the wood-plastic board product.

[0055] For example, Figure 2 As shown in the figure, suppose we have a binary image after color segmentation (that is, it only contains wood-plastic board products and background). This image is smoothed by a Gaussian filter with a standard deviation of 1. The processed image will look smoother and have fewer noise points. For a pixel point in the smoothed image , the Sobel operator can be used to calculate its Direction and Directional gradient component and ; Then, according to the calculation formula of the gradient amplitude , we can get the gradient amplitude of the pixel point; similarly, according to the calculation formula of the gradient direction , we can get the gradient direction of the pixel, where ≠0; for each pixel in the smoothed image, check the adjacent pixels in the gradient direction; if the gradient amplitude of the current pixel is not the local maximum in the gradient direction, set its gradient amplitude to zero (or a very small value), otherwise keep its gradient amplitude, so that an edge image with non-maximum suppression is obtained; set a high threshold and a low threshold , ( ); For each pixel in the edge image, if its gradient magnitude is greater than , it is marked as a strong edge point; if its gradient amplitude is and If the gradient magnitude is less than , it is regarded as a non-edge point and ignored; using the contour tracking algorithm starting from the strong edge point, the adjacent edge points (including strong edge points and weak edge points) are gradually connected along the gradient direction; in the connection process, broken edges or wrong connections may be encountered, and appropriate corrections are needed to correct these problems; finally, a complete edge image is obtained, which accurately represents the shape characteristics of the wood-plastic board product.

[0056] Furthermore, the high-precision positioning of the key feature points in the feature data set and the output of the position information include: Perform preliminary positioning in the feature data set to find key feature points; Exemplarily, a preliminary positioning algorithm (such as edge detection, corner detection, etc.) is used to find the approximate position of key feature points in the feature data set; these preliminary positioning results may not be very accurate, but only provide the area where the feature points may exist.

[0057] According to the key feature points initially located, a Gaussian model for characterizing the grayscale value of pixels is constructed. For the Gaussian model, , In the formula, represents the coordinates of the actual position of the pixel corresponding to the key feature point, represents the predicted gray value of the key feature point, represents the background gray value of the key feature point, represents the grayscale peak value of the key feature point, represents the coordinates of the pixel prediction position corresponding to the key feature point, represents the variance of the Gaussian model; For example, based on the results of the preliminary positioning, a Gaussian model for characterizing the grayscale value of pixels is constructed; the Gaussian model is a commonly used mathematical model that can be used to describe the distribution of the grayscale value of pixels; based on the results of the preliminary positioning, an initial predicted position is set for each key feature point , and assume an initial background gray value , Grayscale Peak and variance ; Then, traverse each pixel in the feature data set and use the above formula to calculate the predicted grayscale value and compare it with the actual grayscale value.

[0058] The Gaussian model is optimized by adjusting the model parameters and the position information is output.

[0059] For example, by comparing the predicted grayscale values and the actual grayscale value, we can adjust the model parameters ( , , as well as ), so that the predicted grayscale value is closer to the actual grayscale value; this process can be achieved through iterative optimization algorithms, such as gradient descent method, least squares method, etc.; during the optimization process, the predicted position is continuously adjusted to minimize the error between the predicted grayscale value and the actual grayscale value; at the same time, the background grayscale value also needs to be adjusted , Grayscale Peak and variance , so that the Gaussian model can better describe the distribution of pixel grayscale values; when the Gaussian model is optimized to a certain extent, the precise location information of the key feature points can be obtained; this location information is given by the optimized predicted position, which is more accurate than the result of the preliminary positioning.

[0060] Furthermore, the Gaussian model is optimized by adjusting the model parameters, and the output position information includes: A residual function is established for characterizing the difference between the actual gray value of the pixel in the selected window and the gray value predicted by the Gaussian model. ,have , In the formula, Indicates the area within the selected window. Represents the actual grayscale value, where , , , are the model parameters of the Gaussian model to be optimized; An iterative algorithm is used to optimize the model parameters of the Gaussian model, residual values ​​are calculated according to the current model parameters, and the model parameters are updated; When the residual value reaches the residual threshold or the number of iterations reaches the iteration threshold, the coordinates of the pixel prediction position are output to obtain the position information.

[0061] For example, Figure 3 As shown in the figure, suppose that an image of a wood-plastic board product is being processed. The image has been preprocessed and key feature points have been extracted. Now, these feature points need to be located with high precision. First, the preliminary positions of these key feature points are found in the feature data set. Then, a window area is selected with these preliminary positions as the center, and the actual grayscale value of the pixel is calculated in this area. ; In order to find the optimal parameter value, a residual function is established , which characterizes the difference between the actual gray value of the pixel in the selected window and the gray value predicted by the Gaussian model; the goal is to find a set of parameter values ​​( , , , ), so that the residual function To achieve this goal, an iterative algorithm is used to optimize these parameters. In each iteration, the residual function is calculated based on the current parameter values. The value of , and update the parameter value according to optimization strategies such as gradient descent. When the value of reaches the preset residual threshold, or the number of iterations reaches the preset iteration threshold, the optimization process is considered to be completed. At this time, the coordinates of the pixel prediction position can be output , this coordinate is the precise location information of the required key feature points; in this way, the key feature points in the feature data set can be located with high precision, thereby providing accurate spatial positioning information for subsequent sorting operations; this method not only improves the accuracy and efficiency of sorting, but also makes the entire sorting process more automated and intelligent.

[0062] Furthermore, the combination of the color feature and the shape feature to classify and identify the wood-plastic board product and determine the category attribute includes: Constructing a color feature database and a shape feature database to store various categories of standard color features and standard shape features; Exemplarily, a color feature database and a shape feature database are constructed, which respectively store standard color features and standard shape features of various categories of wood-plastic board products; these standard features are obtained by collecting and analyzing a large amount of sample data, and represent the typical features of various types of wood-plastic board products.

[0063] Calculating the color similarity between the color feature and the standard color feature, and calculating the shape similarity between the shape feature and the standard shape feature; Exemplarily, color features are converted into color feature vectors, and color similarity is determined by calculating the Euclidean distance, cosine similarity or other suitable measurement methods between color feature vectors. The higher the color similarity, the better the match between the color in the real-time image and the standard color of a certain category; shape features are converted into shape feature vectors, and shape similarity is determined by comparing the similarity of shape feature vectors, the matching degree of contours or the matching degree of other shape descriptors. The higher the shape similarity, the better the match between the shape in the real-time image and the standard shape of a certain category.

[0064] The category attribute of the wood-plastic board product is determined according to the color similarity and the shape similarity.

[0065] Specifically, the category attributes of the wood-plastic board products are determined based on the comprehensive results of color similarity and shape similarity; this is usually achieved by setting a threshold or using methods such as weighted average; if the color similarity and shape similarity of a category both exceed the set threshold, or its comprehensive score is the highest, then the product will be classified into that category.

[0066] For example, it is assumed that three categories of wood-plastic board products are stored: Class A, Class B and Class C; when a real-time image is collected, the color features and shape features of the image are extracted after processing; then these features are compared with the standard features of Class A, Class B and Class C in the database; if the comparison result shows that the color features of the image have the highest color similarity with the standard color features of Class A, and the shape features have a high shape similarity with the standard shape features of Class A (both exceed the set threshold), then the product will be classified as Class A; in this way, the detailed classification and accurate identification of wood-plastic board products can be achieved, providing accurate spatial positioning and category information for subsequent sorting operations.

[0067] Furthermore, the sorting of the wood-plastic board products to a preset location based on the category attributes and the physical coordinates includes: Determine the location of the classification area according to the category attributes; Exemplarily, the location of the classification area to which the product should be sorted is determined based on the category attributes of the product; these classification areas are usually pre-set, and each area corresponds to one or more categories; for example, Class A wood-plastic board products should be sorted to Class A area, Class B wood-plastic board products should be sorted to Class B area, and so on.

[0068] According to the physical coordinates and the position of the classification area, a sorting path is planned to ensure that the robot arm can sort the wood-plastic board products to the position of the classification area.

[0069] For example, the sorting path is planned based on the physical coordinates of the product and the location of the classification area; this process usually involves a path optimization algorithm to ensure that the robot arm can complete the sorting task in the shortest time, with the least energy consumption and the highest accuracy; when planning the path, multiple factors are considered, such as the robot arm's range of motion, speed, acceleration limits, and obstacles on the production line.

[0070] For example, assuming that a Class A wood-plastic board product is being processed, the physical coordinates of the current position are obtained through processing; first, the position of the Class A area is determined, and then the optimal path from the current position to the Class A area is calculated; this path may avoid other products, equipment or obstacles on the production line to ensure that the robotic arm can reach the target position safely and accurately.

[0071] Furthermore, if Figure 4 As shown, the method also includes: Collect all kinds of data generated during the sorting process in real time to obtain the sorting results of each wood-plastic board product; Exemplarily, during the sorting process, the image information, color features, shape features, location information of key feature points, physical coordinates, category attributes and final sorted location of each wood-plastic board product are recorded in real time; these data are collected and stored for subsequent analysis and processing; for example, the sorting result of a certain wood-plastic board product shows that its color feature is red and its shape feature is rectangular, and it is sorted into the "red rectangular product area".

[0072] Periodically classify and count the sorting results and analyze the causes of various types of erroneous sorting; For example, the collected sorting results can be classified and counted every minute or hour, such as the sorting accuracy of red rectangular products, the number and type of incorrect sorting, etc.; by analyzing cases of incorrect sorting, some common problems can be found, such as color recognition errors, inaccurate shape matching, positioning deviation, etc.

[0073] Based on the analysis results, evaluate the rationality of the current system parameters, identify the system parameters that need to be optimized, and determine the optimization goals; For example, after analysis, if it is found that the positioning error is large, it may be because the parameter setting of the Gaussian model is unreasonable; at this time, the rationality of the current Gaussian model parameters can be evaluated and the optimization target can be determined, such as adjusting the variance of the Gaussian model. , background gray value , Grayscale Peak .

[0074] Adjusting system parameters according to the optimization target, and using the adjusted system parameters to perform sorting operations to obtain adjusted sorting results; For example, suppose the optimization goal is to adjust the variance of the Gaussian model , then the variance of the Gaussian model can be adjusted according to the analysis results , and perform sorting operations; the variance of the new Gaussian model In this case, the physical coordinates of the wood-plastic board products will be repositioned and sorted based on the new recognition results; in this way, the adjusted sorting results can be obtained.

[0075] Determining the sorting accuracy of the adjusted sorting result; For example, the adjusted sorting results need to be judged for accuracy to determine whether the optimization is effective; the sorting results before and after the adjustment can be compared, and indicators such as sorting accuracy and error sorting rate can be calculated to evaluate the optimization effect; if the sorting accuracy is significantly improved and the error sorting rate is reduced, then the optimization can be considered to be effective.

[0076] If the sorting accuracy is improved, the adjusted system parameters are retained; If the sorting accuracy decreases, continue to adjust the system parameters; For example, if after accuracy judgment, it is found that the adjusted sorting accuracy is indeed improved (for example, the sorting accuracy is improved from 90% to 95%), then the adjusted system parameters can be retained and used in future sorting operations; on the contrary, if the sorting accuracy is not improved or even reduced, then it is necessary to continue to adjust the system parameters and repeat the above steps until the optimal parameter settings are found.

[0077] The system parameters include the color threshold, the high threshold, the low threshold, model parameters of the Gaussian model, the standard color feature and the standard shape feature.

[0078] Specifically, the system parameters include the background gray value, gray peak, coordinates of the pixel prediction position, and variance of the Gaussian model; after converting the preprocessed image from the RGB color space to the HSV color space, it is necessary to perform color segmentation on the converted image according to the preset color threshold, so the color threshold is also a system parameter; when extracting the shape features of the wood-plastic board product from the color-segmented image, it is necessary to calculate the gradient amplitude and gradient direction of the image. This process may involve some parameters, such as the step size and direction of the gradient calculation, which can also be adjusted according to actual conditions, so these parameters are also system parameters; when refining the pixel points of the denoised image through non-maximum suppression, some parameters (such as high threshold, low threshold, etc.) are involved, which are also system parameters; standard color features and standard shape features will also affect the accuracy of sorting, so standard color features and standard shape features are also system parameters.

[0079] Based on the same inventive concept, Figure 5 As shown, the present invention also provides a wood-plastic board product color sorting system based on machine vision, the system comprising: Image acquisition module, used to collect real-time image information of wood-plastic board products; An image processing module, used for preprocessing the image information; A feature extraction module is used to extract the color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set; A positioning module, used to perform high-precision positioning of key feature points in the feature data set and output position information; A coordinate conversion module, used to convert the position information into physical coordinates in an actual working environment; A classification and recognition module, used to classify and recognize the wood-plastic board products by combining the color features and the shape features, and determine the category attributes; A sorting control module, used for sorting the wood-plastic board products to a preset position based on the category attributes and the physical coordinates; The sorting optimization module is used to collect various types of data generated during the sorting process for analysis, optimize system parameters according to the analysis results, and verify them; the sorting optimization module is also used to judge the sorting accuracy of the adjusted sorting results; if the sorting accuracy is improved, the adjusted system parameters are retained; if the sorting accuracy is reduced, the system parameters continue to be adjusted.

[0080] It should be noted that the electrical connection between the above-mentioned units does not necessarily mean the connection between the lines. The indirect connection method can be applied to the embodiments of the present invention as long as the purpose of the present invention is achieved. The above is only an exemplary embodiment of the present invention and cannot be used to limit the scope of the present invention.

[0081] That is, any equivalent changes and modifications made according to the teachings of the present invention are still within the scope of the present invention. After considering the disclosure of the specification and practice, those skilled in the art will easily think of other embodiments of the present invention. This application is intended to cover any variation, use or adaptation of the present invention, which follows the general principles of the present invention and includes common knowledge or customary technical means in the art that are not described in the present invention.

Claims

1. A color sorting method for wood-plastic board products based on machine vision, characterized in that , the method comprises: Collect real-time image information of wood-plastic board products; Preprocessing the image information; Extract the color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set; Perform high-precision positioning of key feature points in the feature data set and output position information; Converting the position information into physical coordinates in an actual working environment; Combining the color feature with the shape feature, classifying and identifying the wood-plastic board product, and determining the category attribute; Based on the category attributes and the physical coordinates, the wood-plastic board products are sorted to a preset location.

2. The method for color sorting of wood-plastic board products based on machine vision according to claim 1, characterized in that: The method of extracting the color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set includes: Convert the preprocessed image information from the RGB color space to the HSV color space to extract color features; In the HSV color space, color segmentation is performed on the converted image information according to a preset color threshold; Extract the shape features of the wood-plastic board product from the image information after color segmentation; The color feature and the shape feature are integrated to obtain a feature data set.

3. The method for color sorting of wood-plastic board products based on machine vision according to claim 2, characterized in that: The converting the preprocessed image information from the RGB color space to the HSV color space and extracting the color features comprises: Acquire a red component value, a green component value, and a blue component value from the preprocessed image information; Normalizing the red component value, the green component value, and the blue component value; The hue value is calculated by using the normalized red component value, the green component value and the blue component value. ,have , In the formula, Represents the normalized red component value. Represents the green component value after normalization. Represents the normalized blue component value. represents the remainder operation, Indicates the minimum value operation; The saturation value is calculated by using the normalized red component value, the green component value and the blue component value. ,have , In the formula, Indicates the maximum value operation; The brightness value is calculated by using the normalized red component value, the green component value and the blue component value. ,have ; The hue value, the saturation, and the brightness are integrated into a color feature.

4. The method for color sorting of wood-plastic board products based on machine vision according to claim 2, characterized in that: The method of extracting the shape features of the wood-plastic board product from the image information after color segmentation includes: The image information after color segmentation is smoothed by a Gaussian filter, and the image information after noise reduction is output; According to the de-noised image information, the gradient amplitude and gradient direction of the pixel point are calculated. ,have , In the formula, The pixel point is The gradient component of the direction, The pixel point is The gradient component of the direction, is the square root function; For the gradient direction ,have , In the formula, is the inverse tangent function; According to the gradient amplitude and the gradient direction, the pixel points are refined by non-maximum suppression to obtain an edge image; By setting a high threshold and a low threshold, edge points of the edge image are screened to obtain strong edge points and weak edge points; Connecting and correcting the strong edge points and the weak edge points by contour tracking to obtain a complete edge image; Shape features are extracted according to the complete edge image to obtain shape features.

5. The method for color sorting of wood-plastic board products based on machine vision according to claim 4, characterized in that: The high-precision positioning of the key feature points in the feature data set and the output of the position information include: Perform preliminary positioning in the feature data set to find key feature points; According to the key feature points initially located, a Gaussian model for characterizing the grayscale value of pixels is constructed. For the Gaussian model, , In the formula, represents the coordinates of the actual position of the pixel corresponding to the key feature point, represents the predicted gray value of the key feature point, represents the background gray value of the key feature point, represents the grayscale peak value of the key feature point, represents the coordinates of the pixel prediction position corresponding to the key feature point, represents the variance of the Gaussian model; The Gaussian model is optimized by adjusting the model parameters and the position information is output.

6. The method for color sorting of wood-plastic board products based on machine vision according to claim 5, characterized in that: By adjusting the model parameters, the Gaussian model is optimized, and the output position information includes: A residual function is established for characterizing the difference between the actual gray value of the pixel in the selected window and the gray value predicted by the Gaussian model. ,have , In the formula, Indicates the area within the selected window. Represents the actual grayscale value, where , , , are the model parameters of the Gaussian model to be optimized; An iterative algorithm is used to optimize the model parameters of the Gaussian model, residual values ​​are calculated according to the current model parameters, and the model parameters are updated; When the residual value reaches the residual threshold or the number of iterations reaches the iteration threshold, the coordinates of the pixel prediction position are output to obtain the position information.

7. The method for color sorting of wood-plastic board products based on machine vision according to claim 6, characterized in that: Combining the color feature with the shape feature to classify and identify the wood plastic board product, and determining the category attributes includes: Constructing a color feature database and a shape feature database to store various categories of standard color features and standard shape features; Calculating the color similarity between the color feature and the standard color feature, and calculating the shape similarity between the shape feature and the standard shape feature; The category attribute of the wood-plastic board product is determined according to the color similarity and the shape similarity.

8. The method for color sorting of wood-plastic board products based on machine vision according to claim 1, characterized in that: The step of sorting the wood-plastic board products to a preset location based on the category attributes and the physical coordinates includes: Determine the location of the classification area according to the category attributes; According to the physical coordinates and the position of the classification area, a sorting path is planned to ensure that the robot arm can sort the wood-plastic board products to the position of the classification area.

9. The method for color sorting of wood-plastic board products based on machine vision according to claim 7, characterized in that: The method further comprises: Collect all kinds of data generated during the sorting process in real time to obtain the sorting results of each wood-plastic board product; Periodically classify and count the sorting results and analyze the causes of various types of erroneous sorting; Based on the analysis results, evaluate the rationality of the current system parameters, identify the system parameters that need to be optimized, and determine the optimization goals; Adjusting system parameters according to the optimization target, and using the adjusted system parameters to perform sorting operations to obtain adjusted sorting results; Determining the sorting accuracy of the adjusted sorting result; If the sorting accuracy is improved, the adjusted system parameters are retained; If the sorting accuracy decreases, continue to adjust the system parameters; The system parameters include the color threshold, the high threshold, the low threshold, model parameters of the Gaussian model, the standard color feature and the standard shape feature.

10. A wood-plastic board product color sorting system based on machine vision, applied to a wood-plastic board product color sorting method based on machine vision according to any one of claims 1 to 9, characterized in that: The system comprises: Image acquisition module, used to collect real-time image information of wood-plastic board products; An image processing module, used for preprocessing the image information; A feature extraction module is used to extract the color features and shape features of the wood-plastic board product from the preprocessed image information to form a feature data set; A positioning module, used to perform high-precision positioning of key feature points in the feature data set and output position information; A coordinate conversion module, used to convert the position information into physical coordinates in an actual working environment; A classification and recognition module, used to classify and recognize the wood-plastic board products by combining the color features and the shape features, and determine the category attributes; A sorting control module, used for sorting the wood-plastic board products to a preset position based on the category attributes and the physical coordinates; The sorting optimization module is used to collect various types of data generated during the sorting process for analysis, optimize system parameters according to the analysis results, and verify them; the sorting optimization module is also used to judge the sorting accuracy of the adjusted sorting results; if the sorting accuracy is improved, the adjusted system parameters are retained; if the sorting accuracy is reduced, the system parameters continue to be adjusted.

Citation Information

Cited By

  • Metal powder impurity analysis method and system based on machine vision

    CN120543532A