Household appliance appearance defect optimization product design method based on image discrimination
By calculating the gradient direction values and high-frequency texture features of home appliance appearance images, and combining spatial clustering algorithms and least squares methods, the accuracy and real-time problems of home appliance appearance defect identification in traditional methods are solved, and high-precision optimized design is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG OCEAN UNIVERSITY
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-17
AI Technical Summary
Traditional image-based methods for optimizing the appearance defects of home appliances have room for improvement in terms of accuracy and real-time performance, and are difficult to effectively identify and optimize complex appearance defects.
By calculating the gradient direction values of the appearance images of home appliances, a gradient direction distribution matrix is constructed. Pixel point enhancement weights and local analysis are used to extract high-frequency texture features. Surface reconstruction is then performed using spatial clustering algorithms and the least squares method to optimize the appearance design of home appliances.
It improves the ability to handle directional differences in surface texture of home appliances, accurately identifies small defect areas, improves the spatial positioning accuracy of defect areas and the precision of optimization design, and optimizes production efficiency and design quality.
Smart Images

Figure CN121883731A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of product design technology, and in particular to a method for optimizing product design based on image recognition of appearance defects in home appliances. Background Technology
[0002] Product design technology involves innovation and optimization in product appearance, function, and structure, focusing on improving market competitiveness and consumer experience through various design methods and technologies. This technology includes, but is not limited to, industrial design, appearance design, and user experience design. Its core aspects include optimizing appearance design, enhancing product functionality and usability, innovating material selection, and conducting feasibility analysis for design and manufacturing. Product design technology typically utilizes computer-aided design software, 3D modeling technology, and ergonomic analysis to develop differentiated and competitive products tailored to different market demands and consumer preferences.
[0003] Traditional image-based methods for optimizing the appearance of home appliances involve using image processing technology to detect and analyze the appearance of the products, identify surface defects, and then optimize them. These methods typically include image acquisition, image preprocessing, feature extraction, and defect identification, using computer vision technology to automatically identify and locate flaws or defective parts of the product's appearance. For these defects, traditional methods generally employ algorithms such as rule matching or template matching for defect analysis, and optimize the product's appearance through manual intervention or automated correction processes. While these methods can effectively improve production efficiency and reduce errors from manual inspection, there is still room for improvement in accuracy and real-time performance. Summary of the Invention
[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide a product design method for optimizing the appearance defects of home appliances based on image recognition, comprising the following steps: To achieve the above objectives, the present invention adopts the following technical solution: a product design optimization method for home appliance appearance defects based on image recognition, comprising the following steps: S1: Obtain the appearance image of the home appliance product to be optimized, calculate the gradient direction value of each pixel in the appearance image of the home appliance product, and construct a gradient direction distribution matrix based on the gradient direction value. S2: Divide the gradient direction distribution matrix into local analysis neighborhoods, calculate the direction consistency index within the local analysis neighborhoods, determine the pixel enhancement weights based on the direction consistency indexes, and generate an edge segmentation map of home appliance appearance defects based on the pixel enhancement weights. S3: Divide the edge segmentation map of the appliance appearance defect into an adaptive window, extract the high-frequency texture features within the window, calculate the local defect feature score based on the high-frequency texture features, and select the area with the local defect feature score higher than the preset defect significance judgment threshold as the appliance appearance design defect area. S4: Obtain the spatial depth coordinate data of the defective area of the home appliance appearance design, map it into a discrete spatial point cloud, apply a spatial clustering algorithm to divide the point cloud clusters, and output a set of defective point cloud clusters; S5: Extract the geometric centroid coordinates of the defect point cloud cluster set as the surface reconstruction control points, call the least squares method to fit and correct the local appearance surface of the home appliance based on the surface reconstruction control points, and output the home appliance appearance optimization design model.
[0005] As a further embodiment of the present invention, the gradient direction distribution matrix includes a pixel spatial location index, gradient direction angle values, and a gradient magnitude distribution layer; the appliance appearance defect edge segmentation map includes a defect edge binary mask, an edge strength confidence map, and a background noise filtering layer; the appliance appearance design defect region includes defect region bounding box coordinates, abnormal texture feature descriptors, and local defect severity labels; the defect point cloud cluster set includes an independent defect cluster index number, a set of three-dimensional point coordinates within the cluster, and cluster density distribution attributes; and the appliance appearance optimization design model includes a repaired surface mesh topology, optimized design parameterized data, and surface smoothness constraint parameters.
[0006] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Obtain the appearance image of the home appliance product to be optimized, perform color space conversion on the appearance image of the home appliance product, extract the brightness channel data, configure the Gaussian smoothing kernel to perform sliding window convolution filtering on the brightness channel data, remove high-frequency noise signals in the image, traverse the filtered image plane to extract the pixel gray intensity value of each coordinate point, and generate a gray feature map of the home appliance appearance. S102: Call the discrete difference operator to perform spatial convolution operation on the grayscale feature map of the home appliance appearance, quantize the grayscale change amplitude of each pixel on the horizontal and vertical coordinate axes respectively, perform vector angle calculation based on the grayscale change amplitude on the horizontal and vertical coordinate axes, determine the deflection direction angle of the gradient vector, and obtain the set of pixel gradient direction values. S103: Analyze the planar position coordinates of all pixels in the pixel gradient direction numerical set, construct a two-dimensional numerical matrix that matches the resolution of the original image based on the planar position coordinates, map the deflection direction angle value of each pixel to the corresponding row and column units of the two-dimensional numerical matrix, perform zero-value filling processing on the blank areas at the edges of the matrix, and establish a gradient direction distribution matrix.
[0007] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Construct a two-dimensional local analysis window with each pixel as the geometric center for the gradient direction distribution matrix. Traverse the matrix to extract all gradient direction angle values within the window coverage area. Map the angle values to the unit circle plane and convert them into unit direction vectors. Perform vector synthesis and superposition operation on all unit direction vectors within the window. Calculate the magnitude of the synthesized total vector and divide it by the total number of pixels within the window to obtain the normalized consistency coefficient value. Fill the consistency coefficient value into the matrix coordinates corresponding to the original image size to generate a local direction consistency measurement matrix. S202: Based on the preset exponential nonlinear gain curve model, perform numerical mapping transformation on each consistency metric value in the local direction consistency metric matrix, map the values representing high consistency to the high gain interval, amplify the signal weight of regular edges, and attenuate and suppress the low consistency values representing chaotic directions, construct a weight distribution plane with the same resolution as the original image, and fill the transformed weight coefficients into the corresponding coordinate positions to establish a pixel enhancement weight map. S203: Call the grayscale feature map of the home appliance appearance and use the Sobel operator to calculate the gradient magnitude distribution data of the entire image. Perform a pixel-by-pixel Hadamard product operation on the pixel enhancement weight map and the gradient magnitude distribution data to perform weighted modulation on the edge intensity. For the modulated enhanced edge magnitude data, set an adaptive binarization segmentation threshold, filter pixels with response values higher than the adaptive binarization segmentation threshold and mark them as foreground targets, and perform masking and zeroing processing on the background area with a response value lower than the adaptive binarization segmentation threshold to generate a home appliance appearance defect edge segmentation map.
[0008] As a further aspect of the present invention, the process of setting the adaptive binarization segmentation threshold specifically involves: statistically analyzing the numerical distribution of all pixels in the modulated enhanced edge amplitude data; constructing a grayscale histogram; traversing all grayscale levels in the histogram as candidate segmentation points; calculating the inter-class variance values of the foreground pixel set and the background pixel set divided based on the candidate segmentation points; selecting the grayscale level value corresponding to the maximum inter-class variance value; and determining it as the adaptive binarization segmentation threshold.
[0009] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: For the edge segmentation map of the appearance defect of the home appliance, perform quadtree recursive decomposition, divide the image plane into rectangular detection windows of various scales according to the local edge pixel density of the image, perform discrete wavelet transform processing on the pixel matrix in each rectangular detection window, separate and extract the high-frequency detail coefficients in the horizontal, vertical and diagonal directions, and construct a high-frequency feature set of window texture. S302: For the high-frequency feature set of the window texture, calculate the energy entropy value and standard deviation of the high-frequency coefficient in each direction, count the edge pixel ratio density in the corresponding window, perform linear weighted calculation based on the energy entropy value, standard deviation and edge pixel ratio density, quantify the texture heterogeneity in each window, and generate a local defect feature scoring table. S303: Traverse each score value in the local defect feature scoring table, compare the score value with the preset defect significance judgment threshold, filter the score item index with the value greater than the defect significance judgment threshold, locate and crop the corresponding rectangular image block in the original image space according to the index coordinates, and obtain the home appliance appearance design defect area.
[0010] As a further aspect of the present invention, the process of setting the defect significance threshold specifically involves: acquiring a set of standard sample images of home appliances that have been manually confirmed to have no appearance defects; performing feature extraction and scoring calculation on the standard sample images; constructing a benchmark feature scoring dataset; calculating the expected value and variance of all scoring values in the benchmark feature scoring dataset; calculating the sum of the expected value and the preset multiple standard deviation; and using the sum as the defect significance threshold.
[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Call the depth sensing device to synchronously collect the depth information map of the surface of the home appliance, extract the corresponding local depth value matrix according to the boundary coordinate index of the defective area of the home appliance appearance design, perform back projection transformation in combination with the camera internal parameter model, reconstruct the two-dimensional pixel coordinates into geometric points in the three-dimensional Cartesian space coordinate system, remove invalid data points with missing or overflowing depth, and establish a discrete spatial point cloud. S402: Construct a KD-Tree spatial index structure for the discrete spatial point cloud, calculate the Euclidean distance between any two points and generate a distance adjacency matrix, set a spatial neighborhood radius threshold and a minimum number of contained points threshold, traverse all point cloud data to count the number of neighboring points within the neighborhood radius, filter points whose number of neighboring points meets the minimum number of contained points threshold, and generate a high-density core point index table. S403: Traverse the high-density core point index table to select unprocessed core points as seed points. Perform breadth-first search and cluster expansion in the point cloud space according to the density reachability principle. Merge all points that are directly reachable or connected by density paths into the same cluster identifier. At the same time, remove and filter isolated outliers that cannot be classified into any cluster, and output a defective point cloud cluster set.
[0012] As a further aspect of the present invention, the process of setting the spatial neighborhood radius threshold is specifically as follows: calculate the Euclidean distance between each data point in the discrete spatial point cloud and its k-nearest neighbor, arrange all distance values in ascending order to construct a distance change curve, and identify the distance value corresponding to the position where the slope of the curve changes the most abruptly as the spatial neighborhood radius threshold. The process of setting the minimum number of included points threshold is as follows: the average point spacing of the statistical point cloud data is combined with the minimum physical size limit of the defect to be detected, and the minimum number of sample points that can represent the effective cluster structure in a unit spherical space is calculated as the minimum number of included points threshold.
[0013] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: For the set of defect point cloud clusters, calculate the arithmetic mean of the three-dimensional coordinates of each point cloud cluster, obtain the geometric centroid, traverse the edge region within the cluster to calculate the rate of change of the normal vector, extract high curvature feature points, and fuse the geometric centroid and high curvature feature points in spatial position to construct surface reconstruction control points that cover the geometric topology and position information of the defect region. S502: Based on the reconstructed control points of the surface, construct the parameterized basis function equations of the non-uniform rational B-spline surface, set the grid node density for surface fitting, call the least squares method to construct the error energy function to calculate the minimum normal distance from the control point to the fitted surface, determine the weight vector of the control vertex by iteratively solving the linear equation system, and obtain the local optimized surface parameter set. S503: Call the local optimized surface parameter set to generate a smooth repair surface mesh, identify the shear boundary loop of the corresponding defect area in the original digital model of the home appliance product, perform vertex snapping and topological stitching on the repair surface mesh and the shear boundary loop, perform G1 continuity smoothing on the stitched joint to eliminate geometric abrupt changes, and establish a home appliance appearance optimization design model.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by calculating the gradient direction value of each pixel and constructing a gradient direction distribution matrix, the ability to process the directional differences of surface texture of home appliances is effectively improved. By enhancing pixel weights and local analysis, small defect areas are accurately identified, and high-frequency texture features are extracted on this basis, which solves the shortcomings of traditional methods in the identification of complex appearance defects. By applying a spatial clustering algorithm based on density noise to accurately divide the defect point cloud, the spatial positioning accuracy of defect areas is improved, ensuring the precision of optimized design. Combined with the least squares method for surface reconstruction, the appearance design of home appliances is accurately corrected, optimizing production efficiency and design quality. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0019] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent.
[0020] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0021] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0022] Please see Figure 1This invention provides a method for optimizing the design of home appliances based on image recognition of appearance defects, comprising the following steps: S1: Obtain the appearance image of the home appliance product to be optimized, calculate the gradient direction value of each pixel in the appearance image of the home appliance product, and construct the gradient direction distribution matrix based on the gradient direction value. S2: Divide the local analysis neighborhood based on the gradient direction distribution matrix, calculate the direction consistency index of the pixels in the local analysis neighborhood, determine the pixel enhancement weight based on the direction consistency index, and generate the edge segmentation map of the appliance appearance defect based on the pixel enhancement weight. S3: Perform adaptive window division on the edge segmentation map of appliance appearance defects, extract the high-frequency texture features in each window, calculate the local defect feature score based on the high-frequency texture features, and select the area with the local defect feature score higher than the preset defect significance judgment threshold as the appliance appearance design defect area. S4: Obtain the spatial depth coordinate data of the defective area of the home appliance appearance design and map it into a discrete spatial point cloud. Input the discrete spatial point cloud into a density-based noise application spatial clustering algorithm to perform point cloud cluster division and output a defective point cloud cluster set. S5: Extract the geometric centroid coordinates of the defect point cloud cluster set as the surface reconstruction control points, call the least squares method to fit and correct the local appearance surface of the home appliance based on the surface reconstruction control points, and output the home appliance appearance optimization design model.
[0023] The gradient direction distribution matrix includes pixel spatial location index, gradient direction angle value, and gradient magnitude distribution layer. The defect edge segmentation map of home appliance appearance includes defect edge binary mask, edge intensity confidence map, and background noise filtering layer. The defect region of home appliance appearance design includes defect region bounding box coordinates, abnormal texture feature descriptor, and local defect severity label. The defect point cloud cluster set includes independent defect cluster index number, three-dimensional point coordinate set within the cluster, and cluster density distribution attribute. The home appliance appearance optimization design model includes repaired surface mesh topology, optimized design parameterized data, and surface smoothness constraint parameters.
[0024] Please see Figure 2 The specific steps of S1 are as follows: S101: Obtain the appearance image of the home appliance product to be optimized, perform color space conversion on the appearance image of the home appliance product, extract the brightness channel data, configure the Gaussian smoothing kernel to perform sliding window convolution filtering on the brightness channel data, remove high-frequency noise signals in the image, traverse the filtered image plane to extract the pixel gray intensity value of each coordinate point, and generate a gray feature map of the home appliance appearance. For refrigerator door panels or washing machine outer casings placed in a constant LED diffuse light source environment, a resolution of [resolution value missing] is configured. An industrial area array camera is used to vertically capture images of the target surface, obtaining raw three-channel color digital images as the exterior images of home appliances. Data processing for these images first involves dimensionality reduction of the color dimension. A weighted average method is used to linearly combine the values of the red (R), green (G), and blue (B) color channels according to the International Commission on Illumination (CIE) standard proportionality coefficients for different color sensitivities of the human eye. The formula is as follows: The three-dimensional color space is compressed into a single-dimensional luminance signal, extracting luminance channel data that contains only brightness and darkness information. Subsequently, to eliminate high-frequency random noise generated during image acquisition due to thermal noise of the photosensitive element or minor fluctuations in ambient light, a system is constructed... The standard deviation of the two-dimensional Gaussian smoothing kernel matrix composed of numerical values. Set as Its normalized center position value is The value decreases normally with increasing Euclidean distance from the center. This Gaussian smoothing kernel matrix is applied to the pixel plane of the luminance channel data in a left-to-right, top-to-bottom order with a step size of... The pixel sliding operation multiplies and accumulates the values in the kernel matrix with the corresponding pixel brightness values at each sliding position. The accumulated result is used as the new brightness value of the center pixel, completing the convolutional filtering process for the entire image. Finally, the filtered image plane is traversed again, and the smoothed pixel intensity values at each coordinate point are read row by row and column by column. These values are then organized into a single-channel two-dimensional array to generate a grayscale feature map of the appliance's appearance.
[0025] S102: Call the discrete difference operator to perform spatial convolution operation on the grayscale feature map of the home appliance appearance, quantize the grayscale change amplitude of each pixel on the horizontal and vertical coordinate axes respectively, perform vector angle calculation based on the grayscale change amplitude on the horizontal and vertical coordinate axes, determine the deflection direction angle of the gradient vector, and obtain the set of pixel gradient direction values. Call the template containing horizontal direction detection Vertical detection template The Sobel discrete difference operator. The horizontal detection template is set as follows: matrix structure The vertical detection template is set to For each pixel position in the grayscale feature map of home appliance appearance. Spatial convolution operations are performed using horizontal and vertical detection templates respectively. The grayscale values of pixels within the template coverage area are multiplied by the template coefficients and summed to obtain the grayscale change amplitude of the pixel on the horizontal coordinate axis. And the grayscale variation value on the vertical coordinate axis Then, based on the principles of trigonometric functions, the deflection angle of the gradient vector is calculated. The calculation process uses the atan2 function in the programming implementation to handle... Special cases, and map the results to The radian range is used to collect the angle values calculated for all pixels in the entire image, resulting in a set of pixel gradient direction values.
[0026] S103: Analyze the planar position coordinates of all pixels in the pixel gradient direction numerical set, construct a two-dimensional numerical matrix that matches the resolution of the original image based on the planar position coordinates, map the deflection direction angle value of each pixel to the corresponding row and column units of the two-dimensional numerical matrix, perform zero-value filling processing on the blank areas at the edge of the matrix, and establish the gradient direction distribution matrix. Analyze each data unit and read its corresponding original image row index coordinates. with column index coordinates Based on the width of the original image Pixels and height Each pixel constructs a two-dimensional floating-point numerical matrix container with the same row and column dimensions. Iterates through the deflection angle value of each pixel in the numerical set and precisely fills it into the row and column cells of the two-dimensional numerical matrix that correspond one-to-one with the spatial location of that pixel. For the outermost edge of the image... Convolution operations cannot compute gradients in edge pixel regions (i.e., the first pixel region). line, number line, number Column, No. The gradient direction distribution matrix is constructed by copying and filling the nearest neighbor with the gradient direction values of the adjacent inner circle pixels to ensure the spatial continuity and integrity of the matrix data, and finally constructing a gradient direction distribution matrix that can fully characterize the distribution law of the micro-texture on the product surface.
[0027] Please see Figure 3 The specific steps of S2 are as follows: S201: Construct a two-dimensional local analysis window with each pixel as the geometric center for the gradient direction distribution matrix. Traverse the matrix to extract all gradient direction angle values within the window coverage area. Map the angle values to the unit circle plane and convert them into unit direction vectors. Perform vector synthesis and superposition operations on all unit direction vectors within the window. Calculate the magnitude of the synthesized total vector and divide it by the total number of pixels within the window to obtain the normalized consistency coefficient value. Fill the consistency coefficient value into the matrix coordinates corresponding to the original image size to generate a local direction consistency measurement matrix. For each pixel except the edge padding area A square local analysis window is constructed centered on the pixel, covering its surrounding neighborhood. The window size is set to [size missing]. Pixels (i.e., the area contained within a window) (pixels). Traverse and read all pixels within the area covered by the window. Gradient direction angle value of each pixel (in Using Euler's formula, each scalar angle value is mapped onto the unit circle plane, transforming it into a two-dimensional unit direction vector with a unit magnitude and a specific direction. Perform a vector composition and superposition operation on all unit direction vectors within the window in the vector space, connecting them end-to-end, to obtain the composite vector. Calculate the actual magnitude of the composite vector. and divide it by the total number of pixels in the window. Normalization is performed, and the formula is: This value Between and Between, when Approaching The texture direction is highly consistent when the time is represented. Approaching The time signature represents texture disorder. The calculated normalized values are backfilled into the matrix positions corresponding to the original image spatial coordinates. After completing the full image scan, a local orientation consistency measure matrix is generated.
[0028] S202: Based on the preset exponential nonlinear gain curve model, perform numerical mapping transformation on each consistency metric value in the local directional consistency metric matrix, map the values representing high consistency to the high gain interval, amplify the signal weight of regular edges, and attenuate and suppress the low consistency values representing chaotic directions, construct a weight distribution plane with the same resolution as the original image, and fill the transformed weight coefficients into the corresponding coordinate positions to establish a pixel enhancement weight map. A pre-defined exponential nonlinear gain curve defines a nonlinear numerical transformation rule to enhance defect edge signals. The input variable is defined as the consistency metric value in the local direction consistency metric matrix. The inflection point benchmark value is set as The gain coefficient is set to The model function is defined as follows: (A variant of the Sigmoid function). When the input consistency metric... At that time, the weight coefficients output by the model Rapidly rising to near This amplifies the signal weights at regular structural edges; when At that time, the weighting coefficients decayed rapidly and approached [the value]. This suppresses cluttered background textures. A weight distribution plane with the same resolution as the original image is constructed, and the weight coefficients calculated through exponential transformation are filled into the corresponding coordinate positions of this plane one by one, forming a grayscale weight map whose brightness distribution can reflect the regularity of texture, thus establishing a pixel enhancement weight map.
[0029] S203: Call the grayscale feature map of the home appliance appearance and use the Sobel operator to calculate the gradient magnitude distribution data of the whole image. Perform a pixel-by-pixel Hadamard product operation on the pixel enhancement weight map and the gradient magnitude distribution data to perform weighted modulation on the edge intensity. For the modulated enhanced edge magnitude data, set an adaptive binarization segmentation threshold, filter pixels with response values higher than the adaptive binarization segmentation threshold and mark them as foreground targets, and perform masking and zeroing processing on the background area with a response value lower than the adaptive binarization segmentation threshold to generate a home appliance appearance defect edge segmentation map. The process of setting the adaptive binarization segmentation threshold is as follows: statistically analyze the numerical distribution of all pixels in the enhanced edge amplitude data after modulation, construct a gray-level histogram, traverse all gray levels in the histogram as candidate segmentation points, calculate the inter-class variance of the foreground pixel set and the background pixel set divided by the candidate segmentation points, and select the gray level value corresponding to the maximum inter-class variance value as the adaptive binarization segmentation threshold.
[0030] Calculate the horizontal gradient components using the Sobel operator. With vertical gradient components And calculate the gradient magnitude of each pixel in the entire image. This yields the gradient magnitude distribution data. Subsequently, each weight coefficient in the pixel enhancement weight map is... Gradient magnitude at the corresponding position in the gradient magnitude distribution data Perform pixel-by-pixel Hadamard product (i.e., dot product), the formula is: The modulated enhanced edge amplitude data is obtained. Based on this data, a grayscale histogram is constructed by statistically analyzing the amplitude distribution of all pixels in the entire image. The adaptive binarization segmentation threshold is determined using the Otsu's algorithm (maximum inter-class variance method): traversing the grayscale range covered by the histogram (…). to Each gray level within ) As candidate segmentation points, the inter-class variance between the foreground pixel set and the background pixel set is calculated. ,in Pixel percentage This is the average gray level. Select the option that allows... The gray level value corresponding to the maximum peak value As the optimal segmentation threshold, filter response values. The pixels are marked as foreground defect targets, and the remaining areas are marked as background and set to zero values to generate an edge segmentation map of appliance appearance defects.
[0031] Please see Figure 4 The specific steps of S3 are as follows: S301: For the edge segmentation map of the appearance defects of home appliances, perform quadtree recursive decomposition, divide the image plane into rectangular detection windows of various scales according to the local edge pixel density of the image, perform discrete wavelet transform processing on the pixel matrix in each rectangular detection window, separate and extract the high-frequency detail coefficients in the horizontal, vertical and diagonal directions, and construct a high-frequency feature set of window texture. Set the density benchmark value as (i.e., edge pixel ratio) The algorithm determines whether the edge pixel density within the entire image exceeds a baseline value. If it does, the image plane is divided into four equal quadrant sub-blocks. This density determination and division process is repeated for each sub-block until the edge pixel density within the sub-block falls below the baseline value or the sub-block size reaches a preset minimum stopping size (e.g., ...). The image is divided into rectangular detection windows of various scales by pixels. For the pixel matrix within each rectangular detection window, the Discrete Wavelet Transform (DWT) algorithm is applied, using Haar wavelets as the basis function, to perform a first-level decomposition of the window data, separating low-frequency approximation information (LL) and high-frequency detail coefficients in the horizontal (LH), vertical (HL), and diagonal (HH) directions. These high-frequency coefficient sets in these three directions are integrated to construct a high-frequency feature set for the window texture.
[0032] S302: For the high-frequency feature set of window texture, calculate the energy entropy value and standard deviation of the high-frequency coefficient in each direction, count the edge pixel proportion density in the corresponding window, perform linear weighted calculation based on the energy entropy value, standard deviation and edge pixel proportion density, quantify the texture heterogeneity in each window, and generate a local defect feature scoring table. For each subset of high-frequency coefficients in each direction, first calculate its energy entropy value. ,in The normalized coefficient probability distribution is calculated; the standard deviation of the coefficient subset is also calculated. In addition, the proportion of non-zero edge pixels within the corresponding rectangular detection window to the total number of pixels in the window is counted to obtain the edge pixel proportion density. The linear weighting coefficients are set as follows: According to the formula Calculate a score that comprehensively reflects the degree of texture anomalies within the window. Organize the score values of all windows in the entire image according to the spatial index of the windows to generate a local defect feature scoring table.
[0033] S303: Traverse each score value in the local defect feature scoring table, compare the score value with the preset defect significance judgment threshold, filter the score item index with the value greater than the defect significance judgment threshold, locate and crop the corresponding rectangular image block in the original image space according to the index coordinates, and obtain the home appliance appearance design defect area. The specific process for setting the defect significance threshold is as follows: a set of standard sample images of home appliances that have been manually confirmed to have no appearance defects are obtained; feature extraction and scoring calculation are performed on the standard sample images; a benchmark feature scoring dataset is constructed; the expected value and variance of all scoring values in the benchmark feature scoring dataset are calculated; the sum of the expected value and the preset multiple standard deviation is calculated; and the sum is used as the defect significance threshold.
[0034] Pre-obtain a set (e.g.) (Zhang) Standard sample images of the same model of home appliance, which have undergone rigorous manual quality inspection and confirmed to be free of appearance defects, are used to construct a benchmark feature score dataset by performing the exact same feature extraction and scoring calculation process on these standard sample images. The arithmetic mean of all score values in this dataset is then calculated. As the expected value, and calculate the standard deviation. .in accordance with Criteria, Calculation of Thresholds In actual testing, values greater than [a certain threshold] were selected. The scoring items are read, and their corresponding rectangular window index coordinates are read. The corresponding rectangular image blocks are located and cropped in the original image space to obtain the defective areas of the home appliance appearance design.
[0035] Please see Figure 5 The specific steps of S4 are as follows: S401: Call the depth sensing device to synchronously collect the depth information map of the surface of the home appliance, extract the corresponding local depth value matrix based on the boundary coordinate index of the defective area of the home appliance appearance design, perform back projection transformation in combination with the internal parameter model of the camera, reconstruct the two-dimensional pixel coordinates into geometric points in the three-dimensional Cartesian space coordinate system, remove invalid data points with missing or overflowing depth, and establish a discrete spatial point cloud. Each pixel value of the depth map This represents the physical distance (in millimeters) from a point on the object's surface to the camera's optical center. The corresponding local depth matrix is then extracted from the depth information map. This is combined with the intrinsic parameter matrix obtained during camera calibration (including focal length). Coordinates of the principal point of the optical center Using the inverse projection formula of the pinhole camera model: , , The coordinates of each pixel in the local depth numerical matrix Its depth value is converted into a geometric point in a three-dimensional Cartesian coordinate system. During the conversion process, for depth values... Or beyond the effective measurement range (e.g.) Invalid data points (mm) are removed, and only valid spatial coordinate points are retained to establish a discrete spatial point cloud.
[0036] S402: Construct a KD-Tree spatial index structure for discrete spatial point clouds, calculate the Euclidean distance between any two points and generate a distance adjacency matrix, set a spatial neighborhood radius threshold and a minimum number of contained points threshold, traverse all point cloud data to count the number of neighboring points within the neighborhood radius, filter points whose number of neighboring points meets the minimum number of contained points threshold, and generate a high-density core point index table. The process of setting the spatial neighborhood radius threshold is as follows: calculate the Euclidean distance between each data point in the discrete spatial point cloud and its k-nearest neighbor, arrange all distance values in ascending order to construct a distance change curve, and identify the distance value corresponding to the position where the slope of the curve changes the most abruptly as the spatial neighborhood radius threshold. The specific process for setting the minimum number of contained points threshold is as follows: statistically analyze the average point spacing of the point cloud data, combine it with the minimum physical size limit of the defect to be detected, and calculate the minimum number of sample points that can characterize the effective cluster structure in a unit sphere space as the minimum number of contained points threshold. Set spatial neighborhood radius threshold With minimum number of points threshold . The method for determining is: calculate the relationship between each data point in the point cloud and its i-th... The Euclidean distance (k-dist, taking) between the k nearest neighbors is given by the distance between the k nearest neighbors. Arrange all calculated distance values in ascending order and plot the distance change curve. Identify the distance values corresponding to the "elbow" positions where the slope of the curve changes sharply (e.g., mm) as . The basis for determination is: the average point spacing of the statistical point cloud data. (For example mm), combined with the minimum physical feature size limit of the defect to be detected (e.g., diameter). (mm depression), calculated in The minimum number of sample points that should theoretically be contained within a sphere of radius is given by the formula: ,like ,but Iterate through all point cloud data and use a KD-Tree to query the radius of each point. The number of neighboring points within the range, filtered to show the number of neighboring points. The points are used to generate a high-density core point index table.
[0037] S403: Traverse the high-density core point index table to select unprocessed core points as seed points. Perform breadth-first search and cluster expansion in the point cloud space according to the density reachability principle. Merge all points that are directly reachable or connected by density paths into the same cluster identifier. At the same time, remove and filter isolated outliers that cannot be classified into any cluster, and output a defective point cloud cluster set. Perform a density-based clustering algorithm (DBSCAN logic) in the point cloud space to retrieve the seed point. All core points and boundary points within the neighborhood. If a point in the neighborhood is also a core point, continue searching its neighborhood outwards from that point until no new points satisfy the density reachability condition. All points connected via density reachability or density-connected paths are merged under the current cluster identifier, completing the division of one cluster. Then, the next unprocessed core point is selected, and the above process is repeated until all core points are processed. For points that are neither core points nor accessible by any core point via density-connected paths, they are identified as isolated outliers and filtered out of the dataset, ultimately outputting a set of defective point cloud clusters containing several independent point cloud clusters.
[0038] Please see Figure 6 The specific steps of S5 are as follows: S501: For the defect point cloud cluster set, calculate the arithmetic mean of the three-dimensional coordinates of each point cloud cluster, obtain the geometric centroid, traverse the edge region within the cluster to calculate the rate of change of the normal vector, extract high curvature feature points, and fuse the geometric centroid and high curvature feature points in spatial position to construct surface reconstruction control points that cover the geometric topology and position information of the defect region. Accumulate all points within the cluster The geometric centroid coordinates of the cluster are calculated by dividing the coordinate values by the total number of points within the cluster. Then, the points in the cluster edge region are traversed, and the covariance matrix in the neighborhood of each point is calculated using principal component analysis (PCA). The matrix is decomposed to obtain three eigenvalues. Calculate the estimated surface curvature. Filter out values with curvature estimates exceeding a preset curvature threshold (e.g., ...). Points selected from the high-curvature feature points are used as high-curvature feature points, typically located at the ridges or valleys of the defect. The calculated geometric centroid coordinates are combined with the selected high-curvature feature point coordinates to construct a set of surface reconstruction control points that can sparsely but critically characterize the geometric topology and spatial location information of the defect region.
[0039] S502: Based on the surface reconstruction control points, construct the parameterized basis function equations of the non-uniform rational B-spline surface, set the grid node density for surface fitting, call the least squares method to construct the error energy function to calculate the minimum normal distance from the control point to the fitted surface, determine the weight vector of the control vertex by iteratively solving the linear equation system, and obtain the local optimized surface parameter set. Construct the parameterized basis function equations for a non-uniform rational B-spline (NURBS) surface. Assume the surface is in... direction and The order of the directions is (Cubic B-spline), and set the mesh node density for surface fitting based on the number and distribution density of control points (e.g., (Grid). The least squares method is used to construct the error energy function. ,in To fit points on the surface, Let be the control points. By differentiating the error energy function and setting it to zero, a system of linear equations about the control vertex weight vectors is established. The system of linear equations is solved iteratively using the singular value decomposition (SVD) method to determine the control vertex positions and weight vectors that minimize the fitting error, thus obtaining the local optimized surface parameter set describing the geometry of the local smooth surface.
[0040] S503: Call the local optimization surface parameter set to generate a smooth repair surface mesh, identify the shear boundary loop of the corresponding defect area in the original digital model of the home appliance product, perform vertex snapping and topological stitching on the repair surface mesh and the shear boundary loop, perform G1 continuity smoothing on the stitching joint to eliminate geometric abrupt changes, and establish a home appliance appearance optimization design model. In the original computer-aided design digital model of the home appliance, the surface region corresponding to the defective area in the appliance's appearance design was identified, and a shear boundary ring was defined around this region. The generated repair surface mesh was moved and aligned to the position of the shear boundary ring, and a vertex snapping operation was performed to forcibly correct the vertex coordinates of the repair surface edge to the corresponding vertex coordinates on the shear boundary ring. Subsequently, G1 continuity smoothing was performed on the seam, and the normal vectors of the tangent planes on both sides of the seam were adjusted to keep their directions consistent at the connection point (i.e., the dot product of the normal vectors is close to the joint). This eliminates abrupt changes in geometric shape and achieves a smooth visual transition, thus establishing the final optimized design model for the appearance of home appliances.
[0041] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the described technical solutions.
Claims
1. A method for optimizing product design based on image recognition of appearance defects in home appliances, characterized in that, Includes the following steps: S1: Obtain the appearance image of the home appliance product to be optimized, calculate the gradient direction value of each pixel in the appearance image of the home appliance product, and construct a gradient direction distribution matrix based on the gradient direction value. S2: Divide the gradient direction distribution matrix into local analysis neighborhoods, calculate the direction consistency index within the local analysis neighborhoods, determine the pixel enhancement weights based on the direction consistency indexes, and generate an edge segmentation map of home appliance appearance defects based on the pixel enhancement weights. S3: Divide the edge segmentation map of the appliance appearance defect into an adaptive window, extract the high-frequency texture features within the window, calculate the local defect feature score based on the high-frequency texture features, and select the area with the local defect feature score higher than the preset defect significance judgment threshold as the appliance appearance design defect area. S4: Obtain the spatial depth coordinate data of the defective area of the home appliance appearance design, map it into a discrete spatial point cloud, apply a spatial clustering algorithm to divide the point cloud clusters, and output a set of defective point cloud clusters; S5: Extract the geometric centroid coordinates of the defect point cloud cluster set as the surface reconstruction control points, call the least squares method to fit and correct the local appearance surface of the home appliance based on the surface reconstruction control points, and output the home appliance appearance optimization design model.
2. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, characterized in that, The gradient direction distribution matrix includes pixel spatial location index, gradient direction angle value, and gradient magnitude distribution layer. The appliance appearance defect edge segmentation map includes defect edge binary mask, edge intensity confidence map, and background noise filtering layer. The appliance appearance design defect region includes defect region bounding box coordinates, abnormal texture feature descriptor, and local defect severity label. The defect point cloud cluster set includes independent defect cluster index number, cluster intra-cluster 3D point coordinate set, and cluster density distribution attribute. The appliance appearance optimization design model includes repaired surface mesh topology, optimized design parameterized data, and surface smoothness constraint parameters.
3. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain the appearance image of the home appliance product to be optimized, perform color space conversion on the appearance image of the home appliance product, extract the brightness channel data, configure the Gaussian smoothing kernel to perform sliding window convolution filtering on the brightness channel data, remove high-frequency noise signals in the image, traverse the filtered image plane to extract the pixel gray intensity value of each coordinate point, and generate a gray feature map of the home appliance appearance. S102: Call the discrete difference operator to perform spatial convolution operation on the grayscale feature map of the home appliance appearance, quantize the grayscale change amplitude of each pixel on the horizontal and vertical coordinate axes respectively, perform vector angle calculation based on the grayscale change amplitude on the horizontal and vertical coordinate axes, determine the deflection direction angle of the gradient vector, and obtain the set of pixel gradient direction values. S103: Analyze the planar position coordinates of all pixels in the pixel gradient direction numerical set, construct a two-dimensional numerical matrix that matches the resolution of the original image based on the planar position coordinates, map the deflection direction angle value of each pixel to the corresponding row and column units of the two-dimensional numerical matrix, perform zero-value filling processing on the blank areas at the edges of the matrix, and establish a gradient direction distribution matrix.
4. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Construct a two-dimensional local analysis window with each pixel as the geometric center for the gradient direction distribution matrix. Traverse the matrix to extract all gradient direction angle values within the window coverage area. Map the angle values to the unit circle plane and convert them into unit direction vectors. Perform vector synthesis and superposition operation on all unit direction vectors within the window. Calculate the magnitude of the synthesized total vector and divide it by the total number of pixels within the window to obtain the normalized consistency coefficient value. Fill the consistency coefficient value into the matrix coordinates corresponding to the original image size to generate a local direction consistency measurement matrix. S202: Based on the preset exponential nonlinear gain curve model, perform numerical mapping transformation on each consistency metric value in the local direction consistency metric matrix, map the values representing high consistency to the high gain interval, amplify the signal weight of regular edges, and attenuate and suppress the low consistency values representing chaotic directions, construct a weight distribution plane with the same resolution as the original image, and fill the transformed weight coefficients into the corresponding coordinate positions to establish a pixel enhancement weight map. S203: Call the grayscale feature map of the home appliance appearance and use the Sobel operator to calculate the gradient magnitude distribution data of the entire image. Perform a pixel-by-pixel Hadamard product operation on the pixel enhancement weight map and the gradient magnitude distribution data to perform weighted modulation on the edge intensity. For the modulated enhanced edge magnitude data, set an adaptive binarization segmentation threshold, filter pixels with response values higher than the adaptive binarization segmentation threshold and mark them as foreground targets, and perform masking and zeroing processing on the background area with a response value lower than the adaptive binarization segmentation threshold to generate a home appliance appearance defect edge segmentation map.
5. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 4, characterized in that, The process of setting the adaptive binarization segmentation threshold is as follows: statistically analyze the numerical distribution of all pixels in the enhanced edge amplitude data after modulation, construct a gray-level histogram, traverse all gray levels in the histogram as candidate segmentation points, calculate the inter-class variance of the foreground pixel set and the background pixel set divided according to the candidate segmentation points, and select the gray level value corresponding to the maximum inter-class variance value, which is then determined as the adaptive binarization segmentation threshold.
6. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: For the edge segmentation map of the appearance defect of the home appliance, perform quadtree recursive decomposition, divide the image plane into rectangular detection windows of various scales according to the local edge pixel density of the image, perform discrete wavelet transform processing on the pixel matrix in each rectangular detection window, separate and extract the high-frequency detail coefficients in the horizontal, vertical and diagonal directions, and construct a high-frequency feature set of window texture. S302: For the high-frequency feature set of the window texture, calculate the energy entropy value and standard deviation of the high-frequency coefficient in each direction, count the edge pixel ratio density in the corresponding window, perform linear weighted calculation based on the energy entropy value, standard deviation and edge pixel ratio density, quantify the texture heterogeneity in each window, and generate a local defect feature scoring table. S303: Traverse each score value in the local defect feature scoring table, compare the score value with the preset defect significance judgment threshold, filter the score item index with the value greater than the defect significance judgment threshold, locate and crop the corresponding rectangular image block in the original image space according to the index coordinates, and obtain the home appliance appearance design defect area.
7. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 6, characterized in that, The specific process for setting the defect significance threshold is as follows: a set of standard sample images of home appliances that have been manually confirmed to have no appearance defects are obtained; feature extraction and scoring calculation are performed on the standard sample images; a benchmark feature scoring dataset is constructed; the expected value and variance of all scoring values in the benchmark feature scoring dataset are calculated; the sum of the expected value and the preset multiple standard deviation is calculated; and the sum is used as the defect significance threshold.
8. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, wherein the specific steps of S4 are as follows: S401: Call the depth sensing device to synchronously collect the depth information map of the surface of the home appliance, extract the corresponding local depth value matrix according to the boundary coordinate index of the defective area of the home appliance appearance design, perform back projection transformation in combination with the camera internal parameter model, reconstruct the two-dimensional pixel coordinates into geometric points in the three-dimensional Cartesian space coordinate system, remove invalid data points with missing or overflowing depth, and establish a discrete spatial point cloud. S402: Construct a KD-Tree spatial index structure for the discrete spatial point cloud, calculate the Euclidean distance between any two points and generate a distance adjacency matrix, set a spatial neighborhood radius threshold and a minimum number of contained points threshold, traverse all point cloud data to count the number of neighboring points within the neighborhood radius, filter points whose number of neighboring points meets the minimum number of contained points threshold, and generate a high-density core point index table. S403: Traverse the high-density core point index table to select unprocessed core points as seed points. Perform breadth-first search and cluster expansion in the point cloud space according to the density reachability principle. Merge all points that are directly reachable or connected by density paths into the same cluster identifier. At the same time, remove and filter isolated outliers that cannot be classified into any cluster, and output a defective point cloud cluster set.
9. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 8, characterized in that, The process of setting the spatial neighborhood radius threshold is as follows: calculate the Euclidean distance between each data point in the discrete spatial point cloud and its k-nearest neighbor, arrange all distance values in ascending order to construct a distance change curve, and identify the distance value corresponding to the position where the slope of the curve changes the most abruptly as the spatial neighborhood radius threshold. The process of setting the minimum number of included points threshold is as follows: the average point spacing of the statistical point cloud data is combined with the minimum physical size limit of the defect to be detected, and the minimum number of sample points that can represent the effective cluster structure in a unit spherical space is calculated as the minimum number of included points threshold.
10. The method for optimizing the design of home appliance appearance defects based on image recognition according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: For the set of defect point cloud clusters, calculate the arithmetic mean of the three-dimensional coordinates of each point cloud cluster, obtain the geometric centroid, traverse the edge region within the cluster to calculate the rate of change of the normal vector, extract high curvature feature points, and fuse the geometric centroid and high curvature feature points in spatial position to construct surface reconstruction control points that cover the geometric topology and position information of the defect region. S502: Based on the reconstructed control points of the surface, construct the parameterized basis function equations of the non-uniform rational B-spline surface, set the grid node density for surface fitting, call the least squares method to construct the error energy function to calculate the minimum normal distance from the control point to the fitted surface, determine the weight vector of the control vertex by iteratively solving the linear equation system, and obtain the local optimized surface parameter set. S503: Call the local optimized surface parameter set to generate a smooth repair surface mesh, identify the shear boundary loop of the corresponding defect area in the original digital model of the home appliance product, perform vertex snapping and topological stitching on the repair surface mesh and the shear boundary loop, perform G1 continuity smoothing on the stitched joint to eliminate geometric abrupt changes, and establish a home appliance appearance optimization design model.
Citation Information
Cited By
An image processing algorithm based on texture fusion analysis
CN122134812A
Image processing-based semiconductor precision part surface anomaly detection processing system
CN122156215A