Automatic focusing method for astronomical device
By stretching the gradient evaluation method using image variance in star imaging, the problem of fluctuation in focus direction in the traditional method is solved, and stable automatic focusing of star imaging is achieved.
Patent Information
- Application Number
- CN202310346434.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2043-04-03
AI Technical Summary
The traditional gradient evaluation method is insensitive to the evaluation of image clarity in severe defocusing state in star imaging, resulting in fluctuations in focus direction and making it difficult to achieve automatic focus.
The gradient evaluation method is stretched by image variance. By calculating the accumulation of the variance and gradient evaluation value of the image grayscale data, the focus evaluation value after stretching is obtained, which is used to adjust the focus direction and step length.
The focus direction stability of star imaging in the heavy defocused area is improved, ensuring that the image evaluation method can maintain a stable focus recognition direction, and realize the large-scale automatic focus function of astronomical observation devices.
Smart Images

Figure CN116203696B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an automatic focusing method for star imaging, and in particular to a focusing evaluation method for stretching a gradient evaluation method using image variance, so as to achieve automatic focusing of star imaging in a severe defocus state. Background Art
[0002] In the field of atmospheric measurement, astronomical observation methods are usually used to calculate atmospheric optical characteristic parameters, among which star imaging is mainly used for data calculation. Star imaging needs to ensure imaging quality, and focusing is an important means to ensure imaging quality. For imaging in the field of daily life, it is rich in details, and the gradient evaluation method can be well evaluated. However, for star imaging collected by atmospheric measurement, it has the characteristics of small and concentrated signal areas and weak detail information in the background area. Therefore, for star imaging, the traditional gradient evaluation method is not good for evaluating the clarity of the evaluation image under severe defocus. The difference in the evaluation value of two consecutive frames of images is small, and it is easy to fluctuate, making it difficult to judge the correct direction of focusing. The image variance can also evaluate the image clarity to a certain extent, but for star imaging, its sensitivity in the quasi-focus position is poor. Therefore, an automatic focusing method suitable for star imaging of astronomical devices is needed, which is an important focusing difficulty and difficulty faced in star imaging. Summary of the invention
[0003] The present invention aims to address the deficiencies of the above-mentioned prior art and proposes an automatic focusing method for astronomical devices, in order to solve the problem that the traditional gradient method is insensitive to imaging of severely defocused stars, so that the image evaluation method can maintain a stable focusing identification direction, thereby realizing a large-scale automatic focusing function of the astronomical observation device through image data.
[0004] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0005] The present invention discloses an automatic focusing method for an astronomical device. The astronomical device is provided with a telescope mounted on a two-dimensional turntable, a focusing assembly mounted on the rear end of the telescope, a CCD camera mounted on the rear end of the focusing assembly, a focusing driver drives a movable bracket of a focusing base to move forward and backward by using a rotating shaft, the CCD camera is mounted on the movable bracket, and the telescope is connected to a fixed bracket; the two-dimensional turntable is used to adjust the direction of the telescope in the horizontal and pitch directions to achieve focusing on different stars; the automatic focusing method is characterized in that the following steps are performed:
[0006] Step 1: Move the two-dimensional turntable to the target direction of the current star, and set I a is the current imaging data of the CCD camera, let h ais the current reading of the focus actuator, set the down counter cnt = 0, set the down threshold to δ, set the default focus step to ω, set the current focus step to η = ω, set the focus termination threshold to φ, randomly select a direction to be α, and set the current focus direction
[0007] Step 2: Current imaging data I a Perform grayscale processing to obtain the current imaging grayscale data I a_gray ;
[0008] Step 3: Calculate I using the gradient evaluation function a_gray The gradient evaluation value G(I a_gray );Calculate the current imaging grayscale data I a_gray The variance V(I a_gray );
[0009] Step 4: Use V(I a_gray ) vs. G(I a_gray ) is used to evaluate the stretching and obtain the focus evaluation value B(I a_gray );
[0010] Step 5: Use the focus actuator to move the mobile bracket The moving step length η in the direction is used to obtain the imaging data I after the CCD camera moves. b ;
[0011] Step 6: Repeat steps 2 to 4 to b Processing, get I b The star focusing evaluation value B(I b_gray );
[0012] Step 7: If B(I b_gray )>B(I a_gray ), then B(I b_gray ) is assigned to B(I a_gray ), set the down counter cnt = 0, and repeat steps 5 to 7; if B(I b_gray )≤B(I a_gray ), then execute step 8;
[0013] Step 8: Assign cnt+1 to cnt, and assign B(I b_gray ) is assigned to B(I a_gray ), if cnt<δ, repeat steps 5 to 7; otherwise, execute step 9;
[0014] Step 9: Assign to If η>φ, assign η / 2 to η and repeat steps 5 to 7; otherwise, the focus actuator moves the bracket to After moving the step size cnt×η in the direction, the focusing of the current star is completed.
[0015] The automatic focusing method described in the present invention is also characterized in that the evaluation stretching in step 4 includes: calculating the grayscale variance of the current imaging grayscale data; calculating the gradient evaluation value of the current imaging grayscale data using a gradient evaluation function; and accumulating the evaluation value and the grayscale variance in proportion to obtain the stretched evaluation value, which is the focusing evaluation value.
[0016] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the automatic focusing method, and the processor is configured to execute the program stored in the memory.
[0017] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the automatic focusing method when the computer program is executed by a processor.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] 1. The present invention uses image variance to solve the evaluation difficulties of the traditional gradient evaluation method in star imaging, and proposes a focus evaluation method suitable for star imaging. The focus evaluation method optimizes the focus direction fluctuation problem of star imaging in severely defocused areas, so that the image evaluation method can maintain a stable focus identification direction, thereby realizing a large-scale automatic focusing function of astronomical observation equipment through image data.
[0020] 2. The present invention utilizes the hardware structure of a CCD camera, a telescope, a focusing assembly and a two-dimensional turntable to simplify the focusing structure. The dual-bracket design of the focusing assembly can be applied to star imaging devices of different sizes, has the advantages of low cost and easy manufacturing, and improves the application range of the focusing method.
[0021] 3. The present invention uses image data to perform calculations directly without the need for data transformation, processing, or other external information assistance, thereby reducing the structural complexity and amount of calculation of the focusing module, achieving a more concise and convenient method, and improving the calculation speed of the focusing method.
[0022] 4. The present invention adopts a fully automated processing process, and the entire focusing process is carried out automatically, thereby improving the degree of automation of the device; the method is simple and convenient to operate, and the focusing of the device can be completed without excessive human intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the structure of the present invention;
[0024] Figure 2A focusing assembly used in the present invention;
[0025] Figure 3 is the traditional gradient evaluation function curve described in the present invention;
[0026] Figure 4 The image evaluation function curve after optimization of the present invention;
[0027] Numbers in the figure: 1 two-dimensional turntable; 2, telescope; 3 focusing assembly; 4 CCD camera; 5 focusing driver; 6 rotating shaft; 7 focusing base; 8 moving bracket; 9 fixed bracket. DETAILED DESCRIPTION
[0028] In this embodiment, Figure 1 As shown in the figure, in an automatic focusing method for an astronomical device, the astronomical device is a telescope 2 mounted on a two-dimensional turntable 1, and a focusing assembly 3 is mounted at the rear end of the telescope 2. Figure 2 As shown, a CCD camera 4 is installed at the rear end of the focusing assembly 3. In the focusing assembly 3, the focusing driver 5 drives the mobile bracket 8 of the focusing base 7 to move forward and backward using the rotating shaft 6 according to the calculation result of the focusing evaluation method. The CCD camera 4 is installed on the mobile bracket 8, and the telescope 2 is connected to the fixed bracket 9. The mobile bracket can move a total length of 4cm, and the system zero position is set at 1cm. The output torque of the focusing assembly can reach 1.5NM, and the effective load is 5kg; the two-dimensional turntable 1 is used to adjust the direction of the telescope 2 in the horizontal and pitch directions to achieve focusing on different stars. Specifically, the automatic focusing method is carried out in the following steps:
[0029] Step 1: Move the two-dimensional turntable 1 to the target direction of the current star, and set I a is the current imaging data of CCD camera 4, let h a is the current reading of the focus driver 5, set the down counter cnt = 0, set the down threshold to δ, set the default focus step to ω, set the current focus step to η = ω, set the focus termination threshold to φ, and when the focus step is lower than the termination threshold, select the current peak as the target position. Randomly select a direction as α, and set the current focus direction
[0030] Step 2: Current imaging data I a Perform grayscale processing to obtain the current imaging grayscale data I a_gray , in order to better perform data calculation. If the read image is a grayscale image, this step can be omitted;
[0031] Step 3: Calculate I using the gradient evaluation function a_gray The gradient evaluation value G(I a_gray), usually using a simple gradient calculation function, which is used as the original data model for focus evaluation. The subsequent grayscale variance is based on this data model for data stretching and optimization; calculate the current imaging grayscale data I a_gray The variance V(I a_gray );
[0032] Step 4: Use V(I a_gray ) vs. G(I a_gray ) is used to evaluate the stretching and obtain the focus evaluation value B(I a_gray ), the stretched evaluation value is used as the calculation result of the focus evaluation method of this method, which is suitable for imaging of stars with severe defocus, and the focus direction and step length are updated based on the result;
[0033] Step 5: Obtain the next frame of data after the focus movement, and use the focus driver 5 to move the mobile bracket 8 in The moving step length η in the direction is used to obtain the imaging data I after the CCD camera 4 moves. b ;
[0034] Step 6: Repeat steps 2 to 4 to b Processing, get I b The star focusing evaluation value B(I b_gray );
[0035] Step 7: Determine the focus direction by comparing the data of two consecutive frames. b_gray )>B(I a_gray ), then B(I b_gray ) is assigned to B(I a_gray ), indicating that the current moving direction is the correct direction, the accumulated down counter is cleared, that is, the down counter cnt = 0, and steps 5 to 7 are repeated; if B(I b_gray )≤B(I a_gray ), then execute step 8;
[0036] Step 8 indicates that the current moving direction may be wrong, but the specific judgment needs to be based on the value of the down counter, assign cnt+1 to cnt, and set B(I b_gray ) is assigned to B(I a_gray ), if cnt<δ, it means that the number of consecutive descents has not reached the set threshold, the peak is the extreme point, no need to adjust the direction, repeat steps 5 to 7; otherwise, it means that the number of consecutive descents has reached the set threshold, the peak is the target area, need to change the direction and reduce the step size to search carefully, execute step 9;
[0037] Step 9: First change the focus direction. Assign to If η>φ, it means that the focusing step length has not reached the target accuracy threshold, and it is necessary to reduce the step length and search in reverse. Then, after assigning η / 2 to η, repeat steps 5 to 7. Otherwise, the focusing step length has reached the target accuracy threshold, and the current peak value is the target position. It is necessary to call back the driver to the peak position, and the focusing driver 5 moves the bracket 8 in After moving the step size cnt×η in the direction, the focusing of the current star is completed.
[0038] In this embodiment, the evaluation stretching in step 4 includes: calculating the grayscale variance of the current imaging grayscale data; calculating the gradient evaluation value of the current imaging grayscale data using the gradient evaluation function; and accumulating the evaluation value and the grayscale variance in proportion to obtain the stretched evaluation value, which is the focus evaluation value. The specific evaluation stretching method is shown in formula (1):
[0039]
[0040] Where: G(I) is the image gradient value, V(I) is the image variance, B(I) is the evaluation value after stretching, M and N are the image sizes, and k is the proportional coefficient;
[0041] The focus evaluation method of the focusing method uses image variance to stretch the gradient evaluation method, so that the evaluation curve of the gradient evaluation method still has a recognizable focusing direction when it is severely defocused, and can accurately determine the correct direction of focusing, while retaining the quasi-focus sensitivity of the gradient evaluation method to a large extent. Specifically, this method first calculates the gradient value in the image, then stretches the gradient value according to the image variance, converts the gradient value after image variance stretching into a focus evaluation value, and then determines the focusing direction and position by comparing the changing trends of different focus evaluation values. This method has the characteristics of fast evaluation speed, high accuracy, and good focusing effect, and can achieve efficient and accurate automatic focusing in stellar imaging.
[0042] In this embodiment, Figure 3 This is the evaluation curve characteristic of the traditional gradient evaluation method for star imaging. It can be seen that in the heavily defocused area, the evaluation value of the traditional method is small, which is easy to produce evaluation fluctuations, interfere with the focusing direction, and there is no clear focusing direction overall. Figure 4 This is the focus evaluation method curve characteristic of the astronomical device of the present invention for star imaging. It can be seen that it can still have good focusing direction recognition in the severe defocus area, while maintaining the focusing sensitivity of the positive focus position, solving the difficulty in evaluating star imaging.
[0043] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute an automatic focusing method, and the processor is configured to execute the program stored in the memory.
[0044] In this embodiment, a computer-readable storage medium stores a computer program, wherein the computer program executes the steps of the above-mentioned automatic focusing method when executed by a processor.
Claims
1. An automatic focusing method for an astronomical device, wherein the astronomical device comprises a telescope (2) mounted on a two-dimensional turntable (1), a focusing assembly (3) mounted at the rear end of the telescope (2), a CCD camera (4) mounted at the rear end of the focusing assembly (3), a focusing driver (5) driving a movable bracket (8) of a focusing base (7) to move forward and backward by means of a rotating shaft (6), the CCD camera (4) being mounted on the movable bracket (8), and the telescope (2) being connected to a fixed bracket (9); the two-dimensional turntable (1) being used to adjust the direction of the telescope (2) in the horizontal and elevation directions to achieve focusing on different stars; and characterized in that: The automatic focusing method is carried out according to the following steps: Step 1: Move the two-dimensional turntable (1) to the target direction of the current star. is the current imaging data of the CCD camera (4), let is the current reading of the focus actuator (5), let the falling counter cnt = 0, and set the falling threshold to , set the default focus step size to , let the current focus step be , set the focus termination threshold to , randomly select a direction , let the current focus direction ; Step 2: Current imaging data Perform grayscale processing to obtain the current imaging grayscale data ; Step 3: Calculate using the gradient evaluation function The gradient evaluation value ; Calculate the current imaging grayscale data Variance ; Step 4: Use right Perform evaluation stretching to obtain the focus evaluation value of star imaging ; The evaluation stretching includes: calculating the grayscale variance of the current imaging grayscale data; calculating the gradient evaluation value of the current imaging grayscale data using a gradient evaluation function; and accumulating the evaluation value and the grayscale variance in proportion to obtain a stretched evaluation value, which is the focus evaluation value; Step 5: Use the focusing driver (5) to move the mobile bracket (8) Step length in direction , get the imaging data of CCD camera (4) after moving ; Step 6: Repeat steps 2 to 4. Process and obtain The star focus rating ; Step 7: If , then Assign to , set the down counter cnt = 0, and repeat steps 5 to 7; if , then execute step 8; Step 8. Assign cnt + 1 to cnt. Assign to ,like , repeat steps 5 to 7; otherwise, go to step 9; Step 9: Assign to ,like , then Assign to Then, repeat steps 5 to 7; otherwise, the focus actuator (5) moves the bracket (8) to Step length in direction Finally, the focusing of the current star is completed.
2. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the automatic focusing method according to claim 1, and the processor is configured to execute the program stored in the memory.
3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the automatic focusing method according to claim 1 are executed.
Citation Information
Patent Citations
Automatic focusing method for astronomical telescope
CN101813823A
Automatic focusing method and device for camera based on defocus estimation improved hill climbing method
CN108259753A