Method for rapid detection of surface quality of car seats

By dividing the target area and calculating gradient contrast and structural similarity parameters in the surface quality inspection of automobile seats, and dynamically adjusting the bilateral filtering parameters, the problem of indistinguishable textures and defects is solved, and higher detection accuracy is achieved.

CN122134697APending Publication Date: 2026-06-02GRAMMER INTERIOR (BEIJING) CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GRAMMER INTERIOR (BEIJING) CO LTD
Filing Date
2026-03-03
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, machine vision-based solutions for inspecting the surface quality of car seats suffer from the inability to distinguish between textures and defects, resulting in insufficient inspection precision and low accuracy.

Method used

By acquiring images of the seat surface, dividing the target region, calculating gradient contrast parameters and structural similarity parameters, dynamically adjusting the value range and spatial parameters of the bilateral filter, performing adaptive filtering, and then inputting the optimized image into the defect detection model.

Benefits of technology

It improves the accuracy of automotive seat surface quality inspection, effectively distinguishing between regular textures and irregular defects, thus enhancing inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134697A_ABST
    Figure CN122134697A_ABST
Patent Text Reader

Abstract

This invention relates to the technical field of machine vision defect detection, specifically to a rapid detection method for the surface quality of automotive seats. The method includes: acquiring at least one image of the seat surface corresponding to the seat to be inspected; dividing the seat surface image to obtain at least one target region, and calculating gradient contrast parameters and structural similarity parameters corresponding to each target region; determining dynamic value domain parameters based on the gradient contrast parameters and structural similarity parameters, and determining dynamic spatial parameters based on the gradient contrast parameters; performing bilateral filtering on the target regions based on the dynamic value domain parameters and dynamic spatial parameters to obtain an optimized image; and inputting the optimized image into a defect detection model to obtain the detection result of the automotive seat surface quality. This invention can distinguish between texture and defects, thereby improving the accuracy of detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of machine vision defect detection, and more specifically to a rapid detection method for the surface quality of automobile seats. Background Technology

[0002] In the context of automotive seat surface quality inspection, modern seats, to meet functional (such as ventilation and heating) and aesthetic requirements, typically feature regular textures (such as ventilation hole mesh and decorative stitching) and irregular defects (such as wrinkles and scratches). Ventilation holes are often periodically arranged circular / strip structures, and decorative stitching is a continuous linear texture; both share a high degree of similarity in color and texture with the seat base material (such as leather). Defects such as wrinkles, on the other hand, appear as localized protrusions without a fixed direction, and their visual characteristics are fundamentally different from regular textures.

[0003] Currently, bilateral filtering is widely used for image preprocessing in machine vision-based inspection of automotive seat surface quality. However, because regular textures such as heating holes and decorative stitching on seat surfaces are visually highly similar to defects such as wrinkles, traditional bilateral filtering may misjudge wrinkles as high-frequency noise when smoothing textures, or excessively preserve textures, interfering with defect detection. Existing technologies have not solved the problem of distinguishing between textures and defects, resulting in insufficient detection accuracy.

[0004] In other words, the accuracy of existing rapid detection solutions for the surface quality of car seats is relatively low. Summary of the Invention

[0005] To address the technical problems of low detection accuracy and inaccurate results in existing vehicle seat inspection solutions, the present invention aims to provide a rapid detection method for the surface quality of automotive seats. The specific technical solution adopted is as follows: In a first aspect, one embodiment of the present invention provides a rapid detection method for the surface quality of automotive seats, the method comprising: Acquire at least one seat surface image corresponding to the seat to be detected; The seat surface image is divided into at least one target region, and the gradient contrast parameter and structural similarity parameter corresponding to each target region are calculated; the gradient contrast parameter is used to characterize the regularity of the texture within the target region; the structural similarity parameter is used to characterize the structural similarity between the target region and its adjacent regions. Based on the gradient comparison parameters and the structural similarity parameters, dynamic range parameters are determined, and dynamic spatial parameters are determined based on the gradient comparison parameters; the dynamic range parameters are used to control the smoothness of the filtering; the dynamic spatial parameters are used to control the spatial range of the filtering. Based on the dynamic range parameters and the dynamic spatial parameters, bilateral filtering is performed on the target region to obtain an optimized image; The optimized image is input into the defect detection model to obtain the detection results of the surface quality of the car seat.

[0006] In one embodiment, the step of performing bilateral filtering on the target region based on the dynamic range parameter and the dynamic spatial parameter to obtain an optimized image includes: Based on the dynamic spatial parameters, spatial weights are determined; the spatial weights are used to characterize the degree of influence of the spatial distance between neighboring pixels and the filtered pixel value of the center pixel. The value range weight is determined based on the dynamic value range parameter; the value range weight is used to characterize the degree of influence of the neighboring pixels on the similarity of the filtered pixel value of the center pixel; Based on the spatial weight and the range weight, the filtered pixel value corresponding to the target region is determined; Based on the pixel values, an optimized image is obtained.

[0007] In one embodiment, the step of segmenting the seat surface image to obtain at least one target region, and calculating the gradient contrast parameters and structural similarity parameters corresponding to each target region, includes: Semantic segmentation is performed on the seat surface image to extract an initial region image of the seat surface, and the initial region image is divided into at least one target region; For any target region, determine the gradient contrast parameters and structural similarity parameters.

[0008] In one embodiment, determining the gradient contrast parameters for any target region includes: Calculate the gradient direction and gradient magnitude of each pixel within the target region, and generate a gradient direction histogram; Based on the gradient orientation histogram, a first direction is determined; the first direction is the direction interval with the highest cumulative sum of gradient magnitudes in the gradient orientation histogram of the target region. A gradient comparison parameter is determined based on the gradient magnitude in the first direction and the gradient magnitude in the second direction; the second direction includes the first direction.

[0009] In one embodiment, after determining the gradient comparison parameter based on the gradient magnitude in the first direction and the gradient magnitude in the second direction, the method further includes: If the gradient comparison parameter is less than a first preset threshold, the target region is marked as an irregular region. If the gradient comparison parameter is greater than or equal to the first preset threshold, the target region is marked as a regular region.

[0010] In one embodiment, determining the structural similarity parameters for any target region includes: From the target region, a first sub-region and a second sub-region are obtained according to a structural similarity strategy; the second sub-region is adjacent to the first sub-region and has the same range. Based on the first sub-region and the second sub-region, structural similarity parameters are determined.

[0011] In one embodiment, determining the gradient comparison parameter based on the gradient magnitude in the first direction and the gradient magnitude in the second direction includes: The gradient magnitudes in the first direction and the sub-direction are statistically analyzed, and their proportions in the gradient magnitude in the second direction are used to obtain the gradient comparison parameter.

[0012] In one embodiment, determining the dynamic range parameter based on the gradient comparison parameter and the structural similarity parameter includes: The gradient contrast parameters are weighted using a texture preservation coefficient to obtain a first weight adjustment term; The complementary values ​​of the structural similarity parameters are weighted by the defect protection coefficient to obtain the second weight adjustment term; The dynamic range parameters are determined based on the initial range standard deviation of the bilateral filter, the first weight adjustment term, and the second weight adjustment term.

[0013] In one embodiment, determining the dynamic space parameters based on the gradient comparison parameters includes: The gradient comparison parameters are weighted by spatial adjustment coefficients to obtain the third weight adjustment term; The dynamic spatial parameters are determined based on the initial spatial domain standard deviation of the bilateral filter and the third weight adjustment term.

[0014] In one embodiment, determining the filtered pixel value corresponding to the target region based on the spatial weight and the range weight includes: The spatial weight and the range weight are used to perform pixel-by-pixel weighted processing on each pixel value within the target region that falls within the target preset range, to obtain a weighted total gray value; the target preset range is a pixel window range divided according to a preset radius with the center pixel as the center; The total joint weight is determined based on the spatial weight and the range weight. The filtered pixel value corresponding to the target region is determined based on the weighted gray value and the joint weight value.

[0015] Secondly, another embodiment of the present invention provides a rapid detection system for the surface quality of automotive seats, the system comprising: The acquisition module is used to acquire at least one image of the seat surface corresponding to the seat to be detected; The module is used to divide the seat surface image to obtain at least one target region; The calculation module is used to calculate the gradient contrast parameters and structural similarity parameters corresponding to each target region; the gradient contrast parameters are used to characterize the regularity of the texture within the target region; the structural similarity parameters are used to characterize the structural similarity between the target region and adjacent regions. The determination module is used to determine dynamic range parameters based on the gradient comparison parameters and the structural similarity parameters, and to determine dynamic spatial parameters based on the gradient comparison parameters; the dynamic range parameters are used to control the smoothness of the filtering; the dynamic spatial parameters are used to control the spatial range of the filtering. The module is used to perform bilateral filtering on the target region based on the dynamic range parameters and the dynamic spatial parameters to obtain an optimized image; the optimized image is then input into the defect detection model to obtain the detection result of the surface quality of the car seat.

[0016] Thirdly, in another embodiment of the present invention, an electronic device is provided, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.

[0017] Fourthly, in another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0018] The present invention has the following beneficial effects: This invention first acquires at least one surface image of the seat to be inspected, divides the image into at least one target region, and calculates the gradient contrast parameter and structural similarity parameter of each region. Then, based on these two parameters, it determines the dynamic value range parameter and dynamic spatial parameter. Subsequently, it uses these two dynamic parameters to perform bilateral filtering on the target region to obtain an optimized image. Finally, it inputs the optimized image into a defect detection model to obtain the detection result of the car seat surface quality. By dynamically adjusting the filtering parameters, it is possible to distinguish between regular textures and irregular defects, thereby improving the accuracy of detection. Attached Figure Description

[0019] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic flowchart of a rapid detection method for the surface quality of automobile seats provided in one embodiment of the present invention. Figure 1 ; Figure 2 A schematic flowchart of a rapid detection method for the surface quality of automobile seats provided in one embodiment of the present invention. Figure 2 ; Figure 3 This is a schematic diagram of a seat detection platform provided in one embodiment of the present invention; Figure 4 A schematic diagram of a ring-shaped supplementary light and adjustment device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of a seat side front detection image provided in one embodiment of the present invention; Figure 6 This is a schematic diagram of a rapid detection system for the surface quality of automobile seats provided in one embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0021] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a rapid detection method for the surface quality of automobile seats according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0023] The following describes in detail, with reference to the accompanying drawings, a specific scheme for a rapid detection method for the surface quality of automobile seats provided by the present invention.

[0024] This invention proposes a rapid detection method for the surface quality of automotive seats. Please refer to [link / reference]. Figure 1It illustrates a schematic flowchart of a rapid detection method for the surface quality of automobile seats according to an embodiment of the present invention. Figure 1 The method includes the following steps: Step S101: Obtain at least one seat surface image corresponding to the seat to be detected.

[0025] Among them, the seats to be inspected refer to car seats that need to undergo surface quality inspection, including seats of various types of vehicles such as sedans and SUVs, covering components such as backrests, cushions, and sides, and the surface may contain regular textures such as ventilation holes and decorative stitching, as well as potential defects such as wrinkles and scratches.

[0026] Seat surface images refer to image data (which can be RGB or grayscale images) that reflect the appearance characteristics of the seat surface, obtained through image acquisition devices (such as cameras). The images must clearly show information such as the texture, defects, and flatness of the seat surface to provide basic data for subsequent inspection.

[0027] For example, at least one image is collected. In practical applications, in order to achieve detection without blind spots, multiple parts and multiple perspectives are usually collected by a multi-angle camera array to ensure that all areas to be detected on the seat are covered.

[0028] In an embodiment of the present invention, multiple image sensors on a seat inspection platform are used to collect surface images of the car seat to be inspected from multiple angles and at multiple locations, and at least one image data that can clearly show the surface features of the seat is obtained.

[0029] Step S102: Divide the seat surface image to obtain at least one target region, and calculate the gradient contrast parameters and structural similarity parameters corresponding to each target region.

[0030] The process of segmenting the seat surface image refers to first performing semantic segmentation on the seat surface image to extract the effective area of ​​the seat, and then using the Simple Linear Iterative Clustering (SLIC) algorithm to cluster pixels with similar features (color, brightness, texture) in the effective area into complete pixel blocks. This process is used to solve the problem of regional fragmentation caused by complex patterns.

[0031] The target region refers to a single complete pixel block (superpixel) obtained after segmentation. It is the basic unit for subsequent feature analysis. Each target region corresponds to a local area on the seat surface, covering types such as regular areas, defect areas, or flat areas.

[0032] For example, the target region can be a complete pixel block formed by clustering adjacent pixels with similar features (color, brightness, texture) in the initial region image using the SLIC (Simple Linear Iterative Clustering) superpixel segmentation algorithm. This block is the basic unit for subsequent feature parameter calculation, and each target region corresponds to a local region on the seat surface.

[0033] The gradient contrast parameter is used to characterize the regularity of the texture within the target area. It can be a quantized parameter calculated based on the distribution of pixel gradient directions within the target area. The pixel gradient directions are obtained through the Sobel operator and a gradient direction histogram is generated. The ratio of the sum of the gradient magnitudes of the first direction (the direction interval with the highest magnitude) and the gradient magnitudes of the secondary directions to the sum of the total gradient magnitudes is calculated and normalized. This ratio is used to determine the regularity of the texture in the region (the value range is [0,1]).

[0034] The structural similarity parameter is used to characterize the degree of structural similarity between the target region and its adjacent regions. It can be a quantitative parameter calculated by the Structural Similarity Index Measure (SSIM) algorithm. It compares the structural consistency between any sub-region within the target region and its adjacent sub-regions, and is used to distinguish between defective regions and flat regions (the value range is [0, 1]).

[0035] It should be noted that the effective image of the seat surface extracted by semantic segmentation is divided into at least one complete target region using the SLIC superpixel segmentation algorithm. Then, the gradient contrast parameter (D(x,y)) of each target region is calculated by gradient direction analysis, and the structural similarity parameter (S(x,y)) of each target region is calculated by structural similarity analysis. This provides a quantitative basis for the subsequent dynamic adjustment of filtering parameters and the differentiation between regular textures and defects.

[0036] Further, the process of segmenting the seat surface image to obtain at least one target region, and calculating the gradient contrast parameters and structural similarity parameters corresponding to each target region, includes: Semantic segmentation is performed on the seat surface image to extract the initial region image of the seat surface, and the initial region image is divided into at least one target region.

[0037] Semantic segmentation is an image segmentation technique that classifies pixels at the pixel level based on their semantic meaning (such as seats or background) to accurately separate the target object (seats) from irrelevant backgrounds (such as detection platforms or environmental clutter), retaining only the pixel regions related to the seats.

[0038] The seat surface image is obtained by acquiring images from multiple angles through multiple image sensors of the seat inspection platform and then supplementing the light with a ring lamp. The image data (which can be RGB or grayscale) reflects the appearance characteristics of the car seat surface (including regular textures, potential defects, etc.).

[0039] The initial region image refers to the image extracted from the original seat surface image after semantic segmentation, which contains only the effective area of ​​the seat surface and excludes background and other irrelevant areas. It is the base image for subsequent region division.

[0040] For example, the number of target areas obtained after segmentation is no less than one. In practical applications, multiple target areas need to be generated according to the complexity of the seat surface (such as pattern distribution and component segmentation) to ensure coverage of all local areas to be detected on the seat.

[0041] For any target region, determine the gradient contrast parameters and structural similarity parameters.

[0042] In this context, any target region refers to any complete pixel block obtained by dividing the effective area of ​​the seat using the SLIC (Simple Linear Iterative Clustering) superpixel segmentation algorithm. Each target region corresponds to a local area on the seat surface, which may be a regular area, a defect area, or a flat area, covering all local areas of the seat to be detected.

[0043] For example, the gradient contrast parameter (D(x,y)) refers to a quantitative index calculated based on the distribution of pixel gradient directions within the target region. The pixel gradient directions are obtained by using the Sobel operator and a gradient direction histogram covering 0°-180° with 8 bins is generated. The ratio of the sum of gradient magnitudes in the first direction to the sum of gradient magnitudes in all directions (the second direction) is calculated and normalized. The value range is [0, 1], which is used to determine the regularity of the region texture.

[0044] Furthermore, determining the structural similarity parameters for any target region includes: Based on a structural similarity strategy, obtain the first sub-region and the second sub-region from the target region; the second sub-region is adjacent to the first sub-region and has the same range.

[0045] It should be noted that after obtaining the first sub-region, multiple second sub-regions adjacent to the first sub-region can be obtained. These include, for example, effective neighbors that are horizontally or vertically adjacent to the first sub-region, or whose boundary regions are automatically adapted (number of them). 8) Small rectangular pixel blocks of completely identical size constitute the second sub-region.

[0046] Among them, the structural similarity strategy refers to unifying the size of the first and second sub-regions by using a pre-defined sub-region size standard (such as 5×5 pixels or 7×7 pixels).

[0047] The first sub-region refers to a small rectangular pixel block (the smallest unit of image analysis) randomly selected from the target region or selected according to preset rules, and conforming to a preset range threshold. This sub-region is denoted as... (where n is the coordinate of the center point of the sub-region and n is the size corresponding to the range threshold).

[0048] The second sub-region refers to a small rectangular pixel block that is adjacent to the first sub-region (e.g., horizontally adjacent, vertically adjacent, or an effective neighboring region with automatically adapted boundary regions) and has the same size. This is denoted as... This is used for structural similarity comparison with the first sub-region.

[0049] The second sub-region and the first sub-region are directly adjacent in spatial location, with no other pixel blocks separating them, ensuring that the comparison results can reflect the continuity of the local structure within the target area (avoiding structural differences that are irrelevant to defects due to excessive distance).

[0050] "Same range" means that the number of pixels and size specifications of the first and second sub-regions are completely identical, both following the preset range threshold, ensuring that the structural similarity comparison between the two is comparable.

[0051] Based on the first and second sub-regions, structural similarity parameters are determined.

[0052] Among them, the structural similarity parameter (S(x,y)) refers to the quantitative index calculated by the SSIM algorithm, with a value range of [0,1]. It comprehensively considers the similarity between the first sub-region and the second sub-region in three dimensions: brightness, contrast, and structure. The closer the value is to 1, the more consistent the structures of the two regions are, and the closer it is to 0, the more significant the structural differences are. It is used to distinguish between defective areas and flat areas.

[0053] For example, the SSIM algorithm is used to calculate the first sub-region and multiple second sub-regions respectively to determine multiple initial structural similarity parameters. Then, the average value of these multiple initial structural similarity parameters is calculated to obtain the structural similarity parameters.

[0054] It should be noted that the analysis object is the first and second sub-regions of equal size selected from the target area after superpixel segmentation. The SSIM algorithm is used to quantify the similarity between the two in terms of brightness, contrast and structure, and finally obtain the structural similarity parameter (S(x,y)).

[0055] Furthermore, determining the gradient contrast parameters for any target region includes: Calculate the gradient direction and gradient magnitude of each pixel within the target region, and generate a gradient direction histogram.

[0056] Here, a pixel refers to the smallest unit of the image on the seat surface. Each pixel contains grayscale value or RGB color information, and its position can be accurately located using the regional pixel coordinate system (xOy).

[0057] The gradient direction refers to the direction in which the grayscale value of a pixel changes in space. The horizontal direction is calculated using the Sobel operator. ) and vertical direction ( After obtaining the gradient value, it can be obtained through... calculate; The range covers 0°-180° (the gradient direction has no positive or negative sign, only reflects the trend of change).

[0058] Gradient magnitude refers to the rate of change of pixel values ​​in space in an image. It is a non-directional scalar used to quantify the degree of brightness / grayscale change corresponding to a pixel. The more drastic the change, the larger the gradient magnitude (corresponding to image edges, textures, and other features); the more gradual the change, the smaller the gradient magnitude (corresponding to flat areas).

[0059] For example, the first direction is the direction interval with the highest cumulative gradient magnitude in the gradient direction histogram of the target region. That is, the gradient direction histogram divides 0°-180° into a preset number of continuous direction intervals, such as 8 intervals. The first direction refers to the direction in which the pixel grayscale change (gradient) energy is most concentrated in the region, which is used to characterize the dominant extension trend or structural arrangement pattern of the texture.

[0060] A gradient direction histogram is a chart that statistically analyzes the distribution of gradient directions of all pixels within a target area. The horizontal axis represents the gradient direction interval (for example, if the number of bins is set to 8, that is, the 0°-180° range is divided into 8 intervals, each interval being 22.5°), and the vertical axis represents the sum of gradient magnitudes within the corresponding intervals. It is used to characterize the degree of concentration of gradient directions within the area.

[0061] For example, for each target region after SLIC superpixel segmentation, the Sobel operator is used to calculate the gradient direction of all pixels in the region, and then the gradient magnitude of each direction is calculated by dividing the region into intervals of 0°-180° (bins=8) to generate a gradient direction histogram.

[0062] The first direction is determined based on the gradient orientation histogram.

[0063] The first direction refers to the direction interval with the highest amplitude in the gradient direction histogram, also known as the main direction. It reflects the direction in which the pixel gradient changes are most concentrated within the target area and is the core basis for judging the regularity of the texture of the area (the first direction of regular textures is clear and concentrated, while the first direction of defective areas is not obvious).

[0064] The gradient comparison parameter is determined based on the gradient magnitude in the first direction and the gradient magnitude in the second direction; the second direction includes the first direction.

[0065] Gradient magnitude refers to the rate of change of pixel values ​​in space, reflecting the drastic change in pixel brightness / grayscale. Gradient magnitude is a scalar, without direction, and is calculated in the horizontal direction using the Sobel operator. ) and vertical direction ( After the gradient value, by formula The conclusion is as follows.

[0066] The gradient magnitude in the first direction refers to the sum of the gradient magnitudes of all pixels in the target region in the first direction, which is used to quantify the degree of gradient concentration in the first direction.

[0067] The second direction refers to all possible gradient directions within the target area, covering the entire range of 0°-180° (e.g., divided into 8 direction intervals by bins=8), and includes the first direction.

[0068] For example, the gradient magnitude in the second direction refers to the sum of the gradient magnitudes of all pixels within the target region in the second direction (all gradient directions), denoted as... .

[0069] The gradient contrast parameter (D(x,y)) is determined based on the gradient magnitudes in the first direction, the sub-direction, and the second direction, resulting in a normalized quantization parameter (with a value range of [0,1]), which is used to determine the regularity of the region's texture. The closer the value is to 1, the more concentrated the gradient direction of the region is, and the more regular the texture is.

[0070] Furthermore, after determining the gradient comparison parameters based on the gradient magnitudes in the first and second directions, the method further includes: If the gradient comparison parameter is less than the first preset threshold, the target region is marked as an irregular region.

[0071] The first preset threshold is a pre-set critical value used to distinguish whether the texture of a region is regular or not. For example, the first preset threshold can be 0.7, which is set based on the gradient direction concentration characteristics of the regular texture (such as ventilation holes and stitching) on ​​the seat surface.

[0072] The target region can be divided into complete pixel blocks by the semantically segmented effective region of the seat (initial region image), corresponding to the local region of the seat surface, using the SLIC superpixel segmentation algorithm.

[0073] Irregular regions refer to areas where the gradient direction is dispersed and there is no fixed arrangement pattern. They include defective areas (such as wrinkles, scratches, and burns) and flat areas (areas without obvious textures, defects, and with the same structure as adjacent areas). The gradient contrast parameters of irregular regions do not reach the first preset threshold, thus forming a clear distinction from regular regions.

[0074] When the gradient contrast parameter (D(x,y)) of the target area calculated by gradient direction analysis is less than the first preset threshold (0.7), it indicates that the pixel gradient direction in the area is scattered and has no fixed pattern, so it is marked as an irregular area (including defect area or flat area).

[0075] If the gradient comparison parameter is greater than or equal to the first preset threshold, the target region is marked as a regular region.

[0076] Among them, regular areas refer to areas with concentrated gradient directions and fixed arrangement patterns. These mainly include functional or decorative regular textures on the surface of the seat, such as periodically arranged ventilation hole grids and continuous linear decorative stitching. Their core feature is that the gradient contrast parameter reaches or exceeds the first preset threshold, forming a clear distinction from irregular areas (defect areas, flat areas).

[0077] For example, when the gradient contrast parameter (D(x,y)) of the target area calculated by gradient direction analysis is greater than or equal to the preset first preset threshold (0.7), it indicates that the pixel gradient direction in the area is concentrated and has a fixed arrangement pattern, so it is marked as a regular area (including regular textures such as ventilation holes and decorative seams).

[0078] Further, determining the gradient comparison parameter based on the gradient magnitude in the first direction and the gradient magnitude in the second direction includes: The gradient magnitudes in the first direction and the second direction are statistically analyzed, and their proportion in the second direction is used to obtain the gradient comparison parameter. The second direction is perpendicular to the first direction.

[0079] For example, the gradient magnitude in the first direction can be expressed as .

[0080] For example, the gradient magnitude in the secondary direction can be expressed as .

[0081] For example, the gradient magnitude in the second direction can be expressed as .

[0082] For example, the gradient contrast parameters corresponding to each target region can be expressed as: ; in, These are gradient comparison parameters; This represents the cumulative magnitude of gradient change in the first direction within the target region. This is the cumulative value of the gradient change magnitude in the secondary direction perpendicular to the first direction; This represents the cumulative magnitude of pixel values ​​in all directions within the target area. To minimize the value, avoid the denominator being 0 when the gradient is 0, which would invalidate the formula. This is used to calculate the ratio of the sum of the gradient magnitudes in the first direction and the gradient magnitudes in the second direction in the gradient direction histogram to the total sum of gradient magnitudes. This indicates normalization processing.

[0083] Step S103: Determine the dynamic range parameters based on the gradient comparison parameters and structural similarity parameters, and determine the dynamic space parameters based on the gradient comparison parameters.

[0084] Among them, the dynamic range parameter ( The filtering parameters are dynamically adjusted based on the gradient contrast parameter (D(x,y)) and the structural similarity parameter (S(x,y)), and are used to control the smoothness of pixels with similar colors. The formula is as follows: ( Let the initial range be the standard deviation. This is the texture protection factor, with a value range of 0 < <1, based on experience, it can be set to 0.7. This is the defect protection coefficient, with a value range of 0 < <1, based on experience, can be set to 0.85. The minimum threshold for the dynamic range parameter (which can be set to 1.5 based on experience in automotive seat surface inspection scenarios) is set to this value. This dynamic range parameter takes a smaller value in regular areas to protect edges, and a larger value in defect areas to amplify brightness differences and highlight defect features. Simultaneously, a max function is used to constrain the calculation results to prevent the parameter from being too small and causing filtering failure. When the defect is obvious (S≈0) and the texture is regular (D≈1), the core coefficient term in the formula takes its minimum value, thus ensuring... Reaching its minimum value results in the strongest edge preservation. In regions with regular textures (high D) and defects (low S), this core coefficient term becomes smaller, making... Synchronous reduction means that the filter only averages pixels with very similar gray values, thereby sharpening and preserving edges, avoiding blurring of textures and defects, and providing clearer features for subsequent detection models.

[0085] For example, the dynamic range parameter is used to control the smoothness of the filtering. For instance, the dynamic range parameter is a parameter that is adaptively adjusted based on the initial range standard deviation, combined with the gradient contrast parameter (D(x,y)), the structural similarity parameter (S(x,y)), and the corresponding protection coefficient. It is used to control the smoothness of pixels with similar color / grayscale during the filtering process, so as to achieve the goal of regular texture protection and defect feature enhancement.

[0086] Dynamic space parameters ( The filtering parameters are dynamically adjusted based on the gradient contrast parameter (D(x,y)), and are used to control the spatial range of the filter. The formula is as follows: ; ( (where γ is the initial spatial domain standard deviation and γ is the spatial adjustment coefficient). Values ​​are smaller in regular texture regions to limit the filtering range and prevent adjacent textures from being averaged. In regular texture regions (high D). The smaller D value limits the filtering range, preventing the erroneous averaging of distant, irrelevant texture elements and thus preserving the local structure of the texture. In defective regions, the D value is lower. It will be relatively large, allowing for analysis within a slightly larger range, which helps to capture defects with a certain space, such as folds.

[0087] For example, the dynamic spatial parameter is used to control the spatial range of the filter. For instance, the dynamic spatial parameter is a parameter that is adaptively adjusted based on the initial spatial domain standard deviation, combined with the gradient contrast parameter (D(x,y)) and the spatial adjustment coefficient (γ), and controls the range of neighboring pixels included when the weighted average of the center pixel is calculated.

[0088] Furthermore, determining the dynamic range parameters based on the gradient comparison parameters and structural similarity parameters includes: The gradient contrast parameters are weighted by the texture protection coefficient to obtain the first weight adjustment term.

[0089] For example, assume the texture protection factor is . The first weight adjustment term can be expressed as .

[0090] Texture protection factor refers to a preset constant coefficient (value range 0 < 0). <1 (based on experience, it can be set to 0.7), which is used to weaken the smoothness of filtering in the regular region during the calculation of dynamic range parameters.

[0091] The second weight adjustment term is obtained by weighting the complementary values ​​of structural similarity parameters using the defect protection coefficient.

[0092] For example, assume the defect protection factor is The second weight adjustment term can be expressed as .

[0093] The defect protection coefficient refers to a preset constant coefficient (with a value range of 0 < 0). <1 (based on experience, it can be set to 0.85), which is used to enhance the gray-scale difference identification of the defect area in the calculation of dynamic value range parameters.

[0094] The dynamic range parameters are determined based on the initial range standard deviation of the bilateral filter, the first weight adjustment term, and the second weight adjustment term.

[0095] For example, the dynamic range parameter can be represented as: ; in, For dynamic range parameters; The initial range standard deviation for bilateral filtering; This is the texture protection factor. ; This is the defect protection coefficient. ; These are gradient comparison parameters; The parameters are for structural similarity; the max function is used to filter the results.

[0096] For example, the initial standard deviation of the bilateral filtering range refers to the preset basic range parameter in the bilateral filtering algorithm. Before dynamic adjustment, it is used to measure the degree of influence of color / grayscale similarity on the filtering weight (it is a fixed constant and needs to be pre-calibrated according to the characteristics of the seat image (such as fabric material and brightness range).

[0097] Furthermore, the determination of dynamic space parameters based on gradient comparison parameters includes: The gradient comparison parameters are weighted by spatial adjustment coefficients to obtain the third weight adjustment term.

[0098] For example, assume the spatial adjustment factor is The third weight adjustment term can be expressed as .

[0099] The dynamic spatial parameters are determined based on the initial spatial domain standard deviation of the bilateral filter and the third weight adjustment term.

[0100] For example, dynamic space parameters can be expressed as: ; in, For dynamic space parameters; The initial spatial domain standard deviation for bilateral filtering; This is the spatial adjustment coefficient. ; This represents the spatial parameter adjustment coefficient for the current target area; These are the gradient comparison parameters.

[0101] Among them, the initial spatial domain standard deviation of bilateral filtering refers to the basic spatial parameter preset in the bilateral filtering algorithm. It is the initial benchmark value used to measure the degree of influence of spatial distance on the filtering weight before dynamic adjustment (it is a fixed constant and needs to be pre-calibrated according to the seat image resolution and texture density).

[0102] The space adjustment coefficient refers to a preset constant coefficient (value range 0 < 0). <1, needs to be calibrated according to the spatial distribution density of the seat's regular texture), used to limit the filtering range of regular regions in dynamic spatial parameter calculation.

[0103] The spatial parameter adjustment coefficient for the current target region refers to the dynamically calculated variable coefficient, which is determined by the spatial adjustment coefficient. Gradient comparison parameters with the current target region The product of these terms is used to reflect the adjustment range of the current regional spatial parameters.

[0104] Step S104: Perform bilateral filtering on the target region based on dynamic range parameters and dynamic spatial parameters to obtain an optimized image.

[0105] Bilateral filtering refers to an image denoising technique that combines spatial distance weighting and gray-level difference weighting. By calculating the spatial weight (based on dynamic spatial parameters) and value range weight (based on dynamic value range parameters) between the center pixel and neighboring pixels in the target region, the value of the neighboring pixels is weighted and averaged to achieve the effect of smoothing noise while retaining key features, which is different from traditional fixed parameter filtering.

[0106] The optimized image refers to the seat surface image obtained after adaptive bilateral filtering. Its core features are that the edges of regular textures (such as ventilation holes and seams) are clear and not smoothed, the outlines of defects (such as wrinkles and scratches) are prominent and the edges are complete, and noise in flat areas is effectively suppressed.

[0107] For example, the dynamic range parameters (adapting to the color / grayscale processing requirements of the region) and dynamic spatial parameters (adapting to the spatial range processing requirements of the region) of the target region are used as the core filtering parameters. Adaptive bilateral filtering is performed on each target region after SLIC superpixel segmentation. Through the dual constraints of spatial weight and range weight, while suppressing noise in flat regions, the edge integrity of regular textures is preserved and the contour features of defects are highlighted, ultimately obtaining a high-quality optimized image that meets the requirements of subsequent defect detection.

[0108] Furthermore, the step of performing bilateral filtering on the target region based on dynamic range parameters and dynamic spatial parameters to obtain an optimized image includes: Determine spatial weights based on dynamic spatial parameters.

[0109] For example, spatial weights This refers to the weight values ​​calculated based on the spatial distance between pixels in bilateral filtering, as shown in the formula: It is used to quantify the spatial relationship between neighboring pixels and the center pixel. The closer to the center pixel, the greater the spatial weight, and vice versa. It is used to control the spatial range of filtering to ensure that smoothing is performed only on the local area around the center pixel.

[0110] It should be noted that spatial weight is used to characterize the degree of influence of the spatial distance between neighboring pixels and the filtered pixel value of the center pixel. The calculation of spatial weight depends on the Euclidean distance between the neighboring pixels and the center pixel. The closer the distance, the larger the spatial weight, which means that the neighboring pixel has a stronger influence on the filtered value of the center pixel. The farther the distance, the smaller the spatial weight, and the weaker the influence.

[0111] Based on dynamic range parameters ( ) calculate the range weights, and simultaneously based on the dynamic space parameters ( The spatial weights are calculated, and together they constitute the dual weight constraints of the bilateral filter. The range weights are adjusted based on the pixel grayscale difference, and the spatial weights are adjusted based on the pixel spatial distance. Finally, the weighted average is used to achieve adaptive filtering of the target area, which can suppress noise in flat areas while protecting regular textures and highlighting defect edges.

[0112] Determine the range weights based on the dynamic range parameters.

[0113] Among them, the range weight ( The weight value () refers to the weight value calculated based on the gray level / color difference between the center pixel and the neighboring pixels in bilateral filtering. It is used to quantify the gray level similarity between the neighboring pixels and the center pixel. The smaller the gray level difference, the larger the weight value; the larger the difference, the smaller the weight value. It is used to protect image edges (such as regular texture edges and defect contours) while smoothing noise, and to avoid the edges being over-smoothed.

[0114] Based on the adaptively adjusted dynamic range parameters ( The grayscale difference between the center pixel and its neighboring pixels is quantized, and the range weight is calculated using an exponential function. The smaller the grayscale difference, the greater the weight; the greater the difference, the smaller the weight. This weight, together with the spatial weight, constitutes a dual constraint for bilateral filtering, achieving the effects of protecting regular texture edges, highlighting defect contours, and suppressing noise in flat areas.

[0115] For example, the range weight is used to characterize the degree of influence of neighboring pixels on the similarity of the filtered pixel value of the center pixel. The calculation of the range weight depends on the difference in gray values ​​between the neighboring pixels and the center pixel. The smaller the gray value difference, the larger the range weight, and the easier it is for the neighboring pixel to be included in the smoothing calculation of the center pixel, which is suitable for the noise suppression requirements of flat areas. The larger the gray value difference, the smaller the range weight, and the weaker the influence of the neighboring pixel on the center pixel, which is suitable for the edge / texture protection requirements.

[0116] For example, the range weight can protect the edges of regular textures; for instance, reducing the weight of the gray-scale difference area between the seam and the base material avoids smoothing the edges and highlights the defect features; for instance, optimizing the weight of the light and dark difference area of ​​the fold amplifies the boundary contrast between the defect and the surrounding area, while effectively suppressing random noise in flat areas.

[0117] Based on spatial weights and range weights, the filtered pixel values ​​corresponding to the target region are determined.

[0118] Among them, the filtered pixel values This refers to the center pixel within the target region after adaptive bilateral filtering. The final pixel value is calculated using the following formula: Where k is the neighborhood radius, the numerator is the sum of the product of the neighborhood pixel values ​​and the dual weights, and the denominator is the sum of the dual weights. Normalization ensures that the pixel values ​​are within a reasonable range, and it is the output result of the filtering preprocessing.

[0119] Using dynamically adjusted spatial weights (quantizing pixel spatial correlation) and range weights (quantizing pixel grayscale similarity) as dual constraints, within the neighborhood window (radius k) of the center pixel in the target region, the sum of the products of all neighboring pixel values ​​and their corresponding dual weights is calculated, then divided by the sum of the dual weights, and normalized to obtain the filtered pixel value. This process achieves a balance between noise suppression and feature preservation; that is, noise in flat areas is smoothed, the edges of regular textures (such as seams and vents) remain clear, and the contours of defects (such as wrinkles) are fully highlighted, providing high-quality image data for subsequent defect detection models.

[0120] An optimized image is obtained based on pixel values.

[0121] The optimized image refers to the seat surface image formed by recombining all filtered pixel values ​​according to the pixel coordinates of the original image. It is the final output of the adaptive bilateral filtering preprocessing. Regular textures (such as ventilation holes and decorative stitching) have clear edges that are not smoothed out, and irregular defects (such as wrinkles and scratches) have prominent outlines and complete edges. Noise in flat areas is effectively suppressed. Compared with the original image, it is more suitable for the recognition needs of subsequent defect detection models.

[0122] Furthermore, determining the spatial weights based on dynamic spatial parameters includes: ; in, Spatial weights; , for The neighborhood range of a pixel; For neighboring pixels To the center pixel The squared Euclidean distance; e is the local minimum, avoiding the region The formula does not hold true when the value is 0. This represents the natural exponential function with base e as the distance increases. The value is reduced, thus decreasing the weight of distant pixels. i and j are the coordinate offsets of neighboring pixels relative to the center pixel; It is the square of the Euclidean distance; this weight is only related to the spatial distance between pixels. The smaller the value, the faster the weight decays with distance, meaning that only points very close to the center pixel have a large weight, thus achieving edge-preserving smoothness.

[0123] The neighborhood of a pixel refers to a square pixel area formed by extending a fixed number of pixels in both the horizontal and vertical directions, with a central pixel as the core of the target area. Its range is defined by the neighborhood radius k (for example, when k=3, the neighborhood range is 7×7 pixels, that is, all pixels around the central pixel in the 3 pixels).

[0124] The center pixel refers to the target pixel currently being filtered during the bilateral filtering calculation. Its position is precisely located using the regional pixel coordinate system (xOy, with the origin at the top left corner), and its coordinates are (x, y). It is the core reference point in the neighborhood.

[0125] Neighboring pixels refer to all other pixels located within the neighborhood of the center pixel. Their position offset relative to the center pixel is represented by (i, j) (for example, the offset of the right neighboring pixel of the center pixel (x, y) is (1, 0), and the offset of the bottom neighboring pixel is (0, 1)). The coordinates are (x+i, y+j).

[0126] The squared Euclidean distance is a core indicator used to quantify the spatial proximity between the center pixel (x, y) and a neighboring pixel (x+i, y+j). The calculation formula is as follows: (in This is the horizontal offset. (This refers to the vertical offset).

[0127] Further, determining the range weights based on the dynamic range parameters includes: ; in, Weights for the range; This represents the difference in grayscale value between the center pixel and its neighboring pixels. This is a dynamic range parameter; e is the local minimum value, avoiding the region. The formula does not hold true when the value is 0; grayscale difference The larger the value, the smaller the weight. This applies to edge regions (texture or defects). The difference is very small, so even a tiny difference in grayscale will cause the weight to drop sharply, thus preventing pixels across the edge from being averaged and achieving the purpose of protecting the edge.

[0128] In this context, the grayscale value of the center pixel refers to the quantized grayscale value corresponding to the core pixel currently being processed (i.e., the center pixel, with coordinates (x, y)) during the bilateral filtering calculation. (If it is a grayscale image, it is directly the single-channel grayscale value; if it is an RGB image, it is usually the value of the luminance channel or the value after grayscale conversion.) This pixel is the basis for calculating the spatial weight and the range weight, and its position is precisely located using the regional pixel coordinate system (xOy, with the origin at the top left corner).

[0129] The grayscale value of a neighboring pixel refers to the grayscale value of all other pixels located within the (x, y) neighborhood of the center pixel. The neighborhood range is defined by the neighborhood radius k (e.g., when k=3, the neighborhood is a 7×7 pixel area), and the coordinates of the neighboring pixels are determined by their offset relative to the center pixel (...). , )express( , The value range is from -k to k), so its coordinates are (x+i, y+j).

[0130] It should be noted that the grayscale value of a neighboring pixel must be located within the neighborhood window of the center pixel and belong to the effective region Q (excluding the background) of the seat after superpixel segmentation. The smaller the grayscale difference between the neighboring pixel and the center pixel, the larger the corresponding value range weight, and the greater the influence on the filtered value of the center pixel, ultimately achieving a filtering effect that smooths noise while preserving edges.

[0131] Step S105: Input the optimized image into the defect detection model to obtain the detection results of the surface quality of the car seat.

[0132] Among them, the defect detection model refers to the machine vision model (e.g., YOLOv8 model) applicable to the identification of defects on the surface of car seats. After being trained on a large number of seat defect samples (including regular textures and various defects), the model has the ability to distinguish between regular textures and irregular defects. It can automatically identify abnormal areas such as wrinkles, scratches, and burns in images and output information such as the location, type, and confidence level of the defects.

[0133] The inspection results of automotive seat surface quality refer to the final conclusions output by the defect detection model after optimizing image analysis, including a qualitative judgment on the existence of defects (qualified / unqualified); in the case of defects, it is necessary to clarify the specific information of the defects (such as defect type: wrinkles, scratches, etc.; defect location: coordinate range based on the regional pixel coordinate system; defect severity: determined by model confidence level) to provide a basis for seat quality grading and rework repair.

[0134] Furthermore, before determining the dynamic range parameters and dynamic spatial parameters, the process also includes classifying the target region type based on gradient contrast parameters and structural similarity parameters, including: If the gradient comparison parameter of the target area is greater than or equal to the first preset threshold (for example, the first preset threshold can be 0.7), then the target area is determined to be a regular area. Regular areas include areas with fixed direction or periodic arrangement such as ventilation hole grids and decorative seams. If the gradient comparison parameter of the target area is less than the first preset threshold and the structural similarity parameter is less than the second preset threshold (for example, the second preset threshold can be 0.5), then the target area is determined to be a defect area (irregular area). The defect area includes areas with local structural abrupt changes such as wrinkles, scratches, and burns. If the gradient comparison parameter of the target region is less than the first preset threshold and the structural similarity parameter is greater than or equal to the second preset threshold, then the target region is determined to be a flat region. A flat region is a region without obvious texture, without defects and with the same structure as the adjacent regions.

[0135] It should be noted that, with the first preset threshold of 0.7, the determination process for the concentration of gradient directions is as follows: when D(x,y)≥0.7, the pixel gradient directions in the target area are concentrated in the first direction, which conforms to the characteristics of regular texture; with the second preset threshold of 0.5, the determination criterion for structural consistency is: when S(x,y)<0.5, the structural difference between the target area and the adjacent areas is significant, which conforms to the characteristics of defect area (irregular area).

[0136] It should be noted that textured areas, defect areas, and flat areas are mutually exclusive and fully covered region types. Any target region belongs to only one of these types, and the classification result is directly used as the basis for subsequent dynamic parameter adjustments.

[0137] Further, determining the filtered pixel values ​​corresponding to the target region based on spatial weights and range weights includes: By using spatial weights and range weights, each pixel value within the target area that falls within the target preset range is weighted pixel by pixel to obtain the weighted total gray value; the target preset range is the pixel window range divided according to a preset radius with the center pixel as the center.

[0138] For example, the weighted grayscale total value refers to the weighted sum of all pixel values ​​within a neighborhood radius of k; each neighboring pixel is multiplied by its corresponding spatial weight. Sum range weight .

[0139] The total joint weight is determined based on the spatial weight and the range weight.

[0140] For example, the total joint weight refers to the sum of the products of the spatial weights and the range weights of all neighboring pixels within the neighborhood window of the center pixel.

[0141] The filtered pixel values ​​corresponding to the target region are determined based on the total weighted gray value and the total joint weight value.

[0142] For example, taking the neighborhood window of the center pixel as the calculation range, the original gray values ​​of all pixels within the window are multiplied by their corresponding spatial weights and range weights to obtain the weighted gray value of each pixel. Then, all weighted gray values ​​are summed to obtain the total weighted gray value. The products of the spatial weights and range weights of all pixels within the window are summed to obtain the total joint weight value. Based on the ratio of the total weighted gray value to the total joint weight value, the filtered pixel value of the center pixel is determined, thereby completing the filtering process for all pixels within the target area.

[0143] For example, the filtered pixel value corresponding to the target region can be represented by the following formula: ; In the formula, k is the neighborhood radius; It is a weighted sum of the values ​​of all pixels in the neighborhood; each neighboring pixel Each will be multiplied by its corresponding spatial weight. Sum range weight ; The sum of all weights is used; normalization is performed to ensure that the sum of all weights is 1, so that the filtered pixel value... It remains within a reasonable range of pixel values ​​and will not become too bright or too dark due to weighting.

[0144] This invention proposes a rapid detection method for the surface quality of automotive seats. Please refer to [link / reference]. Figure 2 It illustrates a schematic flowchart of a rapid detection method for the surface quality of automobile seats according to an embodiment of the present invention. Figure 2 The method includes the following steps: Step S201: Collect data from the seat to be tested based on the seat detection device.

[0145] The process involves placing the chair to be inspected on a chair inspection platform. Multiple image sensors (cameras) installed within the platform acquire surface images of the chair from multiple angles and locations. These images are then uploaded to the inspection system's processing platform for image data processing. Simultaneously, during image acquisition, a ring light is used to supplement the brightness of the chair, increasing its overall brightness while preventing excessive localized brightness caused by direct light from obscuring defective areas.

[0146] Reference Figure 3 The figure shows a schematic diagram of a seat inspection platform according to the present invention. As shown in the figure, the seat inspection platform is the core hardware carrier for rapid inspection of the surface quality of automobile seats. It is designed to meet the needs of multi-view and blind-angle image acquisition of seats. The platform has a standardized placement area, which supports the placement of the seats to be inspected according to a preset template and can adjust the posture during the inspection process to meet the inspection needs of various components such as seat back, seat cushion, and side. It integrates multiple image sensors (cameras) to form a fixed array. Each camera corresponds to a directional surface of the seat, which can realize comprehensive image acquisition of various parts of the seat to be inspected, and the acquired images of each component will be marked in the order of acquisition.

[0147] Reference Figure 4 The figure shows a schematic diagram of a ring-shaped supplementary light and adjustment device according to the present invention. As shown in the figure, the ring-shaped supplementary light and adjustment device is a key auxiliary device in the image acquisition stage of automotive seat surface quality inspection. It works in conjunction with the seat inspection platform and image sensor (camera). It adopts a surround structure design, which can be adapted to the camera acquisition angle and can provide uniform and soft light illumination for the seat to be inspected. At the same time, it is equipped with a dedicated adjustment function to support flexible adjustment of parameters such as light intensity and illumination angle to adapt to the inspection needs of seats with different fabric materials and color depths. During image acquisition, the device simultaneously turns on the supplementary light, which can not only improve the brightness uniformity of the seat surface and weaken the interference of local shadows on defect identification, but also avoid excessive local brightness caused by direct light, and prevent wrinkles, scratches and other defects from being covered. It ensures that the gray-scale difference and edge features of regular textures (such as ventilation holes and seams) and irregular defects on the seat surface are clearly recorded in the acquired image, providing high-quality raw data support for subsequent semantic segmentation, feature analysis, adaptive bilateral filtering preprocessing and accurate identification of defect detection models.

[0148] For example, the seat to be inspected is placed on the inspection platform according to the template pattern, and each camera corresponds to one direction of the seat to be inspected. By adjusting the seat during the inspection process, image data of each component area to be inspected is acquired, and the data is marked based on the acquisition order of the image data of each component.

[0149] For the acquired seat image data, a regional pixel coordinate system is constructed with the top left corner of the image as the starting point (the horizontal coordinate is , the vertical coordinate is , and 0 is the origin).

[0150] Furthermore, semantic segmentation is performed on single-frame vehicle seat image data to obtain the vehicle seat regions present in the image.

[0151] Step S202: Analyze the detection data to obtain the seat status parameters after the area adjustment.

[0152] Seat surfaces are often decorated with complex patterns to enhance aesthetics and functionality. However, decorative patterns or air conditioning vents can cause regional differences between certain areas and the overall seat. This can lead to the misidentification of patterned areas and defects such as wrinkles as high-frequency noise during noise reduction processing of car seat images, thus affecting image defect recognition. Since decorative areas have regularity, while defects such as wrinkles are irregular, the preprocessing of seat images can be optimized by adjusting the bilateral filtering algorithm parameters based on the feature differences between decorative and defective areas.

[0153] It should be noted that in the process of analyzing the detection data and obtaining the seat state parameters after regional adjustment, regional features can be extracted first and regional anomaly analysis can be performed; and parameter adaptive analysis can be performed on the regional structural similarity.

[0154] To enhance the visual appeal and functionality of images on seats, complex patterns are often used to decorate the seat surface. However, when these patterns are segmented, they are often mistaken for the edges of the regions. In other words, in vehicle seat image data acquired from a single angle, the texture of the seat surface divides the seat into multiple different regions, resulting in low correlation between the regions. In reality, the areas segmented by the seat pattern are all the same region.

[0155] Reference Figure 5 The figure shows a schematic diagram of a seat side front detection image according to the present invention. As shown in the figure, the white texture divides the seat surface into individual small areas, reducing the commonality between the areas. Therefore, a superpixel segmentation algorithm is used for the seat area to be detected to segment pixel areas with similar features into complete areas (target areas) Q.

[0156] Functional areas such as vents have a high degree of regularity in their arrangement. When decorating them, adjustments should be made as much as possible along the regular edges. That is, decorative or functional ventilation meshes, decorative seams, and other textures have regularity, and their lines (arrangements) have a fixed direction. For example, ventilation holes are arranged horizontally / vertically, seams are linear, and the gradient direction is concentrated. On the other hand, defects such as wrinkles or burns caused by abnormal arrangement do not have regularity. They are characterized by no fixed direction and the gradient direction is dispersed.

[0157] Therefore, in the process of identifying abnormal regions, it is necessary to consider the comparison parameters of abnormal regions in different detection areas.

[0158] First, the Sobel operator is used to calculate the gradient direction of the pixel values ​​within the complete contour region Q of the seat, generating a gradient direction histogram (e.g., (Covering 0°-180°).

[0159] Subsequently, the first direction is determined in the gradient orientation histogram, and the direction perpendicular to the first direction is designated as the secondary direction. In regular contours, the regular image and the main image exhibit high similarity (similar trend in contour pattern extension). The ratio of the sum of gradient magnitudes in the first direction to the sum of all gradient magnitudes in the gradient orientation histogram is then calculated. As a gradient comparison parameter within the region: ; In the formula, For pixels exist Gradient magnitude in the direction; The cumulative value of the gradient change magnitude in the first direction within the target region is used as a feature quantization parameter within the seat region. This represents the cumulative magnitude of pixel values ​​in all directions within the target area. This is the cumulative value of the gradient change magnitude in the secondary direction perpendicular to the first direction; To minimize the value, avoid the denominator being 0 when the gradient is 0, which would invalidate the formula. This is used to calculate the ratio of the sum of the gradient magnitudes in the first and second directions to the total sum of gradient magnitudes in the gradient direction histogram. A larger value indicates a more regular gradient change at the pixel level in the first direction. The function normalizes the result.

[0160] Set the threshold to 0.7, when If it has a regular texture (such as ventilation holes or seams), then it may have a regular texture (such as ventilation holes or seams); conversely, when If so, it may be an irregular area (defect or flat area).

[0161] Ventilation holes and other seat areas are designed to avoid creating a sense of separation from the seat surface and affecting aesthetics. These hollow areas are similar in macroscopic structure to the background material around the seat fabric. After being arranged in a regular manner, they are difficult to observe with the naked eye from a certain distance. In contrast, abnormal areas such as wrinkles have abrupt changes in local structure compared to the surrounding smooth areas, resulting in significant regional differences.

[0162] Furthermore, for any image region within the region... (I is the pixel value, x and y are the center point of the region, and n is the range of the region) and adjacent regions By comparing the regional structural representations between them, a structural similarity index algorithm is used to quantify the structural similarity parameters between a local region and its surrounding regions. .

[0163] Within a single area on a car's surface (such as the seat back), aside from logos and other decorative elements, different areas exhibit high similarity. For instance, stitching and regular embossing are regular patterns that require protection, while irregular areas like wrinkles only represent localized anomalies. Furthermore, there are transitional areas between inconspicuous wrinkled areas and smooth, even areas that are easily smoothed when using filtering algorithms. Traditional bilateral filtering, however, uses a fixed... (Standard deviation of range) and (Spatial domain standard deviation) makes it difficult to effectively protect texture and defects while smoothing noise; therefore, it is necessary to... and These two parameters are dynamically adjusted for each pixel.

[0164] After obtaining the gradient contrast parameters and structural similarity parameters for each region, in areas with regular decorative patterns such as embossing, to prevent the texture lines from disappearing due to a smooth transition with the surrounding background, it is necessary to reduce the weight of pixels with similar colors. In contrast, in areas with wrinkles and transitions, due to the color gradient between the texture lines and the background, it is necessary to increase the brightness difference within the area to improve the overall clarity of the region's outline. Therefore, for the current region... and Constructing dynamic range parameters for the current region by comparing the standard deviation of the initial range. .

[0165] Furthermore, wrinkles can create localized protrusions, causing adjacent flat areas to be shadowed by these protrusions. This results in a larger variance in localized texture areas, which should therefore be reduced. Values ​​are used to limit the filtering range and avoid erroneously averaging different structural or texture elements, thereby constructing the dynamic spatial parameters of the current region. .

[0166] Subsequently, a bilateral filtering operation is performed using the dedicated parameters calculated for each pixel (x, y). The filtered pixel value is obtained by a weighted average of the pixel values ​​in its neighborhood, with the weights determined by both spatial distance and grayscale difference. The adjusted... and Perform bilateral filtering.

[0167] First, spatial weights and range weights are reconstructed based on the spatial distance relationships between different regions within the region.

[0168] Accordingly, the adjusted final pixel value parameters for each region are constructed for the bilateral filter core. It can be represented as: ; In the formula, k is the neighborhood radius; It is a weighted sum of the values ​​of all pixels in the neighborhood; each neighboring pixel Each will be multiplied by its corresponding spatial weight. Sum range weight . This is the sum of all weights. Normalization is performed to ensure that the sum of all weights is 1, resulting in a filtered pixel value. It remains within a reasonable range of pixel values ​​and will not become too bright or too dark due to weighting.

[0169] Step S203: Rapid inspection of the surface quality of the car seat.

[0170] This solution is a rapid detection method for the surface quality of automotive seats. Based on the above steps, the adjustment result of the bilateral filter is obtained, and then... Input subsequent defect detection model In order to optimize the bilateral filtering algorithm: Regular textures (ventilation holes, stitching): clear edges, not ground down, to avoid misjudging as defects; Irregular defects (wrinkles): edges remain intact, reducing the rate of missed detection; Flat areas: Noise is effectively suppressed, and image quality is improved.

[0171] Finally, the obtained filtered image is fed into an existing machine vision-based automotive seat defect detection model to achieve rapid detection of the surface quality of the vehicle seats to be inspected.

[0172] In summary, this invention first acquires at least one surface image of the seat to be inspected, divides the image into at least one target region, and calculates the gradient contrast parameter and structural similarity parameter of each region. Then, based on these two parameters, it determines the dynamic range parameter and dynamic spatial parameter. Subsequently, it uses these two dynamic parameters to perform bilateral filtering on the target region to obtain an optimized image. Finally, it inputs the optimized image into a defect detection model to obtain the detection result of the car seat surface quality. By dynamically adjusting the filtering parameters, it is possible to distinguish between regular textures and irregular defects, thereby improving the accuracy of detection.

[0173] This invention proposes a rapid inspection system for the surface quality of automotive seats. Please refer to [link / reference]. Figure 6 The diagram illustrates a structural schematic of a rapid inspection system 600 for automotive seat surface quality according to an embodiment of the present invention. The system includes: The acquisition module 601 is used to acquire at least one seat surface image corresponding to the seat to be detected; Module 602 is used to divide the seat surface image to obtain at least one target region; The calculation module 603 is used to calculate the gradient contrast parameters and structural similarity parameters corresponding to each target region; the gradient contrast parameters are used to characterize the regularity of the texture within the target region; the structural similarity parameters are used to characterize the structural similarity between the target region and adjacent regions. The determining module 604 is used to determine the dynamic range parameter based on the gradient comparison parameter and the structural similarity parameter, and to determine the dynamic space parameter based on the gradient comparison parameter; the dynamic range parameter is used to control the smoothness of the filtering; the dynamic space parameter is used to control the spatial range of the filtering. The module is used to perform bilateral filtering on the target region based on the dynamic range parameters and the dynamic spatial parameters to obtain an optimized image; the optimized image is then input into the defect detection model to obtain the detection result of the surface quality of the car seat.

[0174] It should be noted that the system provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the rapid detection system for automotive seat surface quality provided in the above embodiments and the rapid detection method for automotive seat surface quality are based on the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0175] This invention also provides an electronic device. Please refer to [link to relevant documentation]. Figure 7 The electronic device may include a processor 701, a memory 702, and a program 7021 stored in the memory 702 and executable on the processor 701.

[0176] When program 7021 is executed by processor 701, it can achieve the following: Figure 1 Any steps in the corresponding method embodiments and the achievement of the same beneficial effects will not be repeated here.

[0177] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by hardware related to program instructions, and the program can be stored in a readable medium.

[0178] This invention also provides a readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0179] The computer-readable storage medium of this invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0180] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0181] The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0182] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0183] This invention also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to achieve the rapid detection method for the surface quality of automobile seats provided in the above embodiments.

[0184] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0185] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A rapid detection method for the surface quality of automobile seats, characterized in that, The method includes: Acquire at least one seat surface image corresponding to the seat to be detected; The seat surface image is divided into at least one target region, and the gradient contrast parameter and structural similarity parameter corresponding to each target region are calculated. The gradient contrast parameter is used to characterize the regularity of the texture within the target region, and the structural similarity parameter is used to characterize the structural similarity between the target region and its adjacent regions. Based on the gradient comparison parameters and the structural similarity parameters, dynamic range parameters are determined, and dynamic spatial parameters are determined based on the gradient comparison parameters; the dynamic range parameters are used to control the smoothness of the filtering; the dynamic spatial parameters are used to control the spatial range of the filtering. Based on the dynamic range parameters and the dynamic spatial parameters, bilateral filtering is performed on the target region to obtain an optimized image; The optimized image is input into the defect detection model to obtain the detection results of the surface quality of the car seat.

2. The rapid detection method for the surface quality of automobile seats according to claim 1, characterized in that, The step of performing bilateral filtering on the target region based on the dynamic range parameters and the dynamic spatial parameters to obtain an optimized image includes: Based on the dynamic spatial parameters, spatial weights are determined; the spatial weights are used to characterize the degree of influence of the spatial distance between neighboring pixels and the filtered pixel value of the center pixel. The value range weight is determined based on the dynamic value range parameter; the value range weight is used to characterize the degree of influence of the neighboring pixels on the similarity of the filtered pixel value of the center pixel; Based on the spatial weight and the range weight, the filtered pixel value corresponding to the target region is determined; Based on the pixel values, an optimized image is obtained.

3. The rapid detection method for the surface quality of automobile seats according to claim 1, characterized in that, The process of segmenting the seat surface image to obtain at least one target region, and calculating the gradient contrast parameters and structural similarity parameters corresponding to each target region, includes: Semantic segmentation is performed on the seat surface image to extract an initial region image of the seat surface, and the initial region image is divided into at least one target region; For any target region, determine the gradient contrast parameters and structural similarity parameters.

4. The rapid detection method for the surface quality of automobile seats according to claim 3, characterized in that, Determining gradient contrast parameters for any target region includes: Calculate the gradient direction and gradient magnitude of each pixel within the target region, and generate a gradient direction histogram; Based on the gradient orientation histogram, a first direction is determined; the first direction is the direction interval with the highest cumulative sum of gradient magnitudes in the gradient orientation histogram of the target region. A gradient comparison parameter is determined based on the gradient magnitude in the first direction and the gradient magnitude in the second direction; the second direction includes the first direction.

5. The rapid detection method for the surface quality of automobile seats according to claim 4, characterized in that, After determining the gradient comparison parameter based on the gradient magnitude in the first direction and the gradient magnitude in the second direction, the method further includes: If the gradient comparison parameter is less than a first preset threshold, the target region is marked as an irregular region. If the gradient comparison parameter is greater than or equal to the first preset threshold, the target region is marked as a regular region.

6. The rapid detection method for the surface quality of automobile seats according to claim 3, characterized in that, Determining structural similarity parameters for any target region includes: From the target region, a first sub-region and a second sub-region are obtained according to a structural similarity strategy; the second sub-region is adjacent to the first sub-region and has the same range. Based on the first sub-region and the second sub-region, structural similarity parameters are determined.

7. The rapid detection method for the surface quality of automobile seats according to claim 4, characterized in that, The step of determining the gradient comparison parameter based on the gradient magnitude in the first direction and the gradient magnitude in the second direction includes: The gradient magnitudes in the first direction and the secondary direction are statistically analyzed, and their proportions in the gradient magnitude in the second direction are used to obtain a gradient comparison parameter; the secondary direction is perpendicular to the first direction.

8. The rapid detection method for the surface quality of automobile seats according to claim 1, characterized in that, The step of determining the dynamic range parameter based on the gradient comparison parameter and the structural similarity parameter includes: The gradient contrast parameters are weighted using a texture preservation coefficient to obtain a first weight adjustment term; The complementary values ​​of the structural similarity parameters are weighted by the defect protection coefficient to obtain the second weight adjustment term; The dynamic range parameters are determined based on the initial range standard deviation of the bilateral filter, the first weight adjustment term, and the second weight adjustment term.

9. The rapid detection method for the surface quality of automobile seats according to claim 1, characterized in that, The determination of dynamic space parameters based on the gradient comparison parameters includes: The gradient comparison parameters are weighted by spatial adjustment coefficients to obtain the third weight adjustment term; The dynamic spatial parameters are determined based on the initial spatial domain standard deviation of the bilateral filter and the third weight adjustment term.

10. The rapid detection method for the surface quality of automobile seats according to claim 2, characterized in that, Determining the filtered pixel value corresponding to the target region based on the spatial weight and the range weight includes: The spatial weight and the range weight are used to perform pixel-by-pixel weighted processing on each pixel value within the target region that falls within the target preset range, to obtain a weighted total gray value; the target preset range is a pixel window range divided according to a preset radius with the center pixel as the center; The total joint weight is determined based on the spatial weight and the range weight. The filtered pixel value corresponding to the target region is determined based on the weighted gray value and the joint weight value.