Intelligent detection method and system for surface defects of foam material based on machine vision
By acquiring light intensity values at different polarization angles, calculating light intensity gradient sequences, generating enhanced images, segmenting and filling defect areas, calculating depth values, and combining quality scoring with application scenario matching, the problem of accuracy and resource waste in foam material surface defect detection is solved, achieving efficient intelligent detection and classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN SHANGSHANG INSULATION MATERIAL CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-29
AI Technical Summary
Existing methods for detecting surface defects in foam materials have limited ability to identify defects under uneven lighting conditions, making it difficult to accurately extract defect features and measure defect depth precisely. Furthermore, they lack intelligent allocation mechanisms, resulting in low detection accuracy and wasted resources.
By acquiring light intensity values at different polarization angles, calculating light intensity gradient sequences, generating enhanced images, segmenting defect regions, calculating defect depth values, performing adaptive filling reconstruction, and combining defect depth and appearance quality scores, the images are classified and assigned according to application scenarios.
It improves the accuracy and visibility of defect detection, enables three-dimensional quantitative analysis, repairs image defects, maintains texture consistency, predicts material properties, achieves intelligent classification and allocation, and improves material utilization and economic benefits.
Smart Images

Figure CN122116362A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to machine vision inspection technology, and more particularly to an intelligent detection method and system for surface defects in foam materials based on machine vision. Background Technology
[0002] Foam materials are widely used in various industries such as furniture, automobiles, aerospace, electronics, and medical due to their excellent cushioning, elasticity, and sound insulation properties. However, in actual production, foam materials are prone to surface defects such as bubbles, holes, dents, and cracks. These defects not only affect the appearance quality of the product but also reduce the material's lifespan and performance. Traditional surface quality inspection of foam materials mainly relies on manual visual inspection, which is inefficient and produces inconsistent quality. With the development of machine vision technology, automated inspection systems are gradually being applied to the detection of surface defects in foam materials, but existing technologies still have some significant shortcomings.
[0003] Existing detection methods have limited ability to identify minute defects on the surface of foam materials, especially under uneven lighting conditions, leading to frequent missed and false detections. Due to the complex and porous surface structure of foam materials, traditional image processing algorithms struggle to accurately extract defect features, resulting in low detection accuracy. The lack of precise methods for measuring defect depth prevents a comprehensive assessment of the actual impact of defects on material properties. Most systems can only detect visible surface defects and cannot analyze the relationship between defect depth and material deformation characteristics, leading to discrepancies between quality assessment results and the requirements of actual application scenarios.
[0004] Existing foam material inspection systems typically focus only on defect identification and classification, lacking an intelligent allocation mechanism based on defect characteristics and material properties. Different application scenarios have varying performance requirements for foam materials, but current technologies cannot automatically match the most suitable application scenario based on inspection results, leading to the inefficient use of material resources and unnecessary waste. Summary of the Invention
[0005] This invention provides a machine vision-based intelligent detection method and system for surface defects in foam materials, which can solve the problems in the prior art.
[0006] A first aspect of this invention provides a machine vision-based intelligent detection method for surface defects in foam materials, comprising: An image of the foam material surface is obtained by photographing the surface of the foam material using an industrial camera; Light intensity values are extracted from each pixel in the surface image of foam material under different polarization angles, the light intensity gradient sequence between adjacent polarization angles is calculated, and an enhanced surface image of foam material is generated based on the changing trend of the light intensity gradient sequence. The surface image of the enhanced foam material is segmented to determine the location of the defect area, the light intensity attenuation feature within the defect area is extracted, and the defect depth value is calculated based on the light intensity attenuation feature. Based on the location of the defect area, the surrounding normal area is determined, and the multi-scale texture mapping features of the surrounding normal area are extracted. The defect area is then adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image. The difference between the repaired foam material surface image and the standard sample image is calculated to obtain the appearance quality score; The deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. The application scenarios are matched and calculated based on the deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario. Foam materials are categorized and allocated according to the target application scenario.
[0007] The process involves extracting the light intensity values of each pixel in a foam material surface image at different polarization angles, calculating the light intensity gradient sequence between adjacent polarization angles, and generating an enhanced foam material surface image based on the changing trend of the light intensity gradient sequence. The surface of the foam material is irradiated by a multi-channel polarized light source, and the angle of the polarization filter of the industrial camera is set according to the polarization angle of the incident light. Light intensity data of each pixel in the surface image of foam material is collected in multiple polarization directions. The light intensity data is used to construct a three-dimensional light intensity distribution matrix. The light intensity change curve of each pixel between adjacent polarization angles is extracted from the three-dimensional light intensity distribution matrix to generate a light intensity change sequence. Peak and trough detection is performed on the light intensity change sequence to extract the light intensity extreme points. Based on the light intensity extreme points, the polarization degree value and polarization direction value of each pixel are calculated, and a pixel polarization characteristic mapping relationship is established. The polarization characteristic distribution on the surface of the foam material is generated based on the polarization characteristic mapping relationship, and the light intensity gradient sequence between adjacent polarization angles is obtained. The polarization feature distribution and the light intensity gradient sequence are fused to generate an enhanced weight distribution. The light intensity value of each pixel in the foam material surface image is linearly weighted according to the enhanced weight distribution. The weighting coefficient is adjusted according to the changing trend of the light intensity gradient sequence to generate an enhanced foam material surface image.
[0008] The surface image of the enhanced foam material is segmented to determine the location of defect areas. Light intensity attenuation features within the defect areas are extracted, and the defect depth value is calculated based on these features, including: The enhanced foam material surface image is divided into blocks by sliding at a fixed step size. The mean brightness and standard deviation of brightness of each image block in the divided image are calculated to construct the brightness distribution vector of the image block. The brightness difference between adjacent image blocks is calculated based on the brightness distribution vector of the image blocks, and the regions are merged according to the brightness difference to obtain the location of the defect region. Based on the location of the defect area, boundary points are extracted to generate a defect boundary point sequence. The positional relationship and light intensity gradient of adjacent points in the defect boundary point sequence are calculated to construct a light intensity attenuation direction field. The light intensity attenuation path in the defect area is extracted from the light intensity attenuation direction field. Light intensity change data is collected along the light intensity attenuation path, the light intensity attenuation rate per unit distance is calculated and converted into a depth scaling factor, and the defect depth value is calculated based on the product of the reference light intensity value of the defect-free area on the foam material surface and the depth scaling factor.
[0009] Based on the location of the defect area, the surrounding normal area is determined, and multi-scale texture mapping features of the surrounding normal area are extracted. The defect area is then adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image, including: A reference boundary is determined by extending a fixed pixel distance outward from the location of the defect area. A circular scan is performed along the reference boundary to count the frequency of pixel grayscale values and calculate the texture repetition period. Within the range of the texture repetition period, texture structure features and texture direction features are extracted and combined to generate a basic texture feature vector; The basic texture feature vector is downsampled and decomposed according to the scale ratio to obtain a texture feature vector group with multiple scale levels. The texture similarity between adjacent scale levels in the texture feature vector group is calculated, a texture level mapping matrix is constructed, and the principal direction component is extracted from the texture level mapping matrix to generate multi-scale texture mapping features. Multi-scale texture mapping features are projected onto the defect area, and the continuity score between the edge pixels of the defect area and the texture of the surrounding normal area is calculated. The pixel filling order and filling value are determined based on the continuity score. Pixel gradient smoothing constraints are used to eliminate filling boundary traces, and a repaired foam material surface image is generated.
[0010] The surface image of the repaired foam material is compared with a standard sample image to calculate the difference, and the appearance quality score is obtained, including: The surface image of the repaired foam material and the standard sample image are divided into pixel blocks, and the gray-level distribution characteristics of the pixels in the block image are calculated. Extract structural correlation features between pixels, construct an image feature representation sequence based on the grayscale distribution features and structural correlation features, and convert the image feature representation sequence into a standardized representation space through spatial transformation; In the standardized representation space, a feature mapping path is constructed, and a feature difference sequence between the repaired foam material surface image and the standard sample image is extracted along the feature mapping path. A difference distribution curve is generated based on the feature difference sequence, and characteristic feature points are extracted from the difference distribution curve to generate a quality evaluation feature sequence. The quality evaluation feature sequence is mapped to the feature vector space, and a quality grading boundary is constructed based on the distance relationship between the feature vectors. A scoring mapping surface is generated by surface fitting on the quality grading boundary. The feature vectors of the repaired image are converted into numerical scores through the scoring mapping surface to obtain the appearance quality score.
[0011] The deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. Application scenarios are then matched based on this deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario, including: The defect depth value is mapped to the material compression parameter, and the appearance quality score is mapped to the surface stress parameter. A deformation response function is constructed based on the material compression parameter and the surface stress parameter. Extract compression rebound features and deformation recovery features from the deformation response function, and combine them to generate a deformation characteristic vector; The pressure and deformation parameters of foam materials under multiple application scenarios are obtained. The pressure parameters are mapped to load distribution vectors, and the deformation parameters are mapped to tolerance boundary vectors. The load distribution vectors and tolerance boundary vectors are combined to generate scenario feature vectors. Establish matching constraints between deformation characteristic vectors and scene feature vectors, calculate scene matching values that satisfy the matching constraints, and select the application scenario with the largest scene matching value as the target application scenario.
[0012] Foam materials are categorized and allocated according to their target application scenarios, including: Obtain the pressure direction sequence and deformation allowable range sequence of foam material in the target application scenario; extract pressure distribution features based on the pressure direction sequence; and extract deformation distribution features based on the deformation allowable range sequence. By combining the pressure distribution characteristics and deformation distribution characteristics, a constraint vector for the application scenario is constructed. Collect compression deformation data and recovery deformation data of foam material under pressure load, extract compression response features from the compression deformation data, extract recovery response features from the recovery deformation data, and construct a material property vector; The application scenario matching value is calculated based on the application scenario constraint vector and the material performance vector, and the foam material is assigned to the corresponding target application scenario according to the application scenario matching value.
[0013] A second aspect of this invention provides a machine vision-based intelligent detection system for surface defects in foam materials, comprising: The image acquisition module is used to capture images of the foam material surface using an industrial camera. The image enhancement module is used to extract the light intensity value of each pixel in the foam material surface image under different polarization angles, calculate the light intensity gradient sequence between adjacent polarization angles, and generate an enhanced foam material surface image based on the changing trend of the light intensity gradient sequence. The defect detection module is used to segment the surface image of the reinforced foam material, determine the location of the defect area, extract the light intensity attenuation features within the defect area, and calculate the defect depth value based on the light intensity attenuation features. The image restoration module is used to determine the surrounding normal area based on the location of the defect area, extract the multi-scale texture mapping features of the surrounding normal area, and perform adaptive filling and reconstruction of the defect area through the multi-scale texture mapping features to generate a restored foam material surface image. The quality assessment module is used to calculate the difference between the surface image of the repaired foam material and the standard sample image to obtain an appearance quality score. The scenario matching module is used to calculate the deformation characteristic vector of foam material under pressure based on the defect depth value and appearance quality score, perform matching calculation on the application scenario based on the deformation characteristic vector, and select the application scenario corresponding to the maximum matching value as the target application scenario. The classification and allocation module is used to classify and allocate foam materials according to the target application scenario.
[0014] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0015] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0016] In this embodiment, by acquiring light intensity values at different polarization angles and calculating the light intensity gradient sequence, effective enhancement of the foam material surface image is achieved, making previously difficult-to-identify minute defects more clearly visible and improving the accuracy of defect detection. Utilizing light intensity attenuation characteristics to calculate defect depth values overcomes the limitation of traditional two-dimensional image detection, which can only identify defect locations but not measure defect depth, enabling three-dimensional quantitative analysis of foam material defects. Adaptive filling and reconstruction of defect areas not only repairs image defects but also maintains the texture consistency of the foam material surface, providing a more accurate basis for subsequent quality assessment. Based on the comprehensive calculation of deformation characteristic vectors using defect depth values and appearance quality scores, prediction of the functional performance of the foam material is achieved, extending the detection results beyond surface defect identification to the evaluation of the material's actual application performance. Through application scenario matching calculations, intelligent classification and allocation of foam materials are realized, avoiding the "one-size-fits-all" material selection in traditional detection methods and improving material utilization and economic efficiency. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the intelligent detection method for surface defects of foam materials based on machine vision, according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating the intelligent matching process between materials and application scenarios in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0020] Figure 1 This is a flowchart illustrating the intelligent detection method for surface defects in foam materials based on machine vision, as described in an embodiment of the present invention. Figure 1 As shown, the method includes: An image of the foam material surface is obtained by photographing the surface of the foam material using an industrial camera; Light intensity values are extracted from each pixel in the surface image of foam material under different polarization angles, the light intensity gradient sequence between adjacent polarization angles is calculated, and an enhanced surface image of foam material is generated based on the changing trend of the light intensity gradient sequence. The surface image of the enhanced foam material is segmented to determine the location of the defect area, the light intensity attenuation feature within the defect area is extracted, and the defect depth value is calculated based on the light intensity attenuation feature. Based on the location of the defect area, the surrounding normal area is determined, and the multi-scale texture mapping features of the surrounding normal area are extracted. The defect area is then adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image. The difference between the repaired foam material surface image and the standard sample image is calculated to obtain the appearance quality score; The deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. The application scenarios are matched and calculated based on the deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario. Foam materials are categorized and allocated according to the target application scenario.
[0021] In one optional implementation, the light intensity values of each pixel in the foam material surface image are extracted at different polarization angles, the light intensity gradient sequence between adjacent polarization angles is calculated, and an enhanced foam material surface image is generated based on the changing trend of the light intensity gradient sequence, including: The surface of the foam material is irradiated by a multi-channel polarized light source, and the angle of the polarization filter of the industrial camera is set according to the polarization angle of the incident light. Light intensity data of each pixel in the surface image of foam material is collected in multiple polarization directions. The light intensity data is used to construct a three-dimensional light intensity distribution matrix. The light intensity change curve of each pixel between adjacent polarization angles is extracted from the three-dimensional light intensity distribution matrix to generate a light intensity change sequence. Peak and trough detection is performed on the light intensity change sequence to extract the light intensity extreme points. Based on the light intensity extreme points, the polarization degree value and polarization direction value of each pixel are calculated, and a pixel polarization characteristic mapping relationship is established. The polarization characteristic distribution on the surface of the foam material is generated based on the polarization characteristic mapping relationship, and the light intensity gradient sequence between adjacent polarization angles is obtained. The polarization feature distribution and the light intensity gradient sequence are fused to generate an enhanced weight distribution. The light intensity value of each pixel in the foam material surface image is linearly weighted according to the enhanced weight distribution. The weighting coefficient is adjusted according to the changing trend of the light intensity gradient sequence to generate an enhanced foam material surface image.
[0022] The surface of the foam material is illuminated by a multi-channel polarized light source. LEDs with different polarization directions can be used to construct a multi-channel illumination system, with the illumination angle set between 15° and 60°. The polarization filter angle of the industrial camera is set according to the polarization angle of the incident light; that is, if the incident light polarization angle is 0°, the filter angle is set sequentially to 0°, 45°, 90°, and 135° to acquire image information under different polarization directions. During the acquisition process, the exposure time of the industrial camera is set to 10 milliseconds, and the gain value is maintained at 6dB to ensure image quality.
[0023] Light intensity data of each pixel in an image of the foam material surface is collected in multiple polarization directions. This light intensity data is then used to construct a three-dimensional light intensity distribution matrix I(x, y, θ), where x and y are pixel coordinates and θ is the polarization angle. For example, for a 640×480 resolution image, acquiring data in four polarization directions (0°, 45°, 90°, 135°) yields a 640×480×4 three-dimensional matrix. The light intensity variation curves of each pixel between adjacent polarization angles are extracted from this matrix. For a pixel at position (x, y), the light intensity variation sequence is I(x, y, 0°), I(x, y, 45°), I(x, y, 90°), I(x, y, 135°).
[0024] Peak and trough detection is performed on the light intensity variation sequence, and a sliding window method is used to identify local extreme points. The window width is set to 3 sampling points. When the light intensity value at the center point is greater than that at the two points on either side, it is identified as a peak; when it is less than that at the two points on either side, it is identified as a trough. Based on the detected light intensity extreme points, the polarization degree value and polarization direction value of each pixel are calculated. The polarization degree value ρ can be calculated from the maximum light intensity value Imax and the minimum light intensity value Imin: ρ=(Imax-Imin) / (Imax+Imin). The polarization direction value φ corresponds to the polarization angle at which the maximum light intensity value appears. A pixel polarization characteristic mapping relationship M(x,y)=[ρ(x,y),φ(x,y)] is established, which contains the polarization degree and polarization direction information of each pixel.
[0025] The polarization characteristic distribution map P(x, y) of the foam material surface is generated based on the polarization characteristic mapping relationship, which can be represented as the orientation distribution of the microstructure on the foam surface. Further calculation of the light intensity gradient sequence G(x, y, θ) between adjacent polarization angles is then performed. i ), where θ i Let G(x, y, θ) represent the i-th polarization angle. i )=|I(x, y, θ) i+1 )-I(x, y, θ i )| / |θ i +1-θ iFor example, for acquisition in four polarization directions, three gradient values can be obtained, corresponding to the rate of change of light intensity between 0° and 45°, 45° and 90°, and 90° and 135°, respectively.
[0026] The polarization feature distribution and the light intensity gradient sequence are fused to generate an enhanced weight distribution W(x, y). The fusion process can employ a weighted average method: W(x, y) = α·P(x, y) + β·max(G(x, y, θ)). i ), where α and β are weighting coefficients, set to 0.6 and 0.4 respectively, max(G(x, y, θ) i The ')' represents the maximum value among all gradient values, reflecting the sensitivity of that point to polarization changes. Based on the enhancement weight distribution, the light intensity value of each pixel in the foam material surface image is linearly weighted, and the enhanced pixel value can be expressed as: Ie(x, y) = I(x, y, θ) base )·(1+γ·W(x,y)), where I(x,y,θ base ) represents the original light intensity value at the reference polarization angle, and γ is the enhancement coefficient, ranging from 0.5 to 1.5.
[0027] To further improve image quality, the weighting coefficients are adjusted according to the changing trend of the light intensity gradient sequence. When the gradient sequence shows a trend of first increasing and then decreasing, the weighting coefficients are increased; when the gradient sequence shows a trend of first decreasing and then increasing, the weighting coefficients are decreased. Specifically, the adjusted weighting coefficients can be expressed as: γ'=γ·(1+δ·T), where T is the gradient change trend index, with a value range of [-1, 1], and δ is the adjustment amplitude, set to 0.2. Finally, the enhanced foam material surface image Ie(x, y) is generated.
[0028] In practical applications, an illumination system with a four-channel polarized light source and a wavelength of 550nm was first used to illuminate the foam surface. After acquiring images in four polarization directions (0°, 45°, 90°, and 135°), the light intensity variation sequence was extracted, and the peak was detected at 45°, with the trough at 135°. The calculated average degree of polarization was 0.35, with most areas showing polarization concentrated between 40° and 50°. The light intensity gradient sequence showed a gradient value of 0.012 from 0° to 45°, 0.028 from 45° to 90°, and 0.018 from 90° to 135°, exhibiting a trend of first increasing and then decreasing. The resulting enhancement weight distribution improved the contrast of fine surface scratches by 42%, making even previously difficult-to-detect 0.2mm wide scratches clearly visible after enhancement. In the final enhanced image, the detection rate of minute defects on the foam material surface increased from 78% to 92%, significantly improving defect detection capabilities.
[0029] In one optional implementation, the enhanced foam material surface image is segmented to determine the location of defect areas, light intensity attenuation features within the defect areas are extracted, and the defect depth value is calculated based on the light intensity attenuation features, including: The enhanced foam material surface image is divided into blocks by sliding at a fixed step size. The mean brightness and standard deviation of brightness of each image block in the divided image are calculated to construct the brightness distribution vector of the image block. The brightness difference between adjacent image blocks is calculated based on the brightness distribution vector of the image blocks, and the regions are merged according to the brightness difference to obtain the location of the defect region. Based on the location of the defect area, boundary points are extracted to generate a defect boundary point sequence. The positional relationship and light intensity gradient of adjacent points in the defect boundary point sequence are calculated to construct a light intensity attenuation direction field. The light intensity attenuation path in the defect area is extracted from the light intensity attenuation direction field. Light intensity change data is collected along the light intensity attenuation path, the light intensity attenuation rate per unit distance is calculated and converted into a depth scaling factor, and the defect depth value is calculated based on the product of the reference light intensity value of the defect-free area on the foam material surface and the depth scaling factor.
[0030] In the process of detecting surface defects in foam materials, the acquired surface image of the foam material is first enhanced to improve image quality and contrast, facilitating subsequent defect segmentation and depth calculation. The enhanced foam surface image is then divided into multiple overlapping image blocks using a fixed step size. In practical applications, 8 pixels or 16 pixels can be selected as the step size to divide the entire image into multiple overlapping blocks. For each image block, its mean brightness and standard deviation are calculated. The mean brightness reflects the overall brightness of the image block, while the standard deviation reflects the brightness fluctuations within the image block. The mean brightness and standard deviation of each image block are combined to form a two-dimensional feature vector, which together constitute the set of image block brightness distribution vectors.
[0031] The brightness difference between adjacent image blocks is calculated based on the brightness distribution vector of the image blocks. The brightness difference can be calculated using the Euclidean distance formula, which involves summing the squares of the differences between the mean and standard deviation of the brightness of two image blocks, and then taking the square root. A brightness difference threshold is set; if the brightness difference between adjacent image blocks is less than this threshold, the two image blocks are considered to belong to the same region; otherwise, they are considered to belong to different regions. By iteratively merging similar adjacent image blocks, the location of the defect region is finally obtained.
[0032] Boundary points are extracted based on the location of the defect region. An edge tracking algorithm is used to start from any boundary point in the defect region and sequentially search for adjacent boundary points in a clockwise or counterclockwise direction until returning to the starting point, forming a complete sequence of boundary points. For the obtained defect boundary point sequence, the positional relationship between adjacent points is calculated, including distance and orientation angle; simultaneously, the light intensity gradient at these boundary points is calculated, including gradient magnitude and gradient direction.
[0033] Construct a light intensity attenuation direction field. The light intensity gradient direction of each pixel within the defect region is used as the light intensity attenuation direction at that point, forming a light intensity attenuation direction field. Within this direction field, the light intensity attenuation path within the defect region is extracted by tracing the direction of the largest light intensity gradient. Specifically, the brightest point on the defect boundary is selected as the starting point, and the path moves along the direction of the fastest light intensity decrease until the point with the lowest brightness within the defect region is encountered, thus obtaining a light intensity attenuation path.
[0034] Light intensity variation data is collected along the light intensity attenuation path. The position coordinates and corresponding light intensity value of each pixel on the path are recorded to construct a light intensity-position curve. The ratio of the light intensity difference between adjacent pixels to the distance is calculated to obtain the light intensity attenuation rate per unit distance. According to the optical properties of materials, the attenuation of light in materials follows an exponential decay law, and the light intensity attenuation rate is directly proportional to the material thickness (i.e., defect depth).
[0035] The relationship between light intensity attenuation rate and depth, i.e., the depth scaling factor, is determined through pre-calibration. For example, standard defect samples of known depth can be used for calibration to establish a mapping function between light intensity attenuation rate and defect depth.
[0036] Finally, multiple points were selected on the defect-free area of the foam material surface, and their average light intensity value was calculated as the reference light intensity value. The light intensity value in the defect area was compared with the reference light intensity value, and the defect depth value was calculated by combining it with the depth scaling factor. The specific calculation formula is: Defect depth value = (Reference light intensity value - Defect area light intensity value) × Depth scaling factor.
[0037] In practical applications, to improve calculation accuracy, depth values can be calculated along multiple light intensity attenuation paths within the defect area, and then the average value can be taken as the final defect depth value. Furthermore, considering the different light attenuation characteristics of foam materials, the depth scaling factor needs to be calibrated for specific materials.
[0038] The above steps effectively segment defects on the surface of foam materials and accurately calculate their depth, providing crucial information for foam material quality control. It is particularly suitable for detecting deep defects such as dents and scratches on foam material surfaces, quantitatively assessing defect severity and providing data support for product quality grading and defect cause analysis.
[0039] In one optional implementation, the surrounding normal area is determined based on the location of the defect area, multi-scale texture mapping features of the surrounding normal area are extracted, and the defect area is adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image, including: A reference boundary is determined by extending a fixed pixel distance outward from the location of the defect area. A circular scan is performed along the reference boundary to count the frequency of pixel grayscale values and calculate the texture repetition period. Within the range of the texture repetition period, texture structure features and texture direction features are extracted and combined to generate a basic texture feature vector; The basic texture feature vector is downsampled and decomposed according to the scale ratio to obtain a texture feature vector group with multiple scale levels. The texture similarity between adjacent scale levels in the texture feature vector group is calculated, a texture level mapping matrix is constructed, and the principal direction component is extracted from the texture level mapping matrix to generate multi-scale texture mapping features. Multi-scale texture mapping features are projected onto the defect area, and the continuity score between the edge pixels of the defect area and the texture of the surrounding normal area is calculated. The pixel filling order and filling value are determined based on the continuity score. Pixel gradient smoothing constraints are used to eliminate filling boundary traces, and a repaired foam material surface image is generated.
[0040] First, a reference boundary is determined by extending a fixed pixel distance outward from the defect area. Specifically, after detecting the defect area on the foam material surface, the center coordinates (x0, y0) of the defect area are recorded, and a fixed pixel distance d is extended outward. Typically, d is chosen to be 1.5 to 2 times the maximum diameter of the defect area to ensure that the reference boundary contains sufficient normal texture information. The reference boundary can be represented as a circular region centered at (x0, y0) with a radius of r+d, where r is the equivalent radius of the defect area.
[0041] A circular scan is performed along the reference boundary to count the frequency of pixel grayscale values and calculate the texture repetition period. The circular scan samples pixel grayscale values at equal angular intervals along the reference boundary, typically with an angular interval of 1 degree, resulting in 360 sampling points. Autocorrelation analysis is performed on the grayscale value sequences of these sampling points to identify repetition patterns in the grayscale value distribution. The peak position of the autocorrelation function corresponds to the texture repetition period, denoted as T. For example, if the autocorrelation function shows its first peak at 30°, it indicates that the texture repeats once every 30° rotation, and the texture repetition period T = 30°.
[0042] Texture structure features and texture orientation features are extracted within the texture repetition period and combined to generate a basic texture feature vector. Texture structure features are extracted using Local Binary Pattern (LBP). For normal regions within the reference boundary, LBP features are calculated with a neighborhood radius of 8 pixels to obtain local texture structure information. Texture orientation features are extracted using Histogram of Oriented Gradients (HOG). The statistical distribution of gradient directions in image patches is calculated, typically divided into 9 directions. The LBP and HOG features are concatenated and combined to form a basic texture feature vector F0, which contains the structural and orientation information of the foam material surface texture.
[0043] The basic texture feature vector is downsampled and decomposed according to the scale ratio to obtain texture feature vector groups at multiple scale levels. Specifically, a Gaussian pyramid structure is used to decompose F0 at multiple scales, with the downsampling ratio typically set to 0.5, generating 3 to 5 scale levels. For the f-th scale level, the feature vector is denoted as F. f Where f ranges from 0 to n-1, and n is the total number of scale levels. Each scale level captures texture details at different scales; lower levels preserve detailed textures, while higher levels preserve structural textures.
[0044] Calculate the texture similarity between adjacent scale levels in the texture feature vector group to construct a texture level mapping matrix. The texture similarity between adjacent levels f and f+1 is calculated by the feature vector F. f and F f+1 The cosine similarity is obtained, denoted as S. f,f+1 The similarity values of all adjacent layers form a texture hierarchy mapping matrix M, with matrix elements M... f,j This indicates the strength of the mapping relationship between level f and level j.
[0045] The principal direction component is extracted from the texture hierarchy mapping matrix to generate multi-scale texture mapping features. Eigenvalue decomposition is performed on the matrix M, and the eigenvector corresponding to the largest eigenvalue is selected as the principal direction component V. This principal direction component reflects the variation pattern of texture features between different scale levels, containing texture mapping information from detail to structure. The principal direction component is combined with the eigenvectors of each scale level to construct the multi-scale texture mapping feature MF.
[0046] Multi-scale texture mapping features are projected onto the defect region. Based on the location and shape of the defect region, the extracted multi-scale texture mapping features (MF) are mapped to the corresponding location, serving as a reference template for defect region filling. For each pixel within the defect region, the region with the most similar texture features in the surrounding normal region is searched as the filling source.
[0047] Calculate the continuity score between edge pixels of the defect region and the texture of the surrounding normal region. For edge pixels of the defect region, calculate their gradient continuity and texture consistency with the texture of the surrounding normal region. Gradient continuity is calculated by the difference in pixel gradient direction and magnitude, while texture consistency is calculated by the similarity of local texture features. The two are combined to form the continuity score.
[0048] The pixel filling order and value are determined based on the continuity score. Filling priority is determined according to the continuity score from high to low, prioritizing pixels with high texture continuity with the surrounding normal areas. For a pixel to be filled, the region in the surrounding known pixel area that best matches the multi-scale texture mapping features is selected as the filling source, and the corresponding pixel value is filled into the pixel to be filled.
[0049] Pixel gradient smoothing constraints are used to eliminate fill boundary artifacts. After filling, gradient smoothing is applied to the boundary between the filled region and the original region to eliminate any potential boundary artifacts. Specifically, a weighted average filter is applied to the boundary region, with the weights proportional to the pixel gradient direction to ensure a natural texture transition at the boundary.
[0050] Finally, a repaired image of the foam material surface is generated. The repaired image maintains the continuity and consistency of the original foam material surface texture, and the defective areas are naturally filled, making it visually indistinguishable from the difference before and after the repair.
[0051] In one optional implementation, the difference between the repaired foam material surface image and a standard sample image is calculated to obtain an appearance quality score, including: The surface image of the repaired foam material and the standard sample image are divided into pixel blocks, and the gray-level distribution characteristics of the pixels in the block image are calculated. Extract structural correlation features between pixels, construct an image feature representation sequence based on the grayscale distribution features and structural correlation features, and convert the image feature representation sequence into a standardized representation space through spatial transformation; In the standardized representation space, a feature mapping path is constructed, and a feature difference sequence between the repaired foam material surface image and the standard sample image is extracted along the feature mapping path. A difference distribution curve is generated based on the feature difference sequence, and characteristic feature points are extracted from the difference distribution curve to generate a quality evaluation feature sequence. The quality evaluation feature sequence is mapped to the feature vector space, and a quality grading boundary is constructed based on the distance relationship between the feature vectors. A scoring mapping surface is generated by surface fitting on the quality grading boundary. The feature vectors of the repaired image are converted into numerical scores through the scoring mapping surface to obtain the appearance quality score.
[0052] In one embodiment, the repaired foam material surface image and the standard sample image are first processed by pixel segmentation. Using a sliding window technique, both images are divided into several image blocks of the same size, each block being n×n pixels, where n can be chosen as 16, 32, or 64 based on the surface texture characteristics of the foam material. A certain overlap area can be set between adjacent image blocks, typically 25%, to ensure the continuity of feature extraction. For each image block, the gray-level distribution characteristics of the pixels are calculated, including statistics such as gray-level mean, gray-level standard deviation, gray-level skewness, and gray-level kurtosis. The gray-level distribution characteristics reflect the brightness variations in local areas of the image, effectively identifying the smoothness, uniformity, and minor defects of the foam surface.
[0053] For each image patch, structural correlation features, including energy, contrast, correlation, and entropy, are extracted using the gray-level co-occurrence matrix (GLCM) method. The distance parameter of the GLCM is set to 1 pixel, and the orientation angles are 0°, 45°, 90°, and 135°. Features in all four directions are calculated and averaged to eliminate directional influences. These structural correlation features describe the fine structure and directional characteristics of the foam surface texture, reflecting the differences in structural consistency between the repaired surface and the standard sample.
[0054] An image feature representation sequence is constructed based on the obtained gray-level distribution features and structural correlation features. For each image patch, the gray-level distribution features and structural correlation features are combined to form a feature vector, which is then arranged according to the position of the image patch in the original image to generate a feature representation sequence. To eliminate the influence of different feature dimensions, normalization is used to map each feature value to the interval [0, 1]. Through dimensionality reduction techniques such as principal component analysis, the high-dimensional feature space is compressed to a suitable dimension, retaining more than 90% of the information, thereby converting the feature representation sequence into a standardized representation space.
[0055] In the standardized representation space, a feature mapping path is constructed. A shortest path algorithm is used to establish connections between the feature spaces of the restored image and the standard sample image. Specifically, feature points in both images are treated as network nodes, an adjacency matrix is constructed based on Euclidean distance, and Dijkstra's algorithm is used to find the shortest connection path in the feature space. Along this feature mapping path, the Euclidean distance between adjacent feature points is calculated, forming a feature difference sequence. This sequence reflects the gradual transition from the restored image to the standard sample image in the feature space, capturing subtle differences between the two.
[0056] A difference distribution curve is generated based on the characteristic difference sequence. The characteristic difference sequence is arranged in the order of the mapping path to form a continuous curve that changes with the path position. Key characteristic points, including maxima, minima, inflection points, and mean points, are extracted from the difference distribution curve. The location and amplitude information of these characteristic points are combined to generate a quality assessment characteristic sequence. The quality assessment characteristic sequence contains statistical characteristics of the difference distribution, such as maximum difference, average difference, difference standard deviation, and fluctuation frequency of the difference curve, comprehensively reflecting all aspects of the repair quality.
[0057] The quality assessment feature sequence is mapped to a feature vector space. Vectorization is used to convert the quality assessment feature sequence into fixed-dimensional feature vectors. In the feature vector space, the quality grading boundary is determined based on pre-labeled samples of different quality levels. The quality grading can be divided into four levels: Excellent, Good, Average, and Poor. A mapping relationship between feature vectors and quality levels is established using classifiers such as support vector machines. Surface fitting is performed on the quality grading boundary, and a scoring mapping surface is constructed using radial basis functions to realize the conversion from feature vectors to specific numerical scores.
[0058] Finally, the feature vectors of the repaired image were converted into numerical scores using a scoring mapping surface. The scoring range was 0-100 points, with 90-100 points being excellent, 75-89 points being good, 60-74 points being average, and below 60 points being poor. The numerical scores intuitively reflect how close the surface quality of the repaired foam material is to the standard sample, providing a quantitative basis for the assessment of repair quality.
[0059] In practical applications, taking a piece of foam material repaired after physical damage as an example, a high-resolution image of its surface was acquired with a resolution of 1200×800 pixels. Simultaneously, a standard sample image of the same type of undamaged foam was prepared. Using the above method, a difference calculation was performed, resulting in a quality score of 83 points for the repaired foam surface, belonging to the "Good" level. This indicates that the repair effect is good, but there are still discernible differences compared to the standard sample. This score result is highly consistent with the subjective evaluation of professionals, verifying the effectiveness and accuracy of the method.
[0060] like Figure 2 The diagram shown illustrates the intelligent matching flowchart between materials and application scenarios in this embodiment.
[0061] In one optional implementation, the deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. The application scenarios are then matched based on this deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario. This includes: The defect depth value is mapped to the material compression parameter, and the appearance quality score is mapped to the surface stress parameter. A deformation response function is constructed based on the material compression parameter and the surface stress parameter. Extract compression rebound features and deformation recovery features from the deformation response function, and combine them to generate a deformation characteristic vector; The pressure and deformation parameters of foam materials under multiple application scenarios are obtained. The pressure parameters are mapped to load distribution vectors, and the deformation parameters are mapped to tolerance boundary vectors. The load distribution vectors and tolerance boundary vectors are combined to generate scenario feature vectors. Establish matching constraints between deformation characteristic vectors and scene feature vectors, calculate scene matching values that satisfy the matching constraints, and select the application scenario with the largest scene matching value as the target application scenario.
[0062] The mapping is implemented using a piecewise function. When the depth is between 0 and 1 mm, the compression parameter increases with depth at a slope of 0.15, plus a base value of 0.1. When the depth is between 1 and 3 mm, the slope remains at 0.15, but the base value increases to 0.15. When the depth exceeds 3 mm, a logarithmic function mapping is used to reflect the saturation characteristics of the compression parameter. When the appearance quality score is mapped to the surface stress parameter, the higher the score, the lower the corresponding stress parameter; the two are inversely proportional. From a score of 0 to 100, the stress parameter decreases from 1.0 to 0.1. Compression tests were conducted on 83 groups of foam samples with different defect levels, measuring their compression modulus and surface stress distribution. A quantitative correspondence between depth, score, compression parameter, and stress parameter was established, verifying the accuracy of the mapping function.
[0063] A deformation response function was constructed based on the obtained material compression parameters and surface stress parameters. This function describes the relationship between applied pressure and the amount of deformation. The function consists of two parts: the first part reflects the characteristics of the linear compression stage, where the deformation is proportional to the pressure, and the proportionality coefficient is the compression parameter divided by the stress parameter; the second part reflects the nonlinear effect of the large deformation stage, where the deformation is proportional to the square of the pressure, and the coefficient includes the square term of the compression parameter. Pressures ranging from 0.05 to 1.2 MPa were applied to 127 foam samples with different parameter combinations, and the deformation after stabilization was recorded. The specific form and coefficients of the function were determined using a numerical fitting method, and the deviation between the fitting results and the measured data was controlled within 5%.
[0064] Extracting compression rebound characteristics from the deformation response function involves three aspects. Initial compressive stiffness is obtained by calculating the rate of change of the deformation response function near zero pressure, reflecting the material's resistance to deformation under small loads. Maximum compressive deformation rate is calculated by substituting the upper limit of the working pressure into the function to calculate the deformation amount, then dividing by the original thickness of the specimen to obtain the percentage deformation rate. Compressive energy absorption rate is obtained by calculating the area under the deformation response function curve during loading and comparing it with the total input energy, reflecting the material's ability to convert mechanical energy into internal energy. For a sample with a defect depth of 2.3 mm and a quality score of 68, under conditions of 0.8 MPa pressure and an original thickness of 20 mm, the calculated initial stiffness is 1.276 MPa, the maximum deformation rate is 38.2%, and the energy absorption rate is 54.7%.
[0065] Extracting deformation recovery characteristics from the deformation response function requires an unloading test. The residual deformation rate is calculated by measuring the ratio of permanent deformation 5 minutes after complete pressure release to the original thickness, reflecting the degree of plastic deformation of the material. Springback time is defined as the time required from the start of unloading to recovery to 95% of the original thickness. The deformation recovery process is recorded using a high-speed camera system, acquiring 100 frames per second for measurement. Springback completion is the ratio of the final recovered thickness to the original thickness, reflecting the material's elastic recovery capability. For the above sample, the measured residual deformation rate was 9.4%, the springback time was 2.6 seconds, and the springback completion rate was 90.6%.
[0066] A deformation characteristic vector is generated by combining six parameters: initial stiffness, maximum deformation rate, energy absorption rate, residual deformation rate, springback time, and springback completion rate. During parameter normalization, the initial stiffness is divided by the maximum stiffness value (3.2 MPa) among all tested samples; the maximum deformation rate is divided by the theoretical limit (0.8); the energy absorption rate is already a ratio and requires no further processing; the residual deformation rate is calculated by subtracting its ratio to the allowable maximum value (0.25) from 1; the springback time is calculated by subtracting its ratio to the upper limit (5 seconds) from 1; and the springback completion rate is already a ratio. After normalization, the values of each component are uniformly between 0 and 1, facilitating comprehensive comparison of parameters with different dimensions. The six components of the normalized deformation characteristic vector for the above samples are 0.399, 0.478, 0.547, 0.624, 0.480, and 0.906, respectively.
[0067] Pressure parameters for application scenarios were obtained through field testing and standard experimental methods. In the automotive seat cushioning scenario, a pressure distribution testing system was deployed to collect pressure data from 30 test subjects in three postures: normal sitting, forward leaning, and backward leaning, for a recording period of 8 hours, with sampling once per second. Statistical analysis revealed an average load of 620 Newtons, a peak load of 1150 Newtons, and a load fluctuation frequency of 0.37 times per second. In the shock-absorbing packaging scenario, drop tests were conducted according to standards, with a height set at 1.2 meters. Accelerometer data was recorded and converted into force, yielding an average load of 3800 Newtons, a peak load of 8200 Newtons, and an impact frequency of 0.015 times per second. In the gasket scenario, a constant compressive stress relaxation test was used, applying an initial load of 400 Newtons and maintaining it for 1000 hours, recording the load decay curve over time.
[0068] The pressure parameters are mapped to a load distribution vector, which contains three components representing the average load, peak load, and load variation frequency. For the automotive seat scenario, the load distribution vector has three components: 620 N, 1150 N, and 0.37 Hz; for the shock-absorbing packaging scenario, it has 3800 N, 8200 N, and 0.015 Hz; and for the gasket scenario, feature values are extracted from the stress relaxation curve to construct the load vector. The load distribution vector comprehensively describes the mechanical load characteristics of the material under specific scenarios, providing fundamental data for subsequent matching calculations.
[0069] Deformation parameters for specific application scenarios are determined based on the specific material performance requirements of that scenario. For automotive seats, the maximum compressive deformation rate must not exceed 30% to ensure comfort, the residual deformation rate must not exceed 8% to ensure service life, the rebound time must not exceed 3 seconds to ensure response speed, and the rebound completion rate must be no less than 92% to ensure support performance. For shock-absorbing packaging, a maximum compressive deformation rate of 70% is allowed to fully absorb impact energy, and the residual deformation rate can be relaxed to 20% because it is usually for single use, but the energy absorption rate must be no less than 60%. For gaskets, the initial compressive stiffness must be no less than 5 MPa to ensure sealing effect, the residual deformation rate must not exceed 15%, and the stress relaxation rate must not exceed 25% after 1000 hours.
[0070] Deformation parameters are mapped to tolerance boundary vectors. These vectors contain four components corresponding to the maximum permissible compressive deformation rate, the maximum permissible residual deformation rate, the minimum required springback completion rate, and the minimum required energy absorption rate. The tolerance boundary vectors for the automotive seat scenario are 0.30, 0.08, 0.92, and 0.40; for the shock-absorbing packaging scenario, they are 0.70, 0.20, 0.80, and 0.60; and for the gasket scenario, they are 0.45, 0.15, 0.85, and 0.35. The tolerance boundary vectors define the boundary conditions that material properties must meet; materials exceeding these boundaries are not suitable for this scenario.
[0071] The load distribution vector and tolerance boundary vector are combined to generate a scene feature vector with seven dimensions. The first three components, derived from the load distribution vector, describe the mechanical load characteristics, while the last four components, derived from the tolerance boundary vector, describe the performance requirements. The complete scene feature vector for the automotive seat scenario comprises seven feature values, including both load and tolerance values. Similarly, the shock-absorbing packaging and sealing gasket scenarios also form their own seven-dimensional scene feature vectors. These scene feature vectors comprehensively characterize the specific application scenarios' requirements for foam materials.
[0072] When establishing matching constraints between the deformation characteristic vector and the scene feature vector, four basic constraints are set. The first constraint requires that the maximum compressive deformation rate of the material must be less than the maximum compressive deformation rate allowed by the scene, ensuring that the material is not over-compressed during use; the second constraint requires that the residual deformation rate of the material must be less than the maximum residual deformation rate allowed by the scene, ensuring that the material does not undergo excessive permanent deformation; the third constraint requires that the springback completion rate of the material must be greater than the minimum springback completion rate required by the scene, ensuring that the material has sufficient recovery capability; the fourth constraint requires that the energy absorption rate of the material must be greater than the minimum energy absorption rate required by the scene, ensuring that the material can meet the cushioning or sealing function.
[0073] When calculating the matching value for a scenario that satisfies the matching constraints, the deformation characteristic vector for each application scenario is checked one by one to see if it meets all four constraints of that scenario. If any constraint is not met, the matching value for that scenario is directly recorded as 0, indicating that the material is not suitable for that scenario. If all constraints are met, the specific matching value is calculated. The matching value is calculated by subtracting the difference between the four performance parameter components in the deformation characteristic vector and the four tolerance components in the scenario feature vector. The difference in maximum compressive deformation rate, residual deformation rate, springback completion rate, and energy absorption rate are multiplied by weighting coefficients of 0.3, 0.3, 0.2, and 0.2, respectively. The four weighted differences are summed, and the sum is subtracted from 1 to obtain the scenario matching value. The closer the matching value is to 1, the better the material performance matches the scenario requirements.
[0074] The application scenario with the highest scenario matching value is selected as the target application scenario. This matching method ensures that the basic performance requirements are met through constraints, while also achieving the selection of the optimal scenario through precise calculation of the matching value.
[0075] By establishing a quantitative relationship between defect characteristics and mechanical properties, surface inspection results are transformed into evaluations of material deformation characteristics. Multidimensional matching calculations then enable precise matching between materials and application scenarios. The setting of constraints ensures the safety and reliability of the classification results, preventing materials that do not meet basic requirements from being assigned to unsuitable scenarios. Weighted matching value calculations comprehensively consider multiple performance indicators, making the classification results more scientific and reasonable. This fully explores the use value of materials with minor defects, improves material utilization, and achieves a leap from simple qualification judgment to differentiated and precise application, providing technical support for the quality grading and application optimization of foam materials.
[0076] In one optional implementation, classifying and allocating foam materials according to the target application scenario includes: Obtain the pressure direction sequence and deformation allowable range sequence of foam material in the target application scenario; extract pressure distribution features based on the pressure direction sequence; and extract deformation distribution features based on the deformation allowable range sequence. By combining the pressure distribution characteristics and deformation distribution characteristics, a constraint vector for the application scenario is constructed. Collect compression deformation data and recovery deformation data of foam material under pressure load, extract compression response features from the compression deformation data, extract recovery response features from the recovery deformation data, and construct a material property vector; The application scenario matching value is calculated based on the application scenario constraint vector and the material performance vector, and the foam material is assigned to the corresponding target application scenario according to the application scenario matching value.
[0077] When classifying and assigning foam materials according to target application scenarios, the first step is to obtain the sequence of pressure directions and the sequence of allowable deformation ranges for the foam materials in the target application scenario. The sequence of pressure directions describes the direction of force on the foam material during use, such as vertical compression, horizontal shear, or multi-directional combined force; the sequence of allowable deformation ranges defines the minimum and maximum allowable deformation of the foam material in each direction.
[0078] After acquiring these sequence data, the pressure direction sequence is analyzed to extract pressure distribution characteristics. Specifically, the pressure direction is quantified into a vector form, the primary pressure direction and its magnitude are calculated, and the secondary pressure directions and their distribution are analyzed. For example, in a seat cushion application scenario, the primary pressure direction is vertically downward, the pressure magnitude varies with the user's weight, and there is also a small amount of horizontal shear force. The extracted pressure distribution characteristics include parameters such as the angle of the primary pressure direction, the ratio of primary to secondary pressure, and the uniformity of pressure distribution.
[0079] When extracting deformation distribution features for a deformation tolerance sequence, it is necessary to consider the maximum allowable compression ratio in each direction, the required recovery deformation, and the deformation stability over the service life. For example, in shockproof packaging applications, large one-time compression deformation is permissible, but good cushioning is required; while in furniture cushion applications, good resilience is required even after long-term repeated compression. Deformation distribution features can be represented as the deformation range values in each key direction and their weighting coefficients.
[0080] The extracted pressure distribution features and deformation distribution features are combined to construct an application scenario constraint vector. Combination methods can include feature concatenation, weighted fusion, etc. Taking shockproof packaging as an example, its application scenario constraint vector may contain feature parameters such as high vertical pressure feature weights, large one-time deformation tolerance, and low recovery speed requirements.
[0081] Next, performance data of the foam material was collected. First, a compression test was conducted to record compression deformation data under different pressure loads, including compression rate, stress-strain curve, energy absorption efficiency, etc. Then, a recovery test was conducted to record recovery deformation data after unloading, including recovery time, permanent deformation rate, recovery curve shape, etc.
[0082] Compression response features are extracted from compression deformation data, including parameters such as initial compression modulus, stress-strain curve slope change, and compression hysteresis loop area. These parameters reflect the stiffness changes and energy absorption capacity of the foam material during compression. Recovery response features are extracted from recovery deformation data, including recovery rate, recovery percentage, and percentage of permanent deformation. These parameters reflect the elastic recovery capability and long-term stability of the foam material.
[0083] The extracted compression response features and recovery response features are integrated to construct a material property vector. For example, for highly elastic polyurethane foam, its material property vector may include features such as moderate compression modulus, high recovery rate, and low permanent deformation rate; while for memory foam, its material property vector may include features such as low initial compression modulus, slow recovery rate, and temperature sensitivity.
[0084] Based on the constructed application scenario constraint vector and material property vector, the application scenario matching value is calculated. The calculation method can employ vector distance metrics, similarity calculations, or matching degree scoring models. For example, the Euclidean distance or cosine similarity between two vectors can be calculated; a smaller or larger value indicates a higher matching degree. Alternatively, a weighted scoring model can be established, assigning different weights to different features to comprehensively evaluate the degree of matching.
[0085] For example, the constraint vector for furniture cushion scenarios focuses on long-term repeated compression recovery and comfort under vertical pressure, while the constraint vector for shockproof packaging scenarios pays more attention to one-time high energy absorption capacity and cushioning effect in different directions. Through matching calculations, high-elasticity foam achieves a high matching value with furniture cushion scenarios, while low-resilience memory foam has a high matching degree with ergonomic pillow scenarios.
[0086] Finally, based on the calculated application scenario matching value, the foam material is assigned to the corresponding target application scenario. A matching threshold can be set; when the matching value exceeds a specific threshold, the foam material is determined to be suitable for the corresponding scenario. Alternatively, the scenario with the highest matching degree can be selected as the best application scenario for the material based on the matching value ranking. A multi-level matching mechanism can also be established, classifying materials into different levels such as most suitable, suitable, usable, and unsuitable.
[0087] The above method enables the scientific classification and precise allocation of foam materials, ensuring optimal performance in various application scenarios, improving resource utilization efficiency, and meeting diverse usage needs. This method is particularly suitable for the screening of various foam materials and the optimized configuration for different application scenarios.
[0088] A second aspect of this invention provides a machine vision-based intelligent detection system for surface defects in foam materials, the system comprising: The image acquisition module is used to capture images of the foam material surface using an industrial camera. The image enhancement module is used to extract the light intensity value of each pixel in the foam material surface image under different polarization angles, calculate the light intensity gradient sequence between adjacent polarization angles, and generate an enhanced foam material surface image based on the changing trend of the light intensity gradient sequence. The defect detection module is used to segment the surface image of the reinforced foam material, determine the location of the defect area, extract the light intensity attenuation features within the defect area, and calculate the defect depth value based on the light intensity attenuation features. The image restoration module is used to determine the surrounding normal area based on the location of the defect area, extract the multi-scale texture mapping features of the surrounding normal area, and perform adaptive filling and reconstruction of the defect area through the multi-scale texture mapping features to generate a restored foam material surface image. The quality assessment module is used to calculate the difference between the surface image of the repaired foam material and the standard sample image to obtain an appearance quality score. The scenario matching module is used to calculate the deformation characteristic vector of foam material under pressure based on the defect depth value and appearance quality score, perform matching calculation on the application scenario based on the deformation characteristic vector, and select the application scenario corresponding to the maximum matching value as the target application scenario. The classification and allocation module is used to classify and allocate foam materials according to the target application scenario.
[0089] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0090] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0091] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A machine vision-based intelligent detection method for surface defects in foam materials, characterized in that, include: An image of the foam material surface is obtained by photographing the surface of the foam material using an industrial camera; Light intensity values are extracted from each pixel in the surface image of foam material under different polarization angles, the light intensity gradient sequence between adjacent polarization angles is calculated, and an enhanced surface image of foam material is generated based on the changing trend of the light intensity gradient sequence. The surface image of the enhanced foam material is segmented to determine the location of the defect area, the light intensity attenuation feature within the defect area is extracted, and the defect depth value is calculated based on the light intensity attenuation feature. Based on the location of the defect area, the surrounding normal area is determined, and the multi-scale texture mapping features of the surrounding normal area are extracted. The defect area is then adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image. The difference between the repaired foam material surface image and the standard sample image is calculated to obtain the appearance quality score; The deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. The application scenarios are matched and calculated based on the deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario. Foam materials are categorized and allocated according to the target application scenario.
2. The method according to claim 1, characterized in that, The process involves extracting the light intensity values of each pixel in a foam material surface image at different polarization angles, calculating the light intensity gradient sequence between adjacent polarization angles, and generating an enhanced foam material surface image based on the changing trend of the light intensity gradient sequence. The surface of the foam material is irradiated by a multi-channel polarized light source, and the angle of the polarization filter of the industrial camera is set according to the polarization angle of the incident light. Light intensity data of each pixel in the surface image of foam material is collected in multiple polarization directions. The light intensity data is used to construct a three-dimensional light intensity distribution matrix. The light intensity change curve of each pixel between adjacent polarization angles is extracted from the three-dimensional light intensity distribution matrix to generate a light intensity change sequence. Peak and trough detection is performed on the light intensity variation sequence to extract extreme light intensity points. Based on these extreme points, the polarization degree and polarization direction values of each pixel are calculated, and a mapping relationship of pixel polarization characteristics is established. The polarization characteristic distribution on the surface of the foam material is generated based on the polarization characteristic mapping relationship, and the light intensity gradient sequence between adjacent polarization angles is obtained. The polarization feature distribution and the light intensity gradient sequence are fused to generate an enhanced weight distribution. The light intensity value of each pixel in the foam material surface image is linearly weighted according to the enhanced weight distribution. The weighting coefficient is adjusted according to the changing trend of the light intensity gradient sequence to generate an enhanced foam material surface image.
3. The method according to claim 1, characterized in that, The surface image of the enhanced foam material is segmented to determine the location of defect areas. Light intensity attenuation features within the defect areas are extracted, and the defect depth value is calculated based on these features, including: The enhanced foam material surface image is divided into blocks by sliding at a fixed step size. The mean brightness and standard deviation of brightness of each image block in the divided image are calculated to construct the brightness distribution vector of the image block. The brightness difference between adjacent image blocks is calculated based on the brightness distribution vector of the image blocks, and the regions are merged according to the brightness difference to obtain the location of the defect region. Based on the location of the defect area, boundary points are extracted to generate a defect boundary point sequence. The positional relationship and light intensity gradient of adjacent points in the defect boundary point sequence are calculated to construct a light intensity attenuation direction field. The light intensity attenuation path in the defect area is extracted from the light intensity attenuation direction field. Light intensity change data is collected along the light intensity attenuation path, the light intensity attenuation rate per unit distance is calculated and converted into a depth scaling factor, and the defect depth value is calculated based on the product of the reference light intensity value of the defect-free area on the foam material surface and the depth scaling factor.
4. The method according to claim 1, characterized in that, Based on the location of the defect area, the surrounding normal area is determined, and multi-scale texture mapping features of the surrounding normal area are extracted. The defect area is then adaptively filled and reconstructed using the multi-scale texture mapping features to generate a repaired foam material surface image, including: A reference boundary is determined by extending a fixed pixel distance outward from the location of the defect area. A circular scan is performed along the reference boundary to count the frequency of pixel grayscale values and calculate the texture repetition period. Within the range of the texture repetition period, texture structure features and texture direction features are extracted and combined to generate a basic texture feature vector; The basic texture feature vector is downsampled and decomposed according to the scale ratio to obtain a texture feature vector group with multiple scale levels. The texture similarity between adjacent scale levels in the texture feature vector group is calculated, a texture level mapping matrix is constructed, and the principal direction component is extracted from the texture level mapping matrix to generate multi-scale texture mapping features. Multi-scale texture mapping features are projected onto the defect area, and the continuity score between the edge pixels of the defect area and the texture of the surrounding normal area is calculated. The pixel filling order and filling value are determined based on the continuity score. Pixel gradient smoothing constraints are used to eliminate filling boundary traces, and a repaired foam material surface image is generated.
5. The method according to claim 1, characterized in that, The surface image of the repaired foam material is compared with a standard sample image to calculate the difference, and the appearance quality score is obtained, including: The surface image of the repaired foam material and the standard sample image are divided into pixel blocks, and the gray-level distribution characteristics of the pixels in the block image are calculated. Extract structural correlation features between pixels, construct an image feature representation sequence based on the grayscale distribution features and structural correlation features, and convert the image feature representation sequence into a standardized representation space through spatial transformation; In the standardized representation space, a feature mapping path is constructed, and a feature difference sequence between the repaired foam material surface image and the standard sample image is extracted along the feature mapping path. A difference distribution curve is generated based on the feature difference sequence, and characteristic feature points are extracted from the difference distribution curve to generate a quality evaluation feature sequence. The quality evaluation feature sequence is mapped to the feature vector space, and a quality grading boundary is constructed based on the distance relationship between the feature vectors. A scoring mapping surface is generated by surface fitting on the quality grading boundary. The feature vectors of the repaired image are converted into numerical scores through the scoring mapping surface to obtain the appearance quality score.
6. The method according to claim 1, characterized in that, The deformation characteristic vector of the foam material under pressure is calculated based on the defect depth value and appearance quality score. Application scenarios are then matched based on this deformation characteristic vector, and the application scenario corresponding to the maximum matching value is selected as the target application scenario, including: The defect depth value is mapped to the material compression parameter, and the appearance quality score is mapped to the surface stress parameter. A deformation response function is constructed based on the material compression parameter and the surface stress parameter. Extract compression rebound features and deformation recovery features from the deformation response function, and combine them to generate a deformation characteristic vector; The pressure and deformation parameters of foam materials under multiple application scenarios are obtained. The pressure parameters are mapped to load distribution vectors, and the deformation parameters are mapped to tolerance boundary vectors. The load distribution vectors and tolerance boundary vectors are combined to generate scenario feature vectors. Establish matching constraints between deformation characteristic vectors and scene feature vectors, calculate scene matching values that satisfy the matching constraints, and select the application scenario with the largest scene matching value as the target application scenario.
7. The method according to claim 1, characterized in that, Foam materials are categorized and allocated according to their target application scenarios, including: Obtain the pressure direction sequence and deformation allowable range sequence of foam material in the target application scenario; extract pressure distribution features based on the pressure direction sequence; and extract deformation distribution features based on the deformation allowable range sequence. By combining the pressure distribution characteristics and deformation distribution characteristics, a constraint vector for the application scenario is constructed. Collect compression deformation data and recovery deformation data of foam material under pressure load, extract compression response features from the compression deformation data, extract recovery response features from the recovery deformation data, and construct a material property vector; The application scenario matching value is calculated based on the application scenario constraint vector and the material performance vector, and the foam material is assigned to the corresponding target application scenario according to the application scenario matching value.
8. A machine vision-based intelligent detection system for surface defects in foam materials, used to implement the method described in any one of claims 1-7, characterized in that, include: The image acquisition module is used to capture images of the foam material surface using an industrial camera. The image enhancement module is used to extract the light intensity value of each pixel in the foam material surface image under different polarization angles, calculate the light intensity gradient sequence between adjacent polarization angles, and generate an enhanced foam material surface image based on the changing trend of the light intensity gradient sequence. The defect detection module is used to segment the surface image of the reinforced foam material, determine the location of the defect area, extract the light intensity attenuation features within the defect area, and calculate the defect depth value based on the light intensity attenuation features. The image restoration module is used to determine the surrounding normal area based on the location of the defect area, extract the multi-scale texture mapping features of the surrounding normal area, and perform adaptive filling and reconstruction of the defect area through the multi-scale texture mapping features to generate a restored foam material surface image. The quality assessment module is used to calculate the difference between the surface image of the repaired foam material and the standard sample image to obtain an appearance quality score. The scenario matching module is used to calculate the deformation characteristic vector of foam material under pressure based on the defect depth value and appearance quality score, perform matching calculation on the application scenario based on the deformation characteristic vector, and select the application scenario corresponding to the maximum matching value as the target application scenario. The classification and allocation module is used to classify and allocate foam materials according to the target application scenario.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.