Polarimetric imaging system for metal surface scratch detection
The metal surface scratch recognition system, which utilizes polarization imaging and dynamic parameter adjustment, solves the problems of low efficiency and poor adaptability in traditional methods, and achieves efficient and accurate recognition of metal surface scratches.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing methods for identifying scratches on metal surfaces rely on manual inspection, which is inefficient. Furthermore, machine vision-based inspection systems are poorly adaptable to complex surfaces or different materials, making it difficult to accurately identify minute or shallow scratches. Polarization imaging systems also suffer from problems such as having a single polarization parameter or lacking dynamic adjustment in metal surface identification.
The system employs a polarization imaging unit, an image preprocessing unit, a polarization feature extraction unit, a scratch recognition unit, and a parameter adaptive unit. Through polarization image acquisition, noise reduction and enhancement, polarization feature extraction, and dynamic parameter adjustment, combined with polarization degree distribution and azimuth angle distribution, it uses a preset scratch feature template for recognition and performs compensation processing under environmental interference.
It improves the accuracy and adaptability of identifying scratches on metal surfaces, enabling clear differentiation of scratch features under strong reflective light or contamination conditions, reducing misjudgments, and enhancing the flexibility and stability of the system.
Smart Images

Figure CN121027123B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of metal detection technology, specifically to a metal surface scratch recognition system based on polarization imaging. Background Technology
[0002] In the industrial production and manufacturing sector, metallic materials are widely used in various industries such as machinery manufacturing, automotive, and aerospace due to their excellent physical and chemical properties. The surface quality of metal products directly affects their appearance, service life, and safety, with surface scratches being one of the most common quality defects. These scratches can occur at multiple stages, including raw material processing, component assembly, transportation, and storage. If they are not detected and addressed in a timely manner, they may lead to a decline in product performance or even pose safety hazards.
[0003] Traditional methods for identifying scratches on metal surfaces primarily rely on manual visual inspection. Inspectors visually examine the metal surface and judge the presence and severity of scratches based on experience. However, this method is heavily influenced by the subjective factors of the inspectors; different individuals have different judgment standards, leading to missed or false detections. Furthermore, manual inspection is inefficient and ill-suited to the high-speed, high-volume inspection demands of modern industrial production, especially when dealing with large metal components or complex surface structures, where the inspection difficulty increases significantly.
[0004] With the development of machine vision technology, automatic detection methods based on traditional optical imaging are gradually being applied to the identification of scratches on metal surfaces. These methods acquire two-dimensional images of the metal surface using ordinary cameras, and then use image processing algorithms to analyze the images to identify scratches. However, metal surfaces usually have strong reflective properties. Under ordinary optical imaging, the specular reflection of the metal surface will result in low contrast between the background and the scratch area in the image. Especially for some fine or shallow scratches, they are often masked by strong light reflection and are difficult to distinguish clearly from the image.
[0005] Existing machine vision-based inspection systems have poor adaptability when dealing with metal surfaces of different materials and under different lighting conditions. When oil, oxide layers, or other contaminants are present on the metal surface, they further interfere with image quality, weakening scratch features and increasing the difficulty of recognition. Furthermore, the imaging parameters of traditional inspection systems are mostly fixed settings and cannot be dynamically adjusted according to actual inspection conditions. This can easily lead to a decrease in recognition accuracy when dealing with metal products with complex surface textures or diverse scratch patterns.
[0006] In recent years, polarization imaging technology has begun to be applied to the field of surface defect detection. Polarization imaging can capture the changes in polarization characteristics produced when light reflects off an object's surface, and these changes are closely related to the physical state of the object's surface. However, existing polarization imaging-based detection systems still have many shortcomings in the identification of scratches on metal surfaces. Some systems only use a single polarization parameter for analysis, making it difficult to comprehensively reflect the differences between scratched and normal areas; some systems lack a dynamic adjustment mechanism for imaging parameters, and when the metal surface state changes, the quality stability of the acquired images cannot be guaranteed, resulting in unstable scratch identification results. At the same time, existing systems often rely on simple threshold segmentation or edge detection algorithms in the feature extraction stage, making it difficult to accurately extract candidate scratch regions when the polarization characteristics of scratches and background areas are not significantly different, affecting the final identification results. Summary of the Invention
[0007] The purpose of this invention is to provide a metal surface scratch recognition system based on polarization imaging to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides a metal surface scratch identification system based on polarization imaging, the system comprising:
[0009] The system includes a polarization imaging unit, an image preprocessing unit, a polarization feature extraction unit, a scratch recognition unit, and a parameter adaptation unit.
[0010] The polarization imaging unit acquires polarization images of the metal surface and transmits the acquired polarization image data to the image preprocessing unit in real time.
[0011] The image preprocessing unit performs noise reduction and contrast enhancement on the polarization image data, and generates optimized image data based on the processing results.
[0012] The polarization feature extraction unit obtains optimized image data through the image preprocessing unit, analyzes the polarization state parameters in the optimized image data to obtain the polarization degree distribution and azimuth angle distribution, and extracts the polarization features of the scratch candidate region based on the polarization degree distribution and azimuth angle distribution.
[0013] The scratch recognition unit obtains the polarization features of the scratch candidate region through the polarization feature extraction unit, compares the polarization features with the preset scratch feature template, and generates a scratch recognition result.
[0014] The parameter adaptive unit obtains the scratch recognition result through the scratch recognition unit, and dynamically adjusts the acquisition parameters of the polarization imaging unit according to the scratch clarity and contrast in the recognition result.
[0015] Preferably, the polarization imaging unit includes a light source module, a polarization modulation module, and an image sensor module. The light source module provides multi-band illumination light, the polarization modulation module modulates the polarization direction of the illumination light emitted by the light source module to generate probe light with different polarization states to illuminate the metal surface, and the image sensor module receives the polarized light reflected from the metal surface and converts it into an electrical signal to form polarization image data.
[0016] When generating polarized image data, if the polarization imaging unit detects that the light intensity is lower than a preset intensity threshold, it will activate the supplementary lighting control signal. If no abnormal light intensity is detected, it will perform image acquisition according to a preset polarization modulation sequence.
[0017] Preferably, the process of the image preprocessing unit performing noise reduction on the polarization image data is as follows:
[0018] Select a preset noise filtering template, divide the polarization image data into multiple pixel blocks, calculate the gray-level variance of each pixel block, mark the pixel blocks with gray-level variance greater than the preset variance threshold as noise regions, and filter the noise regions using a median filtering algorithm.
[0019] The image preprocessing unit performs contrast enhancement processing on polarized image data as follows: a preset gray-level stretching interval is selected, the gray-level histogram of the polarized image data is calculated, the endpoint values of the gray-level stretching interval are determined based on the gray-level histogram, and the gray-level values of the polarized image data are mapped to the gray-level stretching interval through a linear stretching algorithm to generate optimized image data.
[0020] Preferably, the polarization feature extraction unit obtains optimized image data through the image preprocessing unit, records the polarization state parameter of each pixel in the optimized image data as P, and records the upper and lower limits of the preset polarization state parameter range as p0 and p1 respectively, wherein P includes either polarization degree or azimuth angle, and p0 and p1 are a set of polarization degree parameter range or azimuth angle parameter range.
[0021] The polarization feature extraction unit calculates the difference between the polarization state parameters P and p0 and the difference between P and p1 of the pixel, records the smaller absolute value of the two sets of differences as the parameter deviation D, determines the boundary threshold of the scratch candidate region through the parameter deviation D, segments the scratch candidate region from the optimized image data according to the boundary threshold, and extracts the polarization feature vector of the region.
[0022] Preferably, the scratch recognition unit sends the polarization feature vector to a preset feature matching model. The feature matching model calculates the similarity value between the polarization feature vector and the preset scratch feature template using a cosine similarity algorithm. If the similarity value is greater than a preset similarity threshold, a scratch presence signal is generated. If the similarity value is less than or equal to the preset similarity threshold, a scratch absence signal is generated.
[0023] When generating a scratch presence signal, the scratch recognition unit simultaneously records the scratch's position coordinates and length information, generating a scratch recognition result that includes both position coordinates and length information.
[0024] Preferably, the parameter adaptive unit obtains the scratch recognition result through the scratch recognition unit. If there is a scratch presence signal in the recognition result, the average contrast of the scratch area is calculated and compared with a preset contrast standard. If the average contrast is lower than the contrast standard, an exposure time increase signal is generated and sent to the polarization imaging unit. The polarization imaging unit extends the exposure time of the image sensor module according to the exposure time increase signal.
[0025] If the average contrast ratio meets the contrast ratio standard, the exposure time will not be adjusted.
[0026] Preferably, the system further includes an environmental interference suppression unit, which acquires original polarized image data through a polarization imaging unit, analyzes the ambient light polarization component in the original polarization image data, generates an interference suppression coefficient, and sends the interference suppression coefficient to an image preprocessing unit. The image preprocessing unit performs ambient light compensation processing on the polarization image data based on the interference suppression coefficient.
[0027] Preferably, the process by which the environmental interference suppression unit analyzes the polarization component of ambient light is as follows:
[0028] A scratch-free area on the metal surface is selected as a reference area. The average value of the polarization state parameters of the reference area is extracted and used as the ambient light polarization reference value. The deviation between the polarization state parameters of each pixel in the original polarization image data and the ambient light polarization reference value is calculated. An interference suppression coefficient is generated based on the magnitude of the deviation. The larger the deviation, the larger the interference suppression coefficient.
[0029] Preferably, the system further includes a system self-testing unit, which monitors the working status of the polarization imaging unit, the image preprocessing unit, and the polarization feature extraction unit in real time. If the working parameters of any unit exceed the preset normal parameter range, a fault warning signal is generated and the identification information of the faulty unit is recorded.
[0030] Preferably, when extracting the polarization features of the candidate scratch region, the polarization feature extraction unit also performs multi-scale decomposition on the optimized image data, dividing the decomposed image data into multiple scale levels, each scale level corresponding to a different spatial resolution. The polarization feature extraction unit performs polarization degree distribution and azimuth angle distribution analysis on each scale level, extracts the local polarization features of each level, and fuses the multi-scale local polarization features into a global polarization feature vector, which is then sent to the scratch recognition unit.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] From an imaging perspective, the polarization imaging unit can capture the polarization characteristics of light reflected from a metal surface, a characteristic closely related to the surface's microstructure. Compared to traditional optical imaging, polarization imaging can effectively distinguish the optical differences between scratched areas and normal areas, capturing scratch features even in cases of strong reflection or slight contamination on the metal surface. The image preprocessing unit performs noise reduction and contrast enhancement on the acquired polarization images, reducing noise interference with subsequent analysis and improving the distinction between scratched areas and the background, making scratch features clearer and more identifiable.
[0033] The polarization feature extraction unit analyzes and optimizes the polarization state parameters in image data to obtain the polarization degree distribution and azimuth angle distribution, and then extracts the polarization features of the scratch candidate region. This feature extraction method based on polarization characteristics overcomes the limitations of traditional grayscale or texture feature-based methods, and can uncover the essential differences between scratches and normal surfaces from the polarization angle of light. Due to the change in surface morphology, the polarization degree and azimuth angle distribution of the scratch region are significantly different from the surrounding normal area. By analyzing these parameters, the scratch candidate region can be accurately located, reducing interference from irrelevant areas.
[0034] The scratch recognition unit compares the extracted polarization features with a preset scratch feature template, generating a recognition result through template matching. This method fully utilizes known scratch feature information, improving the targeting and accuracy of the recognition. For different types and shapes of scratches, the preset feature template can provide an effective comparison benchmark, reducing misjudgments caused by the variability of scratch shapes.
[0035] The parameter adaptive unit dynamically adjusts the acquisition parameters of the polarization imaging unit based on the recognition results, enabling the system to adapt to changes in different metal surface conditions and environmental conditions. When the clarity or contrast of the scratch in the recognition results is insufficient, the parameter adaptive unit will promptly adjust the imaging parameters, such as exposure time and polarization angle, to ensure that subsequent acquired images can more clearly present the scratch features. This dynamic adjustment mechanism enhances the system's flexibility and adaptability, avoiding the problem of unstable detection results caused by fixed parameter settings. Attached Figure Description
[0036] Figure 1 This is a schematic diagram illustrating the working principle of the polarization imaging metal surface scratch recognition system described in this invention.
[0037] Figure 2 A flowchart illustrating the operation of the polarization imaging unit;
[0038] Figure 3Flowchart for noise reduction and enhancement in the image preprocessing unit;
[0039] Figure 4 Flowchart for scratch segmentation of polarization feature extraction unit;
[0040] Figure 5 A flowchart for calculating the ambient light polarization reference. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] Please see Figure 1 This invention provides a metal surface scratch recognition system based on polarization imaging. The system includes: a polarization imaging unit, an image preprocessing unit, a polarization feature extraction unit, a scratch recognition unit, and a parameter adaptation unit. Specific implementation details are as follows:
[0043] The polarization imaging unit acquires polarization images of the metal surface and transmits the acquired polarization image data to the image preprocessing unit in real time. The image preprocessing unit performs noise reduction and contrast enhancement on the polarization image data and generates optimized image data based on the processing results. The polarization feature extraction unit obtains the optimized image data through the image preprocessing unit, analyzes the polarization state parameters in the optimized image data to obtain the polarization degree distribution and azimuth angle distribution, and extracts the polarization features of the scratch candidate region based on the polarization degree distribution and azimuth angle distribution. The scratch recognition unit obtains the polarization features of the scratch candidate region through the polarization feature extraction unit, compares the polarization features with the preset scratch feature template, and generates scratch recognition results. The parameter adaptation unit obtains the scratch recognition results through the scratch recognition unit and dynamically adjusts the acquisition parameters of the polarization imaging unit based on the scratch clarity and contrast in the recognition results.
[0044] Example 1: See Figure 2 The polarization imaging unit comprises a light source module, a polarization modulation module, and an image sensor module. The light source module emits multi-band illumination light, covering the range from visible light to near-infrared. Different bands of light can be adapted to the material properties of different metal surfaces. For example, for smooth aluminum alloys, the visible light band can be emphasized, while for steel with an oxide layer, the proportion of the near-infrared band can be appropriately increased. The light source module contains multiple independently controlled light-emitting units, each corresponding to a specific band. These units can be combined and activated according to the type of metal surface to ensure that the illumination light effectively illuminates the metal surface and forms a recognizable reflected signal.
[0045] The polarization modulation module consists of a rotatable polarizer assembly containing multiple polarizers, each of which can be rotated by a stepper motor to change its polarization direction. Upon receiving an image acquisition command, the polarization modulation module modulates the polarization direction of the illumination light emitted by the light source module according to a pre-defined sequence, generating probe light with different polarization states. These polarization states include common angles such as 0°, 45°, 90°, and 135°, and can also be adjusted to other angle combinations according to actual needs. The modulated probe light illuminates the metal surface with a uniform intensity distribution, ensuring that all areas of the metal surface receive consistent polarized light illumination.
[0046] The image sensor module employs a high-resolution CMOS image sensor, with the pixel array number set according to the required recognition accuracy to meet the need for capturing minute scratches. When polarized light reflected from the metal surface reaches the image sensor module, the sensor converts the optical signal into an electrical signal. After amplification and analog-to-digital conversion, these electrical signals form digital image data containing polarization information, i.e., polarized image data. The image sensor module also has a built-in data buffer unit that can temporarily store the acquired polarized image data. After a frame of image is acquired, it is then transmitted in batches to the image preprocessing unit.
[0047] During the generation of polarized image data, the polarization imaging unit also integrates a light intensity detection function. Its internal light sensor monitors the light intensity on the metal surface in real time. The sensor's detection frequency is consistent with the image acquisition frequency, ensuring that corresponding light intensity data is acquired for each frame of image capture. The preset intensity threshold is set according to the metal material and surface condition. For example, for highly reflective metal surfaces, the threshold can be set to a higher value, while for matte surfaces, the threshold can be appropriately lowered.
[0048] If the light sensor detects that the current light intensity is lower than a preset intensity threshold, the control module of the polarization imaging unit will immediately generate a supplementary lighting control signal and send it to the light source module. Upon receiving the supplementary lighting control signal, the light source module will increase the power output of the corresponding wavelength light-emitting unit to enhance the intensity of the illumination light. During the supplementary lighting process, the light sensor continuously monitors the light intensity until it recovers above the threshold. At this point, the control module stops the supplementary lighting control signal, and the light source module returns to its normal power output state.
[0049] If the light sensor does not detect any abnormal light intensity, meaning the light intensity is within a preset threshold range, the polarization imaging unit acquires images according to a preset polarization modulation sequence. This polarization modulation sequence is an optimal sequence determined experimentally, for example, cycling through 0°→45°→90°→135°→0°, with each polarization state acquired at the same time, ensuring temporal continuity and consistency of image data from different polarization states. During acquisition, the polarization modulation module and the image sensor module work synchronously. Once the polarizer rotates to the target angle, the image sensor module immediately initiates exposure to avoid polarization information distortion caused by angular deviations.
[0050] In addition, the polarization imaging unit also has a status monitoring function, which can monitor parameters such as the light emission stability of the light source module, the angular accuracy of the polarization modulation module, and the operating temperature of the image sensor module in real time. If the light emission intensity of the light source module is found to fluctuate beyond the normal range, or the deviation between the actual rotation angle of the polarizer and the target angle exceeds the allowable value, or the temperature of the image sensor module is too high, an internal warning signal will be issued in a timely manner to prompt the system to make corresponding adjustments or maintenance to ensure the stable and reliable quality of polarization image data.
[0051] Example 2: See Figure 3 After obtaining optimized image data from the image preprocessing unit, the polarization feature extraction unit begins to extract polarization features from the image. First, the polarization state parameter of each pixel in the optimized image data is recorded as P. Here, P can be either the degree of polarization or the azimuth angle, determined specifically according to the type of feature being processed. Simultaneously, a set of upper and lower limits for the range of polarization state parameters is preset, denoted as p0 and p1 respectively. If P represents the degree of polarization, p0 and p1 can be set as the polarization degree interval boundaries suitable for the current metal surface; if P represents the azimuth angle, then p0 and p1 correspond to the effective range boundaries of the azimuth angle.
[0052] Next, the difference between the polarization state parameters P and p0, and the difference between P and p1, are calculated for each pixel. Then, the smaller absolute value of these two differences is selected and recorded as the parameter deviation D for that pixel. The parameter deviation D reflects how close the pixel's polarization state parameters are to the preset range. The smaller the D value, the closer the pixel's polarization state parameters are to the boundary of the preset range, and the more likely it is to belong to the edge of the scratch candidate region.
[0053] Based on the parameter deviation D of all pixels, a boundary threshold for the scratch candidate region is determined. Specifically, the D values of all pixels in the entire image are statistically analyzed to identify their distribution patterns. Then, a suitable value is selected as the boundary threshold, allowing pixels below this threshold to potentially constitute regions containing scratches. After determining the boundary threshold, pixels with a parameter deviation D less than this threshold are marked. These marked pixels collectively constitute the scratch candidate region, thus segmenting areas requiring further analysis from the optimized image data.
[0054] When extracting polarization features of scratch candidate regions, the polarization feature extraction unit also performs multi-scale decomposition on the optimized image data. Multi-scale decomposition uses a method of progressively reducing image resolution, decomposing the original image into multiple scale levels. Each scale level corresponds to a different spatial resolution. For example, the first level maintains the resolution of the original image, the second level has half the resolution of the original image, the third level has a quarter of the resolution of the original image, and so on, forming a series of image data with different levels of detail.
[0055] For the image data at each scale level, polarization degree distribution and azimuth distribution analysis were performed separately. Polarization degree distribution analysis calculates the polarization degree value of each pixel in the image at that scale level and statistically analyzes the distribution of these values in different intervals to identify regions with high or low polarization degree. Azimuth distribution analysis statistically analyzes the distribution characteristics of polarization azimuth angles in the image at that scale level to identify regions where the azimuth angle changes significantly. These regions are often related to the edge features of scratches.
[0056] At each scale level, corresponding local polarization features are extracted. These local features include the average polarization degree, standard deviation of polarization degree, average azimuth angle, and standard deviation of azimuth angle within the candidate scratch region at that scale. They also include the gradient variation features of polarization degree and azimuth angle within that region, i.e., the rate of change of polarization parameters between adjacent pixels. These local features can reflect the polarization characteristics of the scratch region at different scales. Features at small scale levels can capture detailed information about the scratch, while features at large scale levels can reflect the overall outline of the scratch.
[0057] After extracting local polarization features at all scale levels, these multi-scale local polarization features need to be fused into a single global polarization feature vector. The fusion process employs feature concatenation, arranging the local features extracted at each scale level in a preset order to form a higher-dimensional vector. This vector contains all polarization feature information extracted from different spatial resolutions, comprehensively reflecting the polarization characteristics of the scratch candidate region. Finally, this global polarization feature vector is sent to the scratch recognition unit, providing complete feature data for subsequent scratch recognition.
[0058] Throughout the processing, the number of decomposition levels can be adjusted based on the image resolution and the possible size of the scratches, ensuring that the decomposed scales can cover the feature range from small scratches to large scratches. Simultaneously, during feature fusion, local features at different scales are assigned corresponding weights. The magnitude of the weight is determined based on the importance of that scale level to scratch recognition, enabling the global polarization feature vector to more effectively highlight scratch-related feature information.
[0059] Example 3: See Figure 4 After acquiring the optimized image data output by the image preprocessing unit, the polarization feature extraction unit begins to extract polarization features from the image. First, the polarization state parameter of each pixel in the optimized image data is recorded as P. P can be either the degree of polarization or the azimuth angle, depending on the type of image being processed. The upper and lower limits of the preset polarization state parameter range are recorded as p0 and p1, respectively. When P represents the degree of polarization, the values of p0 and p1 are set based on the polarization degree range of common scratch-free areas on metal surfaces; when P represents the azimuth angle, p0 and p1 correspond to the normal variation range of the azimuth angle.
[0060] Next, the parameter deviation D of each pixel is calculated as follows:
[0061]
[0062] in, This refers to the polarization state parameters (degree of polarization or azimuth angle) of a pixel. This is the lower limit of the preset parameter range. This is the upper limit of the preset parameter range. This represents the absolute difference between the pixel parameter and the lower limit value. This represents the absolute difference between the pixel parameter and the upper limit value. The minimum value function is to select the smaller of the two absolute differences as the parameter deviation D of the pixel.
[0063] The parameter deviation D reflects the degree of deviation between the polarization state parameter of a pixel and the parameter range of the normal region. The smaller the D value, the closer the polarization state of the pixel is to the characteristics of the normal region; the larger the D value, the more likely the polarization state of the pixel is abnormal and belongs to the scratch region. Based on the parameter deviation D of all pixels, the boundary threshold of the scratch candidate region is determined. The specific method is to perform statistical analysis on the D values of the entire image and select a specific value in the D value distribution as the boundary threshold, such as selecting a certain percentile of the D value, to ensure that the boundary threshold can effectively distinguish the region that may contain scratches from the normal region.
[0064] After determining the boundary threshold, the D value of each pixel is compared with the boundary threshold. If the D value of a pixel is greater than the boundary threshold, the pixel is identified as a potential candidate region for scratches; if the D value is less than or equal to the boundary threshold, it is identified as a pixel in the normal region. In this way, regions consisting of a large number of consecutive abnormal pixels, i.e., scratch candidate regions, are segmented from the optimized image data. These regions are the focus of further analysis.
[0065] When extracting polarization features from scratch candidate regions, the polarization feature extraction unit also performs multi-scale decomposition on the optimized image data. This multi-scale decomposition uses a pyramid decomposition algorithm to divide the original optimized image data into multiple levels of different scales. Each scale level corresponds to a different spatial resolution. During the decomposition process, the spatial resolution of the image decreases by a certain proportion with each subsequent level, while preserving the main structural features of that level. For example, the first level might have the resolution of the original image, the second level half that of the original, the third level a quarter, and so on, forming image data with multiple scale levels.
[0066] For image data at each scale level, polarization degree distribution and azimuth distribution analysis are performed separately. Polarization degree distribution analysis calculates the polarization degree value of each pixel in the image at that scale, statistically analyzing the pixel distribution within different polarization degree intervals to form a polarization degree distribution map. Azimuth distribution analysis calculates the azimuth value of each pixel, statistically analyzing the azimuth angle distribution characteristics across different angle intervals to form an azimuth angle distribution map. Based on these distribution characteristics, local polarization features are extracted for each scale level. These local polarization features include the average polarization degree, standard deviation of polarization degree, average azimuth angle, and standard deviation of azimuth angle for the scratch candidate region at that scale. These features reflect the polarization characteristics of the scratch region at that scale level.
[0067] After extracting local polarization features at all scale levels, these multi-scale local polarization features need to be fused into a global polarization feature vector. The fusion process employs feature concatenation, arranging the extracted local polarization features from each scale level sequentially to form a higher-dimensional feature vector containing multi-scale information. For example, the local features from the first level are used as the first half of the vector, the local features from the second level as the middle half, and the local features from subsequent levels are arranged sequentially to form the final global polarization feature vector. This global polarization feature vector integrates polarization feature information at different spatial resolutions, encompassing both overall structural features at large scales and detailed features at small scales, comprehensively reflecting the polarization characteristics of the scratch candidate region. This global polarization feature vector is then sent to the scratch recognition unit.
[0068] Example 4: After receiving the global polarization feature vector output by the polarization feature extraction unit, the scratch recognition unit inputs it into a preset feature matching model. The feature matching model stores multiple sets of preset scratch feature templates. These templates are constructed based on scratch samples from different types of metal surfaces, covering scratch features of varying depths, widths, lengths, and orientations. For example, there are corresponding feature templates for fine linear scratches on stainless steel surfaces and arc-shaped scratches on aluminum alloy surfaces. Each template contains specific polarization degree distribution features and azimuth angle distribution features, consistent with the dimension of the global polarization feature vector, for comparison purposes.
[0069] The feature matching model uses a cosine similarity algorithm to compare the global polarization feature vector with each scratch feature template. During the comparison, the vector magnitudes of the global polarization feature vector and each scratch feature template are first calculated, then the dot product of the two vectors is calculated. The similarity value is obtained by comparing the dot product with the magnitude product. The similarity value ranges from 0 to 1; the higher the value, the higher the feature overlap. When the similarity value between the global polarization feature vector and a certain scratch feature template is greater than a preset similarity threshold, the feature matching model generates a scratch presence signal; if the similarity value with all templates is less than or equal to the similarity threshold, a scratch non-existence signal is generated.
[0070] When a scratch detection signal is generated, the scratch recognition unit initiates a coordinate localization process. A two-dimensional coordinate system is established with the top-left corner of the image as the origin. By scanning the pixel distribution of the scratch candidate region, the start and end coordinates of the scratch are determined. For example, if the scratch is a straight line, the start coordinates might be (x1, y1) and the end coordinates (x2, y2), where x1, y1, x2, and y2 are the row and column indices of the pixels. Simultaneously, based on the positions of the start and end points in the coordinate system, the straight-line distance between the two points is calculated, serving as the scratch length information. The final scratch recognition result contains the scratch's position coordinates (start and end points) and corresponding length information, forming a structured data record.
[0071] The parameter adaptive unit receives scratch recognition results from the scratch recognition unit in real time. If the results contain a scratch presence signal, it calculates the average contrast of the scratch area. The calculation involves first extracting all pixels in the scratch area from the optimized image data, counting the grayscale values of these pixels, identifying the maximum and minimum grayscale values, and finding the difference between them as the contrast of that area. Then, the average contrast of multiple consecutive pixel blocks is taken to obtain the average contrast of the scratch area.
[0072] The parameter adaptive unit compares the calculated average contrast ratio with a preset contrast standard. The contrast standard is set based on the material characteristics of the metal surface. For example, for a high-gloss metal surface, the contrast standard is relatively high to ensure that fine scratches can be clearly identified; for a rough metal surface, the standard can be appropriately lowered. If the average contrast ratio is lower than the contrast standard, the parameter adaptive unit generates an exposure time increase signal. This signal contains specific adjustment information, such as extending the current exposure time by a certain percentage.
[0073] After the exposure time increase signal is sent to the image sensor module of the polarization imaging unit, the control circuit of the image sensor module modifies the exposure control parameters according to the adjustment magnitude in the signal. For example, if the current exposure time is 8 milliseconds and the adjustment magnitude is 30%, the exposure time is extended to 10.4 milliseconds to increase the intensity of the light signal received by the sensor and improve the brightness and contrast of the image. If the average contrast reaches or exceeds the contrast standard, the parameter adaptation unit does not generate an adjustment signal, and the polarization imaging unit maintains the current exposure time parameter unchanged and continues to acquire images according to the original settings.
[0074] In addition, the parameter adaptation unit records the results of each adjustment, forming a parameter adjustment log, including information such as adjustment time, exposure time before and after adjustment, and average contrast change in the scratched area. This log data can be used for subsequent analysis of optimal acquisition parameters under different metal surface conditions, providing a reference for optimizing the similarity threshold in the feature matching model, but it will not affect the current recognition process. When the scratch recognition result is no signal, the parameter adaptation unit does not perform any parameter adjustments, but only records the current recognition status, ensuring that the system maintains stable operating parameters in the absence of scratches.
[0075] Example 5: See Figure 5 The system includes an environmental interference suppression unit, which establishes a data connection with the polarization imaging unit to directly acquire raw, unprocessed polarization image data. After activation, the environmental interference suppression unit first scans the raw polarization image data, selecting a scratch-free area on the metal surface as a reference area. During the selection process, the stability of polarization state parameters in each region of the image is analyzed to filter out areas with small fluctuations in pixel polarization degree and azimuth angle. The area of the reference area must be no less than 3% of the total image area, and there should be no significant abrupt changes in grayscale within the area to ensure that the region accurately reflects the polarization characteristics of ambient light.
[0076] After determining the reference area, the environmental interference suppression unit calculates the average polarization state parameters of all pixels within that area, including the average polarization degree and the average azimuth angle. These two average values are used together as the ambient light polarization reference value. Subsequently, each pixel in the original polarized image data is traversed, and the difference between the polarization degree and the polarization degree reference value, as well as the difference between the azimuth angle and the azimuth angle reference value, are calculated for each pixel. Both differences are taken as absolute values to quantify the degree of ambient light interference to a single pixel.
[0077] The calculated deviation value generates an interference suppression coefficient for the corresponding pixel. The deviation value and the interference suppression coefficient are negatively correlated; that is, the larger the deviation value, the smaller the interference suppression coefficient, indicating that the pixel is more severely affected by ambient light interference and requires stronger suppression processing. For example, when the deviation value is 0, the coefficient is 1, indicating that the pixel is not affected by additional ambient light interference. As the deviation value increases, the coefficient decreases linearly until the deviation value reaches a set upper limit, at which point the coefficient drops to 0.5 to avoid over-suppression leading to the loss of effective signals.
[0078] The environmental interference suppression unit sends the generated interference suppression coefficient matrix to the image preprocessing unit. Before performing noise reduction and contrast enhancement, the image preprocessing unit multiplies the polarization state parameter of each pixel in the original polarized image data with the corresponding interference suppression coefficient to complete the ambient light compensation process. In this way, the influence of the ambient light polarization component on the image is reduced, making the polarization characteristics of the metal surface more prominent.
[0079] The system also includes a system self-test unit, which monitors the operating status of the polarization imaging unit, image preprocessing unit, and polarization feature extraction unit in real time through a built-in sensor network. For the polarization imaging unit, the monitoring includes the actual output power of the light source module, the rotation angle error of the polarizer in the polarization modulation module, and the frame rate and signal-to-noise ratio of the image sensor module. For the image preprocessing unit, the monitoring includes its data processing latency and cache utilization. For the polarization feature extraction unit, the monitoring includes the time consumption of feature extraction and the dimensionality stability of the feature vectors.
[0080] The system self-test unit compares the monitored parameters with preset normal parameter ranges, which are set according to the hardware performance and operating requirements of each unit. For example, the normal output power range of the light source module is ±15% of the rated power, the polarizer rotation angle error must be controlled within ±2°, and the signal-to-noise ratio of the image sensor must not be lower than 30dB. If any parameter exceeds the normal range, the system self-test unit immediately generates a fault warning signal. This signal includes the fault type, occurrence time, and identification information of the involved unit, such as "Polarization Imaging Unit - Polarization Modulation Module Angle Deviation Exceeds Standard".
[0081] The fault warning signal is sent to the control terminal via the system's internal bus. Upon receiving the signal, the control terminal triggers the audible and visual alarm device and simultaneously records the fault information in the system log. The log includes the specific time of the fault occurrence, a comparison of the measured values of the fault parameters with the normal range, and the hardware number of the faulty unit. After generating the fault warning signal, the system continues to operate its basic functions until maintenance personnel perform repairs, ensuring that the scratch identification process is not interrupted.
[0082] The monitoring frequency of the system self-test unit is consistent with the image acquisition frequency. After each frame of image is acquired and processed, a comprehensive monitoring is performed to ensure that abnormal states of each unit can be detected in a timely manner and to ensure the long-term stable operation of the system.
[0083] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0084] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A polarimetric imaging metal surface scratch identification system, characterized by, The system comprises a polarization imaging unit, an image preprocessing unit, a polarization feature extraction unit, a scratch identification unit and a parameter adaptive unit. The polarization imaging unit collects polarization images of the metal surface and transmits the collected polarization image data to the image preprocessing unit in real time. The image preprocessing unit performs noise reduction and contrast enhancement processing on the polarization image data and generates optimized image data according to the processing result. The polarization feature extraction unit obtains the optimized image data from the image preprocessing unit, analyzes the polarization state parameters in the optimized image data to obtain the polarization degree distribution and the azimuth angle distribution, and extracts the polarization features of the scratch candidate region according to the polarization degree distribution and the azimuth angle distribution. The scratch identification unit obtains the polarization features of the scratch candidate region from the polarization feature extraction unit, compares the polarization features with a preset scratch feature template, and generates a scratch identification result. The parameter adaptive unit obtains the scratch identification result from the scratch identification unit and dynamically adjusts the collection parameters of the polarization imaging unit according to the scratch clarity and contrast in the identification result. The polarization feature extraction unit obtains the optimized image data from the image preprocessing unit, records the polarization state parameters of each pixel point in the optimized image data as P, and records the upper and lower limits of the preset polarization state parameter range as p0 and p1, respectively, wherein P includes one of the polarization degree or the azimuth angle, and p0 and p1 are one set of the polarization degree parameter range or the azimuth angle parameter range. The polarization feature extraction unit calculates the difference between the polarization state parameter P and p0 and the difference between P and p1, records the smaller absolute value of the two sets of differences as the parameter deviation D, determines the boundary threshold of the scratch candidate region through the parameter deviation D, segments the scratch candidate region from the optimized image data according to the boundary threshold, and extracts the polarization feature vector of the region. When extracting the polarization features of the scratch candidate region, the polarization feature extraction unit also performs multi-scale decomposition on the optimized image data, divides the decomposed image data into multiple scale levels, each scale level corresponds to a different spatial resolution, and the polarization feature extraction unit performs polarization degree distribution and azimuth angle distribution analysis on each scale level, extracts local polarization features of each level, fuses the multi-scale local polarization features into a global polarization feature vector, and sends it to the scratch identification unit.
2. The polarimetric imaging metal surface scratch identification system of claim 1, wherein, The polarization imaging unit comprises a light source module, a polarization modulation module and an image sensor module, the light source module provides multi-band illumination light, the polarization modulation module modulates the polarization direction of the illumination light emitted by the light source module to generate probe light of different polarization states to irradiate the metal surface, and the image sensor module receives the polarized light reflected by the metal surface and converts it into an electrical signal to form polarization image data. When generating polarization image data, if the light intensity is detected to be lower than the preset intensity threshold, the light compensation control signal is started, and if no light intensity anomaly is detected, the image is collected according to the preset polarization modulation sequence.
3. The polarimetric imaging metal surface scratch identification system of claim 1, wherein, The process of noise reduction processing of the image preprocessing unit on the polarization image data is as follows: The preset noise filtering template is selected, the polarized image data is divided into a plurality of pixel blocks, the gray variance of each pixel block is calculated, the pixel block with the gray variance greater than a preset variance threshold is marked as a noise region, and the noise region is filtered through a median filtering algorithm; The process that the image preprocessing unit performs the contrast enhancement processing on the polarized image data is: selecting a preset gray stretching interval, calculating a gray histogram of the polarized image data, determining end point values of the gray stretching interval according to the gray histogram, mapping the gray values of the polarized image data into the gray stretching interval through a linear stretching algorithm, and generating optimized image data.
4. The polarimetric imaging metal surface scratch identification system of claim 1, wherein, The scratch recognition unit sends the polarized feature vector to a preset feature matching model, the feature matching model calculates a similarity value of the polarized feature vector and a preset scratch feature template through a cosine similarity algorithm, if the similarity value is greater than a preset similarity threshold, a scratch existing signal is generated, and if the similarity value is less than or equal to the preset similarity threshold, a scratch non-existing signal is generated. The scratch recognition unit records the position coordinates and length information of the scratch when the scratch existing signal is generated, and generates a scratch recognition result containing the position coordinates and length information.
5. The polarimetric imaging metal surface scratch identification system of claim 4, wherein, The parameter adaptive unit obtains the scratch recognition result through the scratch recognition unit, if the scratch existing signal exists in the recognition result, the average contrast of the scratch region is calculated, the average contrast is compared with a preset contrast standard, if the average contrast is lower than the contrast standard, an exposure time increasing signal is generated and sent to the polarized imaging unit, and the polarized imaging unit prolongs the exposure time of the image sensor module according to the exposure time increasing signal. If the average contrast reaches the contrast standard, the exposure time is not adjusted.
6. The polarimetric imaging metal surface scratch identification system of claim 1, wherein, The environmental interference suppression unit obtains the original polarized image data through the polarized imaging unit, analyzes the environmental light polarization component in the original polarized image data, generates an interference suppression coefficient, and sends the interference suppression coefficient to the image preprocessing unit, and the image preprocessing unit performs environmental light compensation processing on the polarized image data according to the interference suppression coefficient.
7. The polarimetric imaging metal surface scratch identification system of claim 6, wherein, The process that the environmental interference suppression unit analyzes the environmental light polarization component is: A scratch-free area on the metal surface is selected as a reference area, the average value of the polarization state parameters of the reference area is extracted, the average value is taken as an environmental light polarization reference value, the deviation of the polarization state parameters of each pixel point in the original polarized image data from the environmental light polarization reference value is calculated, and the interference suppression coefficient is generated according to the deviation, the larger the deviation is, the larger the interference suppression coefficient is.
8. The polarimetric imaging metal surface scratch identification system of claim 1, wherein, The system self-checking unit monitors the working state of the polarized imaging unit, the image preprocessing unit and the polarized feature extraction unit in real time, if the working parameter of any unit exceeds the preset normal parameter range, a fault warning signal is generated, and the identification information of the fault unit is recorded.
Citation Information
Patent Citations
Seal signature sequence identification method based on polarization spectral imaging
CN111189784A
Tower clearance sensor anomaly detection method and related equipment
CN116412085A