Device and method for realizing automatic focusing of visible light detection system
By introducing a hermetically sealed enclosure and an image processing system into the visible light detection system, combined with a temperature sensor and an absolute position sensor, real-time automatic focusing was achieved, solving the problems of image blurring and local optima, and improving image clarity and efficiency.
Patent Information
- Application Number
- CN202511419419.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-09-30
AI Technical Summary
Existing visible light detection systems cannot achieve real-time, automated joint focusing under different ambient temperatures, resulting in blurred images. Furthermore, image autofocus methods are prone to getting stuck in local optima, making it impossible to achieve clear images.
The system employs a control system, optical lens, photoelectric sensor, temperature sensor, and absolute position sensor housed within an hermetically sealed enclosure. By monitoring temperature and distance changes in real time and combining this with an image processing system, it performs automatic focusing, calculates the focus value using the Tenengrad method, filters out noise interference, and achieves precise focusing.
It achieves real-time, automated, clear imaging under different ambient temperatures and distances, avoids condensation, improves imaging quality and focus detection efficiency, and reduces time and labor costs.
Smart Images

Figure CN120916059A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of photoelectric detection, and particularly relates to an automatic focusing implementation device and method of a visible light detection system. BACKGROUND
[0002] In the field of photoelectric detection, a detection system working in the visible light band occupies an important position in photoelectric equipment and is regarded as the eyes of the equipment, and is an important means to obtain target image information. The visible light detection system includes an optical lens (including an optical system), a photoelectric sensor, an image processing and display device, and the like. In order to obtain a clear image of a target, a manual or hand-controlled electric distance and temperature focusing function is provided.
[0003] The reason for setting the focusing is that, in the process of assembling the optical lens and the machine of the visible light detection system, the imaging surface of the optical lens for the target at an infinite distance is usually dropped on the receiving target surface of the photoelectric sensor at normal temperature, at which time the focusing is successful and the target image is optimal. When the imaging distance changes, the imaging surface of the target deviates from the receiving target surface of the photoelectric sensor, and the deviation range is out of focus beyond the focal depth of the detection system, which leads to blurred imaging and affects the detection of the target by the subsequent system. Through distance focusing, the target can still be focused on the target surface of the photoelectric sensor. When the detection system is used at different environmental temperatures, the refractive index of the optical element changes with the temperature, which causes the length of the system optical path to change and causes out-of-focus; at the same time, due to the difference in the thermal expansion coefficient between the optical element material and the mechanical material such as the lens barrel and the base plate, different axial displacements are caused, which aggravate the out-of-focus phenomenon and cause the imaging surface of the target to deviate from the receiving target surface of the photoelectric sensor. Therefore, temperature focusing is set to compensate for the temperature out-of-focus and obtain a clear image of the target. Most of the existing detection technologies do not consider the internal drying problem of the system. When the environment is complex, condensation occurs due to the lack of drying means, which ultimately affects the imaging quality. Some products use a desiccant to keep the system dry, but the desiccant has an effective period and is prone to failure, which is inconvenient to maintain. In addition, the number of desiccants is limited by the volume and cannot meet the drying needs of large-volume optical detection systems.
[0004] With the wide application of the visible light detection system, the demand for real-time and automatic clear imaging of moving targets at near (such as within 100 m) and far (such as more than 100 km) or from far to near is increasing at different environmental temperatures. The existing technology has manual or hand-controlled electric distance focusing and temperature focusing, which does not meet the requirements of real-time and automatic focusing, has high time and labor costs, and only considers a single factor. There is little research on combined focusing of multiple factors, and it cannot meet the requirements of real-time and full-automatic combined focusing under the changes of distance and temperature. In addition, the automatic focusing method based on the temperature model or theoretical analysis function of the existing technology compensates for the out-of-focus by setting steps, and the accuracy does not meet the requirements of clear imaging. This is because: (1) to obtain a clear image, the accuracy of the glass refractive index needs to reach 10 -6The above, the theoretical model cannot meet the focusing accuracy requirement; (2) Step compensation belongs to open loop state, and the compensation effect cannot meet the focusing accuracy requirement.
[0005] After the distance-temperature focusing, due to the errors in distance and temperature measurement, a small offset may be generated in the final focusing, in order to achieve the optimal focusing effect, fine correction is needed by using image automatic focusing. In the process of using image automatic focusing, the focusing mechanism needs to be guided to move by the focusing value. The existing image focusing method usually includes the process of multiple optimization oscillation, which affects the imaging perception. The existing image-based automatic focusing method lacks focusing guidance (target distance transformation trend), and when deviating far from the optimal focusing position, it is easy to fall into local optimum and cannot be adjusted to the actual optimal focusing position. At the same time, under the influence of different weather and environment, image noise will have a great influence on the focusing value, leading to the optimization error of the focusing mechanism. SUMMARY
[0006] To solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0007] An automatic focusing implementation device of a visible light detection system, comprising: a gas-tight packaging box body and a control system, an optical lens, a photoelectric sensor, an image processing system, a temperature sensor, a charging and discharging valve and an absolute position sensor installed in the gas-tight packaging box body; wherein the photoelectric sensor is set in the gas-tight packaging box body based on the coincidence of the target surface position and the infinite target optical image plane of the optical lens;
[0008] The optical lens, the temperature sensor, the absolute position sensor and the image processing system are electrically connected with the control system respectively; the photoelectric sensor is connected with the image processing system; the charging and discharging valve is a mechanical type without electrical connection;
[0009] The optical lens has a focusing function, and the focusing function is realized by driving a motor of the control system to drive a focusing element to move linearly along the optical axis direction through a mechanical transmission pair; the control system collects corresponding data of the temperature sensor and the absolute position sensor, and transmits the corresponding data to the image processing system; the image data obtained by the photoelectric sensor is also sent to the image processing system;
[0010] The image processing system receives the data sent by the temperature sensor, the absolute position sensor and the photoelectric sensor, performs real-time calculation and detection on the defocus value of the target image, and sends the defocus value of the target image to the control system for controlling the optical lens to focus.
[0011] An automatic focusing implementation method of a visible light detection system, for the automatic focusing implementation device of the visible light detection system, comprising:
[0012] Step 1, at room temperature, adjust the automatic focusing device of the visible light detection system to realize that the photoelectric sensor receives the target surface on the imaging surface of the optical lens to the infinite distance target, and obtain the clear imaging to the infinite distance target, that is, the focusing is completed; the position of the focusing element of the optical lens at this time is taken as the focusing zero point;
[0013] Step 2, the automatic focusing device of the visible light detection system is filled with nitrogen through the filling and discharging valve and is packaged;
[0014] Step 3, the automatic focusing device of the visible light detection system is placed into the high and low temperature test box, the temperature in the high and low temperature test box is set, the temperature value of the temperature sensor and the corresponding focusing element position are read, and a temperature-focusing element position relationship table is formed;
[0015] Step 4, according to the temperature-focusing element position relationship table recorded in step 3, a temperature-focusing curve is fitted; the temperature compensation position of the focusing element is obtained according to the temperature-focusing curve;
[0016] Step 5, the distance focusing amount is calculated according to the distance of the target and the focusing relationship ;
[0017] Step 6, the focusing element position is obtained according to the temperature compensation position of the focusing element obtained in step 4 and the distance focusing amount obtained in step 5, and preliminary focusing is realized;
[0018] Step 7, the image processing system is used to calculate the image focusing value, and it is judged whether the image clarity reaches the best phase position, if not, the focusing element is guided to image focusing, until the image reaches the image clarity requirement, and the focusing is completed.
[0019] The present application has the following beneficial effects:
[0020] (1) The automatic focusing device of the visible light detection system of the present application adopts a nitrogen-filled airtight packaging box to keep the internal dry state, prevent condensation phenomenon in the device when the temperature in the high and low temperature chamber changes from low temperature to high temperature, affect the clear imaging of the target, and improve the accuracy of the temperature-focusing curve.
[0021] (2) The present application obtains the temperature-focusing curve of the detection system by testing in the high and low temperature chamber, which saves time and labor cost compared with obtaining the environmental temperature change mode in the external natural environment.
[0022] (3) The automatic focusing device of the visible light detection system of the present application realizes real-time and accurate compensation of the defocusing caused by temperature by setting the built-in temperature sensor to detect the temperature of the optical lens in real time.
[0023] (4) The image processing system of the visible light detection system automatic focusing implementation device of the present application calculates the position of the focusing element corresponding to the target distance according to the target distance value inputted from outside and in combination with the optical system parameters. The position information is acquired in real time by an absolute position sensor, and real-time automatic compensation for defocus caused by distance change is realized.
[0024] (5) The visible light detection system automatic focusing implementation method of the present application uses the temperature-focusing curve fitted in advance, in combination with real-time temperature feedback of the built-in temperature sensor, and the distance-focusing corresponding value and the position information of the absolute position sensor acquired in real time, to obtain the focusing element position at different temperatures and different distances: temperature / distance focusing position = temperature compensation focusing position + distance focusing amount.
[0025] (6) The visible light detection system automatic focusing implementation method of the present application realizes real-time and automatic acquisition of the clear image of the target on the basis of (5) above in combination with the fine focusing hybrid method based on the image processing system, solves the defect that pure image focusing falls into local optimum, and improves the focusing efficiency.
[0026] (7) The image processing system of the visible light detection system automatic focusing implementation device of the present application uses the Tenengrad (based on Sobel gradient) method to calculate the focusing value, which has advantages in effectiveness and calculation speed over the local variance method, the entropy-based detection, the Brenner gradient method, the Laplacian method, etc. As for the influence of noise on the detection result, the gradient of the image is calculated and then a suitable threshold is selected for removal. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 Fig. 1 is a top view of the visible light detection system automatic focusing implementation device of the present application, wherein 1 is an optical lens, 2 is a control system, 3 is a photoelectric sensor, 4 is an image processing system, 5 is a temperature sensor, 6 is a charging and discharging valve, 7 is an absolute position sensor, and 8 is a hermetically sealed box.
[0028] Figure 2 Fig. 2 is a schematic diagram of the component connection relationship of the visible light detection system automatic focusing implementation device of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and advantages of the present application clearer and more apparent, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0030] AsFigure 1 As shown in the figure, the automatic focusing implementation device of the visible light detection system of the present application comprises: an optical lens 1, a control system 2, a photoelectric sensor 3, an image processing system 4, a temperature sensor 5, a filling and discharging valve 6, an absolute position sensor 7, and a gas-tight packaging box 8.
[0031] The optical lens 1 with focusing function is installed in the gas-tight packaging box 8. The photoelectric sensor 3 is set in the gas-tight packaging box 8 based on the criterion that the target surface position coincides with the infinite target optical image plane of the optical lens 1. The temperature sensor 5 is installed in the gas-tight packaging box 8, which can be close to the optical lens 1 according to the specific spatial layout. The control system 2 and the image processing system 4 are installed in the gas-tight packaging box 8 according to the spatial layout. The gas-tight packaging box 8 is also provided with the filling and discharging valve 6 and the absolute position sensor 7. The filling and discharging valve 6 is set at a position in the gas-tight packaging box 8 which is convenient for operation of filling and discharging. In the present example, the filling and discharging valve 6 is set at the rear part of the gas-tight packaging box 8. The optical lens 1, the temperature sensor 5, the absolute position sensor 7, and the image processing system 4 are respectively electrically connected with the control system 2. The photoelectric sensor 3 is connected with the image processing system 4. The filling and discharging valve 6 is a mechanical type without electrical connection, which is used for filling nitrogen gas to package the automatic focusing implementation device of the visible light detection system to keep the inside dry.
[0032] As shown in the figure, Figure 2 The component connection relationship and function of the automatic focusing implementation device of the visible light detection system are as follows:
[0033] The optical lens 1 with focusing function comprises a motor, a mechanical transmission pair, and a focusing element. The focusing function is realized by driving the motor through the mechanical transmission pair to drive the focusing element to move linearly along the optical axis. At the same time, the control system 2 collects the corresponding data of the temperature sensor 5 and the absolute position sensor 7, and transmits the corresponding data to the image processing system 4.
[0034] The temperature sensor 5 is used for real-time monitoring of the temperature change in the gas-tight packaging box 8.
[0035] The absolute position sensor 7 is used for real-time measurement of the position information of the output focusing element. In the embodiment, the sampling accuracy of the absolute position sensor 7 is 50 nanometers. The control system 2 receives the position data of the absolute position sensor 7. The control system 2 adopts a PID (proportion, integral, and differential) control algorithm, and the control precision of the minimum moving step of the focusing element is less than 1 micrometer, which can meet the image focusing demand of the optical system.
[0036] A photoelectric sensor 3, in this example a digital industrial camera. The photoelectric sensor 3 obtains an image of an infinite target provided by the collimator at temperature calibration (step 3 below), and in actual use, an image of the imaging target, and sends the image signal to the image processing system 4 for data processing.
[0037] The image processing system 4 receives the temperature and position sensor data returned by the control system 2, combines the image data obtained by the photoelectric sensor 3, and calculates and detects the defocus value of the target image in real time, and sends it to the control system 2 to control the focusing of the optical lens 1.
[0038] The visible light detection system automatic focusing implementation method of the present application uses the visible light detection system automatic focusing implementation device described above, which includes:
[0039] Step 1, as shown in Figure 1 At room temperature, manually adjust the conventional optical system, adjust the photoelectric sensor 3 of the visible light detection system automatic focusing implementation device to receive the target surface on the imaging surface of the optical lens 1 to the infinite distance target (use the light pipe to simulate the infinite distance target), obtain clear imaging of the infinite distance target (use the light pipe to simulate the infinite distance target) to complete the focusing; the position of the focusing element of the optical lens 1 at this time is taken as the focusing zero point, which is the zero point of the absolute position sensor 7 (the zero point position will change with the change of temperature, therefore, the high and low temperature box will be used for calibration and correction in the future).
[0040] Step 2, fill the visible light detection system automatic focusing implementation device with nitrogen through the charging and discharging valve 6.
[0041] Step 3, place the visible light detection system automatic focusing implementation device into the high and low temperature test box. A collimator is erected outside the high and low temperature test box, and the position of the collimator can ensure that the optical lens 1 in the visible light detection system automatic focusing implementation device can clearly image the infinite distance target provided by the collimator. Set the temperature range and temperature change mode of the high and low temperature test box, such as from -40℃ to +60℃, read data every 10℃ interval, and keep the temperature at each temperature for 1 hour. The control system 2 controls the focusing element of the optical lens 1 to move along the optical axis until a clear target image is observed at the corresponding temperature. Read the temperature value of the temperature sensor 5 and the corresponding focusing element position (position information measured by the absolute position sensor 7) at this time. After all temperature segments are recorded, a temperature-focusing element position relationship table is formed.
[0042] Step 4, fitting the temperature-focusing curve according to the temperature-focusing element position relationship table of Step 3. Based on the temperature focusing design curve provided by the optical structure design, the curve provided in the present example is one or more linear equations L=kT+L0, where k is the slope, L0 is the constant related to the focusing position, T is the temperature (the measured value of the temperature sensor 5), and L is the focusing element position. The least squares method is used to fit the linear equation with temperature T and focusing element position L as parameters, and the temperature-focusing curve is obtained. In implementation, according to the temperature-focusing curve, the temperature value is input to obtain the temperature compensation position of the focusing element.
[0043] Step 5, calculating the distance focusing amount according to the distance and focusing relationship of the target ;
[0044] The following formula is the distance and focusing relationship of the target, which derives the distance focusing amount from the distance-focusing relationship .
[0045] The object-image relationship of the optical lens 1 is expressed by the Gaussian formula:
[0046] (1)
[0047] wherein, is the object distance, is the image distance, is the focal length;
[0048] The calculation formula of the image distance is obtained as follows:
[0049] (2)
[0050] The minimum diffraction that can be distinguished by the photoelectric sensor 3 is 1 pixel, and at this time the corresponding image surface changes in the axial direction to satisfy the following formula:
[0051] (3)
[0052] wherein, is the size of the detector pixel, is the optical focal length, is the aperture (entrance pupil diameter) of the optical system, is the image surface change.
[0053] The distance of the detected target satisfies the following relationship, and the distance focusing action is no longer needed:
[0054] (4)
[0055] When the distance of the detected target is , wherein : The latest detection distance. Distance focusing amount The following formula:
[0056] (5)
[0057] According to the actual detection requirements, the stroke of the absolute position sensor 7 covering the focusing range is selected, and the corresponding focusing speed is designed to match the target motion speed.
[0058] Step 6, according to the focusing element temperature compensation position obtained in step 4 above, combined with the distance focusing amount obtained in step 5 , the focusing element position is obtained. The preliminary focusing is realized.
[0059] Wherein, the focusing element position = focusing element temperature compensation focusing position + distance focusing amount .
[0060] Step 7, on the basis of the preliminary focusing in step 6, the image processing system 4 calculates the image focusing value, and determines whether the image sharpness reaches the best phase position. Otherwise, guide the focusing element to image focusing, until the image reaches the image sharpness requirement, and the focusing is completed. In this embodiment, the image-based focusing value calculation is as follows:
[0061] As can be seen from formula (3), the F number (focal length) of the detector determines the theoretical focal plane position of the optical lens 1. When the image dispersion is greater than one pixel of the photoelectric sensor 3, it is considered that the defocus has occurred, and at this time the defocus amount is greater than the depth of focus , according to the Shannon sampling principle, the focusing step S of the control system 2 can be set to 2 times .
[0062] Image focusing value calculation: common automatic focusing calculation focusing value includes the following methods: local variance method, entropy-based call point detection, Tenengrad (based on Sobel gradient) method, Brenner gradient method, Laplacian method, etc.
[0063] Combined with the effectiveness and calculation speed of the focusing value evaluation, the present application selects the Tenengrad (based on Sobel gradient) method to calculate the focusing value. The disadvantage of this method is that noise has an impact on the result. Since noise is mostly low-frequency signal, after calculating the gradient of the image, most of them are in a low threshold state. Selecting a suitable threshold to remove low threshold signals can filter out most of the noise. Image noise is mainly generated by the camera. Collect a uniform background image, calculate its Sobel gradient, and calculate the mean variance at this time. According to the 3 criteria, the threshold segmentation formula is as follows:
[0064] (6)
[0065] wherein, is a segmentation threshold, is a uniform background image gradient mean, is a uniform background image gradient variance.
[0066] image focus value The calculation formula is as follows:
[0067] , (7)
[0068] wherein, and are Sobel filter responses in horizontal and vertical directions respectively, is the width (horizontal direction) of the image, is the height (vertical direction) of the image.
[0069] image focus value The greater the value of the image focus value, the clearer the image. According to this property, the focusing mechanism is guided to move, and the position of the focusing element and the corresponding focus value information are recorded. In the initial period, the focusing mechanism is selected to move towards the optical focusing position, if the corresponding focus value continues to decrease, it is considered that the focusing direction is wrong, and the opposite direction is moved; when the focus value continues to increase, it is considered that the focusing direction is correct, and the focusing mechanism continues to move in the same direction until the peak value of the focus value is detected, and the final image focusing position is the focusing element position corresponding to the peak value of the focus value.
[0070] The above only describes the embodiments of the present application, and does not limit the scope of the present application, any equivalent structure or equivalent process transformation made by using the content of the specification and drawings, or directly or indirectly applied in other related system fields, are also included in the protection scope of the present application.
[0071] The contents not described in detail in the specification of the present application belong to the prior art known to those skilled in the art.
Claims
1. A visible light detection system automatic focusing implementation device, characterized in that, It comprises: Airtight packaging box and control system, optical lens, photoelectric sensor, image processing system, temperature sensor, filling and discharging valve, absolute position sensor installed in the airtight packaging box; wherein the photoelectric sensor is set in the airtight packaging box based on the coincidence of the target surface position and the optical lens infinite distance target optical image plane; The optical lens, temperature sensor, absolute position sensor and image processing system are electrically connected with the control system respectively; the photoelectric sensor is connected with the image processing system; the filling and discharging valve is mechanical without electrical connection; The optical lens has focusing function, which is realized by driving motor of the control system to drive focusing element to move linearly along the optical axis direction through mechanical transmission pair; the control system collects corresponding data of the temperature sensor and absolute position sensor, and transmits the corresponding data to the image processing system; the image data obtained by the photoelectric sensor is also sent to the image processing system; The image processing system receives the data sent by the temperature sensor, absolute position sensor and photoelectric sensor, performs real-time calculation and detection on the defocus value of the target image, and sends the defocus value of the target image to the control system for controlling the optical lens to focus.
2. The automatic focusing device for a visible light detection system according to claim 1, wherein The control system adopts PID control algorithm, and the control precision of the minimum moving step of the focusing element is less than microns.
3. A method for automatic focusing of a visible light detection system, for use in the automatic focusing device of a visible light detection system according to claim 1 or 2, characterized in that It comprises: Step 1, at room temperature, adjust the photoelectric sensor of the visible light detection system automatic focusing device to receive the target surface on the imaging surface of the optical lens on the infinite distance target, obtain clear imaging on the infinite distance target, and complete focusing; the position of the focusing element of the optical lens at this time is taken as the focusing zero point; Step 2, fill nitrogen into the visible light detection system automatic focusing device through the filling and discharging valve for packaging; Step 3, put the visible light detection system automatic focusing device into the high and low temperature test box, set the temperature in the high and low temperature test box, read the temperature value of the temperature sensor and the corresponding focusing element position, and form the temperature-focusing element position relationship table; Step 4, according to the temperature-focusing element position relationship table recorded in step 3, fit the temperature-focusing curve; according to the temperature-focusing curve, obtain the temperature compensation position of the focusing element; Step 5, calculate the distance focus amount according to the distance of the target and the focus relationship ; Step 6, according to the temperature compensation position of the focusing element obtained in step 4 and the distance focusing amount obtained in step 5, obtain the focusing element position, and realize preliminary focusing; Step 7, use the image processing system to calculate the image focusing value, and determine whether the image clarity reaches the best phase position; if not, guide the focusing element to focus the image until the image reaches the image clarity requirement, and the focusing is completed.
4. The method of claim 3, wherein the method further comprises: In step 1, a light pipe is used to simulate an infinite distance target.
5. The method of claim 3, wherein the method further comprises: In step 3, a collimator is arranged outside the high-low temperature test chamber, and the collimator is positioned to ensure that the optical lens in the visible light detection system automatic focusing device can provide a clear image of the infinite distance target provided by the collimator; the temperature range and temperature change mode of the high-low temperature test chamber are set, the control system controls the focusing element of the optical lens to move along the optical axis until a clear target image is observed at multiple corresponding temperatures; the temperature value of the temperature sensor at this time and the corresponding focusing element position are read, and after all the temperature segments are recorded, a temperature-focusing element position relationship table is formed.
6. The method of claim 3, wherein the method further comprises: In step 4, a straight line equation is fitted by using the least square method with temperature T and focusing element position L as parameters, and a temperature-focusing curve is obtained.
7. The method of claim 3, wherein the method further comprises: In step 5, the distance focusing amount is obtained according to the following equation : ; wherein is the optical far target distance, is the current target distance, is the focal length.
8. The method of claim 3, wherein the method further comprises: In step 6, focus element position = focus element temperature-compensated focus position + distance focus amount .
9. The method of claim 3, wherein the method further comprises: In step 7, the image focus value The calculation formula is as follows: , ; wherein, and are the responses of the Sobel filter in horizontal and vertical direction, respectively, is the width of the image, is the height of the image, is the segmentation threshold.
10. The method of claim 9, wherein the method further comprises: Segmentation threshold The formula for calculating the segmentation threshold is as follows: ; wherein, is the uniform background image gradient mean, is the uniform background image gradient variance.
Citation Information
Patent Citations
Ground calibration device and method for defocusing amount of optical lens at high altitude
CN107707906A
An automatic focusing system and a method of an infrared thermal imager with temperature compensation
CN109068073A
Temperature focusing compensation method for photoelectric tracking system
CN109218624A
Servo-mechanism-free defocusing amount automatic compensation control system for aerial camera
CN119472140A
Systems and methods for imaging using absorption
WO2010011938A1