On-orbit automatic focusing method for satellite-borne space target observation camera

By introducing a coarse-adjustment + fine-adjustment variable-step focusing strategy and adaptive focusing window selection into the spaceborne camera, combined with an efficient image sharpness evaluation function, the problems of poor real-time performance and limited resources in spaceborne camera focusing technology are solved, enabling fast and accurate automatic focusing and meeting the needs of efficient unattended operation for space target observation.

CN121386136APending Publication Date: 2026-01-23SUZHOU JITIAN XINGZHOU SPACE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511748149.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing spaceborne camera focusing technologies suffer from problems such as poor real-time performance, insufficient adaptability to unattended operation, complex hardware structure and weak adaptability to the space environment, limited spaceborne platform resources making deployment difficult, and difficulty in focusing in severely out-of-focus scenarios.

Method used

A variable step-size focusing strategy combining coarse and fine adjustments is adopted, along with an adaptive focusing window and a high-efficiency, low-power image sharpness evaluation function. This method is designed to enable on-orbit autofocusing for spaceborne target observation cameras. The camera controller performs image preprocessing, adaptive focusing window selection, and closed-loop autofocusing to achieve fast and accurate focusing.

Benefits of technology

It significantly improves focusing speed and efficiency, achieves a balance between accuracy and efficiency, adapts to rapidly changing scenarios in space target observation, meets high real-time requirements, has high reliability and unattended operation capabilities, and reduces computational and storage burdens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121386136A_ABST
    Figure CN121386136A_ABST
Patent Text Reader

Abstract

The invention discloses an on-orbit automatic focusing method for a spaceborne space target observation camera, relates to the technical field of space application of spaceborne cameras, and solves the problems of poor real-time performance and insufficient unattended operation adaptability of a manual focusing technology in the existing focusing technology. And meanwhile, in the automatic focusing technology, the hardware structure is complex, the space environment adaptability is weak, satellite-borne platform resources are limited and difficult to deploy, and focusing is difficult in a severe out-of-focus scene. According to the invention, the realization of automatic focusing is divided into a coarse adjustment stage and a fine adjustment stage. A large step pitch is adopted in the coarse tuning stage, rapid crossing is achieved, and an area adjacent to a positive focus position is rapidly positioned; in the fine adjustment stage, small step pitch is adopted, fine adjustment is achieved, and the peak position is accurately locked. The contradiction between the search speed and the positioning precision is balanced. When far away from the positive focus, a large-step-pitch fast approximation peak region is used, so that the number of iterations and the number of image acquisition frames are greatly reduced; when the focus is approached, small step pitch is switched for fine tuning, and the final precision is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of space application of spaceborne cameras, and particularly relates to an on-orbit automatic focusing method for a spaceborne space target observation camera. BACKGROUND

[0002] During launching and on-orbit operation, a spaceborne optical camera will be affected by factors such as temperature change, pressure change and change of observation target position, resulting in defocusing phenomenon and then leading to decline of imaging quality. Therefore, timely correction of focal plane position to ensure imaging quality is an important requirement of a spaceborne optical camera.

[0003] At present, a commonly used focusing method for a spaceborne camera is manual focusing, that is, image data transmitted by the camera is received on the ground to analyze defocusing amount, so as to determine whether the camera is defocused and to determine focusing parameters; based on the result of judgment, instructions containing focal plane adjustment amount and adjustment direction are generated on the ground and uploaded to the camera through a ground station, and a focusing mechanism is driven by a camera controller according to the focusing instructions to drive the focal plane to move along the optical axis, so as to change the image distance, make the light rays re-converge accurately, and then restore the image clarity and imaging performance. However, when applied to a space target observation scene, this manual focusing method has obvious shortcomings:

[0004] Poor real-time performance: the manual focusing process needs to go through image transmission-defocusing judgment-parameter adjustment instruction transmission-focusing implementation, resulting in a long response time of the whole focusing process, which cannot meet the real-time requirement of a spaceborne space target observation camera and it is difficult to achieve rapid and accurate focusing.

[0005] Poor adaptability to unattended operation: in the scene of monitoring dark and weak space targets by using a space target observation optical camera, if a near distance target is observed, the imaging distance between the camera and the target will change rapidly. Since manual focusing needs to rely on remote control by ground personnel, not only personnel need to be on duty continuously, but also it is difficult to complete multiple focusing operations efficiently in a short time, so the focusing demand under unattended operation cannot be met.

[0006] In addition to manual focusing, some automatic focusing technologies are also used in existing spaceborne cameras, but there are also some shortcomings in the space exploration environment:

[0007] Poor adaptability of hardware structure complexity to space environment: for example, traditional on-board automatic focusing technologies such as phase detection method and distance measurement method have high measurement accuracy, but they need to increase special structures on the camera to assist focusing, which not only increases the envelope and mass of the camera system, but also leads to complexity of the hardware structure. In addition, factors such as temperature change, radiation and vibration in the space environment will affect the performance of these hardware, leading to instability of the system, which is difficult to meet the high requirements of stability, reliability, small mass and small envelope of a spaceborne space target observation camera.

[0008] Limited computing and storage capabilities hinder the implementation of complex algorithms: Many existing autofocus algorithms typically require powerful computing capabilities and large image buffers. While these algorithms perform excellently on ground systems or high-performance computing platforms, in spaceborne environments, especially under constraints related to envelope and mass, spaceborne space target observation cameras usually employ embedded control chips such as FPGAs and SOCs. The computing and storage capabilities of these chips are relatively limited, making it impossible to support complex autofocus algorithms and thus preventing their direct implementation on spaceborne platforms.

[0009] Severe defocusing results in poor image quality, making algorithmic adjustments difficult. Space target imaging exhibits the following characteristics: when images are clear, contrast is high, signal regions are distinct, and constituent elements are relatively simple. However, in cases of severe defocusing, contrast decreases significantly, signal regions are more susceptible to noise interference, and the gradient variation at target edges diminishes. These characteristics cause existing autofocus algorithms to suffer from numerous shortcomings when processing defocused images of space targets, especially in cases of severe defocusing or poor image quality. Many existing autofocus algorithms often struggle to effectively adjust to the focal point and restore image sharpness.

[0010] In space observation missions, the core task of spaceborne optical cameras is to capture faint signals from space targets. However, during transportation, launch, or in orbit, the camera can be affected by factors such as pressure, temperature, and changes in the position of the observed target, causing the focal plane of the camera's optical system to deviate from the target surface of the image sensor—a phenomenon known as defocusing. Defocusing leads to a decrease in image quality. To obtain a clear image, the focal plane assembly containing the image sensor needs to be moved back and forth along the optical axis to align the image sensor target surface with the camera's focal plane; this process is called focusing. Precise focusing is a core requirement for ensuring high-quality imaging by spaceborne space target observation cameras.

[0011] Existing technical solutions still employ traditional manual focusing technology, the principle of which is as follows:

[0012] (1) Image downlink: The space-borne camera downlinks the captured image data back to the ground receiving station.

[0013] (2) Analysis and interpretation: Professionals analyze the received image to determine whether defocusing has occurred, and further calculate focusing parameters such as the displacement of the focal plane component and the focusing direction.

[0014] (3) Command upload: The ground station uploads the command containing the focusing parameters to the satellite.

[0015] (4) Command execution: The onboard camera controller (such as a processor) receives the command, drives the focusing motor, and drives the focusing mechanism to move the focal plane assembly along the optical axis of the lens by a specified distance and direction.

[0016] (5) Verification: Download a new image again to verify the focusing effect. If the requirements are not met, repeat the above process.

[0017] To address the shortcomings of the aforementioned manual focusing technique:

[0018] Manual focusing is not suitable for space target observation applications that require high real-time performance and efficient operation. The main disadvantages are as follows:

[0019] (1) Poor real-time performance: The entire focusing process (image downlink - analysis and interpretation - focusing command upload - focusing command execution - focusing effect verification) involves multiple space-to-ground communication loops, which is time-consuming. It cannot meet the requirements of rapidly changing observation scenarios or the need for real-time target acquisition in spaceborne space target observation.

[0020] (2) Reliance on manual labor and low efficiency: It is highly dependent on the operation and interpretation of ground personnel, and cannot achieve automated, high-frequency focusing operations without human intervention. For real-time space target observation tasks that require frequent focusing, the labor cost is high and the efficiency is low.

[0021] The current typical autofocus technology was developed in the late 1970s. Scholars have conducted a lot of research on autofocus and proposed many focusing methods, the most typical of which are rangefinding and image detection.

[0022] The rangefinding method involves installing a signal transmitter on the focal plane assembly. During focusing, light or sound waves are actively emitted towards the target. The reflected light or sound waves are then received by a receiver on the focal plane assembly to measure the distance and orientation of the subject. The distance to the image plane is then calculated based on the imaging laws, thereby adjusting the lens to achieve automatic focusing. A typical example is the Polaroid SX-70 Sonar, launched in 1978. It calculates the correct distance parameters by measuring the time difference of the ultrasonic signals traveling back and forth from the camera body, thus achieving automatic focusing.

[0023] Image detection primarily achieves autofocus by comparing the contrast of images from two photodetectors at equal distances in front of and behind the image, or by detecting the image offset. A typical example is the Pentax ME-F SLR camera, which was released in 1981 and uses the principle that the clearer the image, the greater the contrast of the image for autofocus.

[0024] The disadvantages of the above-mentioned autofocus technology are:

[0025] These methods generally require additional hardware support, such as ultrasonic sensors or focus sensors, resulting in complex structures, large sizes, and high costs. However, due to high launch costs and the stringent requirements for camera quality, envelope, and energy consumption in space applications, these methods are not suitable for spaceborne cameras.

[0026] Image processing-based autofocus technology, developed in the 1990s, employs a completely different approach from traditional autofocus methods. It directly analyzes the acquired image to determine the current focusing state of the imaging system and then adjusts the focal plane position to achieve autofocus. Image-based autofocus methods offer advantages such as simple structure, small size, low cost, and wide applicability, making them the mainstream autofocus method for current spaceborne applications.

[0027] The main principle of image-based autofocus methods is as follows:

[0028] (1) Image acquisition: The camera acquires a frame of image at the current focal plane position.

[0029] (2) Evaluation Function Calculation: A predefined sharpness evaluation function is applied to the acquired image. This function calculates a numerical value to quantify the sharpness of the image. Theoretically, the sharper the image (closer to the focal point), the higher the evaluation value; the blurrier the image (more out of focus), the lower the evaluation value. Common evaluation functions include gradient operators (such as Tenengrad, Sobel), variance, and Laplacian operators.

[0030] (3) Search strategy decision: Based on the current evaluation function value, a specific focusing search strategy is adopted to determine which direction the focal plane should move in the next step and how much step it should move.

[0031] (4) Drive execution: The camera controller generates instructions based on the search strategy, drives the focusing mechanism, and drives the focal plane assembly to perform high-precision linear displacement along the optical axis to adjust the position of the focal plane.

[0032] (5) Iteration and convergence: Repeat steps (1)-(4) to acquire images and calculate evaluation values ​​at multiple focal plane positions. The goal of the search strategy is to find the position with the highest evaluation value (i.e., the peak point), which is considered the optimal focusing position.

[0033] (6) Focusing complete: When the search strategy determines that the peak (optimal focus position) has been found or the stopping condition is met, the focus plane is stopped and focusing is complete.

[0034] The disadvantages of the above-mentioned image processing-based autofocus technology are:

[0035] (1) It is difficult to balance focusing speed and accuracy: The entire search process of "defocus-focus-defocus-final focus" requires the acquisition and processing of multiple images and the driving motor to move the focal plane to find the possible focus position. The more accurate the focus position, the more images need to be acquired and the longer it takes. It is difficult to meet the real-time requirements of rapidly changing scenes. Finding the best focal plane position within a limited time is a challenge.

[0036] (2) Insufficient adaptability to space targets: The ideal evaluation function curve should be unimodal and monotonically decreasing on both sides of the peak. However, space target imaging often exhibits low contrast and is susceptible to noise interference. Under such conditions, the existing evaluation function curve is prone to generating local extrema, reducing the reliability of focusing and potentially leading to focusing failure. Furthermore, when a space target is severely out of focus, the target image diffuses into a large, blurry spot, with extremely weak or even absent edge gradient information. The evaluation function curve changes smoothly and lacks directional indication, making it difficult to effectively guide focusing and restore clear imaging.

[0037] Therefore, the main challenge of this type of method lies in how to design a suitable focusing search strategy to achieve a balance between accuracy and efficiency while ensuring real-time performance, and a suitable evaluation function to better adapt to the application scenarios of space target observation.

[0038] Currently, similar implementation schemes to this invention have the following implementation principle:

[0039] The Beijing-3B satellite camera employs an integrated electronic central control architecture, remotely controlling and telemetry of the focal plane and focusing circuits via a bus. The focal plane transmits image data to the focal plane control unit, which uses a processor as its core. The processor selects the center portion of each frame and automatically calculates the sharpness evaluation value for each frame using a sharpness evaluation algorithm, returning this value to the integrated electronic control unit via telemetry. The integrated electronic control unit controls the focusing circuit according to a focusing search strategy, recording the sharpness evaluation function values ​​at different focal plane positions. By comparison, it controls the focal plane to reach the position with the optimal sharpness evaluation value, completing the focusing action. Figure 1 The implementation process of the camera's autofocus method is described.

[0040] The camera employs a stepper motor-based focusing mechanism to drive the movement of the focal plane, utilizes a hill-climbing method as the focus search strategy, and employs the average gray-level gradient method as the image sharpness evaluation algorithm. This method enables precise automatic focusing after manual focusing to a defocus amount not exceeding twice the depth of focus, effectively improving the efficiency of on-orbit search for the optimal focal plane.

[0041] Disadvantages in space target observation applications:

[0042] First, a balance between accuracy and efficiency is not achieved. This method uses a typical hill-climbing approach as its focusing search strategy, resulting in a large number of images being acquired and processed each time, and a long focusing time. This means that although high accuracy can be achieved, the focusing process may become too slow in dynamically changing observation scenarios, making it difficult to meet the real-time requirements of rapidly changing environments.

[0043] Secondly, the "average gray-level gradient method" is employed. However, when the observed target is dim and severely out of focus, the calculation is easily affected by noise, leading to fluctuations and local extrema in the curve, or a flat curve lacking directional indication, making it difficult to effectively guide focusing and restore clear imaging. The image sharpness evaluation algorithm can still be improved. This method uses the average gray-level gradient method as the evaluation function. While it can measure image sharpness to some extent, its effectiveness is unstable in the presence of noise, easily leading to misjudgments and affecting the accuracy and reliability of focusing. Especially when the target is severely out of focus, errors in the evaluation function may cause focusing failure or insufficient accuracy, making it unsuitable for space target observation scenarios.

[0044] Existing technologies designed for Earth remote sensing perform calculations within a fixed, preset window during autofocus. While this reduces computational load, it relies on the assumption that the target is always within the calculation window. However, in space target observation applications, the target's position may change, and the fixed window may contain a large amount of invalid background or non-target areas.

[0045] Therefore, in order to meet the actual needs of spaceborne target observation, this invention optimizes the autofocus algorithm based on the limited computing and storage resources of spaceborne platforms and the characteristics of space target imaging. It proposes a high-precision on-orbit autofocus method suitable for spaceborne space target observation cameras to solve the problems of poor real-time performance and insufficient adaptability to unattended operation of manual focusing. At the same time, it overcomes the technical difficulties of existing autofocus technologies, such as complex hardware structure, weak adaptability to space environment, limited spaceborne platform resources and difficulty in deployment, and difficulty in focusing in severe defocusing scenarios. Summary of the Invention

[0046] This invention addresses the problems of poor real-time performance and insufficient adaptability to unattended operation in existing focusing technologies, as well as the technical challenges of complex hardware structures, weak adaptability to space environments, limited spaceborne platform resources, and difficulties in focusing in severely out-of-focus scenarios in automatic focusing technologies. It provides an on-orbit automatic focusing method suitable for space target observation applications.

[0047] An on-orbit autofocusing method for a spaceborne space target observation camera, the method comprising the following steps:

[0048] Step 1: The camera controller preprocesses the received raw image data to obtain preprocessed image data;

[0049] Step 2: Determine the focusing window;

[0050] Step 3: Focusing is performed;

[0051] The camera controller controls the focusing mechanism to move the focal plane position sequentially according to a preset direction and a preset focusing step distance, acquires an image at each focal plane position, calculates the image sharpness evaluation value within the focusing window, and records the focal plane position and the corresponding sharpness evaluation value.

[0052] Based on the changing patterns of sharpness evaluation values ​​at multiple adjacent focal plane positions, the correctness of the focal plane movement direction and whether the sharpness evaluation peak area has been reached are determined. If not, the currently set focusing step distance is halved, and a new focusing scan is performed. If yes, the optimal focal plane position is determined, and the automatic focusing is completed.

[0053] The beneficial effects of the present invention: The automatic focusing method described in the present invention has the following advantages:

[0054] 1. Focusing speed and efficiency have been significantly improved, achieving a balance between accuracy and efficiency;

[0055] This invention employs a coarse-step focusing strategy combining coarse and fine adjustments, dividing the autofocus process into two stages: coarse and fine. The coarse adjustment stage uses a large step size for rapid traversal and quick positioning to the vicinity of the focal point; the fine adjustment stage uses a small step size for precise fine-tuning, accurately locking the peak position. This strategy perfectly balances the trade-off between search speed and positioning accuracy. When far from the focal point, a large step size is used to quickly approach the peak region, significantly reducing the number of iterations and image acquisition frames; when approaching the focal point, a small step size is used for fine-tuning, ensuring final accuracy. This strategy significantly shortens the overall focusing time, resolves the conflict between focusing speed and accuracy, better adapts to scenarios with rapidly changing observation distances in space target observation, and meets high real-time requirements.

[0056] 2. An image sharpness evaluation algorithm more suitable for spatial target characteristics;

[0057] This invention introduces a bilateral filtering preprocessing step and makes targeted optimizations to the image sharpness evaluation algorithm. After preprocessing and optimization, the resulting image sharpness evaluation curve exhibits more significant unimodality and monotonicity. Even under severe imaging conditions such as heavy defocusing and low contrast, it can provide stable and reliable sharpness evaluation and clear search direction guidance, greatly improving the success rate and reliability of the focusing algorithm. This method effectively suppresses noise while better preserving the edge features of weak signal targets, providing a more reliable data foundation for subsequent calculation of image sharpness evaluation values.

[0058] 3. The adaptive focusing window confirmation technology in this invention proposes a focusing window determination mechanism that allows for one-time calculation and full reuse. This reduces computational load and resource consumption while ensuring reliability. The adaptive focusing window technology performs only one window calculation at the start of autofocus; subsequent calculations during the focusing process are all performed within this fixed window, eliminating the need for repeated full-image calculations and significantly reducing the computational and storage burden on the onboard processor. In dynamic scenarios, if a moving target is detected, the target's location is selected as the focusing window, and the window's state is fed back to the satellite platform. The satellite platform then uses attitude adjustment, turntable rotation, or fast-reflecting mirrors to ensure the target remains within the selected window, guaranteeing that the target does not leave the selected focusing window during the focusing cycle, achieving one-time calculation and multiple reuse. In static scenarios, the region with the richest edge information in the image is selected as the focusing window. Since the target position is essentially fixed, this window can be reused for the entire focusing process without platform assistance, ensuring both reliability and real-time performance. This mechanism reduces computational load and resource consumption while ensuring the accuracy and efficiency of autofocus.

[0059] 4. The method of this invention employs a high-efficiency and low-consumption image sharpness evaluation function design. An image sharpness evaluation algorithm based on image gradient calculation is selected. This algorithm has low computational complexity and requires minimal resources, making it suitable for operation on spaceborne processors with limited computing resources. Furthermore, the collaborative design of the preprocessing steps ensures that the generated image sharpness evaluation curve exhibits excellent unimodality and monotonicity, significantly improving the success rate and reliability of focusing.

[0060] 5. This invention adopts a highly integrated and optimized hardware and software co-design, and performs in-depth co-optimization for the characteristics of spaceborne hardware. Due to the limited computing resources, the entire algorithm can be directly embedded in the camera imaging drive controller. After combining with the external focusing mechanism, the camera imaging drive controller can realize the autofocus algorithm while realizing the imaging drive, thereby solving the problem that existing autofocus technology cannot be applied to space due to hardware complexity or algorithm bloat.

[0061] 6. The method of this invention employs a closed-loop automatic focusing process: This method automates the entire process from image acquisition, processing, and analysis to motor drive and position feedback, requiring no intervention from ground personnel. This not only completely solves the problems of poor real-time performance and reliance on manual focusing, but also meets the high-frequency, automated focusing requirements in unattended scenarios. Attached Figure Description

[0062] Figure 1 A flowchart of an existing camera autofocus method;

[0063] Figure 2 This is a schematic diagram of the automatic focusing system described in this invention;

[0064] Figure 3 This is a schematic diagram of the bilateral filtering process; where (a) is the original image and (b) is the result after bilateral filtering.

[0065] Figure 4 The process of selecting a focus window in dynamic scenes and the corresponding effect diagram;

[0066] Figure 5 The process of selecting a focus window in a static scene and the corresponding effect diagram;

[0067] Figure 6 This is a schematic diagram of the image sharpness evaluation algorithm curve;

[0068] Figure 7 This is a schematic diagram illustrating the principle of the hill-climbing method.

[0069] Figure 8 This is a flowchart of the on-orbit automatic focusing method described in this invention. Detailed Implementation

[0070] Combination Figures 1 to 8 This embodiment describes an on-orbit autofocus method for a spaceborne target observation camera. One specific hardware implementation of this autofocus method is an autofocus system integrated within the camera system, such as... Figure 2 As shown, the automatic focusing system includes a focusing control electronics module and a focusing mechanism;

[0071] The focusing control electronics module, as a control unit for executing the autofocus method, specifically includes a camera controller, a motor drive circuit, and an encoder data interaction circuit.

[0072] The camera controller is used to execute the autofocus method and send control commands to the motor drive circuit. The motor drive circuit receives the commands from the camera controller and provides the necessary power and signals to drive the focusing motor.

[0073] The encoder data interaction circuit is used to receive the current focal plane position signal fed back by the position encoder, realize closed-loop focusing control, and improve positioning accuracy and reliability.

[0074] The focusing mechanism serves as a focusing actuator that converts control commands issued by the controller into the actual movement of the focal plane. The core function of the focusing mechanism is to accurately and reliably convert the rotational motion of the focusing motor into high-precision linear displacement of the focal plane assembly along the optical axis. Its core components include the focusing motor, the transmission mechanism, and the position encoder.

[0075] The focusing motor receives instructions from the camera controller and outputs rotational torque;

[0076] The transmission mechanism precisely converts the rotational torque of the focusing motor into a high-precision linear displacement that drives the focal plane assembly along the optical axis.

[0077] The position encoder monitors in real time and feeds back the position information of the focal plane component to the camera controller.

[0078] The autofocusing method described in this embodiment includes the following steps:

[0079] Step S1: Initialization and parameter setting;

[0080] Upon receiving an autofocus command, the camera controller powers up the control unit, activating the focusing mechanism. Subsequently, the camera controller loads relevant autofocus parameters, which will serve as criteria and execution boundaries for subsequent focusing convergence. After parameter loading is complete, the camera controller switches the focusing operation mode based on the camera's current state.

[0081] In this embodiment, the autofocus-related parameters include the initial focus step size, the number of focus cycles, and the autofocus imaging parameters. These parameters can be either local default values ​​embedded in the camera controller or configured by the ground station via the communication interface. Based on engineering experience, it is recommended that the initial focus step size be set to twice the camera's depth of focus; to ensure that the deviation between the final determined focal position and the ideal optimal focal plane position does not exceed half the depth of focus, it is recommended that the number of focus cycles be set to 3; and the autofocus imaging parameters mainly involve setting the frame rate and exposure time to match the imaging requirements of the focusing task.

[0082] The focusing operation modes include an in-process imaging mode and a stand-alone mode. In the in-process imaging mode, when the camera is in the midst of an imaging task, the camera controller temporarily stores the current imaging parameters and pauses external image data transmission, temporarily switching to autofocus imaging parameters for imaging. After completing one round of autofocus, the original imaging parameters are restored, and image data continues to be output. In the stand-alone mode, when the camera is not in the midst of an imaging task when an autofocus command is executed, the camera controller performs imaging according to preset autofocus imaging parameters. Image data is not transmitted externally but is only used for subsequent autofocus. After completing this round of autofocus, imaging ends, and the camera returns to standby operation.

[0083] Step S2: Imaging acquisition and image preprocessing;

[0084] After completing step S1 initialization and parameter setting, the camera enters the autofocus imaging stage. The camera controller preprocesses the acquired raw image data. This step aims to suppress the interference of random noise in the image on subsequent image sharpness evaluation, thereby providing high signal-to-noise ratio and high-fidelity input data for subsequent steps. The specific implementation process is as follows:

[0085] Step S21, Image Acquisition: The camera controller controls the camera to acquire continuous raw image data according to the autofocus imaging parameters set in step S1.

[0086] Step S22, Image Preprocessing: The camera controller performs real-time filtering on each frame of the acquired raw image to suppress random noise in the image and obtain preprocessed image data.

[0087] In this embodiment, since the subsequent sharpness evaluation uses the intensity of image edges (i.e., gradient magnitude) as the main evaluation metric, the filtering method employs bilateral filtering, such as... Figure 3 As shown, (a) is the original image, and (b) is the result after bilateral filtering. This method can effectively smooth internal noise in an image while effectively preserving edge information that is crucial for subsequent sharpness evaluation.

[0088] The implementation process of the bilateral filtering method is as follows:

[0089] A 3×3 neighborhood window is defined with the current pixel p as the center point, and a bilateral filtering weight kernel is dynamically generated for this neighborhood window. This weight kernel comprehensively considers the spatial distance and gray-level similarity between each pixel in the neighborhood and the center point. Finally, the new gray-level value of the center point p is calculated by weighted averaging of all pixels in the neighborhood based on this weight kernel. To ensure that the output image after filtering has the same size as the original image, zero-padding is performed on the edges of the original image.

[0090] The calculation method for the bilateral filtering can be expressed as follows:

[0091]

[0092] in, This is the pixel value at position p after filtering. Let p be the pixel value at the location to be processed. Let be the pixel value at a certain position q in the 3×3 neighborhood of the pixel p to be processed; S is the range of the 3×3 neighborhood of p. The spatial distance between the center point and neighboring points. This is a normalization factor to ensure that the pixel range of each pixel is equal before and after filtering.

[0093]

[0094] in, Spatial proximity factor The pixel similarity factor is calculated using the following formula:

[0095]

[0096]

[0097] Where x is the difference between the x-coordinates of positions p and q, and y is the difference between the y-coordinates of positions p and q, using a bilateral filter kernel. and Fixed parameters determined based on image characteristics.

[0098] Step S23, Data caching: To facilitate subsequent operations, the preprocessed image data is cached to a cache storage medium (e.g., DDR3 SDRAM). This caching mechanism enables rapid retrieval of different frame data during subsequent operations.

[0099] Step S3: Select the adaptive focus window;

[0100] After obtaining the image data preprocessed in step S2, the camera controller needs to determine the focusing window for subsequent sharpness evaluation calculations. The purpose is twofold: firstly, to reduce the overall data volume and improve computational efficiency; and secondly, to ensure that the focusing evaluation is concentrated on key areas containing target information, thereby improving the accuracy and stability of the focusing results. Specifically, this includes the following steps:

[0101] Step S31: Window Division: Predefine N (e.g., 9) evenly distributed, non-overlapping candidate window regions within the image field of view. A preferred layout is a "nine-grid" arrangement, including: four corner windows (top left, top right, bottom left, bottom right), four edge center windows (top center, bottom center, left center, right center), and one center window. This layout ensures effective coverage regardless of whether the target appears in the center or at the edge of the field of view. Each window should be large enough to accommodate typical targets and tolerate their movement within a certain frame interval, preventing the target from moving out of the window during focusing.

[0102] Step S32, as follows Figure 4 As shown, window selection in dynamic scenes: the camera controller prioritizes selecting a focusing window based on moving targets. To determine if a moving target exists within the field of view, the camera controller performs a moving target detection algorithm on the image preprocessed in step S2. If a significant moving target region is detected, the candidate window containing that region is directly selected as the focusing window. To ensure that the moving target remains within the selected window during subsequent focusing, the camera controller can feed back the detection status to the satellite platform. The satellite platform then tracks the target using attitude adjustments, turntable rotations, or fast-reflection mirror adjustments, thereby ensuring that the moving target always remains within the defined focusing window area. Platform adjustments are only used as an auxiliary measure to ensure window stability.

[0103] In this embodiment, the moving target detection algorithm uses the frame difference method, and the implementation steps of the frame difference method are as follows:

[0104] a) Let m be the current frame number. Select the m-nth frame (n-1) as the reference frame (n represents the number of frames between the two frames; the value of n should be dynamically adjusted according to the relative speed between the camera and the target object and the camera frame rate). The camera controller acquires the image data of the mth frame and the image data of the mnth frame cached in step S23. Perform a pixel-by-pixel absolute difference operation on each pixel of the two frames to obtain the difference image. The calculation formula is as follows:

[0105]

[0106] In the formula, This represents the pixel value at pixel coordinates (x, y) of the m-th frame in the video stream. This represents the difference in intensity between the two images at this pixel location. Subsequently, a thresholding operation is performed on the difference image to obtain the binarized result image, expressed as:

[0107]

[0108] In the formula, The threshold for binarizing the difference image. The binary frame difference result at pixel coordinates (x, y) is represented by B, which indicates the overall binary frame difference result image. "1" represents that the pixel is a candidate (foreground) region of a moving target, and "0" represents the background region. B will serve as the input data for subsequent morphological erosion operations, providing a basis for subsequent screening of effective moving target regions and statistical analysis of the motion intensity of candidate windows.

[0109] (b) To suppress isolated noise points introduced by pixel-level response inhomogeneity, morphological operations are performed on the binarized image. A preferred morphological operation is erosion. Specifically, the camera controller slides a preset structuring element across the binarized image. The center position of the structuring element is marked as a foreground pixel only if all pixels within its coverage area are foreground pixels (value "1"); otherwise, it is marked as a background pixel (value "0"). The structuring element is preferably a 3×3 square template. Through the erosion operation, isolated noise points are effectively filtered out because their neighborhoods cannot satisfy the condition that all structuring elements are foreground pixels, thus preventing them from being misidentified as moving targets. Meanwhile, moving targets, due to their large area, retain their main body even if edge pixels are reduced during erosion.

[0110] After completing the morphological operations, the resulting binarized frame difference image after noise suppression is denoted as B. T The camera controller selects B within a preset candidate window. T The number of pixels with a value of "1" is counted to obtain the number of valid foreground pixels within the candidate window, and this number is defined as the motion intensity of the window. If at least one candidate window has a motion intensity exceeding a preset threshold, the motion intensity is considered to be at risk. (The preset threshold can be pre-set according to task requirements), then it is determined that there is a significant moving target in the field of view, and the candidate window with the highest motion intensity is selected as the final focusing window. If the motion intensity of all candidate windows is lower than... If no significant moving target is found, the dynamic window selection mode is terminated, and the process proceeds to step S33 to perform window selection based on a static scene.

[0111] Step S33, Window Selection in Static Scenes: If no suitable moving target is detected, static scene processing begins. At this point, the camera controller executes edge detection operators on each of the nine candidate windows, obtaining the sum of gradient magnitudes within each candidate window. Finally, the candidate window with the largest gradient sum is selected as the focusing window to ensure that the selected area includes more effective information, thereby improving the effectiveness of subsequent sharpness evaluation.

[0112] like Figure 5As shown, in this embodiment, the edge detection operator (edge ​​gradient calculation method) is the average gray-level gradient method, and its implementation steps are as follows: Let the pixel value of each pixel in a frame of an image be represented by f(x,y), and G(x,y) be the gradient value at that position, then:

[0113]

[0114] The camera controller calculates the pixel gradient magnitude within each candidate window according to the above formula, and binarizes the obtained gradient magnitudes to highlight significant edge information. Then, the binarized gradient magnitudes of each candidate window are summed to obtain the total edge intensity of that window. Finally, the total edge intensity of all candidate windows is compared, and the candidate window with the largest total intensity is selected as the final focusing window.

[0115] Through the aforementioned windowing mechanism, the camera controller can adaptively select the optimal focusing area in different scenarios: prioritizing the locking of moving target areas in dynamic scenes, and selecting the area with the richest edge information in static scenes. This design improves the specificity of focusing evaluation while reducing computational burden, ensuring the real-time performance and robustness of the autofocus process.

[0116] Step S4: Focusing is performed, such as... Figure 6 and Figure 7 As shown.

[0117] After the focus window is determined, the camera controller enters the focus execution phase. The camera controller controls the focus mechanism to move the focal plane position sequentially according to a preset direction and preset focus step distance, acquires an image at each focal plane position, and calculates the image sharpness evaluation value within the focus window; the focal plane position and the corresponding sharpness evaluation value are recorded; the goal of this step is to gradually drive the focus mechanism to make the focal plane position gradually approach the optimal focus position.

[0118] To achieve efficient sampling and robust decision-making, the camera controller maintains a sampling buffer C, which is a set of "position, corresponding sharpness evaluation value" used to store the most recently sampled focal plane position and its corresponding sharpness evaluation value. The sampling buffer initially contains the current focal plane position and its corresponding sharpness evaluation value. This step specifically includes the following steps:

[0119] Step S41: Image acquisition and sharpness evaluation value calculation;

[0120] First, the current focal plane position is denoted as P, and the currently set focusing step distance is denoted as Δ. A set of sampling positions {P-Δ, P, P+Δ} is determined using P as a reference sampling position. Then, for each sampling position in the set, the sampling buffer C is checked. If the buffer already contains the sampling position and its corresponding sharpness evaluation value (previously calculated and saved), the value is directly read from the buffer. If the buffer does not contain the sharpness evaluation value for that position, the camera controller controls the focusing motor to move the focal plane to that position. Within the focusing window determined in step S3, the sharpness evaluation value for that position is calculated using the preprocessed image sampled in step S2. Then, the position and its corresponding sharpness evaluation value are written into the sampling buffer C. After this operation, the sampling buffer C will contain three sets of the latest focal plane positions and their corresponding sharpness evaluation values ​​{(P-Δ, F...Δ ... P-Δ ),(P,F P ),(P+Δ,F P+Δ )}, F P This is the sharpness evaluation value for the focal plane position P; used in step S42.

[0121] Step S42: Update the focal plane position and focusing direction decision;

[0122] To improve the robustness of the algorithm in noisy environments, a threshold is set. This threshold is a preset small positive number; when the difference between two sharpness evaluation values ​​is less than or equal to... When the difference is greater than 1, it is considered "approximately equal"; when the difference is greater than 1, it When the former is significantly larger than the latter, the camera controller makes a decision to update the focal plane position and orientation based on the latest sampling buffer C obtained in step S41. The specific logic of the decision is as follows:

[0123] If F P It is a set {F P-Δ ,F P ,F P+Δ The significant maximum value (i.e., F) in} P >F P-Δ + And F P ≥F P+Δ + or F P >F P+Δ + And F P ≥F P-Δ + The sharpness evaluation value at focal plane position P is determined to be located in a local peak region. To further verify that it is a global peak rather than a maximum value caused by local fluctuations, the camera controller moves the focal plane one focusing step Δ along the direction of the previous focal plane position adjustment to position P′, and calculates the sharpness evaluation value F′ at this position; if F′ > F...P This indicates that the sharpness is still increasing, and the focal plane has not yet reached the global peak region. The camera controller updates the current focal plane position to P′ and re-enters step S41; if F′≤F P This indicates that the area near the focal plane position P is the region of peak sharpness. The camera controller records this position P as the candidate optimal focal plane position under the current step distance Δ and executes step S43.

[0124] (1) If F P-Δ It is a set {F P-Δ ,F P ,F P+Δ The significant maximum value (i.e., F) in} P-Δ >F P + And F P-Δ >F P+Δ + If the focal plane should move in the direction of decreasing focal length, the camera controller controls the focusing motor to move the focal plane and updates the current focal plane position to P′=P-Δ position. Then, P′ is used as the new current focal plane position, and the process re-enters step S41.

[0125] (2) If F P+Δ It is a set {F P-Δ ,F P ,F P+Δ The significant maximum value (i.e., F) in} P+Δ >F P + And F P+Δ >F P-Δ + If the focal plane is not in the direction of increasing focal length, the camera controller controls the focusing motor to move the focal plane and updates the current focal plane position to P′=P+Δ position. Then, P′ is used as the new current focal plane position and the process re-enters step S41.

[0126] (3) If F P+Δ and F P-Δ They are approximately equal and both are significantly greater than F. P (i.e., |F) P+Δ - F P-Δ |< F P-Δ >F P + And F P+Δ >F P + If the sharpness evaluation value has not yet reached the peak area, the camera controller controls the focusing motor to move the focal plane by one focusing step according to the direction of the previous focal plane position adjustment, updates the current focal plane position to P′, and then uses P′ as the new current focal plane position to re-enter step S41.

[0127] (4) If F P+Δ、 F P and F P-Δ They are approximately equal (i.e., |F) P+Δ -F P |≤ , |F P -F P-Δ |≤ , |F P+Δ -F P-Δ |≤ If the focal plane is in a plateau where the sharpness evaluation value does not change significantly, the plateau event counter will be incremented by 1. If the plateau is entered three times consecutively (i.e., the plateau event counter is ≥3), it indicates that the focal plane may be in an extremely out-of-focus area. The camera controller will then control the focusing motor to move the focal plane in the opposite direction by 3. The camera controller updates the focal plane position after the movement to P′, and then uses P′ as the new current focal plane position to re-enter step S41 and reset the plateau event counter to 0; otherwise, the camera controller controls the focusing motor to move the focal plane by one focusing step Δ according to the direction of the previous focal plane position adjustment, updates the position, and re-enters step S41.

[0128] Step S43, Focusing result determination:

[0129] If the current number of focusing cycles has not reached the preset value (see the setting in step S1), it means that the focusing accuracy can be further improved. At this time, the camera controller updates the focusing step size to half of the current step size (Δ / 2), increments the focusing cycle count counter by 1, and then re-enters step S41 to perform the next round of fine focusing, so as to achieve a smooth transition from coarse adjustment to fine adjustment;

[0130] If the current focus cycle count counter has reached the preset value, the camera controller will determine the current focal plane position P as the final optimal focal plane position and output the position parameter to end the current autofocus process.

[0131] In this embodiment, the sharpness evaluation value is based on image edge features to measure image sharpness. The basic principle is that the sharper an image, the more dramatic the grayscale changes between pixels, and the larger and more concentrated the gradient values ​​at the edges; conversely, when an image is blurry, grayscale transitions tend to be smoother, and edge gradients are significantly weakened. Therefore, by calculating the gradient values ​​of adjacent pixels in the image and statistically analyzing them within a certain area, the image sharpness of the current focal plane can be objectively reflected. A preferred method for calculating the sharpness evaluation value is as follows:

[0132] First, the gradient value g(x,y) of the pixel at position (x,y) can be calculated using the following formula:

[0133]

[0134] in, ,

[0135] in, and For use as structural elements in both horizontal and vertical directions; The pixel value at position (x, y).

[0136] Secondly, considering the changes in the scene during on-orbit focusing and the noise present during staring imaging, a threshold is added during the calculation process to filter out noise interference as much as possible. This threshold is generated adaptively, and to reduce computation, the set threshold is... :

[0137]

[0138] in, It is an adaptive threshold located at position (x,y). It is located in The edge gradient value is calculated from the position pixels; k is an empirical coefficient determined based on the characteristics of the actual image.

[0139] Then, the calculated gradient image values ​​are subjected to threshold filtering, the expression of which is:

[0140]

[0141] in, This refers to the gradient image value at the (x,y) pixel position after thresholding.

[0142] Finally, for the selected focusing window area, the above binarization results are summed to obtain the sharpness evaluation value F of the frame image:

[0143]

[0144] Where x∈M, y∈N, and (M, N) is the selected focusing window region.

[0145] Step S5: After focusing is completed, the system can decide when to automatically trigger focusing again based on the following strategy. After the autofocus command is triggered again, return to step S1 to start autofocusing again.

[0146] In this embodiment, there are two types of automatic focus triggering strategies:

[0147] (1) Timed triggering: Every certain period of time, the overall image sharpness of a captured frame is calculated, and the image sharpness is calculated until the image sharpness value is lower than the preset threshold T. hThen it will be triggered, and the threshold is preset according to the task requirements;

[0148] (2) Command trigger: Triggered by receiving a command from the platform.

[0149] The focusing method described in this embodiment maintains the advantages of high computational efficiency and simple implementation, while significantly improving robustness in low signal-to-noise ratio environments and the reliability of evaluation results. It is particularly suitable for application in on-orbit automatic focusing tasks with limited computing resources and high real-time requirements.

[0150] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0151] The embodiments described above are merely illustrative 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 invention patent. 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 all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. An on-orbit automatic focusing method for a spaceborne space target observation camera, characterized by: This method is implemented by the following steps: Step 1: The camera controller preprocesses the received raw image data to obtain preprocessed image data; Step 2: Determine the focusing window; Step 3: Focusing is performed; The camera controller controls the focusing mechanism to move the focal plane position sequentially according to a preset direction and a preset focusing step distance, acquires an image at each focal plane position, calculates the image sharpness evaluation value within the focusing window, and records the focal plane position and the corresponding sharpness evaluation value. Based on the changing patterns of sharpness evaluation values ​​at multiple adjacent focal plane positions, the correctness of the focal plane movement direction and whether the sharpness evaluation peak area has been reached are determined. If not, the currently set focusing step distance is halved, and a new focusing scan is performed. If yes, the optimal focal plane position is determined, and the automatic focusing is completed.

2. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 1, characterized in that: Step one includes loading autofocus-related parameters into the camera controller. These autofocus-related parameters include the initial focus step size, the number of focus cycles, and the autofocus imaging parameters. The initial focus step size is set to twice the camera's depth of focus. The number of focus cycles is set to 3. The autofocus imaging parameters include settings for frame rate and exposure time.

3. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 1, characterized in that: In step one, the camera controller preprocesses the received raw image data using a bilateral filtering method to obtain preprocessed image data, and then caches the preprocessed image data to the storage medium.

4. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 1, characterized in that: In step two, the specific process for determining the focusing window is as follows: Step 21: Define nine candidate windows in a 3x3 grid within the image's field of view; Step 22: In dynamic scenes, the camera controller processes the pre-processed image using a moving target detection algorithm. If a significant moving target is detected, the candidate window containing the moving area is selected as the focusing window. If no moving target is detected, in a static scene, the camera controller performs edge detection on each of the nine candidate windows, obtains the sum of gradient magnitudes in each candidate window, and finally selects the candidate window with the largest gradient sum as the focusing window.

5. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 4, characterized in that: In step 22, the moving target detection algorithm uses the frame difference method to obtain a difference image, and then performs a thresholding operation on the difference image to obtain a binarized result image; Morphological operations are performed on the binarized image to obtain a noise-suppressed binarized frame difference image B. T The camera controller selects B within a preset candidate window. T The number of pixels with a value of 1 is counted to obtain the number of effective foreground pixels in the candidate window, and this number is defined as the motion intensity of the window.

6. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 5, characterized in that: The method for identifying salient moving targets is as follows: If the motion intensity of at least one candidate window exceeds a preset threshold, it is determined that there is a significant moving target in the field of view, and the candidate window with the highest motion intensity is selected as the final focusing window; if the motion intensity of all candidate windows is lower than the preset threshold, it is determined that there is no significant moving target, the dynamic window selection mode is terminated, and the window selection based on the static scene is switched.

7. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 1, characterized in that: In step three, the calculation process for the sharpness evaluation value is as follows: First, the gradient image value g(x,y) of the pixel at position (x,y) is calculated using the following formula: ; In the formula, and For use as structural elements in both horizontal and vertical directions; The pixel value at position (x, y); Secondly, the set threshold T(x,y): ; in, This is the adaptive threshold at position (x, y). For position The edge gradient value calculated from the pixel; k is an empirical coefficient, determined based on the characteristics of the actual image. Then, the calculated gradient image values ​​are subjected to threshold filtering, as expressed by: ; in, This represents the gradient image value at pixel position (x,y) after threshold filtering. Finally, for all areas within the selected focus window region... The sharpness evaluation value F of the image frame is obtained by accumulating the rows: ; In the formula, x∈M, y∈N, and (M, N) is the selected focusing window.

8. The on-orbit automatic focusing method for a spaceborne space target observation camera according to claim 7, characterized in that: The specific process of step three is as follows: Step 31: Image Acquisition and Sharpness Evaluation Calculation; Let the current focal plane position be P, set the current focusing step distance to Δ, and determine the sampling position set {P-Δ, P, P+Δ} with P as the reference sampling position. The camera controller moves the focusing motor to that position, samples the pre-processed image at that position within a defined focusing window, and calculates the sharpness evaluation value {(P-Δ,F}} for that position. P-Δ ),(P,F P ),(P+Δ,F P+Δ )}, F P F is the sharpness evaluation value at focal plane position P. P-Δ F P F P+Δ These are the sharpness evaluation values ​​for the focal plane positions P-Δ, P, and P+Δ, respectively. Step 3.2: Update the focal plane position and focusing direction decision; Set a threshold The updated decision is made in the following order: (1) If F P The maximum value (F) P >F P-Δ + And F P >F P+Δ + If the focus plane is moving in the current direction, move one focusing step to P' and calculate the sharpness evaluation value F'; if F' > F P If the current focal plane position is P', then update the current focal plane position to P' and proceed to step 31; otherwise, if the sharpness evaluation peak area has been reached, confirm P as the candidate best focal plane position and proceed to step 33. (2) If F P-Δ or F P+Δ If the value is the maximum, then move the focal plane to P-Δ or P+Δ as the new current focal plane position, and proceed to step three-one. (3) If F P-Δ With F P+Δ They are approximately equal and both are significantly greater than F. P Then move one focusing step along the current focal plane moving direction and execute step three-one; (4) If F P F P-Δ F P+Δ If the three are approximately equal, the plateau event counter is incremented by 1. When the plateau event counter is ≥3, the focal plane position is reversed by 3Δ and the plateau event counter is reset. Otherwise, the focal plane is moved one focusing step Δ along the current focal plane moving direction, and step three is executed. Step 3: Determine whether the number of focusing cycles has reached the preset number of focusing cycles. If so, the camera controller determines the current candidate focal plane position P as the final optimal focal plane position and outputs the position parameter, ending the current autofocus process. Otherwise, proceed to steps three and four; Steps three and four: refinement and fine-tuning of step spacing; Halve the currently set focus step size, increment the focus cycle count by 1, and proceed to step three-one to continue fine-tuning the focus scan with the updated focus step size.

9. An on-orbit automatic focusing method for a spaceborne space target observation camera according to any one of claims 1-8, characterized in that: It also includes step four, which involves setting the autofocus strategy after the current autofocus is completed and starting the next autofocus.

10. An on-orbit automatic focusing method for a spaceborne space target observation camera according to any one of claims 9, characterized in that: The autofocus strategy is divided into two types: Timed trigger: At regular intervals, perform an overall image sharpness calculation on a captured frame, and wait until the image sharpness value falls below a preset threshold T. h When the threshold T is reached, autofocus is triggered. h Pre-set according to task requirements; Command Trigger: The camera controller triggers autofocus after receiving a command from the platform.

Citation Information

Cited By

  • Macro-micro linkage automatic focusing control method, controller and system

    CN122269134A