Rapid focusing method, system and device based on complementary differential detection and medium

By using complementary differential detection technology in the imaging system, the light intensity difference value of the target object at different focusing positions is calculated and the optimal focus position is determined, which solves the problem of poor focus during low light, high speed or special band imaging, and achieves a fast, accurate and efficient focus effect.

CN120075612APending Publication Date: 2025-05-30HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510275781.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing automatic focus technology of imaging systems is difficult to achieve fast and accurate focusing during low light conditions, high-speed imaging, or during special band imaging.

Method used

Using a fast focusing method based on complementary differential detection, by applying a modulation process in a specific modulation mode to the target object, and detecting its emitted, reflected or transmitted light signals at different focus points, the difference value corresponding to the light intensity of each focus position is calculated, and the focus position with the maximum difference value is determined as the optimal focus position.

Benefits of technology

It achieves fast and accurate focus under various complex environments and conditions, significantly improves the speed and accuracy of focus, reduces equipment cost and complexity, has strong adaptability and robustness, and has excellent real-time focus performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075612A_ABST
    Figure CN120075612A_ABST
Patent Text Reader

Abstract

The invention discloses a rapid focusing method, system and device based on complementary differential detection and a medium, and the method comprises the steps: applying modulation processing of a specific modulation mode to a target object, and detecting light signals emitted, reflected or transmitted by the target object at different focus points; acquiring light intensity values of the target object at different focusing positions by analyzing the modulated light signal, and calculating a difference value of the light intensity corresponding to each focusing position according to the light intensity values; and comparing the difference values of the detection signals at different focusing positions, and determining the focusing position with the maximum difference value as the optimal focusing position. According to the invention, differential values at different focusing positions are compared, and the focusing position corresponding to the maximum differential value is determined as the focusing position. Under the non-imaging condition of using the double-single-pixel detector, quick and real-time focusing can be realized in only one modulation mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of imaging autofocus, and particularly relates to a fast focusing method, system, device and medium based on complementary differential detection. Background Art

[0002] In recent years, computer vision and image processing technologies have developed rapidly, greatly promoting the growth of the demand for high-quality images in various fields. In many core fields such as medical image analysis, industrial product inspection, and security monitoring, quickly and accurately completing the focusing operation to obtain clear images has become an indispensable key link. However, in specific situations, due to the limitations of optical system design, imaging device performance, or interference from various other external factors, achieving fast and effective focusing still faces many challenges.

[0003] The deficiencies of the prior art are that traditional imaging system autofocus technologies mainly rely on parameters such as the sharpness and contrast of images for judgment, but obvious limitations are exposed in specific scenarios. For example, in low-light conditions, due to insufficient light, the image contrast and detail information are damaged, making it difficult for such focusing technologies to accurately determine the focus position; during high-speed imaging, the image acquisition speed is extremely fast, and the data processing ability of traditional methods is difficult to keep up, resulting in limitations on the accuracy and speed of focusing; in addition, when imaging in special bands such as infrared and terahertz, due to the different characteristics of these bands from visible light, traditional methods are limited by the performance of imaging devices and are difficult to be effective. Summary of the Invention

[0004] The purpose of the present invention is to overcome the deficiencies of the prior art. To achieve the above purpose, a fast focusing method, system, device and medium based on complementary differential detection are adopted to solve the problems raised in the above background art.

[0005] A fast focusing method based on complementary differential detection, characterized by comprising the following steps:

[0006] Step S1, applying modulation processing with a specific modulation mode to the target object, and detecting the light signal emitted, reflected or transmitted by it at different focal points;

[0007] Step S2, by analyzing the modulated light signal, obtaining the light intensity values of the target object at different focal positions, and calculating the difference values of the light intensities corresponding to each focal position accordingly;

[0008] Step S3, comparing the difference values of the detection signals at different focal positions, and determining the focal position with the maximum difference value as the best focusing position.

[0009] As a further solution of the present invention: The specific steps in the above-mentioned step S2 include:

[0010] A dual single-pixel detector is adopted to measure the differential values of the target object at different focusing positions according to the modulated optical signal.

[0011] As a further solution of the present invention: determining a two-dimensional function S(x, y) corresponding to the modulation mode;

[0012] Modulating the optical signal according to the two-dimensional function S(x, y) to obtain the intensity value I of the dual single-pixel detector corresponding to the i-th direction i , which is equivalent to the optical intensity value corresponding to the i-th.

[0013] As a further solution of the present invention: the modulation mode includes:

[0014] The modulation matrix S is a two-dimensional matrix and the value of each element at each position is 1 or -1, the value of the element in the first row and the first column is 1, and the values of adjacent elements are opposite numbers.

[0015] As a further solution of the present invention: the modulation mode corresponds to the two-dimensional function S(x, y), and satisfies:

[0016] S(x, y) = (-1) (x+y)

[0017] The abscissa and ordinate of the coordinate system where the two-dimensional function S(x, y) is located respectively correspond to the row direction and the column direction of the modulation matrix;

[0018] Modulating the optical signal according to the two-dimensional function S(x, y) to obtain 2 corresponding optical information intensity values I 1 , I 2 , and further calculating the differential value of the image, including:

[0019] Modulating the optical signal according to the two-dimensional function S(x, y) to obtain the optical information intensity values I 1 , I 2 , which are expressed as:

[0020] I 1 = Σ x,y f(x, y)S 1 (x, y)

[0021] I 2 = ∑ x,y f(x, y)S 2 (x, y)

[0022] In the formula, S 1 (x, y) retains the value of the 1 element in S(x, y), but the value of the -1 element becomes 0, S 2(x, y) changes the value of the 1 element in S(x, y) to 0 and the value of the -1 element to 1.

[0023] According to the detection light intensity value calculation result |I 1 -I 2 | is equivalent to the image difference value ΔI.

[0024] The technical solution of the second aspect, a kind of fast focusing system based on complementary differential detection, including any one of the above, includes:

[0025] A modulation module, configured to perform modulation processing on the target object with a specific modulation mode, and detect the light signal emitted, reflected or transmitted by it at different focusing points;

[0026] A data calculation module, configured to obtain the light intensity values of the target object at different focusing positions by analyzing the modulated light signal, and calculate the difference values of the light intensities corresponding to each focusing position accordingly;

[0027] A focusing position determination module, configured to compare the difference values of the detection signals at different focusing positions, and determine the focusing position with the largest difference value as the best focusing position.

[0028] As a further solution of the present invention: the modulation module includes a two-dimensional matrix generation unit for generating a modulation matrix, and a modulation template for modulating the light signal based on the modulation matrix.

[0029] As a further solution of the present invention: the data calculation module includes a light intensity value acquisition module and a difference value acquisition module.

[0030] The technical solution of the third aspect, a device, further includes:

[0031] At least one processor;

[0032] At least one memory for storing at least one program;

[0033] When the at least one program is executed by the at least one processor, the at least one processor implements a fast focusing method based on complementary differential detection as described in any one of the above.

[0034] The technical solution of the fourth aspect, a storage medium, in which processor-executable instructions are stored, and the processor-executable instructions are used to implement a fast focusing method based on complementary differential detection as described in any one of the above when executed by the processor.

[0035] Compared with the prior art, the present invention has the following technical effects:

[0036] 1. Precise and efficient focusing: Traditional autofocus methods are easily interfered by adverse factors such as noise, light fluctuations, and motion blur, making it difficult to achieve rapid and precise focusing operations. However, using a dual single-pixel detector for complementary differential detection only requires one modulation mode, which can efficiently evaluate image features in a short time, thus achieving a fast and accurate focusing process, significantly improving the speed and accuracy of focusing.

[0037] 2. Reducing equipment cost and complexity: Traditional image acquisition devices usually rely on pixel arrays to capture image information, which requires a large number of pixels, resulting in high equipment costs and complex structures. However, this technology only needs to use a dual single-pixel detector to achieve focusing without the support of additional numerous hardware devices. This streamlined design architecture not only reduces the manufacturing and maintenance costs of focusing devices but also simplifies the complexity of the devices, making them easier to operate and maintain. The resulting more portable and flexible focusing devices bring great convenience to many application scenarios, such as in fields with high requirements for equipment portability like field exploration and mobile monitoring.

[0038] 3. Strong adaptability and robustness: In cases of poor lighting conditions (such as low-light environments) or special wavelength bands (such as infrared, terahertz, etc.), the performance of traditional focusing technologies often deteriorates significantly. However, the complementary differential detection method adopted by this technology can effectively suppress ambient light interference and significantly improve the signal-to-noise ratio of the signal. By collecting differential signals with a dual single-pixel detector, this technology can comprehensively consider various features and change trends of the target, thereby providing more reliable focusing indicators. This enables it to stably achieve high-quality focusing operations in various complex and changing environments, demonstrating strong adaptability and robustness, and effectively ensuring the quality and efficiency of image acquisition.

[0039] 4. Excellent real-time focusing performance: Thanks to the unique dual single-pixel detector and complementary differential detection design, this technology can quickly detect the focusing state and achieve real-time feedback. Combined with efficient calculation and processing methods, it can meet the strict requirements of real-time focusing. Whether in the field of real-time monitoring to promptly capture key images to ensure safety, or in the scenario of autonomous driving to quickly focus on road conditions to ensure driving safety, this technology can quickly acquire, accurately analyze, and promptly process image data, significantly improving the response speed and real-time performance of the system, providing a solid technical support for the efficient operation and innovative development of various fields.

[0040] In summary, the technology of using a dual-single pixel detector for complementary differential detection to achieve fast focusing has many significant advantages in fields such as image acquisition and projection. It can accurately and quickly focus, effectively solve the problem of poor focusing caused by various factors interfering with traditional methods, and quickly locate the focusing state through a unique detection method; it performs well in terms of cost and complexity, reducing the hardware requirements and costs compared to traditional devices and simplifying the device structure; its strong robustness and wide adaptability enable it to work stably under various lighting conditions and complex backgrounds and adapt to a variety of application scenarios; its excellent real-time focusing performance meets the requirements of fields with strict real-time requirements; most importantly, it has broad application prospects in many fields such as medical imaging, industrial inspection, and optical projection, providing key assistance for the development and progress of these fields, bringing many innovation opportunities, strongly promoting the technology improvement and business expansion of related industries, and having a profound and positive significance for the development of the entire image acquisition and analysis field. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The following will describe in detail the specific embodiments of the present invention with reference to the accompanying drawings:

[0042] Figure 1 It is a schematic diagram of the steps of the fast focusing method according to the disclosed embodiment of the present application;

[0043] Figure 2 It is a schematic diagram of the fast focusing system based on complementary differential detection according to the disclosed embodiment of the present application.

[0044] In the figure:

[0045] 1. Light source; 2. Target object; 3. Imaging lens group; 4. Modulation module; 51. Dual-single pixel detector; 6. Light intensity value acquisition module; 7. Difference value acquisition module; 8. Focusing position determination module. SPECIFIC EMBODIMENTS

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0047] Please refer to Figure 1 , in the embodiment of the present invention, a fast focusing method based on complementary differential detection includes the following steps:

[0048] Step S1: Use the modulation module to perform modulation processing on the target object with a specific modulation mode, and detect the light signal emitted, reflected, or transmitted by it at different focal points;

[0049] Step S2: By analyzing the modulated optical signal, obtain the light intensity values of the target object at different focusing positions, and calculate the difference values of the light intensities corresponding to each focusing position accordingly; the specific steps include:

[0050] Adopt a dual single-pixel detector, and based on the modulated optical signal, measure the difference values of the target object at different focusing positions. Specifically, obtain the light intensity value of the modulated target object through the dual single-pixel detector, and then calculate the difference value of the target object according to the complementary light intensity value;

[0051] Step S3: Compare the difference values of the detection signals at different focusing positions, and determine the focusing position with the maximum difference value as the best focusing position.

[0052] In this embodiment, determine the two-dimensional function S(x, y) corresponding to the modulation mode;

[0053] Modulate the optical signal according to the two-dimensional function S(x, y) to obtain the intensity value I of the dual single-pixel detector corresponding to the i-th direction i , which is equivalent to the light intensity value corresponding to the i-th.

[0054] In the specific implementation manner, the modulation modes include:

[0055] The modulation matrix S is a two-dimensional matrix and the value of each element at each position is 1 or -1. The value of the element in the first row and the first column is 1, and the values of adjacent elements are opposite numbers.

[0056] Specifically, in step S2, obtain the differential light intensity values of the target object at different focusing positions according to the modulated optical signal. In image analysis and recognition, the image difference value is a very crucial feature. The image difference value reflects the degree of change difference between different regions or pixels in the image. This difference information is of great significance for accurately capturing the detailed changes in the image, judging the distribution of image features, and quickly positioning the key regions of the image. It can be used as a basic and effective measurement method to measure the change trend of the image in different dimensions, and plays an indispensable role in both the analysis of the local fine structure of the image and the comparison and judgment of the overall features. The methods for obtaining the image difference value include methods based on pixel gray-scale comparison, regional brightness difference calculation method, edge pixel difference evaluation method, difference acquisition method based on image segmentation and fusion, etc. These methods explore and extract the image difference value from different angles, thus providing a very strong basis and support for a series of complex tasks such as subsequent image analysis, processing, and target recognition, and greatly improving the accuracy and efficiency of image analysis and recognition work.

[0057] The fast focusing technology using a dual single - pixel detector for complementary differential detection is a highly innovative imaging - assisting technology. Based on a unique dual - detector structure and the principle of complementary differential detection, it combines an efficient data - processing algorithm to achieve fast and accurate focusing. Compared with traditional focusing technologies that rely on full - frame image acquisition and complex algorithm calculations, it only uses two single - pixel detectors to collect the differential light - intensity information in the image and only requires one modulation mode. This technology exhibits many outstanding advantages. It has strong adaptability. Whether in complex and changeable lighting conditions, such as strong - light direct - shooting, dark - light hiding scenes, or in situations with complex background interference, it can stably perform excellently, ensuring that accurate focusing is not affected. It has significant cost - effectiveness. It only requires a simple configuration of dual single - pixel detectors and does not require expensive and complex dedicated focusing hardware, greatly reducing the cost of imaging equipment and at the same time reducing the complexity of the equipment, making the entire imaging system more simple and easy to use. It has excellent robustness. In the face of interference factors such as ambient - light fluctuations and slight equipment jitters, it can still accurately detect and process the differential signals, effectively suppress ambient - light interference, and stably output reliable focusing results, ensuring consistent imaging quality.

[0058] In this embodiment, obtaining the differential light - intensity values of the target object at different focusing positions according to the modulated optical signal includes:

[0059] Using a single - pixel detector to obtain the differential light - intensity values of the target object at different focusing positions according to the modulated optical signal. Specifically, use a dual single - pixel detector to obtain the optical signals in two complementary directions after modulation and collect the optical - signal intensity values corresponding to the modulated optical signals, thereby determining the differential values of the target object at different focusing positions;

[0060] In this embodiment, the modulation mode corresponds to a two - dimensional function S(x, y), and satisfies:

[0061] S(x,y)=(-1) (x+y)

[0062] where the abscissa and ordinate of the coordinate system of the two - dimensional function S(x, y) respectively correspond to the row direction and column direction of the modulation matrix S, and the two - dimensional function value corresponds to the element value of the corresponding modulation matrix;

[0063] Specifically, S 1 (6,2)=1 means that in the two - dimensional matrix, the element value of the second column of the sixth row is 1, and S 1 (3,4)=-1 means that in the two - dimensional matrix, the element value of the fourth column of the third row is -1.

[0064] Modulating the optical signal according to the two - dimensional function S(x, y) to obtain 2 corresponding optical - information intensity values I 1 , I 2, Further calculate the difference value of the image, including:

[0065] Modulate the optical signal according to the two-dimensional function S(x, y) to obtain the optical information intensity values I in two corresponding complementary directions 1 , I 2 , expressed as:

[0066] I 1 = ∑ x,y f(x, y)S 1 (x, y)

[0067] I 2 = ∑ x,y f(x, y)S 2 (x, y)

[0068] In the formula, S 1 (x, y) retains the value of the 1 element in S(x, y), but the value of the -1 element becomes 0, and S 2 (x, y) changes the value of the 1 element in S(x, y) to 0, and the value of the -1 element to 1.

[0069] According to the calculation result of the probe light intensity value |I 1 -I 2 | is equivalent to the image difference value △I.

[0070] The optical information intensity values I 1 , I 2 are respectively equivalent to the optical intensity values detected by two corresponding detectors for two complementary directions of light. By obtaining the optical information intensity values in two complementary directions corresponding to a modulation mode and calculating the image difference value, multiple features and change rates of the image are comprehensively considered, and the best focus position can be determined more accurately.

[0071] In this embodiment, the single-pixel imaging technology is combined with the complementary difference detection algorithm, providing an innovative and efficient solution for fast focusing. This technology utilizes only one modulation modulus and quickly calculates the difference value by taking advantage of the complementary characteristics of the modulated light in two directions, achieving fast focusing under extremely low data volume. This method can not only achieve fast focusing of high-quality images under various lighting conditions, but also reduce the consumption of computing resources and meet the requirements of real-time focusing.

[0072] In step S2, calculate the difference value through the optical intensity values in two directions, and the formula is:

[0073] ΔI (g) = |I 1 (g) -I 2 (g) |;

[0074] Among them, (g) represents different focusing positions.

[0075] By calculating two detection values I of the target object at one position at different focusing positions 1 , I 2 , the difference value △I can be quickly calculated, and then the image blur degree can be measured;

[0076] Through step S3, the difference values corresponding to the detection signals at different focusing positions are obtained, and then the difference values corresponding to the detection signals at different focusing positions are compared to determine the focusing position corresponding to the maximum difference value as the focusing position, that is, the purpose of using the direct complementary light intensity detection method for rapid focusing is achieved. Using the direct complementary difference detection method for rapid focusing can evaluate the image clarity and focusing quality in a short time.

[0077] In summary, using the single-pixel detection rapid focusing technology, the flexibility and robustness of the single-pixel detection technology make it applicable to various lighting conditions and scenarios, including low-light environments and complex backgrounds. The light intensity data collected by using the single-pixel detection technology is directly used as a calculated value to calculate the image difference value, and rapid focusing is achieved under the condition of extremely low data volume. This method can not only achieve rapid focusing of high-quality images under various lighting conditions, but also reduce the consumption of computing resources, meet the requirements of real-time focusing, and does not require additional hardware devices.

[0078] The single-pixel direct moment detection rapid focusing technology provides an innovative solution for rapid and accurate focusing by combining single-pixel imaging and complementary difference detection algorithms. This technology has broad application prospects in the field of image acquisition and analysis, can meet the requirements of high-quality image acquisition, and promote the development and progress of related fields.

[0079] The technical solution of the second aspect is as Figure 2 shown. A rapid focusing system based on complementary difference detection, including any one of the above, includes:

[0080] A modulation module 4, configured to perform modulation processing on the target object with a specific modulation mode, and detect the light signal emitted, reflected or transmitted by the target object at different focal points;

[0081] A data calculation module, configured to obtain the light intensity values of the target object at different focusing positions by analyzing the modulated light signal, and calculate the difference values of the light intensities corresponding to each focusing position accordingly;

[0082] The data calculation module includes a light intensity value acquisition module and a difference value acquisition module.

[0083] A light intensity value acquisition module 5, configured to obtain the intensity values of the target object 2 at different focusing positions according to the modulated light signal;

[0084] The differential value acquisition module 6 is configured to receive the intensity values output by the light intensity value acquisition module 5 and calculate the differential values corresponding to the target object 2 at different focusing positions;

[0085] The focusing position determination module is configured to compare the differential values of the detection signals at different focusing positions and determine the focusing position with the maximum differential value as the optimal focusing position.

[0086] In this embodiment, the modulation module 4 includes a two-dimensional matrix generation unit for generating a modulation matrix and a modulation template for modulating the optical signal based on the modulation matrix.

[0087] The modulation module 4 includes a two-dimensional matrix generation unit 41 and a modulation template 42. The two-dimensional matrix generation unit 41 generates a modulation matrix, and the modulation template 42 uses the modulation matrix to modulate the optical signal. The two-dimensional matrix generation unit 41 is configured to generate a modulation matrix S; the modulation matrix S is a two-dimensional matrix and the value of each element at each position therein is 1 or -1, the value of the element in the first row and the first column is 1, and the values of adjacent elements are opposite numbers.

[0088] In this embodiment, the modulation template 42 uses the modulation matrix to modulate the optical signal. The modulation template can be implemented by a mask plate. The modulation matrix is etched onto the mask plate, and the element values of 1 or -1 in the modulation matrix respectively correspond to the light or non-light areas on the mask plate.

[0089] In this embodiment, the differential light intensity value acquisition module includes a single-pixel detector 1, a single-pixel detector 2, and a light intensity value acquisition module 5. The single-pixel detector 51 and the single-pixel detector 52 are arranged in two complementary modulation reflection light directions of the modulation template 42 for receiving the optical signals modulated by the modulation template 42 from the modulation reflection light directions of the modulation template 42. The light intensity value acquisition module 5 obtains the output signals of the single-pixel detector 51 and the single-pixel detector 52; in combination with the modulation matrix generated by the modulation module 4, the light signal intensity value I obtained by the optical signal passing through the modulation matrix S is obtained 1 、I 2 。

[0090] The two-dimensional function generation part in the modulation module is used to determine the two-dimensional function S(x, y) corresponding to the modulation matrix S, and satisfies:

[0091] S(x,y)=(-1) (x+y) ;

[0092] where the abscissa and ordinate of the coordinate system where the two-dimensional function S(x, y) is located respectively correspond to the row direction and the column direction of the modulation matrix S, and the two-dimensional function value corresponds to the element value of the corresponding modulation matrix.

[0093] The differential value acquisition module 6 calculates according to the light signal intensity value I1 , I 2 Calculate the image difference value, and then measure the image blur degree. Finally, in combination with the focus position determination module 7, the purpose of using the complementary difference method for fast focusing is achieved. By using the complementary difference direct detection algorithm for fast focusing, the image clarity and focus quality can be evaluated in a short time.

[0094] In this embodiment, a light source 1 is further included for irradiating the target object 2.

[0095] In this embodiment, an imaging lens group 3 is further arranged between the target object 2 and the modulation module 4 for projecting the optical signal reflected or transmitted by the target object 2 to the modulation module 4. In this process, the imaging lens group 3 changes the focus position and finally obtains the difference values corresponding to different focus positions.

[0096] The technical solution of the third aspect, a device, further includes:

[0097] At least one processor;

[0098] At least one memory for storing at least one program;

[0099] When at least one program is executed by at least one processor, at least one processor implements a fast focusing method based on complementary difference detection as described in any one of the above.

[0100] The content in the above method embodiments is applicable to the device embodiments of the present invention. The functions specifically implemented by the device embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0101] The technical solution of the fourth aspect, a storage medium, in which processor-executable instructions are stored, and the processor-executable instructions are used to implement a fast focusing method based on complementary difference detection as described in any one of the above when executed by the processor.

[0102] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents, and should be included within the protection scope of the present invention.

Claims

1. A fast focusing method based on complementary differential detection, characterized in that: The following steps are involved: Step S1, applying a modulation process of a specific modulation mode to a target object, and detecting the light signals emitted, reflected or transmitted by the target object at different focus points; Step S2, by analyzing the modulated light signal, obtaining the light intensity values ​​of the target object at different focus positions, and calculating the difference value of the light intensity corresponding to each focus position based on the obtained light intensity values; Step S3: comparing the differential values ​​of the detection signals of different focus positions, and determining the focus position with the maximum differential value as the best focus position.

2. The fast focusing method based on complementary differential detection according to claim 1, characterized in that: The specific steps in step S2 include: Using dual single-pixel detectors, the differential value of the target object at different focus positions is measured based on the modulated light signal.

3. The fast focusing method based on complementary differential detection according to claim 3, characterized in that: Determine the two-dimensional function S(x,y) corresponding to the modulation mode; The light signal is modulated according to the two-dimensional function S(x, y) to obtain the dual single pixel detector intensity value I corresponding to the i-th direction i , which is equivalent to the corresponding light intensity value of the i-th.

4. The fast focusing method based on complementary differential detection according to claim 3, characterized in that: The modulation modes include: The modulation matrix S is a two-dimensional matrix in which the element value at each position is 1 or -1, the element value of the first row and the first column is 1, and the values ​​of adjacent elements are opposite numbers.

5. The fast focusing method based on complementary differential detection according to claim 4, characterized in that: The modulation mode corresponds to a two-dimensional function S(x,y) and satisfies: S(x,y)=(-1) (x+y) The horizontal coordinate and the vertical coordinate of the coordinate system where the two-dimensional function S(x,y) is located correspond to the row direction and the column direction of the modulation matrix respectively; The optical signal is modulated according to the two-dimensional function S(x, y) to obtain two corresponding optical information intensity values ​​I1 and I2, and the difference value of the image is further calculated, including: The optical signal is modulated according to the two-dimensional function S(x, y) to obtain the corresponding optical information intensity values ​​I1 and I2 in two complementary directions, which are expressed as: I1=Σ x,y f(x,y)S 1 (x,y) I2=Σ x,y f(x,y)S 2 (x,y) In the formula, S 1 (x,y) retains the value of the 1 element in S(x,y), but the value of the -1 element becomes 0, S 2 (x,y) changes the value of 1 element in S(x,y) to 0 and the value of -1 element to 1. The result |I1-I2| calculated based on the detected light intensity value is equivalent to the image difference value △I.

6. A fast focusing system based on complementary differential detection as claimed in any one of claims 1 to 5, characterized in that: include: A modulation module, used to apply a modulation process of a specific modulation mode to the target object and detect the light signals emitted, reflected or transmitted by the target object at different focal points; A data calculation module is used to obtain the light intensity values ​​of the target object at different focus positions by analyzing the modulated light signal, and calculate the difference value of the light intensity corresponding to each focus position based on the obtained light intensity value; The focus position determination module is used to compare the differential values ​​of different focus position detection signals and determine the focus position with the largest differential value as the best focus position.

7. The fast focusing system based on complementary differential detection according to claim 6, characterized in that: The modulation module includes a two-dimensional matrix generation unit for generating a modulation matrix, and a modulation template for modulating an optical signal based on the modulation matrix.

8. The fast focusing system based on complementary differential detection according to claim 6, characterized in that: The data calculation module includes a light intensity value acquisition module and a difference value acquisition module.

9. A device, characterized in that: Also includes: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the fast focusing method based on complementary differential detection as described in any one of claims 1 to 5.

10. A storage medium storing instructions executable by a processor, characterized in that: The processor-executable instructions are used to implement a fast focusing method based on complementary differential detection as described in any one of claims 1 to 5 when executed by the processor.