High-reflection plane metal part defect detection method and system based on composite polarized light source and medium
By separating the specular reflection and diffuse reflection components through a composite polarized light source, the problem of difficulty in defect detection in highly reflective flat metal parts is solved, and high-precision defect recognition and image enhancement effects are achieved.
Patent Information
- Application Number
- CN202510930901.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies make it difficult to effectively detect defects such as scratches, pits, and stains on highly reflective flat metal parts. Traditional light sources cause the target outline to be blurred and defects to be concealed, affecting the robustness and reliability of the algorithm.
A composite polarized light source is used for illumination. By adjusting the polarization angle of the light source and the LED band combination, a shooting environment is constructed, an image sequence is collected, the relationship between polarized light intensity and Stokes parameters is established, the polarization intensity distribution is analyzed, a polarized light reflection model is constructed, the specular reflection and diffuse reflection components are separated, and image enhancement and defect recognition are performed.
It effectively removes mirror interference, improves defect recognition accuracy, significantly enhances image contrast, enhances edge sharpness and lighting uniformity, and improves the reliability of defect detection.
Smart Images

Figure CN120801347A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of metal part defects, in particular to a high-reflective planar metal part defect detection method and system based on a composite polarized light source and a medium. BACKGROUND
[0002] In the field of precision manufacturing, metal materials (such as anodized aluminum, stainless steel, mirror copper, etc.) are widely used in the structural parts and housings of high-end products. Such metal parts have extremely high surface smoothness after CNC finishing, often with strong mirror reflection characteristics. When machine vision is used for surface defect (such as scratch, pit, stain) and contour boundary detection, traditional light sources (ring light, backlight, coaxial light) will produce strong reflection, saturated area and interference spot, resulting in blurred target contour and hidden defects, which seriously affects the robustness and reliability of the algorithm.
[0003] Existing methods try to improve by means of oblique illumination, polarization filter, image post-processing, etc., but it is still difficult to balance edge sharpness, illumination uniformity and defect visibility at the same time. SUMMARY
[0004] The purpose of the embodiments of the application is to provide a high-reflective planar metal part defect detection method and system based on a composite polarized light source and a medium, which effectively removes mirror interference and improves defect recognition accuracy by removing diffuse reflection components and reconstructing images.
[0005] The embodiments of the application also provide a high-reflective planar metal part defect detection method based on a composite polarized light source, which comprises the following steps:
[0006] The high-reflective metal part is illuminated based on a composite polarized light source, the polarization angle and LED waveband combination of the light source are adjusted to construct a shooting environment, and an image sequence is collected based on the shooting environment;
[0007] The relationship between polarized light intensity and Stokes parameters is established, the polarization intensity distribution parameters of the image sequence are calculated based on the relationship between polarized light intensity and Stokes parameters, and a polarized intensity distribution image is obtained;
[0008] A polarized light reflection model is constructed, the polarized intensity distribution image is analyzed based on the polarized light reflection model, and the mirror reflection component and the diffuse reflection component are output;
[0009] The mirror reflection component is fitted, and the diffuse reflection component is separated to obtain a de-reflective image;
[0010] The de-reflective image is edge enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information.
[0011] Optionally, in the high-reflective planar metal part defect detection method based on the composite polarized light source, the high-reflective metal part is illuminated based on the composite polarized light source, the shooting environment is constructed by adjusting the polarization angle of the light source and the LED waveband combination, and the image sequence is collected based on the shooting environment. Specifically, the method comprises the following steps:
[0012] A multi-waveband ring-shaped LED ring-shaped light source or an LED strip-shaped light source is selected, and a rotatable linear polarizer is arranged in each LED ring-shaped light source or LED strip-shaped light source;
[0013] The shooting angle is adjusted based on the displacement table, the shooting angle is matched based on the rotation angle of the rotatable linear polarizer, the high-reflective metal part is illuminated, and the illumination environment is obtained;
[0014] The blue light waveband, the red light waveband and the near-infrared waveband are obtained, the blue light waveband, the red light waveband and the near-infrared waveband are combined, and the LED waveband combination is obtained;
[0015] A plurality of shooting environments are constructed based on the illumination environment and the LED waveband combination;
[0016] Based on the plurality of shooting environments, a video is shot in real time, the video is processed by single frame, and an image sequence is obtained.
[0017] Optionally, in the high-reflective planar metal part defect detection method based on the composite polarized light source, the relationship between the polarized light intensity and the Stokes parameter is established, the polarization intensity distribution parameter is calculated based on the relationship between the polarized light intensity and the Stokes parameter, the polarization intensity distribution image is obtained, and the method comprises the following steps:
[0018] The polarizer angle is rotated, the light intensity values of multiple angles are obtained, and the relationship between the polarized light intensity and the Stokes parameter is analyzed;
[0019] The linear polarization degree and the polarization angle are analyzed based on the relationship between the polarized light intensity and the Stokes parameter;
[0020] The polarization intensity of each frame of image is analyzed based on the linear polarization degree and the polarization angle, and the polarization intensity distribution parameters of all frames of image are analyzed to obtain the polarization intensity distribution parameters;
[0021] The polarization intensity distribution image is generated based on the polarization intensity distribution parameters.
[0022] Optionally, in the high-reflective planar metal part defect detection method based on the composite polarized light source, the polarization light reflection model is constructed, the polarization intensity distribution image is analyzed based on the polarization light reflection model, and the specular reflection component and the diffuse reflection component are outputted. Specifically, the method comprises the following steps:
[0023] The polarization image sample is obtained, the polarization image sample is inputted into the initial model framework for iterative training, and the training result is obtained;
[0024] analyzing a mapping relationship from the polarized image to the reflection component based on the training result;
[0025] dynamically adjusting model parameters based on the mapping relationship from the polarized image to the reflection component, to obtain a polarized light reflection model;
[0026] inputting the polarized intensity distribution image into the polarized light reflection model, and outputting the reflection component;
[0027] classifying the reflection component to obtain a specular reflection component and a diffuse reflection component.
[0028] Optionally, in the high-reflective planar metal part defect detection method based on the composite polarized light source, the specular reflection component is fitted, and the diffuse reflection component is separated to obtain a de-reflective image, and the method specifically comprises:
[0029] obtaining the specular reflection component, and obtaining edge information based on the specular reflection component;
[0030] optimizing the edge information, filling in edge breakpoints, and obtaining a complete specular reflection component;
[0031] analyzing distribution information of the specular reflection component, and setting fitting parameters based on the distribution information of the specular reflection component;
[0032] fitting the specular reflection component based on the fitting parameters, to obtain the de-reflective image.
[0033] Optionally, in the high-reflective planar metal part defect detection method based on the composite polarized light source, the de-reflective image is edge-enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information, and the method specifically comprises:
[0034] obtaining the de-reflective image, and calculating an image gray value;
[0035] comparing the image gray value with a set gray threshold value;
[0036] if the image gray value is greater than or equal to the set gray threshold value, analyzing an image defect based on the defect recognition algorithm to obtain the defect information;
[0037] if the image gray value is less than the set gray threshold value, generating optimization information, and enhancing the image gray value based on the optimization information to obtain the enhanced image.
[0038] In a second aspect, the embodiments of the present application provide a high-reflective planar metal part defect detection system based on a composite polarized light source. The system comprises a memory and a processor. The memory comprises a program of a high-reflective planar metal part defect detection method based on a composite polarized light source. The program of the high-reflective planar metal part defect detection method based on a composite polarized light source is executed by the processor to implement the following steps:
[0039] The high-reflective metal part is illuminated based on the composite polarized light source. The shooting environment is constructed by adjusting the polarization angle of the light source and the combination of the LED wave bands. The image sequence is acquired based on the shooting environment.
[0040] The relationship between the polarized light intensity and the Stokes parameter is established. The polarization intensity distribution parameter is calculated based on the relationship between the polarized light intensity and the Stokes parameter, and the polarization intensity distribution image is obtained.
[0041] The polarized light reflection model is constructed. The polarization intensity distribution image is analyzed based on the polarized light reflection model, and the specular reflection component and the diffuse reflection component are output.
[0042] The specular reflection component is fitted, and the diffuse reflection component is separated to obtain the anti-reflective image.
[0043] The edge of the anti-reflective image is enhanced based on the image enhancement algorithm to obtain the enhanced image. The enhanced image is analyzed based on the defect recognition algorithm to obtain the defect information.
[0044] Optionally, in the high-reflective planar metal part defect detection system based on a composite polarized light source, the high-reflective metal part is illuminated based on the composite polarized light source. The shooting environment is constructed by adjusting the polarization angle of the light source and the combination of the LED wave bands. The image sequence is acquired based on the shooting environment. Specifically, the method comprises the following steps.
[0045] A multi-waveband ring-shaped LED ring-shaped light source or an LED strip-shaped light source is selected. Each LED ring-shaped light source or LED strip-shaped light source is internally provided with a rotatable linear polarizer.
[0046] The shooting angle is adjusted based on the displacement table. The shooting angle is matched based on the rotation angle of the rotatable linear polarizer. The high-reflective metal part is illuminated to obtain the illumination environment.
[0047] The blue light wave band, the red light wave band, and the near-infrared wave band are obtained. The blue light wave band, the red light wave band, and the near-infrared wave band are combined to obtain the LED wave band combination.
[0048] A plurality of shooting environments are constructed based on the illumination environment and the LED wave band combination.
[0049] The video is processed in a single frame based on the real-time shooting of the plurality of shooting environments to obtain the image sequence.
[0050] Optionally, in the high-reflective planar metal part defect detection system based on the composite polarized light source, a relationship between the polarized light intensity and the Stokes parameter is established, the polarized intensity distribution parameter is calculated based on the relationship between the polarized light intensity and the Stokes parameter, and a polarized intensity distribution image is obtained, specifically including:
[0051] The angle of the rotating polarizer is adjusted, the light intensity values at multiple angles are obtained, and the relationship between the polarized light intensity and the Stokes parameter is analyzed;
[0052] The degree of linear polarization and the polarization angle are analyzed based on the relationship between the polarized light intensity and the Stokes parameter;
[0053] The polarized intensity of each frame of image is analyzed based on the degree of linear polarization and the polarization angle, the polarized intensities of all the frames of image are analyzed, and the polarized intensity distribution parameter is obtained;
[0054] The polarized intensity distribution image is generated based on the polarized intensity distribution parameter.
[0055] In a third aspect, the embodiments of the present application also provide a computer readable storage medium, the computer readable storage medium includes a high-reflective planar metal part defect detection method program based on a composite polarized light source, and the high-reflective planar metal part defect detection method program based on the composite polarized light source is executed by a processor to implement the steps of the high-reflective planar metal part defect detection method based on the composite polarized light source according to any one of the above.
[0056] As can be seen from the above, the high-reflective planar metal part defect detection method, system and medium based on the composite polarized light source provided by the embodiments of the present application, by illuminating the high-reflective metal part based on the composite polarized light source, adjusting the polarization angle and the LED waveband combination of the light source to construct a shooting environment, collecting an image sequence based on the shooting environment, establishing a relationship between the polarized light intensity and the Stokes parameter, calculating a polarized intensity distribution parameter based on the relationship between the polarized light intensity and the Stokes parameter, and obtaining a polarized intensity distribution image, constructing a polarized light reflection model, analyzing the polarized intensity distribution image based on the polarized light reflection model, outputting a specular reflection component and a diffuse reflection component, fitting the specular reflection component, separating the diffuse reflection component, obtaining a de-reflective image, performing edge enhancement on the de-reflective image based on an image enhancement algorithm, obtaining an enhanced image, analyzing the enhanced image based on a defect recognition algorithm, and obtaining defect information, effectively stripping the specular interference by removing the diffuse reflection component and reconstructing the image, and improving the defect recognition accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0058] Figure 1 The flow chart of the high-reflective planar metal part defect detection method based on the composite polarized light source provided in the embodiments of the present application;
[0059] Figure 2 The shooting environment construction flow chart of the high-reflective planar metal part defect detection method based on the composite polarized light source provided in the embodiments of the present application;
[0060] Figure 3 The polarization intensity distribution image acquisition flow chart of the high-reflective planar metal part defect detection method based on the composite polarized light source provided in the embodiments of the present application. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of the present application.
[0062] It should be noted that similar reference numbers and letters represent similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0063] Please refer to Figure 1 , Figure 1 The flow chart of the high-reflective planar metal part defect detection method based on the composite polarized light source in some embodiments of the present application. The high-reflective planar metal part defect detection method based on the composite polarized light source is used in a terminal device. The high-reflective planar metal part defect detection method based on the composite polarized light source includes the following steps:
[0064] S101, illuminate the high-reflective metal part based on the composite polarized light source, adjust the polarization angle of the light source and the LED waveband combination to construct a shooting environment, and collect an image sequence based on the shooting environment;
[0065] S102, establish a relationship between the polarized light intensity and the Stokes parameter, calculate the polarization intensity distribution parameter based on the relationship between the polarized light intensity and the Stokes parameter, and obtain a polarization intensity distribution image;
[0066] S103, construct a polarized light reflection model, analyze the polarization intensity distribution image based on the polarized light reflection model, and output the specular reflection component and the diffuse reflection component;
[0067] S104, fit the specular reflection component and separate the diffuse reflection component to obtain a de-reflective image;
[0068] S105, edge enhance the de-reflective image based on an image enhancement algorithm to obtain an enhanced image, analyze the enhanced image based on a defect recognition algorithm, and obtain defect information.
[0069] It should be noted that through the cascade processing of image enhancement and defect recognition, the defect detection precision of the high-reflective metal part can be significantly improved. The reflected light on the metal surface usually includes specular reflection and diffuse reflection. The specular reflection light intensity is high, and the polarization state is related to the incident light (following the Fresnel law). The diffuse reflection: the light intensity is low, and the polarization state is random (approximately non-polarized light).
[0070] Please refer to Figure 2 , Figure 2 is a shooting environment construction flowchart of a high-reflective planar metal part defect detection method based on a composite polarized light source in some embodiments of the present application. According to the embodiment of the present application, the high-reflective metal part is illuminated based on the composite polarized light source, the shooting environment is constructed by adjusting the polarization angle of the light source and the LED waveband combination, and the image sequence is collected based on the shooting environment. Specifically, it includes:
[0071] S201, select a multi-waveband ring-shaped LED ring-shaped light source or a LED strip-shaped light source, and each LED ring-shaped light source or LED strip-shaped light source is internally provided with a rotatable linear polarizer;
[0072] S201, adjust the shooting angle based on the displacement table rotation, match the shooting angle based on the rotation angle of the rotatable linear polarizer, illuminate the high-reflective metal part, and obtain an illumination environment;
[0073] S203, obtain a blue light waveband, a red light waveband and a near-infrared waveband, combine the blue light waveband, the red light waveband and the near-infrared waveband, and obtain an LED waveband combination;
[0074] S204, construct multiple shooting environments based on the illumination environment and the LED waveband combination;
[0075] S205, based on the plurality of shooting environments, shooting a video in real time, performing single-frame processing on the video to obtain an image sequence.
[0076] It should be noted that by adjusting the shooting angle, the rotation angle of the rotatable linear polarizer is matched with the shooting angle, a better lighting environment is achieved, and different LED waveband combinations are selected to improve the shooting clarity.
[0077] Please refer to Figure 3 , Figure 3 is a polarization intensity distribution image acquisition flowchart of a high-reflectivity planar metal part defect detection method based on a composite polarized light source in some embodiments of the present application. According to the embodiment of the present application, the relationship between the polarization light intensity and the Stokes parameter is established, the polarization intensity distribution parameter is calculated based on the relationship between the polarization light intensity and the Stokes parameter, and the polarization intensity distribution image is obtained. Specifically, it includes:
[0078] S301, rotating the polarizer angle, obtaining light intensity values at multiple angles, and analyzing the relationship between the polarization light intensity and the Stokes parameter;
[0079] S302, analyzing the linear polarization degree and the polarization angle based on the relationship between the polarization light intensity and the Stokes parameter;
[0080] S303, analyzing the polarization intensity of each frame of image based on the linear polarization degree and the polarization angle, and analyzing the polarization intensity of all frames of image to obtain the polarization intensity distribution parameter;
[0081] S304, generating a polarization intensity distribution image based on the polarization intensity distribution parameter.
[0082] It should be noted that the polarization intensity distribution is analyzed based on the relationship between the polarization light intensity and the Stokes parameter, so that the accurate polarization intensity distribution image is obtained.
[0083] According to the embodiment of the present application, a polarized light reflection model is constructed, the polarization intensity distribution image is analyzed based on the polarized light reflection model, and the specular reflection component and the diffuse reflection component are output. Specifically, it includes:
[0084] Obtain a polarization image sample, input the polarization image sample into an initial model framework for iterative training, and obtain a training result;
[0085] Based on the training result, the mapping relationship from the polarization image to the reflection component is analyzed;
[0086] Based on the mapping relationship from the polarization image to the reflection component, the model parameters are dynamically adjusted to obtain a polarized light reflection model;
[0087] The polarization intensity distribution image is input into the polarized light reflection model, and the reflection component is output.
[0088] The reflection component is classified to obtain the specular reflection component and the diffuse reflection component.
[0089] It should be noted that the polarized reflected light modeling method is as follows:
[0090] Suppose that the reflected light intensity of the incident light after surface reflection is composed of two orthogonal components:
[0091] I || : the polarization component parallel to the reflection surface;
[0092] I ⊥ : the polarization component perpendicular to the reflection surface;
[0093] The total reflection intensity I r can be expressed as:
[0094] I r = I || + I ⊥
[0095] In polarized imaging, the relationship between the imaging intensity I(θ) and the polarization angle θ is:
[0096] I(θ) = I0(1 + pcos1(θ - θ0))
[0097] wherein:
[0098] I(θ): the image brightness when the polarization angle is θ;
[0099] I0: the average light intensity;
[0100] p ∈ [0, 1]: the polarization degree (Degree of Linear Polarization);
[0101] θ0: the main polarization direction;
[0102] By fitting the cosine function to the images at multiple angles (for example, θ = 0°, 45°, 90°, 135°), ρ and θ0 can be solved.
[0103] Further, the specular reflection and diffuse reflection separation method is as follows:
[0104] According to the physical reflection model, the total reflected light I r can be divided into:
[0105] I r = I d + I s
[0106] wherein: I d : the diffuse reflection component; I s : the specular reflection component;
[0107] With the polarization degree characteristics, the specular reflection has a higher polarization degree, and the diffuse reflection polarization degree is close to 0. Therefore:
[0108] I s = p I r ,I d = (1-p) I r
[0109] By estimating p in the above step, the specular reflection separation can be completed, and a de-reflective image is obtained:
[0110] I enhanced = I d = (1-p) I r
[0111] I enhanced represents an image obtained after the de-reflective image (i.e., the image after stripping the specular reflection component) is processed by an image enhancement algorithm (such as edge enhancement, high-frequency detail highlighting, etc.).
[0112] According to the embodiment of the present application, the specular reflection component is fitted, and the diffuse reflection component is separated to obtain a de-reflective image, which specifically includes:
[0113] The specular reflection component is obtained, and edge information is obtained based on the specular reflection component;
[0114] The edge information is optimized and processed to fill in the edge breakpoints to obtain a complete specular reflection component;
[0115] The distribution information of the specular reflection component is analyzed, and fitting parameters are set based on the distribution information of the specular reflection component;
[0116] The specular reflection component is fitted based on the fitting parameters to obtain a de-reflective image.
[0117] It should be noted that the spatial distribution of the specular reflection is fitted using polarization intensity distribution parameters (such as polarization degree P and polarization angle θ).
[0118] The fitted specular reflection component is subtracted from the total light intensity, and the diffuse reflection details (such as surface texture and defects) are retained.
[0119] According to the embodiment of the present application, the de-reflective image is edge enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information, which specifically includes:
[0120] The de-reflective image is obtained, and the image gray value is calculated;
[0121] The image gray value is compared with the set gray threshold value;
[0122] If the image gray value is greater than or equal to the set gray threshold value, the image defect is analyzed based on a defect recognition algorithm to obtain defect information;
[0123] If the image gray value is less than the set gray threshold value, optimization information is generated, and the image gray value is enhanced based on the optimization information to obtain an enhanced image.
[0124] It should be noted that high-frequency detail enhancement and direction gradient operators (such as Sobel and Canny) can be used to extract the edges and defect regions of the image after polarization optimization.
[0125] Further, the defect contrast enhancement rate η is defined as an effect evaluation index:
[0126]
[0127] Where C 增强 represents the contrast of the image after polarization processing and image enhancement.
[0128] C 原始 represents the contrast of the original image (before processing).
[0129] C represents the contrast.
[0130] I max represents the maximum gray value of the target region (such as a defect or feature region) in the image, which reflects the brightness peak value of the target region when calculating the contrast.
[0131] I min represents the minimum gray value of the background region in the image, which reflects the dark value of the background when calculating the contrast.
[0132] Experiments show that the image contrast is improved to 1.8-2.5 times the original using the method.
[0133] In a second aspect, the embodiments of the present application provide a high-reflective planar metal part defect detection system based on a composite polarized light source, which comprises a memory and a processor, the memory comprising a program of a high-reflective planar metal part defect detection method based on a composite polarized light source, and the program of the high-reflective planar metal part defect detection method based on a composite polarized light source is executed by the processor to realize the following steps:
[0134] The high-reflective metal part is illuminated based on the composite polarized light source, the polarization angle and the LED waveband combination of the light source are adjusted to construct a shooting environment, and an image sequence is collected based on the shooting environment;
[0135] The relationship between the polarized light intensity and the Stokes parameter is established, the polarization intensity distribution parameter is calculated based on the relationship between the polarized light intensity and the Stokes parameter, and a polarization intensity distribution image is obtained.
[0136] construct a polarized light reflection model, analyze the polarized intensity distribution image based on the polarized light reflection model, and output a specular reflection component and a diffuse reflection component;
[0137] fit the specular reflection component and separate the diffuse reflection component to obtain a reflection-free image;
[0138] edge enhancement is performed on the reflection-free image based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information.
[0139] According to the embodiment of the present application, the high-reflective metal part is illuminated based on the composite polarized light source, the shooting environment is constructed by adjusting the polarization angle of the light source and the combination of the LED waveband, and the image sequence is collected based on the shooting environment, specifically including:
[0140] select a multi-waveband ring-shaped LED ring-shaped light source or a LED strip-shaped light source, and each LED ring-shaped light source or LED strip-shaped light source is internally provided with a rotatable linear polarizer;
[0141] The shooting angle is adjusted based on the displacement table, the shooting angle is matched based on the rotation angle of the rotatable linear polarizer, and the high-reflective metal part is illuminated to obtain an illumination environment;
[0142] obtain a blue light waveband, a red light waveband and a near-infrared waveband, combine the blue light waveband, the red light waveband and the near-infrared waveband to obtain an LED waveband combination;
[0143] Construct multiple shooting environments based on the illumination environment and the LED waveband combination;
[0144] Based on the multiple shooting environments, a video is shot in real time, and the video is processed frame by frame to obtain an image sequence.
[0145] According to the embodiment of the present application, the relationship between the polarized light intensity and the Stokes parameter is established, the polarized intensity distribution parameter is calculated based on the relationship between the polarized light intensity and the Stokes parameter, and the polarized intensity distribution image is obtained, specifically including:
[0146] Rotate the polarizer angle to obtain light intensity values at multiple angles, and analyze the relationship between the polarized light intensity and the Stokes parameter;
[0147] Based on the relationship between the polarized light intensity and the Stokes parameter, the degree of linear polarization and the polarization angle are analyzed;
[0148] Based on the degree of linear polarization and the polarization angle, the polarized intensity of each frame of image is analyzed, and the polarized intensity of all frames of image is analyzed to obtain the polarized intensity distribution parameter;
[0149] Based on the polarized intensity distribution parameter, a polarized intensity distribution image is generated.
[0150] It should be noted that the polarization intensity distribution is analyzed through the relationship between the polarization light intensity and the Stokes parameter, so as to obtain the accurate polarization intensity distribution image.
[0151] According to the embodiment of the present application, the polarized light reflection model is constructed, the polarization intensity distribution image is analyzed based on the polarized light reflection model, and the specular reflection component and the diffuse reflection component are output, specifically including:
[0152] The polarized image sample is obtained, and the polarized image sample is input into the initial model framework for iterative training to obtain a training result;
[0153] The mapping relationship of the polarized image to the reflection component is analyzed based on the training result;
[0154] The model parameters are dynamically adjusted based on the mapping relationship of the polarized image to the reflection component to obtain the polarized light reflection model;
[0155] The polarization intensity distribution image is input into the polarized light reflection model, and the reflection component is output;
[0156] The reflection component is classified to obtain the specular reflection component and the diffuse reflection component.
[0157] It should be noted that the polarized reflection light modeling method is as follows:
[0158] Suppose that the reflected light intensity of the incident light after reflection on the surface is composed of two orthogonal components:
[0159] I || : the polarization component parallel to the reflection surface;
[0160] I ⊥ : the polarization component perpendicular to the reflection surface;
[0161] The total reflection intensity I r can be represented as:
[0162] I r = I || + I ⊥
[0163] In polarized imaging, the relationship between the imaging intensity I(θ) and the polarization angle θ is:
[0164] I(θ) = I0(1 + pcos1(θ - θ0))
[0165] Wherein:
[0166] I(θ): the image brightness when the polarization angle is θ;
[0167] I0: average light intensity;
[0168] ρ∈[0,1]: Degree of Linear Polarization (DoLP);
[0169] θ0: Principal Polarization Direction;
[0170] By fitting the cosine function to the images at multiple angles (e.g. θ = 0°, 45°, 90°, 135°), ρ and θ0 can be solved.
[0171] Further, the specular reflection and diffuse reflection separation method is as follows:
[0172] According to the physical reflection model, the total reflected light I r can be divided into:
[0173] I r = I d + I s
[0174] Where: I d : diffuse reflection component; I s : specular reflection component;
[0175] Using the polarization degree characteristics, specular reflection has a higher polarization degree, while the diffuse reflection polarization degree is close to 0. Therefore:
[0176] I s = ρ·I r ,I d = (1-ρ)·I r
[0177] By estimating ρ in the previous step, specular reflection separation can be completed to obtain the anti-glare image:
[0178] I enhanced = I d = (1-ρ)·I r
[0179] According to the embodiment of the present application, the specular reflection component is fitted, and the diffuse reflection component is separated to obtain the anti-glare image, specifically including:
[0180] Obtain the specular reflection component, and obtain the edge information based on the specular reflection component;
[0181] Optimize the edge information, fill in the edge breakpoints, and obtain the complete specular reflection component;
[0182] Analyze the distribution information of the specular reflection component, and set the fitting parameters based on the distribution information of the specular reflection component;
[0183] Fit the specular reflection component based on the fitting parameters to obtain the anti-glare image.
[0184] It should be noted that the spatial distribution of the specular reflection is fitted by using the polarization intensity distribution parameters (such as the degree of polarization P and the polarization angle θ).
[0185] The fitted specular reflection component is subtracted from the total light intensity, and the diffuse reflection details (such as surface texture and defects) are retained.
[0186] According to an embodiment of the present application, the anti-reflection image is edge enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information, specifically including:
[0187] The anti-reflection image is obtained, and the image gray value is calculated.
[0188] The image gray value is compared with the set gray threshold value.
[0189] If the image gray value is greater than or equal to the set gray threshold value, the image defect is analyzed based on the defect recognition algorithm to obtain the defect information.
[0190] If the image gray value is less than the set gray threshold value, optimization information is generated, and the image gray value is enhanced based on the optimization information to obtain the enhanced image.
[0191] It should be noted that the image edge and defect area after polarization optimization can be extracted by using high-frequency detail enhancement and a direction gradient operator (such as Sobel and Canny).
[0192] Further, the defect contrast enhancement rate η is defined as an effect evaluation index:
[0193]
[0194] Experiments show that the image contrast is improved to 1.8-2.5 times of the original image contrast.
[0195] The third aspect of the present application provides a computer readable storage medium, and the readable storage medium includes a high-reflective planar metal part defect detection method program based on a composite polarized light source. When the high-reflective planar metal part defect detection method program based on the composite polarized light source is executed by a processor, the steps of the high-reflective planar metal part defect detection method based on the composite polarized light source are realized.
[0196] The application discloses a high-reflective plane metal part defect detection method and system based on a composite polarized light source and a medium.
[0197] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other manners. The above-described device embodiments are merely illustrative. For example, the division of units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0198] The units described as separate components above can or can not be physically separate, and the components shown as units can or can not be physical units; they can be located in one place or distributed on multiple network units; and part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0199] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; and the integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional unit.
[0200] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware of program instructions, and the foregoing program can be stored in a readable storage medium, and the program executes the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes various media capable of storing program codes, such as a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc.
[0201] Alternatively, the integrated unit of the present application can be stored in a readable storage medium if the integrated unit is realized in the form of a software function module and sold or used as an independent product. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the software product is stored in a storage medium, includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes various media capable of storing program codes, such as a mobile storage device, a ROM, a RAM, a magnetic disc or an optical disc.
Claims
1. A method for detecting defects in highly reflective planar metal parts based on a composite polarized light source, characterized in that: include: Illuminate highly reflective metal parts using a composite polarized light source, adjust the light source polarization angle and LED band combination to create a shooting environment, and capture image sequences based on the shooting environment; Establishing the relationship between polarized light intensity and Stokes parameters, calculating the polarization intensity distribution parameters of the image sequence based on the relationship between polarized light intensity and Stokes parameters, and obtaining a polarization intensity distribution image; Construct a polarized light reflection model, analyze the polarization intensity distribution image based on the polarized light reflection model, and output the specular reflection component and diffuse reflection component; Fit the specular reflection component and separate the diffuse reflection component to obtain a de-reflected image; The de-reflected image is edge-enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information.
2. The method for detecting defects in highly reflective planar metal parts based on a composite polarized light source according to claim 1, characterized in that: Illuminate highly reflective metal parts using a composite polarized light source, adjust the light source polarization angle and LED band combination to create a shooting environment, and capture image sequences based on the shooting environment, specifically including: Choose a multi-band annular LED ring light source or LED strip light source, each LED ring light source or LED strip light source has a built-in rotatable linear polarizer; The shooting angle is adjusted based on the rotation of the translation stage, and the shooting angle is matched based on the rotation angle of the rotatable linear polarizer to illuminate the highly reflective metal parts to obtain the lighting environment; Obtain a blue light band, a red light band, and a near infrared band, and combine the blue light band, the red light band, and the near infrared band to obtain an LED band combination; Build multiple shooting environments based on lighting environment and LED band combination; Videos are shot in real time based on multiple shooting environments, and the videos are processed into single frames to obtain image sequences.
3. The method for detecting defects in highly reflective planar metal parts based on a composite polarized light source according to claim 2, characterized in that: Establish the relationship between polarized light intensity and Stokes parameters, calculate the polarization intensity distribution parameters of the image sequence based on the relationship between polarized light intensity and Stokes parameters, and obtain the polarization intensity distribution image, which specifically includes: Rotate the polarizer angle to obtain light intensity values at multiple angles and analyze the relationship between polarized light intensity and Stokes parameters; Analyze the linear polarization degree and polarization angle based on the relationship between polarized light intensity and Stokes parameters; Analyze the polarization intensity of each frame image based on the linear polarization degree and polarization angle, analyze the polarization intensity of all frame images, and obtain the polarization intensity distribution parameters; A polarization intensity distribution image is generated based on the polarization intensity distribution parameters.
4. The method for detecting defects in highly reflective planar metal parts based on a composite polarized light source according to claim 3, wherein: Construct a polarized light reflection model, analyze the polarization intensity distribution image based on the polarized light reflection model, and output the specular reflection component and diffuse reflection component, specifically including: Obtain polarization image samples, input the polarization image samples into the initial model framework for iterative training, and obtain training results; Analyze the mapping relationship between polarization image and reflection component based on the training results; Dynamically adjust the model parameters based on the mapping relationship between the polarization image and the reflection component to obtain a polarized light reflection model; The polarization intensity distribution image is input into the polarized light reflection model, and the reflection component is output; The reflection components are classified into specular reflection components and diffuse reflection components.
5. The method for detecting defects in highly reflective planar metal parts based on a composite polarized light source according to claim 4, characterized in that: Fit the specular reflection component and separate the diffuse reflection component to obtain a de-reflected image, specifically including: Obtaining the specular reflection component, and obtaining edge information based on the specular reflection component; Optimize the edge information, fill the edge breakpoints, and obtain the complete specular reflection component; Analyzing distribution information of the specular reflection component analysis, and setting fitting parameters based on the distribution information of the specular reflection component; The specular reflection component is fitted based on the fitting parameters to obtain a de-reflected image.
6. The method for detecting defects in highly reflective planar metal parts based on a composite polarized light source according to claim 5, characterized in that: The de-reflection image is enhanced by edge enhancement based on the image enhancement algorithm to obtain an enhanced image. The enhanced image is analyzed based on the defect recognition algorithm to obtain defect information, including: Obtain the dereflected image and calculate the image grayscale value; Compare the image grayscale value with the set grayscale threshold; If the grayscale value of the image is greater than or equal to the set grayscale threshold, the image defect is analyzed based on the defect recognition algorithm to obtain defect information; If the grayscale value of the image is less than the set grayscale threshold, optimization information is generated, and the grayscale value of the image is enhanced based on the optimization information to obtain an enhanced image.
7. A highly reflective planar metal parts defect detection system based on a composite polarized light source, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program for a method for detecting defects in highly reflective planar metal parts based on a composite polarized light source, and when the program is executed by the processor, the following steps are implemented: Illuminate highly reflective metal parts using a composite polarized light source, adjust the light source polarization angle and LED band combination to create a shooting environment, and capture image sequences based on the shooting environment; Establishing the relationship between polarized light intensity and Stokes parameters, calculating the polarization intensity distribution parameters of the image sequence based on the relationship between polarized light intensity and Stokes parameters, and obtaining a polarization intensity distribution image; Construct a polarized light reflection model, analyze the polarization intensity distribution image based on the polarized light reflection model, and output the specular reflection component and diffuse reflection component; Fit the specular reflection component and separate the diffuse reflection component to obtain a de-reflected image; The de-reflected image is edge-enhanced based on an image enhancement algorithm to obtain an enhanced image, and the enhanced image is analyzed based on a defect recognition algorithm to obtain defect information.
8. The highly reflective planar metal parts defect detection system based on a composite polarized light source according to claim 7, characterized in that: Illuminate highly reflective metal parts using a composite polarized light source, adjust the light source polarization angle and LED band combination to create a shooting environment, and capture image sequences based on the shooting environment, specifically including: Choose a multi-band annular LED ring light source or LED strip light source, each LED ring light source or LED strip light source has a built-in rotatable linear polarizer; The shooting angle is adjusted based on the rotation of the translation stage, and the shooting angle is matched based on the rotation angle of the rotatable linear polarizer to illuminate the highly reflective metal parts to obtain the lighting environment; Obtain a blue light band, a red light band, and a near infrared band, and combine the blue light band, the red light band, and the near infrared band to obtain an LED band combination; Build multiple shooting environments based on lighting environment and LED band combination; Videos are shot in real time based on multiple shooting environments, and the videos are processed into single frames to obtain image sequences.
9. The highly reflective planar metal parts defect detection system based on a composite polarized light source according to claim 8, characterized in that: Establish the relationship between polarized light intensity and Stokes parameters, calculate the polarization intensity distribution parameters of the image sequence based on the relationship between polarized light intensity and Stokes parameters, and obtain the polarization intensity distribution image, which specifically includes: Rotate the polarizer angle to obtain light intensity values at multiple angles and analyze the relationship between polarized light intensity and Stokes parameters; Analyze the linear polarization degree and polarization angle based on the relationship between polarized light intensity and Stokes parameters; Analyze the polarization intensity of each frame image based on the linear polarization degree and polarization angle, analyze the polarization intensity of all frame images, and obtain the polarization intensity distribution parameters; A polarization intensity distribution image is generated based on the polarization intensity distribution parameters.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a program for a method for detecting defects in highly reflective planar metal parts based on a composite polarized light source. When the program for detecting defects in highly reflective planar metal parts based on a composite polarized light source is executed by a processor, the steps of the method for detecting defects in highly reflective planar metal parts based on a composite polarized light source as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Polarized light image processing method and system for highly reflective object detection
CN114897787A
Glass container surface defect detection method based on visual inspection
CN120142307A
Surface inspection method and device
JP2014240766A
Cited By
Automatic adjusting method of polarizer for detecting defects of mechanical parts
CN121141530A
An automatic adjustment method for polarizing mirrors used in defect detection of mechanical parts
CN121141530B
Image recognition system for defect detection of industrial parts
CN121582224A
Precise lens surface flaw detection device based on polarization illumination
CN121656269A