Composite evaluation function stray light optimization method based on dual-mode ray tracing
By optimizing the optical system using a composite evaluation function based on dual-mode ray tracing and a differential genetic algorithm, the problem of image quality degradation caused by stray light optimization in existing technologies is solved, and the effect of effectively suppressing stray light is achieved while ensuring image quality.
Patent Information
- Application Number
- CN202410479055.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-21
- Publication Date
- 2025-10-24
AI Technical Summary
Existing technologies often lead to a decrease in image quality when optimizing stray light in optical systems, and cannot effectively suppress stray light levels while ensuring image quality.
A composite evaluation function based on dual-mode ray tracing is adopted. By combining sequential and non-sequential ray tracing, a ray splitting mechanism is introduced, and a differential genetic algorithm is used for dynamic weight allocation optimization to optimize the structure of the optical system and reduce stray light levels.
While ensuring imaging quality, the stray light level of the optical system was effectively suppressed, thereby improving the imaging quality of the optical system.
Smart Images

Figure CN120831785A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of precision optical design, and proposes a stray light optimization method based on a double-mode light ray tracing composite evaluation function. BACKGROUND
[0002] When an optical system is working, in addition to the light emitted by the light source reaching the image plane through the normal light path, stray light will also be generated due to scattering and reflection of optical elements. These stray lights will cause noise and reduce the imaging quality of the optical system. Therefore, suppressing stray light is an important content of precision optical design.
[0003] We can reduce the level of stray light by optimizing the structure of the optical system, but the existing optimization method of stray light only takes the stray light level as the evaluation value during optimization, which may lead to a decrease in image quality during optimization, and even the negative impact of the decrease in image quality on the system is much greater than the positive improvement brought by the decrease in stray light level.
[0004] Therefore, there is an urgent need for an optimization method that can effectively suppress the stray light level of the optical system while ensuring the imaging quality. SUMMARY
[0005] Based on the above purpose, the present application provides a stray light optimization method based on a double-mode light ray tracing composite loss function, which comprises the following steps:
[0006] Step 1: The user inputs the light source information into the light source generation function, including the field of view, the light source face radius, the light source energy, the light source position, the light source ring number, the light source arm number, and the light source generation function gives the initial tracing data of the parent light ray;
[0007] Step 2: The user inputs the optical system matrix information, including the thickness, the radius of curvature, the medium, and the film transmittance, and the optical-mechanical model generates the optical system and defines the optical surface and the non-optical surface according to the optical system matrix information;
[0008] Step 3: Based on the light source information and the optical system matrix information, the light rays emitted by the light source are traced through sequential light ray tracing to obtain the RMS (root mean square radius) value under different fields of view;
[0009] Step 4: Define the light ray splitting rule;
[0010] Step 5: Based on the light source information and the optical system matrix information, introduce the light ray splitting mechanism, and trace the light rays emitted by the light source through non-sequential optical tracing to obtain the stray light level under different fields of view;
[0011] Step 6: Calculate the values of loss1 and loss2 from the results of steps 3 and 5, and use the dynamic weight distribution method to optimize using the differential genetic algorithm.
[0012] Further, the initial tracing data of the parent ray given by the light source generating function in step one includes the start point, direction vector, energy, surface number, and propagation direction of each ray;
[0013] Further, the thickness in step two refers to the distance between the optical surface and the next optical surface, the radius of curvature refers to the radius of curvature of the optical surface, the medium refers to the substance filled between the optical surface and the next optical surface, and the film layer transmittance refers to the proportion of energy that can be transmitted when the ray passes through the optical surface;
[0014] Further, the optical surface in step two refers to each lens, and the non-optical surface refers to the lens holder and the lens barrel;
[0015] Further, the sequence ray tracing principle in step three is as follows:
[0016] (1) Calculate the intersection point of the ray and the next surface to be intersected from the initial ray data and the optical system matrix information. If there is no intersection point, stop tracing. Otherwise, proceed to the next step;
[0017] (2) Determine whether the intersection point is located on the optical surface. If not, stop tracing. Otherwise, proceed to the next step;
[0018] (3) Determine whether total reflection occurs. If total reflection occurs, calculate the direction vector of the ray according to the reflection law and update the ray tracing data. Otherwise, update the direction vector of the ray according to Snell's law and update the ray tracing data;
[0019] (4) Repeat steps (1) to (3) until the ray intersects the image plane to complete the tracing
[0020] Further, the ray splitting rule in step four is as follows:
[0021] The ray emitted by the light source is called the parent ray. When the parent ray intersects the optical surface, ray splitting occurs, generating an additional child ray. The child ray also undergoes tracing, and if it intersects the optical surface, it can continue to split, generating an additional child ray. The child ray cannot be split, and the ray splitting follows the following rules:
[0022] When the ray intersects the optical surface, partial reflection and partial transmission occur, causing the energy of the ray to be divided into two parts. The additional ray propagates according to the reflection law.
[0023] The energy distribution is related to the film layer transmittance. Here, the film layer is considered to be an ideal film layer, i.e., the film layer transmittance is independent of the incident angle.
[0024] Further, in step five, non-sequential ray tracing is introduced on the basis of sequential ray tracing, and a ray splitting mechanism is introduced to improve efficiency and accelerate operation through matrixing to obtain the distribution of the child rays, i.e., stray light on the image plane.
[0025] Further, in step six, the loss1 function is defined as follows
[0026] According to the results of sequential mode ray tracing, the total number of rays reaching the image plane is N total . Wherein the intersection coordinates of the jth ray and the image plane are marked as (X j , Y j ), the intersection coordinates of the chief ray and the image plane are marked as (X main , Y mian ), and the image quality evaluation function loss2 is defined as:
[0027]
[0028] The loss1 function reflects the imaging quality of the optical system, and its value is inversely proportional to the imaging quality.
[0029] Further, in step six, the loss2 function is defined as follows
[0030] According to the results of non-sequential mode ray tracing, the total energy of the rays reaching the image plane is E total . Wherein the total energy of the first generation of child rays is E1, and the total energy of the second generation of child rays is E2. The stray light evaluation function loss2 is defined as:
[0031]
[0032] The loss2 function reflects the stray light level of the optical system, and its value is proportional to the stray light level.
[0033] Further, in step six, the optimization algorithm principle is as follows
[0034] The optimization is to first perform sequential tracing value judgment, generate non-sequential tracing value (the last column of the non-sequential tracing matrix), and limit various unreasonable lens groups to ensure that the optimal lens group obtained by non-sequential tracing is a real and effective lens group.
[0035] Due to the characteristics of the tracing method, the evaluation value RMS generated by loss1 is also a standard for measuring the quality of the lens, and the randomization characteristics of the initial population initialized by the genetic algorithm make it less likely for the initial population to obtain a qualified loss1 RMS value. The algorithm in this paper directly calculates the evaluation value of loss2 for qualified lens groups, and implements segmented punishment for groups whose image quality RMS is reduced too much. Taking the original lens RMS1.2 times as the standard, the segmented punishment evaluation value is given, and in the first few generations of evolution, the loss1 RMS evaluation value is optimized to make the population quickly become a lens group population that meets the RMS requirements, and then the loss2 true value is used for evolution to achieve the evolution purpose. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 is an optimization flowchart
[0037] Figure 2 is a schematic diagram of an optical-mechanical structure
[0038] Figure 2 In the middle, ① refers to an optical surface, and ② refers to a non-optical surface.
[0039] Figure 3 is a schematic diagram of a ray splitting mechanism
[0040] Figure 4 is a non-sequential tracing flowchart DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the present application clearer and more apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not constitute a limitation on the present application.
[0042] Figure 1 The optical-mechanical structure diagram of the present application is shown, and it can be observed that the orange annular plane represents the lens fixture, and the purple cylindrical pipe represents the inner wall of the lens barrel. The black part represents the non-optical surface treated by oxidation and blackening or coated with light-absorbing material. If the light intersects with these parts, the tracing will stop;
[0043] Figure 2 A schematic diagram of ray splitting in a specific optical system is shown, and it can be found that the parent rays and the first-generation rays split when they intersect with the optical surface, while the second-generation rays and the rays that do not intersect with the optical surface do not split;
[0044] Figure 3 The flow followed by the non-sequential tracing is given. In actual operation, a series of parameters of the light source need to be given according to the actual situation of the optical system, the parameters are input into the light source function to generate light source information, and then the tracing program can be entered;
[0045] After importing the thickness, medium, radius of curvature, and transmittance of the film layer of the optical system, the program builds a model of the optical system for analysis;
[0046] The tracing program first determines whether the light ray is emitted from the front surface. If the condition is met, the light ray will enter the energy threshold judgment. The light ray that meets both conditions continues to be traced, and the rest of the light ray is discontinued.
[0047] The intersection of the light ray and the optical system surface is calculated, and it is determined whether the intersection is located in the optical surface area. The light ray that is located in the area continues to be traced, and the rest of the light ray is discontinued.
[0048] The normal vector at the intersection of the surface is calculated, and it is determined whether total reflection occurs. The light ray that does not split according to the reflection law calculates the direction cosine. The light ray that does not split according to the refraction law calculates the direction cosine.
[0049] It is determined whether the light ray reaches the upper limit of the number of traces. If not, it is determined whether the next surface is an image plane. If the number of traces reaches the upper limit, the light ray stops tracing.
[0050] If the next surface is not an image plane, the first step is repeated. If the intersection is greater than the image plane size, the light ray stops tracing. If it is within the image plane size, the light ray information is stored, and the tracing result is output.
Claims
1. A method of stray light optimization based on a dual-mode ray-tracing composite optimization function, characterized in that, The application comprises a light source model, a light machine structure model, a sequence light ray tracing model, a corresponding loss1 function (image quality evaluation function), a light ray splitting model, a non-sequence light ray tracing model, and a corresponding loss2 function (stray light evaluation function), and a double loss function optimization algorithm based on a differential genetic algorithm.
2. The light source model of claim 1, wherein The light source generation function generates a parallel light lattice light source through a ring arm method, and a user inputs a field of view angle, a light source surface radius, a light source energy, a light source position, a light source ring number, and a light source arm number, and the function externally outputs parent light ray initial tracing data.
3. The optomechanical structure model of claim 1, wherein The system has optical surfaces and non-optical surfaces, the non-optical surfaces adopt an oxidation blackening process or are coated with a light-absorbing coating, and light rays intersecting the non-optical surfaces will lead to the termination of tracing; The optical surfaces are each lens group, and the non-optical surfaces include lens fixtures and a lens barrel.
4. The sequential light ray tracing model and corresponding lossl function of claim 1, wherein, Based on light source information and optical system matrix information, the step of tracing light rays emitted by the light source to obtain RMS values under different fields of view comprises the following steps: a first step is to establish a parallel light lattice light source through a ring arm method based on the light source information, and to provide parent light ray initial tracing data; A second step is to obtain the reaching of the parent light rays to an image surface through a sequence tracing method based on the parent light ray initial tracing data and the provided optical system matrix information; A third step is to obtain an optical system image quality evaluation result through a loss1 function based on the reaching of the parent light rays to the image surface; The light source information comprises a field of view angle, a light source surface radius, a light source energy, a light source position, a light source ring number, and a light source arm number; The optical system matrix information comprises thickness, curvature radius, medium, and film layer transmittance; The sequence tracing method is to iteratively trace the tracing data according to Snell's law according to the parent light ray initial tracing data and the optical system matrix information without considering light ray splitting until the image surface; The loss1 function is that the total number of light rays reaching the image plane is N according to the sequence mode light ray tracing result total , wherein the intersection coordinates of the jth light ray and the image plane are marked as (X j , Y j ), the intersection coordinates of the chief ray and the image plane are marked as (X main , Y mian ), and the image quality evaluation function is defined as: The loss1 function reflects the imaging quality of the optical system, and its value is inversely proportional to the imaging quality.
5. The light splitting model of claim 1, wherein, The light rays emitted by the light source are called parent light rays, the parent light rays intersect the optical surface to cause light ray splitting, the light ray splitting additionally generates a child light ray, the child light ray also performs tracing, if it intersects the optical surface, it can continue to split to additionally generate a grandchild light ray, the grandchild light ray cannot be split, and the light ray splitting follows the following rules: When the light rays intersect the optical surface, partial reflection and partial transmission occur, so that the energy of the light rays is divided into two parts, which propagate according to the reflection law and the refraction law, and the additionally generated light rays propagate according to the reflection law; The energy distribution is related to the film layer transmittance, and after reading the film layer transmittance in the optical system matrix information, the energy distribution ratio is determined each time the light rays split.
6. The nonsequential optical ray tracing model and corresponding loss2 function of claim 1, wherein, Based on light source information and optical system matrix information, the step of tracing light rays emitted by the light source to obtain stray light levels under different fields of view comprises the following steps: A first step is to establish a parallel light lattice light source through a ring arm method based on the light source information, and to provide parent light ray initial tracing data; The second step of the step is to obtain the condition of the child light reaching the image plane by a non-sequential tracing method based on the parent light initial tracing data and in combination with the provided optical system matrix information; The third step of the step is to obtain the optical system stray light evaluation result by a loss2 function based on the condition of the child light reaching the image plane; The light source information includes a field of view, a light source surface radius, light source energy, and a light source position; The optical system matrix information includes thickness, a radius of curvature, a medium, and film layer transmittance; The non-sequential tracing method is to consider the light splitting of claim 3 when the light passes through an ideal film layer, and to simultaneously utilize matrix to accelerate the operation process; The loss2 function is that the total energy of the light rays reaching the image plane according to the non-sequence mode light ray tracing result is E total ; wherein the total value of the energy of the first generation of sub-light rays is E1, and the total value of the energy of the second generation of sub-light rays is E2; the stray light evaluation function loss2 is defined as: The loss2 function reflects the stray light level of the optical system, and the value thereof is proportional to the stray light level.
7. The dual loss function optimization algorithm based on differential genetic algorithm according to claim 1, characterized in that The loss1 function of claim 5 and the loss2 function of claim 6 are used in dynamic weight distribution to optimize by using a differential genetic algorithm; The differential genetic algorithm (DE-GA) is an improved method of the traditional genetic algorithm; it combines the ideas of the differential evolution algorithm and the genetic algorithm, and enhances the search performance by introducing a differential mutation operation and a parameter adaptive mechanism; the traditional genetic algorithm uses crossover and mutation operations to generate new individuals, while DE-GA uses a differential mutation operation; in the differential mutation operation, a differential vector of a group of individuals is selected, and the differential vector and the current individual are mutated to obtain a new individual solution; The dynamic weight distribution means that when the image quality is good and the imaging system image quality level is higher than a threshold value, the genetic algorithm selects the two loss functions according to the same weight, and when the image quality level is lower than the threshold value (at this time, it is indicated that the system image quality decreases too much), the individual is directly eliminated in the subsequent genetic algorithm selection process, that is, at this time, only loss1 is selected.
