An image sensor-based method and system for monitoring the quality of automobile parts
By synchronously controlling the timing of the lighting source and image sensor, and combining the material spectral library and geometric feature analysis, efficient and accurate detection of automotive parts made of multiple materials is achieved. This solves the problems of single detection dimension and insufficient identification of micro-defects in existing technologies, and improves detection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN TOURAN ELECTRONIC TECH CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies for automotive parts inspection suffer from several drawbacks, including limited inspection dimensions, poor adaptability to various material scenarios, insufficient ability to identify micro-defects, and difficulty in achieving rapid, non-contact, full-field inspection.
By controlling the wavelength switching timing of the lighting source to synchronize with the frame exposure timing of the image sensor, the reflection image sequence of the automotive parts surface at different wavelengths is obtained. The wavelength response curve is fitted pixel by pixel. The parts surface is divided into multiple material regions using a preset material spectrum library. Geometric features are extracted for each region, and abnormal points are identified to output quality monitoring results.
It enables simultaneous material compliance verification, appearance defect detection, and geometric dimension measurement in a single scan, significantly improving detection efficiency and overall accuracy. It can identify microscopic defects that are difficult to detect using traditional methods, such as micron-level coating peeling and material texture changes.
Smart Images

Figure CN122243942A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image sensor technology, and in particular to a method and system for quality monitoring of automotive parts based on image sensors. Background Technology
[0002] With the rapid development of the automotive manufacturing industry towards intelligence and automation, the quality inspection of automotive parts has become a critical link affecting the safety and reliability of the entire vehicle. Traditional manual visual inspection or contact measurement methods are not only inefficient and highly subjective, but also difficult to meet the demands of large-scale, high-precision production. Especially against the backdrop of the rapid popularization of new energy vehicles and intelligent driving technologies, the trend of miniaturization and increasing complexity of parts is becoming increasingly apparent, significantly raising the requirements for inspection accuracy, speed, and consistency.
[0003] The maturity and cost reduction of image sensor technologies (such as CCD / CMOS) have opened up new possibilities for industrial visual inspection. By combining high-resolution image acquisition, intelligent algorithm analysis, and automated control, rapid, non-contact inspection of multi-dimensional features such as component dimensions, appearance defects, and assembly integrity can be achieved. However, existing technologies still have many limitations in practical applications, such as poor adaptability to environmental interference, insufficient accuracy in detecting complex curved surfaces, and low system integration, which restrict the large-scale application of this technology in the automotive manufacturing field. Therefore, developing an efficient, stable, and easily integrated image sensor-based automotive component quality monitoring technology is of significant industrial importance for improving the intelligence level of the automotive manufacturing industry, reducing quality inspection costs, and ensuring product consistency.
[0004] Prior art 1, Chinese Patent Application No. 202311417993.8, discloses an automotive parts production management system and its method. First, it acquires reference images and monitoring reference images of automotive parts, as well as multiple appearance parameter values of the automotive parts. Then, it calculates the difference between the reference images and monitoring reference images acquired by the camera through a Siamese network model to obtain a difference feature map. Next, it arranges the multiple appearance parameter values of the automotive parts acquired by the laser rangefinder and passes them through a third convolutional neural network to obtain an appearance feature map. Finally, it performs an order-based displacement transition on the difference feature map and the appearance feature map and passes it through a classifier to obtain a classification result, thereby determining whether the automotive parts are qualified. While achieving high-precision inspection of automotive parts has improved the efficiency of production management systems and quality control capabilities, simply extracting features by combining visible light image difference with appearance parameters cannot distinguish image differences caused by non-defect factors such as lighting and surface texture, which can easily lead to misjudgments. Simply splicing image features with appearance parameter features lacks quantitative analysis of the optical properties of materials, making it difficult to detect spectrally sensitive defects such as micro-coating unevenness and oxidation discoloration. The twin network model requires a large number of qualified / unqualified samples for training and has poor adaptability to new products or material changes.
[0005] Prior art two, Chinese patent application number 202311281903.7, discloses a big data-based automotive parts quality monitoring system, including the following steps: Step 1: Collect parameters of each weld joint of automotive frame parts, and analyze welding problems that occur at each weld joint during the welding process based on these parameters; Step 2: Use high-precision sensors to measure the area of the weld joint and calculate the area of unwelded areas caused by missing welds; Step 3: The monitoring system improves the clarity of the weld joint appearance image based on existing monitoring angles, and monitors welding problems and influencing parameters; Step 4: Monitor and sample the frame welding process, analyze the high-frequency parameters affecting welding based on the repair welding time of each problematic weld joint, and optimize and adjust them; Step 5: The system visualizes the analysis results and solutions for welding problems and generates a monitoring report. While it features enhanced quality monitoring of the welding process for chassis components and improved the pass rate of finished chassis components, it only quantifies the area of missing welds and cannot identify appearance defects in non-welded areas, such as scratches, corrosion, and assembly flaws. It does not consider scenarios where multiple materials are mixed on the surface of components, such as the junction of rubber seals and metal shells, and cannot distinguish between material boundaries and actual defects. It requires the use of sensors to directly measure the area, making it difficult to achieve non-contact, high-speed, full-field inspection.
[0006] Prior art three, Chinese patent application number 202411528136.X, discloses an ultrasonic image processing method, automotive parts processing equipment, and a media program. This method is applied to automotive parts processing equipment, which includes an ultrasonic sensor. The method includes: determining the target relative position parameters between the automotive parts processing equipment and a target object using the ultrasonic sensor; determining a first working parameter corresponding to the target relative position parameters; and controlling the ultrasonic sensor to operate with the first working parameter to obtain a first image of the target object. While this method can improve the ultrasonic imaging effect of automotive parts processing equipment and enhance the accuracy of weld point identification, it is only suitable for detecting internal weld points or structural defects and cannot cover optical property quality issues such as surface appearance, color, and coating. The point-by-point ultrasonic scanning method is time-consuming and difficult to integrate into high-speed production lines for real-time monitoring; it is also insensitive to surface defects such as paint color difference, coating peeling, and contamination adhesion.
[0007] Current technologies 1, 2, and 3 suffer from limitations such as limited detection dimensions, poor adaptability to various material scenarios, insufficient micro-defect identification capabilities, and difficulty in achieving rapid, non-contact, full-field detection. Therefore, this invention provides a method and system for quality monitoring of automotive components based on an image sensor. Summary of the Invention
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] One aspect of the present invention provides a method for quality monitoring of automotive parts based on an image sensor, comprising the following steps:
[0010] By controlling the wavelength switching timing of the illumination source to synchronize with the frame exposure timing of the image sensor, a sequence of reflective images of the surface of automotive parts at different wavelengths is obtained.
[0011] By fitting the wavelength response curve pixel by pixel to the reflection image sequence, the spectral reflection feature vector of each point on the surface of the automotive parts is obtained.
[0012] Based on the spectral reflectance feature vector, the surface of automotive parts is divided into multiple material regions by comparing with a preset material spectral library. Geometric features are extracted for each material region, abnormal points within the region are identified, and quality monitoring results are output.
[0013] Another aspect of the present invention provides an image sensor-based automotive parts quality monitoring system, comprising:
[0014] The image sequence acquisition module is used to acquire a sequence of reflection images of the surface of automotive parts at different wavelengths by controlling the wavelength switching timing of the illumination source and synchronizing it with the frame exposure timing of the image sensor.
[0015] The curve fitting module is used to perform pixel-by-pixel wavelength response curve fitting on the reflection image sequence to obtain the spectral reflection feature vector of each point on the surface of the automotive parts.
[0016] The results output module is used to divide the surface of automotive parts into multiple material regions based on the spectral reflectance feature vector and by comparing with a preset material spectral library. It also extracts geometric features for each material region, identifies abnormal points within the region, and outputs the quality monitoring results.
[0017] This invention ensures spatiotemporal consistency of multi-band data through synchronous acquisition; constructs high-dimensional feature descriptions through spectral fitting; and implements differentiated detection strategies through material zoning. Ultimately, the system can simultaneously complete material compliance verification, appearance defect detection, and geometric dimension measurement in a single scan, significantly improving detection efficiency and overall accuracy. Spectral features respond better to microscopic surface changes, such as micrometer-level coating peeling, than traditional intensity images; the material classification mechanism can distinguish between real defects and permissible material texture variations; and it is applicable to complex components made of mixed materials such as metals, plastics, and composites. Attached Figure Description
[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0019] Figure 1 This is a flowchart of the image sensor-based automotive parts quality monitoring method provided in Embodiment 1 of the present invention;
[0020] Figure 2 This is a schematic diagram of the image sensor-based automotive parts quality monitoring method provided in Embodiment 1 of the present invention.
[0021] Figure 3 This is a process diagram of obtaining a sequence of reflection images of the surface of an automotive component at different wavelengths, as provided in Embodiment 3 of the present invention.
[0022] Figure 4 This is a process diagram of obtaining the spectral reflectance feature vectors of various points on the surface of automotive parts as provided in Embodiment 8 of the present invention;
[0023] Figure 5 This is a process diagram of identifying abnormal points within a region as provided in Embodiment 10 of the present invention;
[0024] Figure 6 This is a block diagram of the image sensor-based automotive parts quality monitoring system provided in Embodiment 16 of the present invention;
[0025] Figure 7 A block diagram of the electronic device provided by the present invention;
[0026] Figure 8 A block diagram of a computer-readable storage medium provided for this invention.
[0027] Reference numerals: 1. Image sequence acquisition module; 2. Curve fitting module; 3. Result output module; 4. Central processing unit / microprocessor / main control chip; 5. Storage medium; 6. Data bus; 7. Input / output bus / external bus / device bus; 8. Display; 9. Input / output device; 10. Computer-readable instructions; 11. Non-transitory computer-readable storage medium. Detailed Implementation
[0028] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0029] Hereinafter, the terms "first," "second," etc., are used for descriptive convenience only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0030] In this invention, unless otherwise explicitly specified and limited, the term "connection" should be interpreted broadly. For example, "connection" can be a fixed mechanical connection, a detachable mechanical connection, or an integral part; or, "connection" can be a direct connection or an indirect connection through an intermediate medium. Furthermore, unless otherwise explicitly specified and limited, the term "coupling" should be interpreted broadly. For example, "coupling" can be a direct electrical connection, such as physical contact and electrical conduction between two components; it can also be understood as an electrical connection between different components in a circuit structure through physical lines capable of transmitting electrical signals, such as copper foil or wires on a printed circuit board (PCB), to transmit electrical signals; or, "coupling" can be an indirect electrical connection between two components through an intermediate medium; or, "coupling" can be an electrical connection between two components in a non-contact manner, such as an electrical connection between two components using capacitive coupling to transmit electrical signals.
[0031] In this embodiment of the invention, directional terms such as "up," "down," "left," and "right" may be defined relative to the orientation of the components shown in the accompanying drawings. It should be understood that these directional terms can be relative concepts, used for relative description and clarification, and can change accordingly depending on the orientation of the components in the accompanying drawings.
[0032] Example 1: As Figure 1 As shown, this embodiment of the invention provides a method for quality monitoring of automotive parts based on an image sensor, comprising the following steps:
[0033] Step S100: By controlling the wavelength switching timing of the illumination source to synchronize with the frame exposure timing of the image sensor, a sequence of reflection images of the surface of automotive parts at different wavelengths is obtained;
[0034] Step S200: Fit the wavelength response curve pixel by pixel to the reflection image sequence to obtain the spectral reflection feature vector of each point on the surface of the automotive parts;
[0035] Step S300: Based on the spectral reflectance feature vector, the surface of the automotive parts is divided into multiple material regions by comparing with the preset material spectrum library. Geometric features are extracted for each material region, abnormal points in the region are identified, and the quality monitoring results are output.
[0036] The reflection image sequence at different wavelengths refers to a set of images acquired in step S100 by controlling the illumination source to emit light of various wavelengths sequentially and precisely synchronizing with the frame exposure sequence of the image sensor, thereby capturing the same automotive component surface. Each frame in this set of images corresponds to a specific illumination wavelength, recording the intensity distribution of reflected light on the automotive component surface under that wavelength. The sequence constitutes the basic data for analysis, used to capture the differentiated responses of different materials on the automotive component surface to different wavelengths. The spectral reflectance feature vector of each point on the automotive component surface refers to the data structure obtained after pixel-by-pixel analysis of the aforementioned reflection image sequence in step S200. For each pixel position in the automotive component surface image, its grayscale value in all different wavelength images is extracted, and the grayscale values are arranged in order of the corresponding wavelength to form a multidimensional vector. The multidimensional vector quantitatively describes the reflection characteristics of a spatial location at different wavelengths and is the core basis for distinguishing the material type and surface condition of that location, such as coating, oxidation, and contamination. The material region refers to the result of dividing the surface of the automotive parts in step S300 based on the aforementioned spectral reflectance feature vector and comparing it with standard data in a preset material spectral library. The preset material spectral library contains standard reflectance features of various materials that may be involved in automotive parts, such as metals, plastics, rubber, glass, and coatings at different wavelengths. Through comparison, the surface of the automotive parts is divided into multiple continuous regions with consistent material properties. For example, metal shells, rubber seals, and glass lenses are accurately distinguished in the image. Anomalies refer to the defect locations determined in step S300 by extracting and identifying the geometric features of each divided material region. Specifically, within a specific material region, isolated pixels or sets of pixels that are inconsistent with the overall geometry of the region or deviate from the preset standard geometric model are marked by analyzing the geometric shape, edges, texture, and other features of the region. These represent potential surface defects, such as scratches, dents, foreign matter attachments, burrs, and damage, and are ultimately output as quality monitoring results.
[0037] In the above embodiments, this embodiment ensures strict spatial alignment and temporal consistency of images in each band during dynamic acquisition by precisely matching the wavelength switching sequence of the illumination source with the exposure sequence of the image sensor frames. This effectively suppresses image registration errors caused by component movement or environmental interference, providing a high-precision data foundation for subsequent pixel-level spectral analysis. Pixel-by-pixel wavelength response curve fitting is performed on the multi-band reflectance image sequence, extending the two-dimensional image information to a continuous spectral dimension. This quantifies the differences in optical properties of surface materials, enhancing sensitivity to subtle defects that are difficult to distinguish using traditional grayscale or RGB images, such as color gradations, uneven coating thickness, and micro-oxidation. This embodiment classifies surface materials by comparing them to a preset material spectral library, dividing the surface of automotive parts into sub-regions with consistent physical properties. Combining the geometric features of each region, such as curvature and texture direction, establishes a partitioned detection standard, reducing the probability of misjudgment due to material differences and improving the targeting and detection accuracy of local anomalies such as scratches, foreign matter adhesion, and corrosion.
[0038] In summary, this embodiment ensures spatiotemporal consistency of multi-band data through synchronous acquisition; constructs high-dimensional feature descriptions through spectral fitting; and implements differentiated detection strategies through material zoning. Ultimately, the system can simultaneously complete material compliance verification, appearance defect detection, and geometric dimension measurement in a single scan, significantly improving detection efficiency and overall accuracy. Spectral features respond better to microscopic surface changes, such as micron-level coating peeling, than traditional intensity images; the material classification mechanism can distinguish between real defects and permissible material texture variations; and it is suitable for complex automotive parts containing a mixture of metals, plastics, and composite materials.
[0039] Example 2: As Figure 2 As shown, based on Example 1, the process of obtaining the reflection image sequence of the surface of automotive parts at different wavelengths in step S100 of this embodiment of the invention specifically includes the following steps:
[0040] Step S101: Using the speed pulse signal output in real time by the speed encoder upstream of the conveyor line, combined with the preset exposure start distance and exposure duration distance, a set of illumination trigger pulse trains corresponding to different wavelengths are generated. The pulse interval of each pulse train is inversely proportional to the conveying speed.
[0041] Step S102: The generated illumination trigger pulse train is input into the semiconductor light source driving circuit of the corresponding wavelength, and each pulse triggers the instantaneous lighting of the light source of the wavelength once; at the same time, the image sensor is driven to perform single-line exposure at the moment the light source is lit, and the row reflection data of the surface of the automotive parts under the wavelength is collected line by line as the automotive parts move with the conveyor line.
[0042] Step S103: All row reflection data collected for the same wavelength are stitched together into a complete wavelength reflection image according to the acquisition time sequence; then, the reflection images of all wavelengths are arranged in order from shortest to longest wavelength to form a multi-wavelength reflection image sequence.
[0043] In the above embodiments, this embodiment achieves high-precision synchronous acquisition of multi-wavelength reflection images of automotive parts under dynamic transmission conditions. Specific technical effects are as follows: Based on speed-encoded pulse trigger control, a pulse train of illumination triggers inversely correlated with the transmission speed is generated in real time using speed pulse signals. This ensures that the trigger frequency of each wavelength light source strictly matches the movement displacement of the automotive parts at different transmission speeds, eliminating image stretching or compression distortion caused by speed fluctuations and providing a stable spatiotemporal reference for image stitching. The synchronization effect of line scanning exposure and wavelength light source illumination adopts a method of strict synchronization between single-line exposure and instantaneous wavelength light source illumination, acquiring reflection data line by line during transmission. This avoids motion blur caused by component movement during global exposure. Simultaneously, by precisely controlling the wavelength corresponding to each line exposure time, it ensures that the reflection intensity acquisition of each pixel at different wavelengths has consistent surface position correspondence. The construction effect of the multi-wavelength image sequence involves stitching single-wavelength line data according to the acquisition sequence to form a complete reflection image, and then arranging the images according to wavelength order to construct a three-dimensional data cube with spatial alignment and spectral continuity. This also preserves surface geometric details and spectral features, providing directly processable standardized input for pixel-level spectral analysis.
[0044] In this embodiment, the velocity-encoded pulse generation enables dynamic adaptation between illumination triggering and transmission displacement; the line exposure synchronization mechanism ensures the spatial accuracy and wavelength specificity of each line of data; temporal stitching and wavelength sorting construct a standardized multi-band image sequence; ultimately, it achieves high-fidelity acquisition of multi-wavelength reflection data of moving automotive parts under continuous transmission conditions, providing a reliable data foundation for spectral feature extraction and defect detection.
[0045] Example 3: Based on Example 2, the process of driving the image sensor to perform single-line exposure at the moment the light source is lit in step S102 of this embodiment of the invention specifically includes the following steps:
[0046] Step S1021: Each pulse in the illumination trigger pulse train is simultaneously sent to the global trigger port of the image sensor and the light source driving circuit of the corresponding wavelength; the row address counter inside the image sensor locks the current count value as the exposure row number on the rising edge of the pulse and starts the photoelectric conversion accumulation process of the row pixel array.
[0047] Step S1022: During the continuous period when the light source driving circuit illuminates the light source of the corresponding wavelength, the locked row pixel continuously receives reflected light from the corresponding row position on the surface of the automotive parts to accumulate photogenerated charge; when the falling edge of the pulse arrives, the integration controller inside the image sensor terminates the row exposure and transfers all the accumulated charge in the row to the row buffer register in parallel.
[0048] Step S1023: During the interval before the next illumination trigger pulse arrives, the readout light source driving circuit in the image sensor converts the charge in the row buffer register column by column into digital grayscale values, forming a row of reflection data, and stores it in the temporary row memory; at the same time, the row address counter automatically increments, ready to receive the next pulse to expose the next row.
[0049] The illumination trigger pulse train is a set of timing signals generated by combining speed encoder pulses with preset distance parameters. Each pulse corresponds to an exposure command at a specific lateral position on the surface of the automotive part. The pulse interval is adjusted in real time with the conveyor speed to ensure that the moving automotive parts are sampled at equal intervals in the spatial dimension, laying the foundation for accurate reconstruction of the geometry of the automotive parts. The global trigger port is the input interface on the image sensor used to receive external synchronization signals. The illumination trigger pulse directly controls the exposure timing inside the sensor through this port, ensuring that each exposure is precisely synchronized with the illumination of the light source. This avoids image stretching or compression deformation caused by conveyor line vibration or speed fluctuations, ensuring the accuracy of automotive part size measurement. The light source drive circuit is an electronic module that connects the illumination source and the trigger pulse. After receiving the illumination trigger pulse, it drives the light source of the corresponding wavelength to illuminate instantaneously during the high level of the pulse, providing the image sensor with narrowband illumination that matches the optical properties of the automotive part surface material, thereby enhancing the reflection differences of different materials, such as metal housings and rubber seals, at different wavelengths. The exposure row number refers to the value locked by the row address counter inside the image sensor on the rising edge of the pulse. It identifies the position of the current exposure row in the sensor's pixel array and corresponds one-to-one with the physical position of the automotive part along the transport direction, ensuring that each row of reflection data can be accurately assigned to the real spatial coordinates of the automotive part. Photogenerated charge accumulation refers to the process by which the pixel unit of the locked row converts the received reflected light into charge and stores it during the duration of the light source illumination. The accumulated charge is proportional to the reflection intensity of the corresponding wavelength on the surface of the automotive part at that row position. Reflection intensity is used to quantitatively analyze material properties or identify surface anomalies, such as coating defects or oxide patches. Reflection data refers to the one-dimensional array formed by the readout circuit converting the charge in the row buffer register column by column into digital grayscale values. It represents the reflection distribution of a transverse section of the automotive part surface at a specific wavelength. After sequentially stitching together the reflection data of all rows, a complete image of the automotive part surface at that wavelength can be reconstructed for further spectral analysis and defect identification.
[0050] In the above embodiments, this embodiment synchronously transmits the illumination trigger pulse train to the global trigger port of the image sensor and the light source driving circuit, achieving precise synchronization between the image sensor exposure timing and the light source illumination. The row address counter locks the exposure row number and initiates photoelectric conversion on the rising edge of the pulse, ensuring that the exposure start time of each row pixel is strictly aligned with the illumination time of the corresponding wavelength light source. During the continuous illumination of the light source, the locked row pixels continuously receive reflected light from the corresponding row position on the surface of the automotive parts and accumulate charge, ensuring that the row pixels can fully acquire the reflected light information of the target wavelength. The falling edge of the pulse triggers the integral controller to terminate the exposure and transfers the accumulated charge in parallel to the row buffer register, achieving precise control of the exposure duration and efficient charge transfer. During the pulse interval, the readout circuit converts the charge in the row buffer register into a digital grayscale value and stores it in the temporary row memory. Simultaneously, the row address counter automatically increments to prepare for the next row exposure, forming a continuous row exposure-readout pipeline operation. This embodiment achieves row-by-row synchronous illumination and imaging of the surface of automotive parts. While ensuring that the reflected light information of each wavelength is collected independently, strict timing control avoids inter-row crosstalk, providing a high-quality raw image data foundation for accurate fusion of multispectral data and defect identification.
[0051] Example 4: Based on Example 3, the startup process of the light source driving circuit in step S1021 provided in this embodiment of the invention specifically includes the following steps:
[0052] Step S10211: When the automotive parts move along the conveyor line and pass through the first preset spatial position, the first N illumination trigger pulses of the conveyed light source drive circuit are used to sequentially light up multiple semiconductor light sources of different wavelengths according to the preset broadband scanning mode, so that the image sensor can synchronously collect temporary reflection data sequences of the same row position on the surface of the automotive parts at different wavelengths.
[0053] Step S10212: Input the acquired temporary reflection data sequence into the light source driving circuit for real-time spectral analysis, calculate the reflection intensity distribution of each pixel at the row position under multiple wavelengths, and identify the two wavelengths with the largest difference in reflection intensity, which are marked as the first enhancement wavelength and the second enhancement wavelength, respectively.
[0054] Step S10213: Real-time spectral analysis writes the driving current parameters corresponding to the first enhancement wavelength and the second enhancement wavelength into the current adjustment register of the light source driving circuit, replacing the original broadband scanning parameters; when the illumination trigger pulse arrives, the light source driving circuit illuminates the semiconductor light source with two wavelengths and performs line-by-line exposure acquisition of the remaining positions of the automotive parts.
[0055] In the above embodiments, this embodiment constitutes an adaptive illumination and imaging method based on initial spectral detection. Through real-time analysis of a small amount of initial row data, the method automatically identifies the feature wavelength pairs most sensitive to the surface features of the current automotive parts, and uses only these two wavelengths for illumination and imaging in subsequent scans. This method significantly reduces data acquisition and illumination energy consumption while ensuring the spectral discrimination required for defect detection, improving scanning efficiency and system adaptability, and providing multispectral image data with both high feature contrast and greater compactness for defect identification.
[0056] Example 5: Based on Example 4, the process of calculating the reflection intensity distribution of each pixel at the row position under multiple wavelengths in step S10212 of this embodiment of the invention specifically includes the following steps:
[0057] Step S102121: Arrange the pixel gray values corresponding to the same row position in each frame of the temporary reflection data sequence in order of wavelength from shortest to longest to form the initial intensity sequence of each pixel at the row position;
[0058] Step S102122: Normalize the initial intensity sequence of each pixel, extract the maximum and minimum values in the initial intensity sequence as reference values, and convert each gray value in the initial intensity sequence into a relative proportion with the reference value to obtain the relative intensity spectrum of each pixel.
[0059] Step S102123: Merge the relative intensity spectra of all pixels at the same row position according to the arrangement order of the pixels in the row direction to form an intensity distribution matrix that reflects the relative relationship of the reflection intensity of each pixel in the row at different wavelengths.
[0060] In the above embodiments, this embodiment realizes the transformation process from raw multi-frame grayscale image data to standardized spatial-spectral distribution data. By independently normalizing each pixel based on its own extreme value, the influence of non-uniform illumination and sensor response inconsistency on spectral shape analysis is effectively suppressed, highlighting the relative change pattern of reflectance of each pixel at different wavelengths. The final generated intensity distribution matrix retains the spectral shape characteristics of each spatial point in the row direction with a consistent standard, providing a reliable and interference-resistant data foundation for accurately identifying the characteristic wavelength with the largest difference in reflection intensity, and ensuring that subsequent wavelength selection decisions have high sensitivity to subtle spectral differences on the surface.
[0061] Example 6: Based on Example 5, the process of forming an intensity distribution matrix reflecting the relative relationship of reflection intensity of each pixel in a row at different wavelengths in step S102123 of this embodiment of the invention specifically includes the following steps:
[0062] Step S1021231: The relative intensity spectrum of all pixels at the same row position is obtained and written into a row buffer array in order from left to right according to the physical arrangement order of the row pixels in the image sensor. Each storage unit of the row buffer array corresponds to a spatial micro-element on the surface of the car part along the row direction. The storage unit stores the intensity ratio value of the spatial micro-element under all scanning wavelengths.
[0063] Step S1021232: Extract the intensity ratio values of each wavelength in each storage cell from the row cache array, use the wavelength in ascending order as column index, and use the arrangement number of the storage cell in the row cache array as row index to fill the corresponding row and column positions of a two-dimensional data matrix, so that each row of the two-dimensional data matrix represents a spatial micro-element and each column represents the reflection intensity ratio under a wavelength.
[0064] Step S1021233: Bind the value of each element in the filled two-dimensional data matrix to the spatial coordinates of the row position on the surface of the automotive parts to generate a three-dimensional data block that simultaneously contains spatial coordinate information, wavelength information, and reflection intensity ratio information. The three-dimensional data block is the intensity distribution matrix of the current row position, which is used to identify the material differences and potential defects of each spatial micro-element in the row.
[0065] In the above embodiments, this embodiment realizes the systematic construction from discrete pixel spectral data to a structured spatial-spectral joint distribution model; through the intermediate storage and ordered mapping of the row cache array, the accurate preservation of spatial adjacency is ensured; through the construction of a two-dimensional matrix, the orthogonal decomposition and regular expression of the spectral and spatial dimensions are realized; finally, through the three-dimensional data block formed by coordinate binding, the reflection intensity ratio information, wavelength information and precise spatial location information are integrated; the intensity distribution matrix provides a data foundation for subsequent analysis that simultaneously possesses spatial continuity, spectral comparability and positional accuracy, enabling the material spectral characteristics of each spatial micro-element in the row to be quantitatively compared and pattern recognized in a unified reference system, significantly improving the accuracy and reliability of material differentiation and micro-defect detection based on spectral differences.
[0066] Example 7: Based on Example 6, the process of binding the value of each element in the filled two-dimensional data matrix with the spatial coordinates of the row position on the surface of the automotive parts in step S1021233 of this embodiment of the invention specifically includes the following steps:
[0067] Step S10212331: Read the cumulative pulse count value of the speed encoder corresponding to the current exposure line from the conveyor control system, calculate the difference between the cumulative pulse count value of the speed encoder and the pulse base number of the system preset starting reference point to obtain the relative pulse increment; multiply the relative pulse increment by the equivalent conveying distance corresponding to each pulse to calculate the absolute position coordinates of the current line in the length direction of the automotive parts.
[0068] Step S10212332: Multiply the row index number of each row in the obtained two-dimensional data matrix by the physical size corresponding to a single pixel of the image sensor in the row direction to obtain the relative position coordinates of each spatial micro-element in the width direction of the automotive part; combine the relative position coordinates of the automotive part in the width direction with the obtained absolute position coordinates in the length direction to form a two-dimensional spatial coordinate pair for each spatial micro-element.
[0069] Step S10212333: Use the two-dimensional spatial coordinates of each spatial micro-element as the index identifier of the spatial dimension, use the wavelength order as the index identifier of the spectral dimension, and write the reflection intensity ratio of the corresponding micro-element and the corresponding wavelength in the two-dimensional data matrix into a designated cell of a three-dimensional data storage area in sequence; after writing all micro-elements and all wavelengths, generate a three-dimensional data block that simultaneously contains two-dimensional spatial coordinates, spectral wavelength information and reflection intensity ratio. The three-dimensional data block binds the intensity distribution matrix of the spatial coordinates to the current row position.
[0070] In the above embodiments, this embodiment achieves precise spatial registration from the image sensor coordinate system to the automotive component world coordinate system, and extends from a two-dimensional spectral matrix to a three-dimensional spatial-spectral data structure. By converting encoder pulses to distance equivalents, a high-precision absolute position along the transmission direction is obtained; by converting pixel size to index number, a precise relative position perpendicular to the transmission direction is obtained. The two-dimensional spatial coordinate pair formed by these two combinations provides a unique and traceable physical location identifier for each spectral measurement point on the component surface. The final constructed three-dimensional data block associates the reflection intensity ratio value with specific spatial location and wavelength, forming a spatial-spectral joint distribution representation with clear physical meaning. The data model enables subsequent analysis to directly perform regional positioning, feature association, and defect spatial distribution statistics based on actual physical coordinates, providing a complete data foundation for precise location-based spectral feature analysis, defect spatial clustering, and spatial consistency assessment of the production process.
[0071] Example 8: As Figure 4 As shown, based on Example 1, the process of obtaining the spectral reflectance feature vector of each point on the surface of the automotive component in step S200 of this embodiment of the invention specifically includes the following steps:
[0072] Step S201: Arrange each frame of the acquired reflection image sequence in order of wavelength from shortest to longest. For each pixel position in the surface image of the automotive parts, extract the gray value from the same coordinates in each frame of the image to form a set of discrete wavelength-gray value correspondence points for the pixel position.
[0073] Step S202: For a set of discrete wavelength-grayscale value corresponding points for each pixel position, a polynomial fitting algorithm is used, with wavelength as the independent variable and grayscale value as the dependent variable, to calculate a continuous spectral response fitting curve, and to make the spectral response fitting curve pass through all discrete points or minimize the sum of squared distances from each discrete point to the curve, so as to obtain the polynomial coefficient vector of the pixel position.
[0074] Step S203: Resample the polynomial coefficient vector of each pixel position on the fitting curve according to the preset wavelength interval to obtain a set of spectral estimates that are continuously distributed under the preset wavelength interval. Arrange the spectral estimates in order of wavelength from shortest to longest to form the spectral reflectance feature vector of the pixel position.
[0075] In the above embodiments, this embodiment arranges each frame of the reflection image sequence in ascending order of wavelength. For each pixel position in the surface image, gray values are extracted from the same coordinates in each frame, forming a set of discrete wavelength-gray value correspondence points for that pixel position. This achieves the extraction of the original spectral sampling data of each spatial point from multiple frames of single-wavelength images. For each set of discrete wavelength-gray value correspondence points for each pixel position, a polynomial fitting algorithm is used, with wavelength as the independent variable and gray value as the dependent variable, to calculate a continuous spectral response fitting curve. The curve is made to pass through all discrete points or to minimize the sum of the squares of the distances from each discrete point to the curve, thus obtaining the polynomial coefficient vector of the pixel position. Through mathematical modeling, the discrete sampling points are transformed into a continuous function representation. The smoothness of polynomial fitting is used to suppress random noise interference, while the complete spectral shape features of the pixel are compressed and stored in the form of a coefficient vector. The polynomial coefficient vector of each pixel position is resampled on the fitting curve according to a preset wavelength interval to obtain a set of spectral estimates that are continuously distributed under the preset wavelength interval. The spectral estimates are arranged in order of wavelength from shortest to longest to form the spectral reflectance feature vector of the pixel position. This realizes the transformation from parametric representation to standardized discrete sampling, ensuring that the spectral feature vectors of different pixels have the same wavelength reference and dimension.
[0076] In summary, this embodiment realizes a complete processing flow from multi-frame discrete wavelength images to continuous spectral response modeling for each pixel, and then to standardized feature vector extraction. Through polynomial fitting, the overall shape and local features of the spectral curve are preserved in a compact coefficient form while effectively smoothing measurement noise. By resampling at preset wavelength intervals, the data inconsistency caused by uneven or missing original sampling wavelengths is eliminated, generating spectral reflectance feature vectors with uniform dimensions and wavelength benchmark alignment. The spectral reflectance feature vectors can more stably and completely characterize the reflectance characteristics of each surface point at different wavelengths, providing highly consistent and low-noise-interference input features for material classification, anomaly detection, and quantitative analysis based on spectral similarity.
[0077] Example 9: Based on Example 8, the process of calculating a continuous spectral response fitting curve in step S202 of this embodiment of the invention specifically includes the following steps:
[0078] Step S2021: For each pixel position, for a set of discrete wavelength-grayscale value corresponding points, count the number of points in the group, set the polynomial fitting order of a small sub-point based on the number of points, and create a coefficient storage array with a length equal to the order plus one based on the polynomial fitting order, and initialize each element in the array to zero.
[0079] Step S2022: Perform power-law operations on the wavelength values of all discrete points at the pixel location from zero to the power of the order, to obtain the power sequence corresponding to each wavelength; arrange the power sequences of all points in order of wavelength from shortest to longest to form a fitted data matrix with the number of rows equal to the number of points and the number of columns equal to the order plus one; at the same time, arrange the gray values corresponding to each point in the same order to form a gray data vector.
[0080] Step S2023: Perform orthogonal triangular decomposition on the fitted data matrix. Calculate the coefficient values that minimize the sum of squared residuals between the product of the fitted data matrix and the coefficient storage array and the grayscale data vector using back substitution operations based on the decomposition results. Write the coefficient values into the coefficient storage array sequentially to complete the generation of the polynomial coefficient vector for the pixel position.
[0081] In step S202, the process of calculating the continuous spectral response fitting curve for each pixel position through polynomial fitting involves the following mathematical formulas and principles. The formulas are related to the quality monitoring of automotive parts and are used to convert discrete wavelength-grayscale sampling points into continuous spectral feature representations.
[0082] Step S2022: Construct the fitted data matrix and grayscale vector
[0083] For each pixel location, let the number of its discrete sampling points be... One, corresponding wavelength and grayscale value , ; Fitting order based on the set polynomial m Construct a matrix and 3D column vector Its elements are:
[0084]
[0085]
[0086] matrix Each row corresponds to a wavelength, and each column corresponds to powers from zero to... The power term of a power; a vector The measured grayscale values at the stored wavelengths are used to represent the multi-wavelength reflection images collected. These grayscale values reflect the reflection intensity of different wavelengths of light at specific locations on the surface of automotive parts, and are the basis for material analysis.
[0087] Step S2023: Solve for the least squares coefficients through QR decomposition to obtain the polynomial coefficient vector. This makes the fitted curve Approximate all sampling points as closely as possible, i.e., minimize the sum of squared residuals. The least squares problem is solved using orthogonal trigonometric decomposition (QR decomposition):
[0088] For matrix Perform QR decomposition to obtain an orthogonal matrix. And satisfy and upper triangular matrix :
[0089]
[0090] Calculate the projection vector Its dimension is ;
[0091] Solve the system of upper triangular linear equations:
[0092]
[0093] The coefficient vector is obtained through back substitution. .
[0094] This method ensures that the obtained coefficients optimize the fitted curve in the least-squares sense, effectively suppressing the influence of random noise in single-wavelength images, while compressing discrete sampling information into a continuous parameterized representation. The coefficient vector of each pixel constitutes the parametric form of the spectral reflectance feature vector of its location. This vector can then be used to resample at any wavelength to form a standardized spectral vector, which is then compared with a preset material spectral library. This allows for precise segmentation of different material regions such as metal, plastic, and rubber on the surface of automotive parts, and identification of microscopic defects such as coating defects and oxidation patches, providing highly sensitive quantitative evidence for quality monitoring.
[0095] In the above embodiments, this embodiment achieves continuous modeling of the spectral response curve through the following technical features: First, the polynomial order is adaptively determined based on the number of discrete sampling points to avoid overfitting or underfitting; then, the wavelength parameters are transformed into the basis function expansion form in linear space by constructing a power matrix; finally, the least squares problem is stably solved using orthogonal triangular decomposition and back substitution algorithms, ensuring the accuracy and efficiency of coefficient solution at the numerical calculation level; thus, the mathematical reconstruction from discrete wavelength-grayscale sampling points to continuous spectral response function is realized, providing a continuously differentiable mathematical model foundation for spectral analysis.
[0096] Example 10: As Figure 5 As shown, based on Example 1, the process of identifying abnormal points in step S300 of this embodiment of the invention specifically includes the following steps:
[0097] Step S301: Perform a pairwise inner product operation between the spectral reflectance feature vector of each pixel location and the standard spectral vector of various automotive parts materials stored in the preset material spectral library. Take the material with the largest inner product value as the candidate material of the pixel and generate an initial material label image. The gray value of each pixel represents the number of its candidate material.
[0098] Step S302: Divide the initial material label image into multiple non-overlapping square neighborhood blocks. Count the frequency of each automotive part material number in each square neighborhood block. Replace the material label of the center pixel of the neighborhood block with the material number that appears most frequently. After traversing the entire image in a sliding window manner, merge adjacent pixels with the same material number into connected material regions and assign a unique region identification code to each connected region.
[0099] Step S303: For each material region with a unique region identification code, extract the spatial coordinates of all pixels on the boundary of the material region, and use the spatial coordinates of the boundary of the material region to fit a parametric reference surface that matches the geometry of the material region; then calculate the directed distance value from each pixel in the material region to the parametric reference surface, mark the pixels whose absolute value of the directed distance value exceeds the preset tolerance threshold as outliers, and output the coordinates of each outlier and its corresponding region identification code.
[0100] In the above embodiments, this embodiment achieves accurate identification of anomalies by combining spectral matching, spatial smoothing, and geometric analysis. First, pixel-level material classification is achieved through spectral vector inner product calculation, providing basic label data for region analysis. Then, neighborhood statistics and connectivity analysis are used to optimize the spatial consistency of the initial classification results, eliminating isolated misclassified points and forming connected homogeneous material regions. Finally, boundary fitting establishes an ideal geometric reference model for each material region, and directed distance detection identifies anomalous pixels whose surface morphology or position deviates from the reference. This embodiment integrates the spectral characteristics of materials and the geometric features of regions, achieving quantitative detection of surface irregularities, defects, or foreign object adhesions based on accurate segmentation of different automotive component material regions.
[0101] Example 11: Based on Example 10, the process of calculating the directed distance value from each pixel within the material region to the parametric reference surface in step S303 of this embodiment of the invention specifically includes the following steps:
[0102] Step S3031: For each material region with a unique regional identification code, based on the material type of the material region, such as a metal shell region, a rubber sealing ring region, or a plastic cover plate region, select three pixels located at the boundary turning points of different directions from the boundary of the material region, extract the three-dimensional spatial coordinates of the three pixels in a certain frame of the reflection image sequence, use the three-dimensional spatial coordinates to determine a reference plane tangent to the overall extension direction of the material region, and use the reference plane as the reference surface for subsequent distance calculation of the material region;
[0103] Step S3032: For each pixel within the material region, extract its three-dimensional spatial coordinates from any frame in the obtained reflection image sequence, compare the three-dimensional spatial coordinates with the determined reference plane, calculate the projection position of the pixel in the direction perpendicular to the reference plane, and obtain a preliminary vertical deviation value that reflects the pixel's relative to the main shape of the material region, such as the planar orientation of the metal panel or the local arc trend of the rubber sealing ring. At the same time, record the orientation mark of the pixel on the side of the reference plane facing the image sensor or the side facing away from the image sensor.
[0104] Step S3033: Combine the obtained preliminary vertical deviation distance value with the spatial position parameters of the reference plane, assign positive and negative signs to the preliminary distance value according to the orientation mark, and generate the directional deviation distance value of each pixel relative to the reference plane of the material area; and store all directional deviation distance values in the order of pixel arrangement in the material area as a directional distance field data block corresponding to the material area. The directional distance field is used to identify abnormal points such as protrusions, depressions and scratches in the material area relative to the standard shape.
[0105] In the above embodiments, this embodiment combines the macroscopic geometric features of the material region with the precise spatial position of the microscopic pixels through the representation of the reference plane; by calculating and storing the directional deviation distance of each pixel, it is possible to separate local changes in the surface morphology, such as protrusions, depressions, scratches, etc., from the overall morphology of the region, thereby providing a quantitative basis for the determination of anomalies based on three-dimensional spatial coordinates.
[0106] Example 12: Based on Example 11, the process of generating the directed offset distance value of each pixel relative to the reference plane of the material region in step S3033 of this embodiment of the invention specifically includes the following steps:
[0107] Step S30331: Based on the unique region identification code corresponding to the material region, extract the spectral feature vector of all pixels in the region from the obtained spectral reflectance feature vector of each pixel, calculate the mean and variance of the spectral feature vector, and generate the surface optical roughness coefficient and spectral variability weight of the material region.
[0108] Step S30332: Compare the initial vertical deviation distance value of each pixel with the initial vertical deviation distance values of the eight adjacent pixels in the material region; use the generated surface optical roughness coefficient as a weighting factor to perform neighborhood weighted fusion on the deviation value of the center pixel to obtain the local smooth deviation value of the center pixel.
[0109] Step S30333: Combine the obtained local smoothing deviation value with the spatial position parameters of the reference plane, assign positive and negative signs to the local smoothing deviation value according to the recorded orientation mark, generate the directional deviation distance value of each pixel relative to the reference plane of the material region, and store it as a directional distance field data block according to the arrangement order of pixels in the material region.
[0110] In the above embodiments, this embodiment optimizes the calculation accuracy and robustness of the directed deviation distance value by fusing spectral features and spatial neighborhood information; by calculating the mean and variance of the pixel spectral feature vectors within the material region, the roughness coefficient and spectral variability weight, which characterize the surface optical properties of the region, are extracted; these two parameters quantify the microscopic optical uniformity and spectral consistency of the material surface, providing prior weights based on the material's own optical properties for spatial deviation analysis. The preliminary vertical deviation distance value of each pixel is compared with the deviation values of its eight neighboring pixels, and neighborhood weighted fusion is performed using the surface optical roughness coefficient as a weighting factor; this achieves the suppression of isolated noise or small optical fluctuations, and enhances the spatial continuity of the deviation signal through local smoothing, making the deviation value of the central pixel more reflective of the overall deformation trend of its local area, rather than the random fluctuations of individual pixels. By combining the smoothed local deviation values with the reference plane parameters and orientation markers, a directional deviation distance value with positive and negative signs is finally generated. This ensures that the final output distance value retains the precise geometric deviation direction and magnitude of the pixel relative to the reference plane, while reducing misjudgments caused by surface optical textures or imaging noise through the pre-smoothing process.
[0111] In summary, this embodiment incorporates the inherent optical properties of the material surface into geometric deviation analysis by introducing an optical roughness coefficient derived from spectral features. The neighborhood-weighted smoothing process adaptively adjusts the smoothing intensity using this coefficient, effectively suppressing optical noise while preserving the true deformation signal. The resulting directed distance field data block not only reflects the geometric position deviation of pixels but also implicitly reflects the influence of the region's material optical properties on deformation judgment. This improves the ability to distinguish between real physical anomalies such as protrusions and depressions and differences in surface optical texture, thereby enhancing the accuracy and reliability of anomaly detection.
[0112] Example 13: Based on Example 12, the process of obtaining the local smoothing deviation value of the center pixel in step S30332 of this embodiment of the invention specifically includes the following steps:
[0113] Step S303321: Using the generated surface optical roughness coefficient as a reference value, and combining the spatial distance between the center pixel and the eight adjacent pixels in the pixel array, calculate the reciprocal of the spatial distance between each adjacent pixel and the center pixel. Multiply the reciprocal of the spatial distance by the surface optical roughness coefficient to generate the local weight coefficient corresponding to each adjacent pixel. At the same time, set the local weight coefficient of the center pixel itself to be twice the surface optical roughness coefficient.
[0114] Step S303322: Multiply the initial vertical deviation distance value of the center pixel by its own local weight coefficient to obtain the center weighted component; multiply the initial vertical deviation distance values of the eight adjacent pixels by their corresponding local weight coefficients to obtain the eight neighborhood weighted components; sum the center weighted component and the eight neighborhood weighted components to form a weighted deviation sum.
[0115] Step S303323: Accumulate all local weight coefficients of the generated center pixel and its eight adjacent pixels to form a weight sum; divide the obtained weighted deviation sum by the weight sum to obtain a quotient value that eliminates local random fluctuations, and use the quotient value as the local smoothing deviation value of the center pixel.
[0116] In the above embodiments, the smoothing intensity is adaptively adjusted by the surface optical roughness coefficient. For regions with high optical roughness, such as surfaces with obvious textures, the weight distribution is relatively balanced, resulting in a stronger smoothing effect. This effectively suppresses the interference of random optical fluctuations caused by surface micro-textures on geometric deviation calculations. For regions with low optical roughness, such as smooth surfaces, the weights are more concentrated on the central pixel, resulting in a weaker smoothing effect, which helps to preserve the true subtle deformation signals. By introducing the inverse of spatial distance as a weighting factor, it is ensured that during the smoothing process, neighboring points closer to the central pixel contribute more, thereby suppressing noise while better maintaining the natural continuity and gradient change of surface deformation in space. Weighted averaging and normalization effectively eliminate random fluctuations caused by imaging noise, isolated point anomalies, or local optical variations, making the obtained local smoothing deviation value more representative of the overall deviation trend of the local area where the pixel is located, improving the reliability and consistency of the directed distance value as the basis for anomaly detection. The output is a local smoothing deviation value that has been dually calibrated by optical properties and spatial relationships, laying a key foundation for generating a high-fidelity, low-noise directed distance field.
[0117] Example 14: Based on Example 13, the step S303321 of this embodiment of the invention generates the local weight coefficients corresponding to each adjacent pixel, specifically including the following steps:
[0118] Step S3033211: Read the coordinate value of the center pixel from the pixel array, and read the coordinate values of the eight pixels adjacent to the center pixel. Calculate the absolute value of the coordinate difference between each adjacent pixel and the center pixel in the row direction and the absolute value of the coordinate difference in the column direction. Take the larger of the two absolute values as the Chebyshev distance between the adjacent pixel and the center pixel.
[0119] Step S3033212: Input the Chebyshev distance of each adjacent pixel into a reciprocal mapper. The reciprocal mapper takes the Chebyshev distance as input and outputs the reciprocal of the Chebyshev distance. The magnitude of the reciprocal is inversely proportional to the Chebyshev distance, thus obtaining the reciprocal of the spatial distance between each adjacent pixel.
[0120] Step S3033213: Multiply the reciprocal of the spatial distance between each adjacent pixel by the generated surface optical roughness coefficient, and use the result as the local weight coefficient for each adjacent pixel; at the same time, use one times the value of the surface optical roughness coefficient itself as the local weight coefficient of the center pixel itself.
[0121] Chebyshev distance refers to the maximum absolute value of the coordinate difference between two pixels in the row and column directions in the two-dimensional grid coordinate system of the pixel array. In step S3033211, the absolute values of the coordinate differences between eight adjacent pixels and the center pixel in the row and column directions are calculated, and the larger value is taken as the Chebyshev distance. This distance reflects the relative positional relationship between adjacent pixels and the center pixel in space. In the quality monitoring of automotive parts, it is used to determine the degree of influence of pixels in different spatial positions on the center pixel. For example, when there are scratches or dents on the surface of the parts, the spatial distribution of adjacent pixels determines the continuity and directionality of the defect morphology.
[0122] The spatial distance reciprocal refers to the value output by the Chebyshev distance after inputting it into the reciprocal mapper. This value is inversely proportional to the Chebyshev distance. In step S3033212, the Chebyshev distance is converted into the spatial distance reciprocal through the reciprocal mapper, so that neighboring pixels closer to the center receive a larger weight value. In automotive parts quality monitoring, this feature is used to strengthen the spatial correlation between the center pixel and its neighboring pixels, ensuring that when calculating local smoothing deviation values, pixels closer to the center, such as normal areas around small protrusions on the surface of metal housings, contribute more to the smoothing results. This effectively suppresses false anomalies caused by random noise or surface texture fluctuations, improving the accuracy of identifying real defects, such as cracks on rubber seals or dents on plastic covers.
[0123] In the above embodiments, this embodiment generates weight coefficients that adapt to the local structure and texture characteristics of the image by fusing spatial distance metrics and surface optical parameters, providing a weighting basis with physical meaning and structural awareness for subsequent pixel processing.
[0124] Example 15: Based on Example 14, step S3033211 of this embodiment of the invention calculates the absolute value of the coordinate difference between each adjacent pixel and the center pixel in the row direction and the absolute value of the coordinate difference in the column direction, specifically including the following steps:
[0125] Step S30332111: From the temporary spatial coordinate index table established for the material area, read the planar coordinates of the center pixel in the actual space of the component. The planar coordinates include the length coordinate value along the conveying direction and the width coordinate value perpendicular to the conveying direction. At the same time, read the actual spatial planar coordinates of the eight pixels adjacent to the center pixel. The coordinates of each adjacent pixel also include the length coordinate value and the width coordinate value.
[0126] Step S30332112: Calculate the difference between the length coordinate value of the center pixel and the length coordinate values of the eight adjacent pixels to obtain eight length direction differences; at the same time, calculate the difference between the width coordinate value of the center pixel and the width coordinate values of the eight adjacent pixels to obtain eight width direction differences.
[0127] Step S30332113: Take the absolute value of the difference in the eight length directions to generate the absolute value of the coordinate difference in the eight length directions; take the absolute value of the difference in the eight width directions to generate the absolute value of the coordinate difference in the eight width directions; use the two sets of absolute values as input for Chebyshev distance calculation.
[0128] In the above embodiments, this embodiment calculates the difference by introducing actual spatial coordinates, so that the spatial relationship between pixels is established on the basis of physical scale, providing input data with actual physical meaning for weight allocation based on Chebyshev distance.
[0129] Example 16: As Figure 6 As shown, based on Embodiments 1-15, the image sensor-based automotive parts quality monitoring system provided in this embodiment of the invention includes:
[0130] Image sequence acquisition module 1 is used to acquire a sequence of reflection images of the surface of automotive parts at different wavelengths by controlling the wavelength switching timing of the illumination source and synchronizing it with the frame exposure timing of the image sensor.
[0131] Curve fitting module 2 is used to perform pixel-by-pixel wavelength response curve fitting on the reflection image sequence to obtain the spectral reflection feature vector of each point on the surface of the automotive parts.
[0132] The result output module 3 is used to divide the surface of automotive parts into multiple material regions based on the spectral reflectance feature vector and by comparing with a preset material spectral library, extract geometric features for each material region, identify abnormal points in the region, and output quality monitoring results.
[0133] In the above embodiments, this embodiment achieves automated spectral detection of automotive component surface quality through the collaborative operation of modular technical features. The image sequence acquisition module acquires the reflection intensity distribution of the object surface at multiple discrete wavelengths by synchronously controlling wavelength and exposure, forming the basis of spectral imaging data. The curve fitting module mathematically models the relationship between the reflection intensity of each pixel and wavelength, transforming discrete sampling into a continuous spectral reflection feature vector, accurately characterizing the optical properties of the material. The result output module automatically classifies and segments the surface material by comparing it with a known material spectral database, and identifies spectral or morphological anomalies based on geometric feature analysis. Finally, it completes the end-to-end detection process from multispectral image acquisition to quality defect identification, improving the ability to distinguish material composition and surface condition anomalies while maintaining non-contact and high efficiency.
[0134] Figure 7 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present invention is shown.
[0135] The electronic device may include a central processing unit / microprocessor / main control chip 4; and a storage medium 5 coupled to the central processing unit / microprocessor / main control chip 4 and storing computer-executable instructions therein for performing the steps of various methods of embodiments of the present invention when executed by the processor.
[0136] The central processing unit / microprocessor / main control chip 4 may include, but is not limited to, one or more processors or microprocessors.
[0137] Storage medium 5 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disk, floppy disk, solid-state drive, removable disk, CD-ROM, DVD-ROM, Blu-ray disc, etc.).
[0138] In addition, the electronic device may include (but is not limited to) a data bus 6, an input / output bus / external bus / device bus 7, a display 8, and input / output devices 9 (e.g., keyboard, mouse, speaker, etc.).
[0139] The central processing unit / microprocessor / main control chip 4 can communicate with external devices (8, 9, etc.) via wired or wireless networks (not shown) through the input / output bus / external bus / device bus 7.
[0140] The storage medium 5 may also store at least one computer-executable instruction for performing the steps of various functions and / or methods in the embodiments described herein when the central processing unit / microprocessor / main control chip 4 is running.
[0141] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.
[0142] Figure 8 A schematic diagram of a computer-readable storage medium according to an embodiment of the present invention is shown.
[0143] like Figure 8 As shown, the non-transitory computer-readable storage medium 11 stores instructions, such as computer-readable instructions 10. When the computer-readable instructions 10 are executed by a processor, the various methods described above can be performed. The non-transitory computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-transitory non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, the non-transitory computer-readable storage medium 11 can be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions 10 stored on the non-transitory computer-readable storage medium 11, the various methods described above can be performed.
[0144] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0145] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0146] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0147] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods of the various embodiments of this invention through a computer device (which may be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0148] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for quality monitoring of automotive parts based on image sensors, characterized in that, Includes the following steps: By controlling the wavelength switching timing of the illumination source to synchronize with the frame exposure timing of the image sensor, a sequence of reflective images of the surface of automotive parts at different wavelengths is obtained. By fitting the wavelength response curve pixel by pixel to the reflection image sequence, the spectral reflection feature vector of each point on the surface of the automotive parts is obtained. Based on the spectral reflectance feature vector, the surface of automotive parts is divided into multiple material regions by comparing with a preset material spectral library. Geometric features are extracted for each material region, abnormal points within the region are identified, and quality monitoring results are output.
2. The method for quality monitoring of automotive parts based on image sensors as described in claim 1, characterized in that... The process of acquiring a sequence of reflection images of automotive parts at different wavelengths includes the following steps: Using the speed pulse signal output in real time by the speed encoder upstream of the conveyor line, combined with the preset exposure start distance and exposure duration distance, a set of illumination trigger pulse trains corresponding to different wavelengths are generated. The pulse interval of each pulse train is inversely proportional to the conveyor speed. The generated lighting trigger pulse train is input into the semiconductor light source driving circuit of the corresponding wavelength. Each pulse triggers the instantaneous lighting of the light source of the wavelength once. At the same time, the image sensor is driven to perform single-line exposure at the moment the light source is lit. As the component moves with the conveyor line, the line reflection data of the component surface at the wavelength is collected line by line. All row reflection data collected for the same wavelength are stitched together in the order of collection to form a complete wavelength reflection image; then, all wavelength reflection images are arranged in order of wavelength from shortest to longest to form a multi-wavelength reflection image sequence.
3. The method for quality monitoring of automotive parts based on image sensors as described in claim 1, characterized in that, The process of obtaining the spectral reflectance feature vectors of various points on the surface of automotive parts includes the following steps: The acquired reflection image sequence is arranged in order of wavelength from shortest to longest. For each pixel position in the surface image of the automotive parts, the gray value is extracted from the same coordinates in each frame of the image to form a set of discrete wavelength-gray value correspondence points for the pixel position. For each pixel location, a set of discrete wavelength-grayscale value corresponding points are used. A polynomial fitting algorithm is employed, with wavelength as the independent variable and grayscale value as the dependent variable, to calculate a continuous spectral response fitting curve. The spectral response fitting curve is made to pass through all discrete points or to minimize the sum of squared distances from each discrete point to the curve, thus obtaining the polynomial coefficient vector of the pixel location. The polynomial coefficient vector of each pixel position is resampled on the fitting curve according to a preset wavelength interval to obtain a set of spectral estimates that are continuously distributed under the preset wavelength interval. The spectral estimates are arranged in order of wavelength from shortest to longest to form the spectral reflectance feature vector of the pixel position.
4. The method for quality monitoring of automotive parts based on image sensors as described in claim 1, characterized in that, The process of identifying outliers within a region includes the following steps: The spectral reflectance feature vector of each pixel is obtained and then the inner product operation is performed on each pair of standard spectral vectors of various automotive parts materials stored in the preset material spectral library. The material with the largest inner product value is taken as the candidate material of the pixel, and an initial material label image is generated. The gray value of each pixel represents the number of its candidate material. The initial material label image is divided into multiple non-overlapping square neighborhood blocks. The frequency of each automotive part material number is counted within each square neighborhood block. The material label of the center pixel of the neighborhood block is replaced with the material number with the highest frequency. After traversing the entire image in a sliding window manner, adjacent pixels with the same material number are merged into connected material regions, and a unique region identification code is assigned to each connected region. For each material region with a unique region identification code, the spatial coordinates of all pixels on the boundary of the material region are extracted. A parametric reference surface matching the geometry of the material region is fitted using the spatial coordinates of the boundary of the material region. Then, the directed distance value from each pixel in the material region to the parametric reference surface is calculated. Pixels whose absolute value of the directed distance value exceeds the preset tolerance threshold are marked as outliers. The coordinates of each outlier and its corresponding region identification code are output.
5. The method for quality monitoring of automotive parts based on image sensors as described in claim 4, characterized in that, The process of calculating the directed distance from each pixel within the material region to the parametric reference surface includes the following steps: For each material region with a unique regional identification code, based on the material type of the material region, three pixels located at the boundary turning points of different directions are selected from the boundary of the material region. The three-dimensional spatial coordinates of the three pixels in a certain frame of the reflection image sequence are extracted. The three-dimensional spatial coordinates are used to determine a reference plane that is tangent to the overall extension direction of the material region. The reference plane is used as the reference surface for calculating the distance of the material region. For each pixel within the material region, its three-dimensional spatial coordinates are extracted from any frame in the obtained reflection image sequence. The three-dimensional spatial coordinates are compared with the determined reference plane, and the projection position of the pixel in the direction perpendicular to the reference plane is calculated to obtain a reflection of the main shape of the pixel relative to the material region. At the same time, the orientation mark of the pixel on the side of the reference plane facing the image sensor or the side facing away from the image sensor is recorded. The obtained initial vertical deviation distance value is combined with the spatial position parameters of the reference plane, and the initial distance value is assigned a positive or negative sign according to the orientation mark to generate the directional deviation distance value of each pixel relative to the reference plane of the material area; and all directional deviation distance values are stored in the order of pixel arrangement in the material area as a directional distance field data block corresponding to the material area. The directional distance field is used to identify abnormal points such as protrusions, depressions and scratches in the material area relative to the standard shape.
6. The method for quality monitoring of automotive parts based on image sensors as described in claim 5, characterized in that, The process of generating the directed offset distance value of each pixel relative to the reference plane of the material region includes the following steps: Based on the unique region identification code corresponding to the material region, the spectral feature vectors of all pixels in the region are extracted from the obtained spectral reflectance feature vectors of each pixel. The mean and variance of the spectral feature vectors are calculated to generate the surface optical roughness coefficient and spectral variability weight of the material region. The initial vertical deviation value of each pixel is compared with the initial vertical deviation values of the eight adjacent pixels in the material region. The generated surface optical roughness coefficient is used as a weighting factor to perform neighborhood weighted fusion on the deviation value of the center pixel to obtain the local smooth deviation value of the center pixel. The obtained local smoothing deviation value is combined with the spatial position parameters of the reference plane. The local smoothing deviation value is assigned a positive or negative sign according to the recorded orientation mark. The directional deviation distance value of each pixel relative to the reference plane of the material region is generated and stored as a directional distance field data block according to the arrangement order of pixels in the material region.
7. The method for quality monitoring of automotive parts based on image sensors as described in claim 6, characterized in that, The process of obtaining the local smoothing deviation value of the center pixel includes the following steps: Using the generated surface optical roughness coefficient as a reference value, and combining the spatial distance between the center pixel and its eight neighboring pixels in the pixel array, the reciprocal of the spatial distance between each neighboring pixel and the center pixel is calculated. The reciprocal of the spatial distance is then multiplied by the surface optical roughness coefficient to generate the local weight coefficient corresponding to each neighboring pixel. At the same time, the local weight coefficient of the center pixel itself is set to be twice the surface optical roughness coefficient. Multiply the initial vertical deviation of the center pixel by its local weight coefficient to obtain the center weighted component; multiply the initial vertical deviation of the eight adjacent pixels by their corresponding local weight coefficients to obtain the eight neighborhood weighted components; sum the center weighted component and the eight neighborhood weighted components to form a weighted deviation sum. The local weight coefficients of the generated center pixel and its eight neighboring pixels are summed to form a weighted sum. The weighted deviation sum is divided by the weighted sum to obtain a quotient that eliminates local random fluctuations. This quotient is used as the local smoothing deviation value of the center pixel.
8. The method for quality monitoring of automotive parts based on image sensors as described in claim 7, characterized in that, Generating the local weight coefficients for each adjacent pixel involves the following steps: Read the coordinates of the center pixel from the pixel array, and read the coordinates of the eight pixels adjacent to the center pixel. Calculate the absolute value of the coordinate difference between each adjacent pixel and the center pixel in the row direction and the absolute value of the coordinate difference in the column direction. Take the larger of the two absolute values as the Chebyshev distance between the adjacent pixel and the center pixel. The Chebyshev distance of each adjacent pixel is input into a reciprocal mapper. The reciprocal mapper takes the Chebyshev distance as input and outputs the reciprocal of the Chebyshev distance. The magnitude of the reciprocal is inversely proportional to the Chebyshev distance, thus obtaining the reciprocal of the spatial distance between each adjacent pixel. The inverse of the spatial distance between each adjacent pixel is multiplied by the generated surface optical roughness coefficient, and the result is used as the local weight coefficient for each adjacent pixel; at the same time, a factor of one of the surface optical roughness coefficients is used as the local weight coefficient for the center pixel itself.
9. The method for quality monitoring of automotive parts based on image sensors as described in claim 8, characterized in that, Calculate the absolute value of the coordinate difference between each adjacent pixel and the center pixel in the row direction and the column direction, including the following steps: From the temporary spatial coordinate index table established for the material area, read the planar coordinates of the center pixel in the actual space of the component. The planar coordinates include the length coordinate value along the conveying direction and the width coordinate value perpendicular to the conveying direction. At the same time, read the actual spatial planar coordinates of the eight pixels adjacent to the center pixel. The coordinates of each adjacent pixel also include the length coordinate value and the width coordinate value. The length coordinates of the center pixel are compared with the length coordinates of its eight neighboring pixels to obtain eight length direction differences; similarly, the width coordinates of the center pixel are compared with the width coordinates of its eight neighboring pixels to obtain eight width direction differences. Take the absolute value of the difference in the eight length directions to generate the absolute value of the coordinate difference in the eight length directions; take the absolute value of the difference in the eight width directions to generate the absolute value of the coordinate difference in the eight width directions; use the two sets of absolute values as input for Chebyshev distance calculation.
10. An image sensor-based automotive parts quality monitoring system, used to implement the image sensor-based automotive parts quality monitoring method as described in any one of claims 1 to 9, characterized in that, include: The image sequence acquisition module is used to acquire a sequence of reflection images of the surface of automotive parts at different wavelengths by controlling the wavelength switching timing of the illumination source and synchronizing it with the frame exposure timing of the image sensor. The curve fitting module is used to perform pixel-by-pixel wavelength response curve fitting on the reflection image sequence to obtain the spectral reflection feature vector of each point on the surface of the automotive parts. The results output module is used to divide the surface of automotive parts into multiple material regions based on the spectral reflectance feature vector and by comparing with a preset material spectral library. It also extracts geometric features for each material region, identifies abnormal points within the region, and outputs the quality monitoring results.