Focus position calculation method for space remote sensing camera
Through the combination of Fourier transform and mountain climbing method, the problem of image clarity reduction caused by the position offset of the focal surface of the spatial remote sensing camera is solved, and more accurate and efficient focal surface position calculation is achieved, and the quality of the remote sensing image is improved.
Patent Information
- Application Number
- CN202411326691.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-23
AI Technical Summary
After the spatial remote sensing camera is transmitted, the position of the focal plane is offset due to mechanical vibration and environmental changes, resulting in a decrease in image clarity. The existing automatic focusing method has problems such as inaccurate calculations and low efficiency.
Using a combination of Fourier transform and mountain climbing method, the optimal focal surface position is calculated by constructing a defocused image dataset, image matching and clarity evaluation, and improving calculation accuracy and efficiency.
It improves the calculation accuracy and efficiency of the optimal focal surface position, reduces image phase shift, and enhances the application value of spatial remote sensing cameras.
Smart Images

Figure CN118843001B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a focus position calculation method for a space remote sensing camera. Background Art
[0002] With the improvement of modern remote sensing technology, space remote sensing cameras have developed rapidly and are widely used in many important fields such as environmental monitoring, military reconnaissance, disaster warning and urban planning. Although the space remote sensing camera is already in the best focal position before launch, during the launch, due to mechanical vibration and changes in temperature and humidity in the environment, the space remote sensing camera will shift the focus position after the satellite enters orbit, resulting in defocus and reduced clarity of the captured image. Figure 1 As shown in the figure, image clarity greatly affects the accuracy of information acquisition by space remote sensing cameras and the application value of space remote sensing cameras. Therefore, the defocus problem is an urgent problem that space remote sensing cameras need to solve. In order to solve the defocus problem, the existing technology mostly uses satellite flight tests to collect data during the test experiment stage, which has the disadvantages of high cost, long cycle and low efficiency. The automatic focusing method of space remote sensing cameras is mainly divided into two categories: photoelectric autocollimation method and automatic focusing method based on digital image processing. The photoelectric autocollimation method requires the addition of a special focusing optical structure, so the focusing stability will be affected and the accuracy has certain defects. The automatic focusing method based on digital image processing is to first calculate the information of each variable focus plane, and then compare the information of the image obtained at different focal plane positions, but the space remote sensing camera will still have a slight shake in the staring working mode, that is, the remote sensing image obtained is not constant, but has a certain degree of phase shift, and when the information of the variable focus plane of each remote sensing image is directly calculated without any positioning processing, there will be inaccurate calculation of the optimal focal plane position due to the inconsistency of the target pixel position of the remote sensing image, and there will be a large error. Summary of the invention
[0003] In view of this, the present invention aims to provide a focusing position calculation method for a space remote sensing camera, so as to solve the problem that the existing optimal focal plane calculation method directly calculates the information of the variable focal plane of each remote sensing image, resulting in inaccurate calculation of the optimal focal plane position and a large error.
[0004] To achieve the above object, the technical solution created by the present invention is implemented as follows:
[0005] A method for calculating the focus position of a space remote sensing camera comprises the following steps:
[0006] S1: Obtain the original focused image and use it to construct a defocused image dataset;
[0007] S2: performing image matching on the original in-focus image and the defocused images included in the defocused image dataset one by one based on a correlation measurement formula to obtain a matching image dataset;
[0008] S3: Calculate the matching image corresponding to the maximum value of the clarity evaluation in the matching image data set based on the hill climbing method, and determine the focus position.
[0009] Furthermore, step S1 specifically includes the following steps:
[0010] S11: performing Fourier transform on the original focused image to obtain a frequency spectrum of the original focused image;
[0011] S12: multiplying the spectrum of the original focused image by the defocus MTF to obtain the spectrum of the defocused image;
[0012] S13: performing inverse Fourier transform on the spectrum of the defocused image to obtain a defocused image;
[0013] S14: changing the defocus amount of the defocus MTF, repeating steps S11-S13, and obtaining a defocus image data set.
[0014] Furthermore, in step S12, the calculation formula of the defocus MTF is:
[0015] ;
[0016] ;
[0017] in, is the through-focus MTF, is a first-order Bessel function, To find the middle value of the through-focus MTF, is the horizontal spatial frequency of the space remote sensing camera, is the defocus amount, is the wavelength of the space remote sensing camera, is the focal ratio of the space remote sensing camera.
[0018] Furthermore, in step S2, the correlation measurement formula is:
[0019] ;
[0020] in, is the average gray value of the defocused image, is the average gray value of the original focused image, is a correlation measure, and is the resolution of the defocused image and the original focused image, For defocused images The pixel value of the point, is the original focused image at The pixel value of the point.
[0021] Furthermore, step S3 specifically includes the following steps:
[0022] S31: setting a focus step, randomly selecting a matching image in the matching image data set as the best matching image, and calculating a clarity evaluation value of the best matching image;
[0023] S32: calculating the clarity evaluation values of each matching image in two neighborhood directions of the best matching image according to the current focus step size;
[0024] S33: if there is a matching image whose definition evaluation value is greater than the definition evaluation value of the best matching image, the matching image with the highest definition evaluation value is used as the best matching image, otherwise the best matching image is kept unchanged;
[0025] S34: Adjust the focus step size, and repeat steps S31-S33 until a matching image with the highest clarity evaluation value is found in the matching image data set, and the matching image with the highest clarity evaluation value is used as the final best matching image. The focal plane position of the final best matching image is the focus position.
[0026] Furthermore, in step S3, the calculation formula of the clarity evaluation value is:
[0027] ;
[0028] in, is the clarity evaluation function value, The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at .
[0029] Compared with the prior art, the invention can achieve the following beneficial effects:
[0030] The present invention creates the focus position calculation method for a space remote sensing camera. Considering that the remote sensing image acquired by the space remote sensing camera in the staring working mode is not constant but has a certain degree of phase shift, it is proposed to align the defocused images before calculating the optimal focal plane position, and align the pixels of the target position on each defocused image, so that the defocused images under different defocus amounts have a high similarity, thereby improving the calculation accuracy of the optimal focal plane position. In addition, the present invention adopts a hill climbing algorithm to calculate the optimal focal plane position, thereby improving the calculation efficiency of the optimal focal plane position. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings constituting part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments and descriptions of the present invention are used to explain the present invention and do not constitute an improper limitation on the present invention. In the drawings:
[0032] Figure 1 To create defocused images at different defocus amounts as described in the embodiments of the present invention;
[0033] Figure 2 A schematic flow chart of a method for calculating a focus position of a space remote sensing camera according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the invention more clear, the invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described here are only used to explain the invention and do not constitute a limitation of the invention.
[0035] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0036] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0037] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the invention can be understood according to specific circumstances.
[0038] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0039] like Figure 2 As shown, the present invention provides a method for calculating the focus position of a space remote sensing camera, which specifically includes the following steps:
[0040] S1: Obtain an original focused image and use the original focused image to construct a defocused image dataset.
[0041] The principle of remote sensing data acquisition process is: energy propagates through the atmosphere, interacts with objects on the surface, and then passes through the atmosphere again, captured by satellite sensors, and finally generates data in graphical or digital form. Therefore, in order to complete the simulation of the entire remote sensing process in real conditions, it is necessary to understand the entire optical propagation link. The optical transfer function (Modulation Transfer Function, MTF) is used to measure the quality of the optical imaging system. The defocus MTF (MTF in defocus condition) is derived by the formula, and the original focused image is Fourier transformed to obtain the spectrum diagram, which is multiplied by the defocus MTF and then inverse Fourier transformed to finally obtain the defocus image.
[0042] Step S1 specifically includes the following steps:
[0043] S11: Performing Fourier transform on the original focused image to obtain a frequency spectrum of the original focused image.
[0044] S12: multiplying the spectrum of the original focused image by the defocus MTF to obtain the spectrum of the defocused image;
[0045] In step S12, the calculation formula of the defocus MTF is:
[0046] ;
[0047] ;
[0048] in, is the through-focus MTF, is a first-order Bessel function, To find the middle value of the through-focus MTF, is the horizontal spatial frequency of the space remote sensing camera, is the defocus amount, is the wavelength of the space remote sensing camera, is the focal ratio of the space remote sensing camera.
[0049] S13: Performing inverse Fourier transform on the spectrum of the defocused image to obtain a defocused image.
[0050] S14: changing the defocus amount of the defocus MTF, repeating steps S11-S13, and obtaining a defocus image data set.
[0051] S2: Based on the correlation measurement formula, image matching is performed one by one on the original in-focus image and the defocused images included in the defocused image dataset to obtain a matching image dataset.
[0052] First, the input defocused image is matched based on grayscale to ensure the consistency of the input image under different defocus conditions. The grayscale-based image matching method is to directly align pixels based on the grayscale information of the image or image block. The main idea of this method is to directly minimize the difference in image information. This invention uses the Normalized Cross Correlation (NCC algorithm) algorithm, which uses the grayscale of the defocused image and the original focused image to calculate the degree of matching between the two through a normalized correlation measurement formula. The correlation measurement formula is:
[0053] ;
[0054] in, is the average gray value of the defocused image, is the average gray value of the original focused image, is a correlation measure, and is the resolution of the defocused image and the original focused image, For defocused images The pixel value of the point, is the original focused image at The pixel value of the point. After traversing all the defocused images, the position with the minimum value is the matched image position. This method can ensure that the similarity of the input images under different defocus amounts is high, ensuring the accuracy of the subsequent automatic focusing algorithm.
[0055] S3: Calculate the matching image corresponding to the maximum value of the clarity evaluation in the matching image data set based on the hill climbing method, and determine the focus position.
[0056] In the present invention, the spatial domain method is selected. The edge details of the image are blurred when out of focus and sharp when in focus. This feature is manifested in the spatial domain as the characteristic values between adjacent pixels. For example, the grayscale, texture, color, etc. change in size when out of focus. Therefore, the gradient information of the image can be used as the basis for evaluating the image clarity. The edge of the image is the area where the grayscale value changes greatly. It has two characteristics: direction and amplitude. The grayscale value of the pixel along the edge of the image changes slowly, and the grayscale value of the pixel perpendicular to the edge changes dramatically. The amplitude and direction of the gradient vector are usually used to represent the change of this pixel grayscale.
[0057] Step S3 specifically includes the following steps:
[0058] S31: setting a focus step, randomly selecting a matching image in the matching image data set as the best matching image, and calculating a clarity evaluation value of the best matching image.
[0059] The present invention selects the Energy of Gradient (EOG) as the clarity evaluation function. The curve of the clarity evaluation function is a single peak, that is, when the target object distance is determined, it has a unique positive focus position; at the same time, the evaluation function has high sensitivity and strong robustness. The square sum of the gray value difference between adjacent pixels in the matching image along the x direction and the y direction is used as the gradient value of each pixel point, and the cumulative sum of all pixel gradient values is used as the clarity evaluation function value (EOG). The calculation formula of the clarity evaluation value is:
[0060] ;
[0061] in, is the clarity evaluation function value, The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at .
[0062] S32: Calculate the clarity evaluation values of the matching images in two neighborhood directions of the best matching image according to the current focus step.
[0063] S33: If there is a matching image whose definition evaluation value is greater than the definition evaluation value of the best matching image, the matching image with the highest definition evaluation value is used as the best matching image; otherwise, the best matching image remains unchanged.
[0064] S34: Adjust the focus step size, and repeat steps S31-S33 until a matching image with the highest clarity evaluation value is found in the matching image data set, and the matching image with the highest clarity evaluation value is used as the final best matching image. The focal plane position of the final best matching image is the focus position.
[0065] The ultimate goal of the focus search algorithm is to retrieve the optimal zoom position and the optimal focus position, and then convert the position information into a motor drive signal to drive the motor to act on the photoelectric lens group to complete the zoom operation or the focus operation. Therefore, a good focus search algorithm can greatly improve the focusing speed. The search algorithm selected in the present invention is a hill climbing algorithm. The hill climbing algorithm is proposed based on the characteristics of the clarity evaluation curve. Since the ideal hill climbing search curve is low on both sides and high in the middle and has only one highest point, it is shaped like a hillside, so it is called a hill climbing algorithm. Based on the characteristics of the hill climbing algorithm, a large focus step is set first, and then, according to the calculation results obtained based on the large focus step, a small focus step is confirmed to achieve continuous search from a large range to a small range, thereby obtaining a matching image with the highest relative clarity evaluation value.
[0066] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the disclosure of the present invention can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0067] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for calculating the focus position of a space remote sensing camera, characterized in that: The specific steps include: S1: Acquire an original focused image, and construct a defocused image dataset using the original focused image; S2: performing image matching on the original in-focus image and the defocused images included in the defocused image dataset one by one based on a correlation measurement formula, and sequentially aligning pixels of the original in-focus image with each defocused image to obtain a matching image dataset; The correlation measurement formula is: ; in, is the average gray value of the defocused image, is the average gray value of the original focused image, is a correlation measure, and is the resolution of the defocused image and the original focused image, For defocused images The pixel value of the point, is the original focused image at The pixel value of the point; S3: calculating a matching image corresponding to a maximum value of the clarity evaluation in the matching image data set based on a hill climbing method, and determining a focus position; The step S1 specifically includes the following steps: S11: performing Fourier transform on the original focused image to obtain a frequency spectrum of the original focused image; S12: multiplying the spectrum of the original focused image by the defocus MTF to obtain a spectrum of the defocused image; The calculation formula of the through-focus MTF is: ; ; in, is the through-focus MTF, is a first-order Bessel function, To find the middle value of the through-focus MTF, is the horizontal spatial frequency of the space remote sensing camera, is the defocus amount, is the wavelength of the space remote sensing camera, is the focal ratio of the space remote sensing camera; S13: performing inverse Fourier transform on the spectrum of the defocused image to obtain a defocused image; S14: changing the defocus amount of the defocus MTF, repeating steps S11-S13, and obtaining a defocus image data set.
2. The method for calculating the focus position of a space remote sensing camera according to claim 1, characterized in that: The step S3 specifically includes the following steps: S31: setting a focus step, randomly selecting a matching image from the matching image data set as the best matching image, and calculating a clarity evaluation value of the best matching image; S32: calculating the clarity evaluation values of the matching images in two neighborhood directions of the best matching image according to the current focusing step size; S33: if there is a matching image whose definition evaluation value is greater than the definition evaluation value of the best matching image, the matching image with the highest definition evaluation value is used as the best matching image, otherwise the best matching image is kept unchanged; S34: Adjust the focus step size, and repeat steps S31-S33 until a matching image with the highest clarity evaluation value is found in the matching image data set, and the matching image with the highest clarity evaluation value is used as the final best matching image. The focal plane position of the final best matching image is the focus position.
3. The method for calculating the focus position of a space remote sensing camera according to claim 2, characterized in that: In step S3, the calculation formula of the clarity evaluation value is: ; in, is the clarity evaluation function value, The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at The current best matching image at coordinates The pixel value at .