A stray light interference source detection method based on ray simulation and image processing
Patent Information
- Application Number
- CN202610082231.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-21
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2046-01-21
AI Technical Summary
[0004]本发明提供一种基于光线仿真和图像处理的杂散光干扰源检测方法,旨在解决相关技术中,无法有效建立光斑与内部具体干扰源组件之间的关联,导致在发现杂散光后,难以快速追溯并定位产生问题的具体结构表面,影响了光学设计的优化效率的问题
[0014]有益效果:通过计算光线的累积能量损耗与结构关联性偏离,构建光路异常指数,并结合图像局部梯度进行风险评分,精准剔除仿真噪声。其最大创新在于建立了光斑像素与车灯内部组件的逆向关联,实现了对产生杂散光的具体干扰源表面的自动追溯与定位,极大提升了光学设计的排查与优化效率。
Smart Images

Figure CN122066653B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a method for detecting stray light interference sources based on ray simulation and image processing. Background Technology
[0002] As a key component of active safety in automobiles, the optical performance of automotive lights directly affects nighttime driving safety and visual experience. During the research and design phase of automotive lights, accurately detecting and eliminating stray light (such as ghosting and glare) caused by light leakage at lens edges and misreflection from internal components is a crucial step in evaluating the quality of the optical system. Currently, the relevant field mainly uses optical simulation technology based on Monte Carlo ray tracing algorithms for detection. This method simulates the propagation process of a massive number of discrete light rays emitted from a light source through reflection, refraction, and other processes within a three-dimensional model of the automotive light headlight, statistically analyzing the light energy distribution that ultimately reaches a virtual receiving screen, and generating simulated light spot images for designers to analyze.
[0003] However, existing detection methods have significant limitations in practical applications. Because Monte Carlo algorithms are based on probability and statistics, simulation results are often accompanied by a large amount of low-energy sampling noise. Existing analysis methods typically rely mainly on intuitive observation of the brightness of simulated light spot images or simple threshold judgments. This makes it difficult for designers to accurately distinguish between systematic stray light caused by specific hardware defects and computational noise in a background full of random noise, easily leading to misjudgments. Furthermore, relying solely on the final image results makes it difficult to deeply explore the physical characteristics of light propagation (such as energy loss and path deviation), and to effectively establish the correlation between the light spot and specific internal interference source components. This makes it difficult to quickly trace and locate the specific structural surface causing the problem after stray light is detected, affecting the optimization efficiency of optical design. Summary of the Invention
[0004] This invention provides a stray light interference source detection method based on light simulation and image processing. It aims to solve the problem in related technologies that it is impossible to effectively establish the correlation between the light spot and the specific internal interference source components. This makes it difficult to quickly trace and locate the specific structural surface causing the problem after stray light is detected, which affects the optimization efficiency of optical design.
[0005] This invention provides a stray light interference source detection method based on ray simulation and image processing, comprising: acquiring optical simulation data of a vehicle headlight, the optical simulation data including a simulated light spot image and propagation path information of multiple light rays, the propagation path information including a sequence of interaction points between the light rays and the surface of internal components of the headlight; calculating the cumulative energy loss weight of each light ray based on the optical characteristics of the component surface corresponding to each interaction point in the interaction point sequence and the distance between adjacent interaction points; determining the degree of structural correlation deviation of each light ray based on the geometric difference between the final emission direction of each light ray and a preset ideal emission direction, and in combination with its corresponding cumulative energy loss weight; statistically processing the degree of structural correlation deviation of all light rays projected to the same pixel to obtain the optical path anomaly index of the pixel; calculating the stray light risk score of the pixel based on the product of the exponential function value of the optical path anomaly index and the local contrast gradient of the corresponding pixel in the simulated light spot image; and comparing the stray light risk score with a preset threshold to determine whether the pixel is a stray light region, the preset threshold being in the range of 0.5 to 1.0. By combining the physical characteristics of the light propagation path (interaction point sequence) and image features (contrast gradient), the cumulative energy loss weight and the degree of structural correlation deviation are calculated, thereby quantifying the degree of light anomaly. This method, which integrates the physical properties of the light path with the visual properties of the image, can more accurately identify stray light risks caused by specific hardware defects, effectively reduce the interference of random noise on the detection results in the Monte Carlo algorithm, and improve the accuracy of stray light identification.
[0006] Furthermore, the cumulative energy loss weight is calculated by summing the product of the surface absorptivity corresponding to each interaction along the light propagation path and the ratio of the propagation distance from that interaction to the next interaction to the total propagation distance. By quantifying the energy attenuation history of light along the propagation path, the cumulative energy loss weight is established. This calculation method combines surface absorptivity and the proportion of propagation distance, effectively identifying "abnormal light" that experiences multiple ineffective bounces or long-distance propagation outside the design area. Compared to focusing solely on the final energy, this weight better reflects the physical evolution of light within the headlight, providing a solid physical basis for distinguishing between effective light and potential stray light.
[0007] Furthermore, the method for calculating the degree of structural correlation deviation is as follows: the spatial distance between the corresponding coordinate points of the two emission directions on the projection plane is used as the exponent for multiplication, and the result is the degree of structural correlation deviation. By combining the energy loss weight with the geometric difference (cosine difference) of the emission directions and introducing spatial distance for normalization, this index can keenly capture those rays that, although reaching the screen, deviate significantly from the ideal direction. This helps to accurately isolate structurally deviated rays that cause glare or ghosting in complex light distributions.
[0008] Furthermore, the statistical processing of the structural correlation deviation includes: using the initial energy value of each ray as a weight, and weighting the structural correlation deviation of all rays projected to the same pixel. By using the initial energy value to weight the structural correlation deviation, it ensures that the core rays with high energy intensity dominate the anomaly index calculation. This processing method effectively suppresses the evaluation bias caused by massive low-energy sampling noise, making the final calculated optical path anomaly index more realistically reflect the actual impact of light on human visual quality and avoiding misjudgments caused by computational noise.
[0009] Furthermore, the product of the exponential function value of the optical path anomaly index and the local contrast gradient of the corresponding pixel in the simulated light spot image is specifically achieved by multiplying the exponential function value of the optical path anomaly index by the ratio of the local contrast gradient to the average background gradient of the entire simulated light spot image. This utilizes the exponential function to amplify the optical path anomaly signal and introduces the signal-to-noise ratio (SNR) concept (the ratio of local gradient to average background gradient) to construct a highly sensitive stray light risk score. By combining the anomaly index with image edge features, this algorithm can significantly enhance the signal intensity of isolated bright spots or anomalous light spikes at the edges of bright areas that suddenly appear against a dark background, making the true stray light region more prominent in the final score and facilitating automated detection.
[0010] Furthermore, the method for obtaining the preset ideal emission direction includes: pre-constructing and storing an ideal light distribution mapping table, which records the correlation between different initial emission parameters and corresponding ideal emission directions in the standard optical model of the vehicle headlight; and performing lookup or interpolation calculations on the mapping table based on the initial emission parameters of each ray to obtain the corresponding ideal emission direction. By pre-constructing the ideal light distribution mapping table, complex real-time ideal optical path tracing calculations are avoided during the detection process. This method utilizes table lookup or interpolation to quickly obtain the reference direction, ensuring the accuracy of the comparison reference and significantly improving the processing speed of massive ray data, thereby improving the overall detection efficiency and meeting the needs of rapid iteration in engineering design.
[0011] Furthermore, obtaining the local contrast gradient of corresponding pixels in the simulated light spot image includes: performing a convolution operation on the simulated light spot image using a preset image edge detection operator to obtain the brightness gradient value of each pixel. The convolution operation is used to extract edge features of the simulated image, capturing drastic changes in brightness from a visual perspective. This step simulates the human eye's sensitivity to high-contrast areas (such as ghosting and glare), providing an objective image-level basis for stray light determination and ensuring consistency between the detection results and actual visual experience.
[0012] Furthermore, the optical properties of the component surface include at least one of reflectivity, absorptivity, or transmittance. This method clarifies the key physical parameters affecting the energy state of light, ensuring that the simulation model can realistically reproduce the optical behavior of internal components of the vehicle headlight (such as rearview mirrors, lenses, and trim rings). This guarantees the physical authenticity and reliability of the aforementioned energy loss weight calculation, which is the foundation for high-precision ray tracing analysis.
[0013] Furthermore, the system is characterized by, in response to identifying a stray light region, tracing back the propagation paths of all light rays constituting the stray light region; and highlighting the surfaces of key components interacting with the propagation paths on the three-dimensional digital model of the headlight. By establishing a reverse mapping relationship between pixels and internal components, the system can automatically trace back and highlight the specific three-dimensional component surfaces causing the stray light. This allows optical engineers to directly locate the problematic structure (interference source) without relying on experience or guesswork, greatly shortening the cycle from problem discovery to optimized design and improving R&D efficiency.
[0014] Beneficial effects: By calculating the cumulative energy loss of light and the deviation from structural correlation, an optical path anomaly index is constructed, and risk scoring is performed in conjunction with local image gradients to accurately eliminate simulation noise. Its greatest innovation lies in establishing a reverse correlation between light spot pixels and internal components of the headlight, enabling automatic tracing and location of specific interference source surfaces that generate stray light, greatly improving the efficiency of optical design investigation and optimization. Attached Figure Description
[0015] Figure 1 This is a schematic diagram illustrating the interference source detection flowchart according to an embodiment of the present invention; Figure 2 This schematically illustrates a measured illumination distribution diagram according to an embodiment of the present invention and a diagram of prior art detection results; Figure 3 This is a schematic diagram illustrating a stray light risk score according to an embodiment of the present invention. Detailed Implementation
[0016] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0017] like Figure 1 As shown, S101: Acquire the simulated image of the vehicle headlights and the original ray tracing data.
[0018] In this embodiment, an optical simulation software is used to construct the testing environment for the vehicle lamp under test. Specifically, a three-dimensional digital model of the vehicle lamp under test is imported into the optical simulation software, for example... , or Configure the optical system properties within the simulation software, defining the spectral distribution and light distribution curve of the light source. For example, this can be achieved by importing... or File definition The light source is defined, and the surface optical properties of each component of the headlight are set, including refractive index, reflectivity and absorptivity. These components include, but are not limited to, reflectors, lenses and trim rings.
[0019] Based on Monte Carlo ray tracing algorithm ( This simulates multiple discrete light rays emitted by a light source. During their propagation, the light rays interact with the surface of the vehicle headlight's 3D model through reflection, refraction, and scattering, ultimately projecting onto a pre-set virtual receiving screen. This virtual receiving screen is typically positioned at a preset distance from the headlight's reference center; the preset distance can be set to... rice or Meters. The software calculates the light flux and distribution reaching the receiving screen, generating a simulated light spot image presented in the form of an irradiance or light intensity distribution map.
[0020] It should be noted that, while performing the above simulation, the raw data of the entire lifecycle of each ray involved in imaging is exported through the software's underlying data interface or ray path analysis module. Specifically extracted parameters include: Initial energy value: recording the initial radiant flux or energy weight of each ray at the moment of emission from the light source; this value is determined by the light source model properties. Material reflectivity coefficient: recording the optical reflectivity parameter assigned to the contact surface each time the ray collides with the structural component surface along its propagation path inside the headlight. If lens refraction is involved, the corresponding transmittance or refractive index correlation coefficient is extracted. Coordinate set of collision nodes: extracting the three-dimensional spatial coordinates of all points where each ray intersects the surface of the three-dimensional model from the emission point to the final receiving screen, resulting in a coordinate set. This coordinate set constitutes the complete propagation path trajectory of the ray within the headlight.
[0021] S102: Calculate the cumulative energy loss weight of each ray along its propagation path.
[0022] To quantify the physical changes caused by multiple internal reflections of light rays, an optical path collision energy loss index is constructed. This index is used to filter out anomalous light rays that have traveled off-preset paths (such as those with multiple false reflections). The calculation formula is as follows: In the formula, Indicates the first The weight of the cumulative energy loss of a ray of light along its propagation path; For the first The total number of collisions a ray of light experiences before reaching the receiving screen; For the first The reflectivity of the component material at the point of secondary collision; For the first From the second collision point to the... The straight-line distance between the secondary collision points; For the first The total path length of a light ray.
[0023] As shown in the formula above, this formula reflects the energy attenuation distribution of light during its spatial evolution through the product of reflectivity and path share. When reflectivity... At very high altitudes, light loses very little energy. The term is very small, resulting in a small calculated loss weight. It decreases. Conversely, when the reflectivity increases... The light is very low, and a large amount of light is absorbed, resulting in significant light loss. The value is very large. If, after severe absorption, the light continues to travel a long distance inside the lamp, that is... If it is larger, then The larger the weight, the more likely it is to cause a loss. It increases significantly. Therefore, The higher the value, the better. The more ineffective bounces or absorption a ray experiences in non-designed areas, the more likely it is to constitute the physical basis of stray light.
[0024] S103: Degree of deviation in the structural correlation of each ray.
[0025] In this embodiment, based on the cumulative energy loss weight obtained in step S102, and combined with the geometric center and optical axis direction of the vehicle headlight optical design, the deviation between the light's landing point and the design target is further analyzed. The geometric consistency between the final light emission direction and the expected optical axis is measured. The formula for its construction is: In the formula, Indicates the first The degree of deviation in the structural correlation of the light rays; Indicates the first The weight of the cumulative energy loss of a ray of light along its propagation path; For the first The exit angle vector of the ray when it finally exits the headlight; For the first The standard exit angle vector of a ray in an ideal optical model. Indicates the first The coordinates of the exit angle of the light ray when it finally exits the headlight and the first The Euclidean distance between the coordinates of the standard exit angle of a ray under an ideal optical model is the smaller the Euclidean distance, the more consistent the spatial positions of the two exit angles are, and the smaller the deviation in structural correlation. Conversely, the larger the Euclidean distance, the greater the deviation of the ray from the design.
[0026] It should be noted that, for each ray involved in the calculation, the corresponding ideal light distribution map table, which is pre-stored in the database, is first obtained. The ideal light distribution map is a set of reference directions generated during the design phase by performing a single reflection / refraction simulation on a standard optical surface and eliminating all anomalous scattering and stray paths. If the initial emission parameters of any ray do not have an exact match in the ideal light distribution map, its corresponding standard exit angle vector is obtained through a spatial neighborhood interpolation algorithm. Specifically, the map is searched for several reference rays that are closest to the initial emission position and emission direction of the ray in Euclidean space; then, the average is calculated to obtain the standard exit angle vector of the ray under ideal conditions.
[0027] S104: Calculate the optical path anomaly index for each pixel.
[0028] In this embodiment, the spatial projection geometry model in the optical simulation system is used to associate each sampled ray tracked in step S3 with the pixel coordinates where it ultimately strikes the receiving screen. Each pixel on the receiving screen is actually a tiny container for receiving photon energy. To measure the stray light risk at a specific pixel location, the set of all rays falling into that pixel coordinate region is statistically analyzed. The initial energy of each ray is used to weight the deviation of the structural correlation of all rays within that ray set, and the weighted sum is used as the optical path anomaly index of that pixel.
[0029] By employing an initial energy weighting method, it is ensured that core rays with high energy intensity have a higher weight in the calculation of the optical path anomaly index. This avoids evaluation bias caused by a large number of low-energy sampled noisy rays, making the optical path anomaly index more reflective of the impact of real optical flow on visual quality. If a large number of rays at a certain pixel coordinate show high structural correlation deviation, it means that there is systematic stray light interference at that spatial location caused by specific hardware defects inside the headlight (such as trim reflection or light leakage at the lens edge).
[0030] S105: Calculate the stray light risk score for each pixel and perform detection.
[0031] In this embodiment, the stray light risk score is calculated by combining the optical path anomaly index of a pixel with the local contrast gradient of the image. The calculation formula is as follows: In the formula, In the simulated light spot image, the first... Stray light risk score for each pixel; The simulated light spot image is shown in the first... Local contrast gradient values of each pixel; This represents the average gradient background noise of the entire simulated image. In the simulated light spot image, the first... Optical path anomaly index of each pixel; This is a very small constant, to avoid a denominator of 0, for example, 0.01. The grayscale value of each pixel can be obtained by convolving the simulated light spot image using a conventional image edge detection operator; it reflects the degree of drastic brightness change between that pixel and its surrounding pixels. Real stray light (such as ghosting or flare) typically manifests as isolated bright spots suddenly appearing against a dark background, or abnormal light spikes appearing at the edges of bright areas; these are characterized by high gradient values in image processing.
[0032] Formula uses The optical path anomaly index is exponentially amplified, making regions with high optical path anomalies more significant in the final score. Finally, the judgment is... Does it exceed the preset threshold? To identify stray light. In this embodiment, the threshold... The value should range from 0.5 to 1.0, with 0.75 being the preferred value. When When the value is greater than 0.75, the system automatically locks onto stray light areas in the image. Because... core parameters It directly relates to the set of collision paths of light rays. The system can trace back along the high-risk light ray path and highlight the specific component surface (interference source) that caused the stray light in the 3D model, thereby assisting designers in making precise optimizations.
[0033] like Figure 2 As shown, Figure 2 The left-middle image shows the measured illumination distribution: displaying the original state of the headlights illuminating the screen. There is a large bright white spot (main beam) in the middle, and two darker spots are faintly visible in the upper right and lower left. These are stray lights / ghosts caused by defects in the refractive index or reflector bowl.
[0034] Figure 2 The image on the right shows the detection results of the existing technology: a black and white binarized image. The existing technology can only identify light intensity, therefore it marks the normal main beam in the center as white (false alarm), or it cannot separate ghost images due to low brightness from the background. The image shows areas marked in red where the main beam and stray light cannot be distinguished.
[0035] like Figure 3 As shown, Figure 3 The stray light risk score for this scheme is shown in a heatmap (Jet color scale). The brightest main beam area in the center of the graph has turned dark blue (indicating a risk score). (Extremely low, filtered out by the algorithm), while the originally dim stray light areas in the upper right and lower left corners turned bright red and yellow (indicating risk scores). (Extremely high). Conclusion: This invention proves that it can ignore the brightness of the light itself and accurately locate the source of interference based on the optical path anomaly index.
[0036] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A method for detecting stray light interference sources based on ray simulation and image processing, characterized in that, include: Acquire optical simulation data of the vehicle headlights, the optical simulation data including simulated light spot images and propagation path information of multiple light rays, the propagation path information including the sequence of interaction points between the light rays and the surface of the internal components of the vehicle headlights; Based on the optical properties of the component surface corresponding to each interaction point in the interaction point sequence and the distance between adjacent interaction points, the cumulative energy loss weight of each ray is calculated. Based on the geometric difference between the final emission direction of each ray and the preset ideal emission direction, and combined with its corresponding cumulative energy loss weight, the degree of deviation of the structural correlation of the ray is determined. The degree of deviation in the structural correlation of all light rays projected onto the same pixel is statistically processed to obtain the optical path anomaly index of the pixel. The stray light risk score of the pixel is calculated by multiplying the exponential function value of the optical path anomaly index with the local contrast gradient of the corresponding pixel in the simulated light spot image. The stray light risk score is compared with a preset threshold to determine whether the pixel is a stray light region.
2. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The method for calculating the cumulative energy loss weight is as follows: The product of the surface absorptivity corresponding to each interaction along the light propagation path and the ratio of the propagation distance from the time of that interaction to the time of the next interaction to the total propagation distance is accumulated.
3. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The method for calculating the degree of deviation of the structural correlation is as follows: The cumulative energy loss weight is multiplied by the cosine difference of the angle between the final emission direction and the ideal emission direction, and the spatial distance between the corresponding coordinate points of the two emission directions on the projection plane is used as the exponent for multiplication. The result is the degree of deviation of structural correlation.
4. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The statistical processing of the deviation degree of structural correlation includes: Using the initial energy value of each ray as a weight, the structural correlation deviation of all rays projected onto the same pixel is weighted and summed.
5. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The product of the exponential function value based on the optical path anomaly index and the local contrast gradient of the corresponding pixel in the simulated light spot image is specifically: Multiply the exponential function value of the optical path anomaly index by the ratio of the local contrast gradient to the average background gradient of the entire simulated light spot image.
6. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The method for obtaining the preset ideal launch direction includes: An ideal light distribution mapping table is pre-built and stored. The mapping table records the relationship between different initial emission parameters and corresponding ideal emission directions in the standard optical model of the vehicle headlight. The ideal emission direction is obtained by querying or interpolating the mapping table based on the initial emission parameters of each ray.
7. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, Obtaining the local contrast gradient of the corresponding pixel in the simulated light spot image includes: The simulated light spot image is convolved using a preset image edge detection operator to obtain the brightness gradient value of each pixel.
8. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The optical properties of the component surface include at least one of reflectivity, absorptivity, or transmittance.
9. The stray light interference source detection method based on ray simulation and image processing according to any one of claims 1-8, characterized in that, In response to identifying a stray light region, the propagation paths of all light rays constituting the stray light region are traced backward; and the surfaces of key components that interact with the propagation paths are highlighted on the three-dimensional digital model of the vehicle headlight.
10. The stray light interference source detection method based on ray simulation and image processing according to claim 1, characterized in that, The preset threshold value ranges from 0.5 to 1.0.
Citation Information
Patent Citations
Method for suppressing stray light of cross-band spectral imaging system and light path system
CN116183018A
Optical lens optical path optimization method and system based on path simulation
CN118112789A