A mechanical sight automatic focusing method and system based on laser ranging

CN122883144APending Publication Date: 2026-10-09深圳翌信信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611018310.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]然而,上述现有技术在实际应用中存在一个关键缺陷:当目标尺寸较小或观测距离较近时,激光测距光斑可能超出目标边界,导致测距值反映的是背景距离而非真实目标距离,进而使后续调焦位置计算产生偏差

Benefits of technology

[0009]Based on the embodiments provided in this application, the coverage determination parameter set is determined by the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value. This enables a quantitative assessment of the spatial coverage relationship between the laser ranging spot and the target before focusing, thereby identifying the risk of the ranging spot exceeding the target boundary. By converting the target boundary angle into the target lateral interval and combining it with the spot coverage interval to generate reliable ranging constraint results, the reliability of the ranging value and the reasonable limitation of the search distance interval are realized, avoiding the systematic deviation caused by directly using unreliable ranging values ​​for focusing control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122883144A_ABST
    Figure CN122883144A_ABST
Patent Text Reader

Abstract

The application discloses a kind of mechanical sighting device automatic focusing method and system based on laser ranging, it is related to laser ranging technical field, the method includes: target boundary angle is converted into target transverse interval, and spot coverage interval is determined according to spot center transverse offset and spot radius calibration value;According to spot coverage interval and target transverse interval, determine ranging credible mark and search distance interval;According to ranging credible constraint result, determine candidate position pair sequence;Based on candidate position pair sequence, drive focusing lens group and difference elimination lens group reach each candidate position pair simultaneously and stay, image window is collected at each stay position corresponding to each candidate position pair and the definition evaluation value is calculated;The highest definition evaluation value of candidate position pair is determined as mechanical focusing difference elimination reference position;According to mechanical focusing difference elimination reference position, drive focusing lens group and difference elimination lens group to position.The application improves the reliability and environmental adaptability of automatic focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of laser ranging technology, and more specifically, to an automatic focusing method and system for mechanical sights based on laser ranging. Background Technology

[0002] With the development of photoelectric aiming technology, miniaturized laser rangefinder technology, and electromechanical drive control technology, compact aiming devices integrating optical sights, mechanical focusing / correction lenses, and laser rangefinders have gradually become an important technological form in precision observation and aiming systems. These devices aim to simultaneously achieve target observation, distance acquisition, automatic focusing, and correction within a limited structural space, thereby reducing operator workload, improving aiming efficiency, and enhancing imaging quality and aiming stability at close to medium ranges. Especially when performing detailed observation and aiming at close-range targets, the sharpness of the target image plane, the spatial correspondence between the reticle and the target, and the accuracy of the correction state directly determine the system's practical performance and reusability.

[0003] Based on existing research and engineering applications, laser ranging-assisted autofocus is usually built on a relatively idealized technical chain, that is, the laser ranging unit first obtains the target distance, then inputs the distance value into a pre-calibrated distance-focusing position mapping relationship, and finally outputs the drive position of the mechanical focusing lens group and related error correction mechanism.

[0004] However, the aforementioned existing technologies have a key drawback in practical applications: when the target size is small or the observation distance is close, the laser ranging spot may extend beyond the target boundary, causing the ranging value to reflect the background distance rather than the actual target distance, thus leading to deviations in subsequent focusing position calculations. Since existing solutions typically use the ranging results directly as input for focusing control, they lack an effective verification mechanism for the spatial coverage relationship between the ranging spot and the target, making them prone to focusing inaccuracies in close-range, small-target scenarios.

[0005] There is currently no effective solution to the above problems. Summary of the Invention

[0006] This application provides an automatic focusing method and system for mechanical sights based on laser rangefinding to solve the above-mentioned technical problems.

[0007] This application provides an automatic focusing method for a mechanical sight based on laser ranging, comprising: S1, determining the target boundary angle based on the current aiming image frame, and determining the lateral offset of the spot center based on the laser ranging value; determining a coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value; S2, converting the target boundary angle into a target lateral interval, and determining the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value; determining a ranging confidence marker and a search distance interval based on the spot coverage interval and the target lateral interval to generate a ranging confidence constraint result; S3, based on the target boundary angle, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, and determining the target lateral interval; S4, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, and determining the target lateral interval; S5, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, and determining the target lateral interval; S6, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, and determining the target lateral interval; S7, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, determining the target lateral interval, and determining the target lateral interval; S8, determining the target lateral interval ... The ranging reliability constraint results determine a candidate position pair sequence, each candidate position pair in the candidate position pair sequence including a focusing position and an aberration correction position; S4, based on the candidate position pair sequence, the focusing lens group and the aberration correction lens group are driven to simultaneously reach and stop at each candidate position pair, and image windows are acquired at each stopping position corresponding to each candidate position pair and the sharpness evaluation value is calculated; the candidate position pair with the highest sharpness evaluation value is determined as the mechanical focusing aberration correction reference position; S5, according to the mechanical focusing aberration correction reference position, the focusing lens group and the aberration correction lens group are driven to the position, and after the position is confirmed, the current position of the focusing lens group and the current position of the aberration correction lens group are locked.

[0008] This application provides an automatic focusing system for a mechanical sight based on laser ranging, comprising: a parameter set determination module, used to determine the target boundary angle based on the current aiming image frame, and to determine the lateral offset of the spot center based on the laser ranging value; and to determine a coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value; a reliable constraint result generation module, used to convert the target boundary angle into a target lateral interval, and to determine the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value; and to determine a ranging reliability marker and a search distance interval based on the spot coverage interval and the target lateral interval to generate a ranging reliability constraint result; and a candidate position pair determination module. The system comprises: a module for determining a sequence of candidate position pairs based on the ranging reliability constraint results, wherein each candidate position pair in the sequence includes a focusing position and a correction position; a reference position determination module for simultaneously driving the focusing lens group and the correction lens group to each candidate position pair and stopping at each stopping position corresponding to each candidate position pair, acquiring image windows and calculating sharpness evaluation values ​​at each stopping position corresponding to each candidate position pair; and determining the candidate position pair with the highest sharpness evaluation value as the mechanical focusing correction reference position; and a driving module for driving the focusing lens group and the correction lens group to their positions according to the mechanical focusing correction reference position, and locking the current positions of the focusing lens group and the correction lens group after confirmation of their positions.

[0009] Based on the embodiments provided in this application, the coverage determination parameter set is determined by the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value. This enables a quantitative assessment of the spatial coverage relationship between the laser ranging spot and the target before focusing, thereby identifying the risk of the ranging spot exceeding the target boundary. By converting the target boundary angle into the target lateral interval and combining it with the spot coverage interval to generate reliable ranging constraint results, the reliability of the ranging value and the reasonable limitation of the search distance interval are realized, avoiding the systematic deviation caused by directly using unreliable ranging values ​​for focusing control.

[0010] By generating a sequence of candidate position pairs and driving the focusing lens group and the aberration lens group to synchronously stop and acquire images at each candidate position pair, the mechanical focusing and aberration correction reference position is determined based on the optimal sharpness evaluation value. This allows the system to complete focusing and aberration correction based on actual image quality even under ranging constraints. Finally, by confirming the position and locking the position, the stability of the focusing lens group and the aberration lens group at the reference position is ensured. Therefore, this application can effectively overcome the focusing inaccuracy problem caused by the ranging spot going out of bounds in close-range small target scenarios, improve the reliability and environmental adaptability of autofocus, and at the same time take into account the structural compactness requirements of mechanical focusing and aberration correction. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0012] Figure 1 This is a flowchart of an optional automatic focusing method for a mechanical sight based on laser rangefinding, according to an embodiment of this application;

[0013] Figure 2 This is a structural diagram of an optional laser rangefinder-based automatic focusing system for a mechanical sight according to an embodiment of this application;

[0014] Figure 3 This is a structural diagram of another optional laser rangefinder-based automatic focusing system for a mechanical sight according to an embodiment of this application.

[0015] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] In the application of automatic focusing in laser-based mechanical sights, the specific scenario involves a compact aiming device with an optical sight, a mechanical focusing / altering lens assembly, and a laser rangefinder unit aiming at a narrow target at close range. The specific object of processing is the actual target plane distance corresponding to the target pointed to by the reticle. Problems arise in the matching of distance data with the target to be focused and in the subsequent calculation of focusing parameters. When the laser rangefinder unit has a fixed lateral baseline offset from the sight's optical axis due to its structural arrangement, and the current target distance is so close that the lateral offset of the rangefinder spot on the target surface exceeds the effective width of the narrow target, existing methods typically use the laser-measured distance value directly input into the distance-focusing position mapping relationship to generate the drive position of the mechanical focusing / altering lens assembly. These existing methods rely on the default assumption that the laser... The ranging optical axis and the aiming line of sight must strictly correspond at the target. The measured distance must belong to the same target pointed to by the reticle. The difference between the actual conditions and this default assumption is that the actual landing point of the ranging beam has deviated from the target pointed to by the reticle and landed on a nearby object or background plane. As a result, the distance value obtained by the system no longer corresponds to the currently observed target plane. Under this condition, the existing method will incorrectly convert the distance of the nearby plane into the focusing position. The specific failure is that the mechanical focusing lens group is driven to the wrong focal plane. The image of the target pointed to by the reticle in the eyepiece remains out of focus. The correction also falls on the wrong distance plane. The direct technical consequence of the failure is that the correspondence between the target image plane and the reticle in the operator's field of view is distorted. When the eye position changes slightly, the reticle drifts observably relative to the target. The autofocus result cannot be stably reproduced.

[0018] The technical problem solved by this application is how to avoid the distance data being incorrectly matched to a neighboring plane, causing the mechanical sight to be automatically driven to the wrong focal plane when there is a fixed baseline offset between the laser rangefinder optical axis and the aiming line of sight, and the lateral size of the close target is insufficient to cover the range offset.

[0019] Most existing solutions focus on distance measurement accuracy, focusing mechanism response speed, mapping model calibration accuracy, and miniaturized integration of opto-mechanical-electronic systems. A relatively mature approach has been developed for incorporating ranging results into focusing control. When the target size is large, the observation distance is moderate, the ranging optical axis and the aiming line of sight are approximately coincident, or the target is sufficient to cover the range of the ranging spot offset, these methods can perform autofocus tasks well, thus having certain applicability in general scenarios.

[0020] However, as compact aiming devices extend to close-range, small-target, and high-precision applications, the default assumptions upon which existing research methods rely are beginning to reveal significant limitations. Due to limited internal space, the observation optical axis of the laser rangefinder and the optical sight often has a fixed lateral baseline offset. When the target is close, this fixed baseline creates a large lateral shift on the target plane, causing the actual landing point of the rangefinder spot to deviate from the position indicated by the reticle. If the target is a narrow target, its lateral dimensions are insufficient to cover this offset, and the distance measured by the laser is likely to come from a nearby object or background plane, rather than the actual target plane corresponding to the reticle. In this case, although the system obtains a numerically valid distance value, the correct correspondence between this distance and the target being focused on has been lost. If the existing method still directly substitutes this distance into the distance-focusing position mapping relationship, it will incorrectly convert the distance of the adjacent plane into the driving position of the mechanical focusing / altering lens group, which will lead to incorrect focal plane selection, target image retention out of focus, aberration correction falling on the wrong distance plane, and ultimately cause the correspondence between the reticle and the target in the operator's field of view to be distorted. Even slight changes in eye position will cause observable drift, and the autofocus results are difficult to reproduce stably.

[0021] According to one aspect of the embodiments of this application, such as Figure 1 As shown, this application provides an automatic focusing method for mechanical sights based on laser rangefinding, including:

[0022] S1, determine the target boundary angle based on the current aiming image frame, and determine the lateral offset of the spot center based on the laser ranging value; determine the coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value.

[0023] The coverage determination parameter set is determined based on the target boundary angle, the lateral offset of the spot center, and the calibrated spot radius. This includes: determining the coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, the calibrated spot radius, the distance-focusing position mapping relationship, the search step size, and the window size.

[0024] S2, convert the target boundary angle into the target lateral interval, determine the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value; determine the ranging confidence mark and search distance interval based on the spot coverage interval and the target lateral interval, so as to generate the ranging confidence constraint result;

[0025] S3, determine the candidate position pair sequence based on the ranging confidence constraint results. Each candidate position pair in the candidate position pair sequence includes a focusing position and a correction position.

[0026] S4, based on the candidate position pair sequence, drive the focusing lens group and the aberration lens group to simultaneously reach and stop at each candidate position pair, acquire image windows at each stopping position corresponding to each candidate position pair and calculate the sharpness evaluation value; determine the candidate position pair with the highest sharpness evaluation value as the mechanical focusing aberration benchmark position;

[0027] S5 drives the focusing lens group and the correction lens group into position according to the mechanical focusing and correction reference position, and locks the current position of the focusing lens group and the correction lens group after the position is confirmed.

[0028] Based on S1 to S5, focus adjustment and error correction are completed on the target plane indicated by the reticle.

[0029] Furthermore, the target boundary angle includes the left target boundary angle and the right target boundary angle; determining the target boundary angle based on the current aiming image frame includes:

[0030] Extract the horizontal grayscale sequence along the horizontal scan line where the horizontal pixel coordinates of the reticle center are located;

[0031] Using the horizontal pixel coordinates of the center of the dividing line as a reference, calculate the absolute value of the gray level difference between adjacent pixels point by point to the left, and locate the pixel coordinates of the target boundary on the left according to the boundary gray level change condition.

[0032] Using the horizontal pixel coordinates of the center of the dividing line as a reference, calculate the absolute value of the gray level difference between adjacent pixels point by point to the right, and locate the pixel coordinates of the target boundary on the right side according to the boundary gray level change condition.

[0033] Calculate the difference between the horizontal pixel coordinates of the reticle center and the horizontal pixel coordinates of the left target boundary to obtain the first pixel distance from the reticle center to the left target boundary;

[0034] Calculate the difference between the horizontal pixel coordinates of the right target boundary and the horizontal pixel coordinates of the reticle center to obtain the second pixel distance from the reticle center to the right target boundary;

[0035] Based on the image's horizontal pixel angle calibration coefficient, the distance of the first pixel is converted into the angle of the left target boundary, and the distance of the second pixel is converted into the angle of the right target boundary.

[0036] The image horizontal pixel angle calibration coefficient refers to the proportional coefficient obtained by calibrating the imaging system of an optical sight, used to convert the horizontal pixel distance in the image plane into the corresponding field of view angle.

[0037] Locating the pixel coordinates of the left or right target boundary based on the boundary grayscale abrupt change condition includes:

[0038] When the absolute value of the gray-level difference between adjacent pixels at the current horizontal index position and several subsequent consecutive horizontal index positions is not less than the boundary gray-level change threshold, the current horizontal index position is identified as the target boundary pixel coordinate.

[0039] When searching to the left until the starting index of the horizontal grayscale sequence still does not find a position that meets the boundary grayscale change condition, the starting index of the horizontal grayscale sequence is used as the left target boundary pixel coordinate; when searching to the right until the ending index of the horizontal grayscale sequence still does not find a position that meets the boundary grayscale change condition, the ending index of the horizontal grayscale sequence is used as the right target boundary pixel coordinate.

[0040] The lateral offset of the laser spot center is determined based on the laser ranging value, including:

[0041] Using the laser ranging value as the query input, locate the lower neighbor node and the upper neighbor node in the signed distance-ranged spot lateral offset calibration table. The signed distance-ranged spot lateral offset calibration table contains multiple nodes arranged in ascending order of distance value. Each node contains at least the node distance value and the corresponding node spot center lateral offset.

[0042] Read the lateral offset of the spot center from the lower neighbor node and the lateral offset of the spot center from the upper neighbor node;

[0043] Linear interpolation is performed based on the laser ranging value relative to the position ratios of the distance to the lower neighbor node and the distance to the upper neighbor node, respectively, to obtain the lateral offset of the laser spot center corresponding to the laser ranging value.

[0044] When the laser ranging value is less than the minimum node distance value in the signed distance-range spot lateral offset calibration table, the lateral offset of the spot center corresponding to the minimum node is taken as the lateral offset of the spot center corresponding to the laser ranging value; when the laser ranging value is greater than the maximum node distance value in the signed distance-range spot lateral offset calibration table, the lateral offset of the spot center corresponding to the maximum node is taken as the lateral offset of the spot center corresponding to the laser ranging value.

[0045] The coverage determination parameter set includes: left target boundary angle, right target boundary angle, lateral offset of the spot center corresponding to the laser ranging value, spot radius calibration value, distance-mechanical focusing position-difference elimination position mapping table, focusing search step size configuration value, and sharpness window size configuration value.

[0046] In this application, the target boundary angle includes the left target boundary angle and the right target boundary angle. In one specific embodiment, the process of determining the target boundary angle based on the current aiming image frame specifically includes:

[0047] First, extract the horizontal grayscale sequence along the horizontal scan line containing the horizontal pixel coordinates of the reticle center. Specifically, read the current aiming image frame and the reticle center pixel coordinates, locate the horizontal scan line based on the vertical coordinates in the reticle center pixel coordinates, and extract all pixel grayscale values ​​of this horizontal scan line to form a horizontal grayscale sequence. Under a set of feasible specific working conditions, the current aiming image frame can be an 8-bit grayscale image with a resolution of 1280×1024, with grayscale values ​​ranging from 0 to 255, and the reticle center pixel coordinates can be (640, 512) in the image coordinate system. When the center vertical coordinate is 512, extract all pixel grayscale values ​​of the 512th row from the current aiming image frame to form a one-dimensional horizontal grayscale sequence of length 1280.

[0048] After the horizontal grayscale sequence is formed, a central reference position is established based on the horizontal pixel coordinates of the dividing line center. To ensure that the left and right search processes are performed under the same data reference, the effective range of the central horizontal coordinates is first checked: when the central horizontal coordinate is less than the starting index of the horizontal grayscale sequence, the central horizontal coordinate is corrected to the starting index of the horizontal grayscale sequence; when the central horizontal coordinate is greater than the ending index of the horizontal grayscale sequence, the central horizontal coordinate is corrected to the ending index of the horizontal grayscale sequence; when the central horizontal coordinate is within the effective index range, the central horizontal coordinate is directly written as the central reference position into the boundary search control unit. Under a set of feasible specific operating conditions, the starting index of the horizontal grayscale sequence can be 0, the ending index can be 1279, and when the central horizontal coordinate is 640, the central reference position remains at 640.

[0049] Then, using the horizontal pixel coordinates of the center of the reticle as a reference, the absolute value of the gray-level difference between adjacent pixels is calculated point by point to the left. The left target boundary pixel coordinates are located based on the boundary gray-level abrupt change condition. Similarly, using the horizontal pixel coordinates of the center of the reticle as a reference, the absolute value of the gray-level difference between adjacent pixels is calculated point by point to the right. The right target boundary pixel coordinates are located based on the boundary gray-level abrupt change condition. During the leftward search, starting from the pixel adjacent to the left of the center reference position, the gray-level values ​​of two adjacent pixels are read point by point in a decreasing horizontal index direction. The absolute value of the gray-level difference between adjacent pixels is calculated, forming a leftward gray-level difference absolute value sequence. The calculation formula is:

[0050] ;

[0051] in, Indicates horizontal index Search for the absolute value of the gray-level difference between the corresponding adjacent pixels in the left direction. Indicates the horizontal grayscale sequence at the horizontal index. The pixel grayscale value at that location, This indicates the current horizontal pixel index during the leftward search process.

[0052] During the rightward search, starting from the pixel adjacent to the right of the central reference position, the gray values ​​of adjacent pixels are read point by point in the direction of increasing horizontal index. The absolute value of the gray value difference between adjacent pixels is calculated to form a rightward gray value difference sequence. The calculation formula is as follows:

[0053] ;

[0054] in, Indicates horizontal index Search for the absolute value of the gray-level difference between the corresponding adjacent pixels to the right. Indicates the horizontal grayscale sequence at the horizontal index. The pixel grayscale value at that location, This indicates the current horizontal pixel index during the rightward search process.

[0055] More specifically, the left or right target boundary pixel coordinates are located based on the boundary gray-level abrupt change condition. This includes: when the absolute value of the gray-level difference between adjacent pixels at the current horizontal index position and several subsequent consecutive horizontal index positions is not less than the boundary gray-level abrupt change threshold, the current horizontal index position is identified as the target boundary pixel coordinate. The consecutive successive ...

[0056] Furthermore, if no position satisfying the boundary gray-level abrupt change condition is found when searching to the left up to the starting index of the horizontal gray-level sequence, the starting index of the horizontal gray-level sequence is used as the left target boundary pixel coordinate; if no position satisfying the boundary gray-level abrupt change condition is found when searching to the right up to the ending index of the horizontal gray-level sequence, the ending index of the horizontal gray-level sequence is used as the right target boundary pixel coordinate. This ensures that the output always has a definite boundary.

[0057] Next, the difference between the horizontal pixel coordinates of the reticle center and the horizontal pixel coordinates of the left target boundary is calculated to obtain the first pixel distance from the reticle center to the left target boundary; the difference between the horizontal pixel coordinates of the right target boundary and the horizontal pixel coordinates of the reticle center is calculated to obtain the second pixel distance from the reticle center to the right target boundary. The calculation formula is:

[0058] ;

[0059] in, This represents the pixel distance (second pixel distance) from the center of the reticle to the left boundary of the target. This represents the pixel distance (also known as the second pixel distance) from the center of the reticle to the right boundary of the target. Indicates the horizontal coordinate of the center. Indicates the pixel coordinates of the left target boundary. This represents the pixel coordinates of the target boundary on the right.

[0060] Finally, according to the image's horizontal pixel angle calibration coefficient, the first pixel distance is converted into the left target boundary angle, and the second pixel distance is converted into the right target boundary angle. Based on the rule that the left direction is negative and the right direction is positive, the left target boundary pixel distance is multiplied by the image's horizontal pixel angle calibration coefficient and written with a negative sign to obtain the left target boundary angle, and the right target boundary pixel distance is multiplied by the image's horizontal pixel angle calibration coefficient and written with a positive sign to obtain the right target boundary angle.

[0061] The process of determining the lateral offset of the laser spot center based on the distance measured by laser includes the following:

[0062] Using the laser-measured distance value as the query input, the lower and upper neighboring nodes are located in the signed distance-range spot lateral offset calibration table. The signed distance-range spot lateral offset calibration table contains multiple nodes arranged in ascending order of distance values. Each node contains at least the node distance value and the corresponding lateral offset of the node spot center. Before looking up the table, the relevant data undergoes validity verification and dimensional standardization.

[0063] In practice, first confirm that the angle fields of the left and right target boundaries are not empty, and then confirm that the laser-measured distance value is greater than zero. Next, iterate through the distance values ​​of each node in the signed distance-range spot lateral offset calibration table, ensuring that the distance value of the next node is greater than the distance value of the previous node to maintain the uniqueness and interpolation capability of the subsequent table lookup process. Simultaneously, check that the lateral offset field of the spot center corresponding to each node has a valid value. When the angle is stored in milliradians, the original value of the angle field is written into the range coverage determination parameter set, but during internal query processing, it is allowed to call the unified unit marker to record the angle unit to avoid unit confusion between different data sources. When the lateral offset of the spot center and the range spot radius calibration value are stored in millimeters while the system stipulates that the lateral length is stored in meters, the corresponding fields are first uniformly converted to meters before participating in subsequent processing, thereby ensuring that the laser-measured distance value corresponds to the lateral offset of the spot center and the range spot radius calibration value in terms of data caliber.

[0064] Then, the lateral offset of the spot center corresponding to the lower neighbor node and the upper neighbor node are read. Next, linear interpolation is performed based on the ratio of the laser-measured distance value to the positions of the lower and upper neighbor nodes, respectively, to obtain the lateral offset of the spot center corresponding to the laser-measured distance value. The calculation formula is:

[0065] ;

[0066] in, This indicates the lateral offset of the laser spot center corresponding to the distance value measured by the laser. This represents the lateral offset from the center of the corresponding spot of the next lower node. This represents the lateral offset from the center of the corresponding spot of the neighboring node. This indicates the distance value measured by laser. This represents the distance value from the next lower neighbor node. This represents the distance from the previous neighbor node.

[0067] Under a set of feasible working conditions, the signed distance-range measurement spot lateral offset calibration table can store the lateral offsets of the spot center at six nodes: -0.060m, -0.030m, 0.000m, 0.025m, 0.055m, and 0.090m, respectively, at 30m, 50m, 80m, 100m, 120m, and 140m. The calibration value for the range measurement spot radius can be taken as 0.015m. When the laser-measured distance value is 86m, the distance to the lower neighbor node is 80m and the distance to the upper neighbor node is 100m. After linear conversion, the lateral offset of the spot center corresponding to the laser-measured distance value is approximately 0.0075m.

[0068] Simultaneously, when the laser-measured distance value is less than the minimum node distance value in the signed distance-range measurement spot lateral offset calibration table, the lateral offset of the spot center corresponding to the minimum node is used as the lateral offset of the spot center corresponding to the laser-measured distance value; when the laser-measured distance value is greater than the maximum node distance value in the signed distance-range measurement spot lateral offset calibration table, the lateral offset of the spot center corresponding to the maximum node is used as the lateral offset of the spot center corresponding to the laser-measured distance value. This ensures that a unique offset output result is obtained for any laser-measured distance value input.

[0069] Thus, the generated range coverage determination parameter set includes: left target boundary angle, right target boundary angle, lateral offset of the spot center corresponding to the laser-measured distance value, spot radius calibration value, distance-mechanical focusing position-error correction position mapping table, focusing search step size configuration value, and sharpness window size configuration value. Under a set of feasible specific working conditions, the focusing search step size configuration value can be 0.20mm, and the sharpness window size configuration value can be a window width of 81 pixels and a window height of 81 pixels.

[0070] Furthermore, based on the area covered by the light spot and the horizontal area of ​​the target, reliable ranging markers are determined, including:

[0071] Compare the size relationship between the left edge lateral position of the light spot coverage area and the left edge lateral position of the target lateral area, and compare the size relationship between the right edge lateral position of the light spot coverage area and the right edge lateral position of the target lateral area.

[0072] If the lateral position of the left edge of the light spot coverage area is not less than the lateral position of the left edge of the target lateral area, and the lateral position of the right edge of the light spot coverage area is not greater than the lateral position of the right edge of the target lateral area, then the ranging confidence mark is determined to be reliable.

[0073] If the left edge of the light spot coverage area is smaller than the left edge of the target horizontal area, or the right edge of the light spot coverage area is larger than the right edge of the target horizontal area, then the ranging confidence marker will be determined as unreliable.

[0074] Furthermore, when the ranging confidence marker is deemed unreliable, the search distance interval is determined, including:

[0075] Traverse each node of the signed distance-range measurement spot lateral offset calibration table;

[0076] At each node, the lateral position of the left edge and the lateral position of the right edge of the node spot are calculated based on the spot radius calibration value and the lateral offset of the center of the node spot corresponding to that node.

[0077] At each node, the lateral position of the target boundary on the left and the lateral position of the target boundary on the right are calculated based on the distance value corresponding to the node and the target boundary angle (left target boundary angle and right target boundary angle).

[0078] Calculate the difference between the lateral position of the left edge of the node spot corresponding to each node and the lateral position of the target boundary on the right side of the node to obtain the right boundary constraint difference sequence;

[0079] Calculate the difference between the lateral position of the right edge of the node spot corresponding to each node and the lateral position of the target boundary on the left side of the node to obtain the left boundary constraint difference sequence;

[0080] In the left boundary constraint difference sequence, locate two adjacent nodes whose difference sign changes from positive to negative or from negative to positive, and perform linear interpolation based on the distance value corresponding to each of the two adjacent nodes and the left boundary constraint difference to obtain the lower limit of the search distance interval;

[0081] In the right boundary constraint difference sequence, locate two adjacent nodes whose difference sign changes from positive to negative or from negative to positive, and perform linear interpolation based on the distance value corresponding to each of the two adjacent nodes and the right boundary constraint difference to obtain the upper limit of the search distance interval.

[0082] When the ranging confidence marker is marked as reliable, the search distance interval is determined, including:

[0083] The laser ranging value is used as both the lower and upper limits of the search distance range.

[0084] Furthermore, the ranging confidence constraint results are generated, including:

[0085] The ranging confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval are combined to form the ranging confidence constraint result.

[0086] When converting target boundary angles into target lateral intervals, the left and right target boundary angles and the laser-measured distance are first read. To ensure that subsequent conversion results are in the same dimension, when angles are stored in milliradians, the angle unit is first standardized by converting milliradian values ​​to radians by one-thousandth before participating in geometric conversion. When lateral position values ​​are stored in millimeters while laser-measured distance values ​​are stored in meters, the lateral offset of the spot center and the calibration value of the ranging spot radius are first converted to meters simultaneously before participating in interval construction.

[0087] Using the line of sight at the center of the reticle as the origin of the target plane's lateral coordinates, a lateral coordinate system for the target plane is established with the rightward direction corresponding to the positive direction of the target plane and the leftward direction corresponding to the negative direction of the target plane. The angles of the left and right target boundaries, along with the laser-measured distance values, are input into the position conversion module. Under the condition that the depth of the target plane equals the laser-measured distance value, the lateral positions of the left and right target boundaries on the target plane are calculated respectively. The calculation formula is:

[0088] ;

[0089] in, Indicates the lateral position of the target boundary on the left. Indicates the lateral position of the target boundary on the right. This indicates the distance value measured by laser. Indicates the angle of the target boundary on the left. This indicates the angle of the right target boundary. The current target's lateral range is defined by the lateral positions of the left and right target boundaries.

[0090] Under a set of feasible specific operating conditions, the angle of the left target boundary is taken as -0.42 mrad, the angle of the right target boundary is taken as +0.37 mrad, and the laser-measured distance is taken as 450 m. After standardizing the angle units, the lateral position of the left target boundary is approximately -0.189 m, and the lateral position of the right target boundary is approximately 0.167 m. These two position values ​​are written into the current target lateral interval register unit in the order of left and right endpoints.

[0091] Simultaneously, the coverage area of ​​the light spot is determined based on the lateral offset of the light spot center and the calibrated value of the light spot radius. The lateral position of the current ranging light spot's left edge and right edge are calculated by superimposing and subtracting the calibrated value of the ranging light spot radius around the lateral offset of the light spot center. The calculation formula is:

[0092] ;

[0093] in, This indicates the horizontal position of the left edge of the current ranging spot. This indicates the horizontal position of the right edge of the current ranging spot. This indicates the lateral offset of the laser spot center corresponding to the distance value measured by the laser. This indicates the calibration value of the ranging spot radius.

[0094] The horizontal coverage area of ​​the current ranging spot is defined by the horizontal positions of its left and right edges. The horizontal position of the left edge of the current ranging spot is written to the left endpoint of the horizontal coverage area, and the horizontal position of its right edge is written to the right endpoint.

[0095] Under a set of feasible specific working conditions, the lateral offset of the laser spot center corresponding to the laser-measured distance value is taken as 0.028m, and the calibrated value of the ranging spot radius is taken as 0.015m. Thus, the lateral position of the left edge of the current ranging spot is 0.013m, and the lateral position of the right edge of the current ranging spot is 0.043m.

[0096] Based on the area covered by the light spot and the horizontal range of the target, a reliable ranging marker is determined. Specifically, this involves comparing the horizontal position of the left edge of the light spot's coverage area with that of the target's horizontal range, and comparing the horizontal position of the right edge of the light spot's coverage area with that of the target's horizontal range. If the horizontal position of the left edge of the light spot's coverage area is not less than that of the left edge of the target's horizontal range, and the horizontal position of the right edge of the light spot's coverage area is not greater than that of the target's horizontal range, then the reliable ranging marker is determined to be reliable (e.g., marked as 1). If the horizontal position of the left edge of the light spot's coverage area is less than that of the left edge of the target's horizontal range, or the horizontal position of the right edge of the light spot's coverage area is greater than that of the target's horizontal range, then the reliable ranging marker is determined to be unreliable (e.g., marked as 0).

[0097] When the reliable distance measurement marker is marked as unreliable, the search distance range is determined, specifically including:

[0098] First, iterate through each node in the signed distance-range measurement spot lateral offset calibration table. At each node, calculate the lateral position of the left and right edges of the node spot based on the spot radius calibration value and the lateral offset of the corresponding node spot center. The formula for calculating the left and right edge positions of the node spot is:

[0099] ;

[0100] in, Indicates the first The horizontal position of the left edge of the node spot corresponding to each distance node. Indicates the first The horizontal position of the right edge of the node spot corresponding to each distance node. Indicates the first Lateral offset of the center of the spot corresponding to each distance node This indicates the calibration value of the ranging spot radius.

[0101] Simultaneously, at each node, based on the distance value corresponding to that node and the target boundary angle, the lateral positions of the target boundary to the left and right of the node are calculated. The formula for calculating the left and right boundary positions of the target at each node is:

[0102] ;

[0103] in, Indicates the first The horizontal position of the target boundary to the right of the node corresponding to the distance node. Indicates the first The horizontal position of the target boundary to the left of the node corresponding to the distance node. Indicates the first The node distance value of each node. Indicates the angle of the target boundary on the right. This indicates the angle of the target boundary on the left.

[0104] Then, the difference between the lateral position of the left edge of the node spot corresponding to each node and the lateral position of the target boundary on the right side of the node is calculated to obtain the right boundary constraint difference sequence. The difference between the lateral position of the right edge of the node spot corresponding to each node and the lateral position of the target boundary on the left side of the node is calculated to obtain the left boundary constraint difference sequence. The formula for calculating the constraint difference is:

[0105] ;

[0106] in, Indicates the first The difference in right boundary constraints corresponding to each distance node. Indicates the first The difference in left boundary constraints corresponding to each distance node. Indicates the first The horizontal position of the left edge of the node spot corresponding to each distance node. Indicates the first The horizontal position of the target boundary to the right of the node corresponding to the distance node. Indicates the first The horizontal position of the right edge of the node spot corresponding to each distance node. Indicates the first The distance node corresponds to the left side of the target boundary horizontal position.

[0107] Next, in the left boundary constraint difference sequence, the two adjacent nodes whose difference sign changes from positive to negative or from negative to positive are located. Linear interpolation is then performed based on the distance values ​​of these two adjacent nodes and the left boundary constraint difference to obtain the lower limit of the search distance interval. Similarly, in the right boundary constraint difference sequence, the two adjacent nodes whose difference sign changes from positive to negative or from negative to positive are located. Linear interpolation is then performed based on the distance values ​​of these two adjacent nodes and the right boundary constraint difference to obtain the upper limit of the search distance interval.

[0108] Under a set of feasible specific operating conditions, the ranging confidence marker is set to zero, the left target boundary angle is set to -0.42 mrad, the right target boundary angle is set to +0.37 mrad, the ranging spot radius calibration value is set to 0.015 m, and the lateral offset calibration table of the signed distance ranging spot is used to set the lateral offset of the spot center at the six distance nodes of 30 m, 50 m, 80 m, 100 m, 120 m, and 140 m to -0.060 m, -0.030 m, 0.000 m, 0.025 m, 0.055 m, and 0.090 m, respectively. After node-by-node calculation, the left boundary constraint difference is reversed in sign between the 30 m and 50 m nodes, and the right boundary constraint difference is reversed in sign between the 120 m and 140 m nodes. Based on this, linear interpolation is performed, and the lower limit of the search distance is approximately 46.875 m, and the upper limit of the search distance is approximately 123.188 m.

[0109] After obtaining the lower and upper limits of the search distance, an order consistency check is performed on the two limit values: the numerical values ​​of the two are compared, the smaller value is written into the lower limit field of the search distance, and the larger value is written into the upper limit field of the search distance, thus forming a closed-loop consistent interval output result.

[0110] When the distance measurement confidence mark is considered reliable, the search distance interval is determined, including: using the distance value measured by the laser as both the lower and upper limit of the search distance interval, thus forming a single-value search distance interval.

[0111] Finally, the ranging confidence constraint result is generated, which includes combining the ranging confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval into the ranging confidence constraint result.

[0112] Furthermore, candidate location pair sequences are determined based on the ranging confidence constraint results, including:

[0113] Obtain the ranging confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval from the ranging confidence constraint results;

[0114] When the ranging confidence mark is confidence, the lower limit of the search distance interval is converted into the corresponding mechanical focusing position value and the error elimination position value through the distance-mechanical focusing position-error elimination position mapping table, and the mechanical focusing position value and the error elimination position value are combined into a single candidate position pair;

[0115] When the reliable distance measurement is marked as unreliable, the lower limit of the search distance range is converted into the corresponding mechanical focusing start position value and the error elimination start position value through the distance-mechanical focusing position-error elimination position mapping table; the upper limit of the search distance range is converted into the corresponding mechanical focusing end position value and the error elimination end position value through the distance-mechanical focusing position-error elimination position mapping table.

[0116] The number of discrete sampling points is determined based on the position span between the mechanical focusing start position value and the mechanical focusing end position value and the focusing search step size configuration value. The discrete mechanical focusing position value is generated point by point along the direction of mechanical focusing position change.

[0117] Based on the distance-mechanical focusing position-error elimination position mapping table, look up the error elimination discrete position value corresponding to each mechanical focusing discrete position value;

[0118] According to the generation order of the mechanical focusing discrete position values, each mechanical focusing discrete position value and the corresponding difference elimination discrete position value are combined into candidate position pairs in turn.

[0119] In one specific implementation, the ranging confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval are first obtained from the ranging confidence constraint results.

[0120] When the ranging confidence mark is confidence, the lower limit of the search distance interval is converted into the corresponding mechanical focusing position value and the difference elimination position value through the distance-mechanical focusing position-difference elimination position mapping table, and the mechanical focusing position value and the difference elimination position value are combined into a single candidate position pair and encapsulated into a candidate position pair sequence of length one.

[0121] When the reliable distance measurement marker is marked as unreliable, the lower limit of the search distance interval is converted into the corresponding mechanical focusing start position value and the error correction start position value using the distance-mechanical focusing position-error correction position mapping table; the upper limit of the search distance interval is converted into the corresponding mechanical focusing end position value and the error correction end position value using the same table. Then, based on the position span between the mechanical focusing start position value and the mechanical focusing end position value and the focusing search step size configuration value, the number of discrete sampling points is determined, and discrete mechanical focusing position values ​​are generated point by point along the direction of mechanical focusing position change. Next, the error correction discrete position value corresponding to each discrete mechanical focusing position value is looked up using the distance-mechanical focusing position-error correction position mapping table. Finally, according to the generation order of the discrete mechanical focusing position values, each discrete mechanical focusing position value and its corresponding error correction discrete position value are combined sequentially into candidate position pairs.

[0122] Specifically, before performing the position conversion, a consistency check is performed on the lower and upper limits of the search distance; if the lower limit is greater than the upper limit, their writing order is swapped. The formula for calculating the number of discrete sampling points is:

[0123] ;

[0124] in, This indicates the number of discrete sampling points for mechanical focusing. This represents the starting position value of the candidate position range for mechanical focusing. This indicates the ending position value of the candidate position range for mechanical focusing. This indicates the focus search step size configuration value.

[0125] The formula for generating the discrete position value of mechanical focusing is:

[0126] ;

[0127] in, Indicates the first Each discrete position value for mechanical focusing. This represents the starting position value of the candidate position range for mechanical focusing. This indicates the ending position value of the candidate position range for mechanical focusing. Represents a symbolic function. This indicates the focus search step size configuration value. Indicates the discrete position number.

[0128] Under a set of feasible working conditions, the lower limit of the search distance is set to 46.875m, and the upper limit of the search distance is set to 123.188m. The distance-mechanical-focusing position-error-elimination position mapping table assigns mechanical focusing position values ​​of 1.20mm, 1.68mm, 2.14mm, 2.58mm, 2.99mm, and 3.37mm respectively to the six distance nodes of 40m, 60m, 80m, 100m, 120m, and 140m, and corresponding error-elimination position values ​​of 0.35mm, 0.51mm, 0.66mm, 0.80mm, 0.93mm, and 1.05mm respectively. After linear conversion, the candidate mechanical focusing position range is [1.365mm, 3.051mm], and the candidate error-elimination position range is [0.405mm, 0.949mm]. The focus search step size is set to 0.20mm, and the number of discrete sampling points for mechanical focusing is calculated to be ten, thus obtaining a candidate position pair sequence of length ten.

[0129] Furthermore, based on the candidate position pair sequence, the focusing lens group and the aberration lens group are driven to simultaneously reach and stop at each candidate position pair. Image windows are acquired at each stopping position corresponding to each candidate position pair, and a sharpness evaluation value is calculated, including:

[0130] While staying at each candidate position pair, acquire the aiming image frame at the staying position corresponding to the current candidate position pair;

[0131] The target image window is cropped from the target image frame based on the resolution window size configuration value, with the center pixel coordinates of the reticle as the center.

[0132] Calculate the absolute values ​​of the horizontal and vertical gray-level differences at each pixel position within the target image window;

[0133] The absolute values ​​of the horizontal and vertical gray-level differences of all pixel positions within the target image window are summed to obtain the sum of the absolute values ​​of the gray-level gradients corresponding to the current candidate position. The sum of the absolute values ​​of the gray-level gradients is used as the sharpness evaluation value.

[0134] In one specific implementation, based on the candidate position pair sequence, the focusing lens group and the aberration lens group are driven to simultaneously reach and remain at each candidate position pair. Specifically, for each candidate position pair in the candidate position pair sequence, the mechanical focusing position drive amount in the candidate position pair is output to the mechanical focusing lens group actuator, and the aberration position drive amount in the candidate position pair is output to the aberration lens group actuator. After the drive output, the position encoder counts of the mechanical focusing lens group and the aberration lens group are continuously read and compared with the position values ​​corresponding to the current candidate position pair. When the encoder counts do not change and remain consistent with the position values ​​corresponding to the current candidate position pair for multiple consecutive control cycles, the dual-lens group is considered to have entered a stationary state, and stationary aiming image frame acquisition is triggered. Under a set of feasible specific operating conditions, the stationary state can be determined by the position encoder counts remaining unchanged for two consecutive control cycles.

[0135] Image windows are acquired at each dwell position corresponding to each candidate position pair, and sharpness evaluation values ​​are calculated. This includes cropping the target image window from the dwell aiming image frame, centered on the pixel coordinates of the reticle center, according to the sharpness window size configuration value. Specifically, the window width is expanded to the left and right by half a pixel, centered on the horizontal coordinate of the reticle center, and the window height is expanded upwards and downwards by half a pixel, centered on the vertical coordinate of the reticle center, to obtain the target image window from the current dwell aiming image frame. To ensure the comparability of sharpness evaluation results between different candidate position pairs, all candidate position pairs use the same window center and the same window size configuration value.

[0136] Calculate the absolute values ​​of the horizontal and vertical gray-level differences for each pixel position within the target image window. Specifically, read the gray-level values ​​of adjacent horizontal pixels along each row of the target image window, calculate the absolute value of the difference between the gray-level value of the right-hand adjacent pixel and the current pixel's gray-level value, forming the absolute value of the horizontal gray-level difference for the current pixel position; read the gray-level values ​​of adjacent vertical pixels along each column of the target image window, calculate the absolute value of the difference between the gray-level value of the lower-hand adjacent pixel and the current pixel's gray-level value, forming the absolute value of the vertical gray-level difference for the current pixel position. Summate the absolute values ​​of the horizontal and vertical gray-level differences for all pixel positions within the target image window to obtain the sum of the absolute values ​​of the gray-level gradients corresponding to the current candidate position. Use this sum of absolute values ​​of gray-level gradients as the sharpness evaluation value. The calculation formula is:

[0137] ;

[0138] in, Indicates the first The sum of the absolute values ​​of the grayscale gradients for each candidate position. Indicates the first The candidate positions are the coordinates within the target image window during the dwell time. The pixel grayscale value at that location, This represents the horizontal pixel coordinates within the target image window. Represents the vertical pixel coordinates within the target image window. Indicates the horizontal starting coordinates of the target image window. Indicates the horizontal termination coordinates of the target image window. Indicates the vertical starting coordinates of the target image window. This represents the vertical termination coordinate of the target image window. Represents the sequence index of the candidate position pair.

[0139] Under a set of feasible working conditions, the candidate position pair sequence length can be ten, the center pixel coordinates of the reticle can be (640, 512), and the sharpness window size can be configured as 81×81 pixels. After completing ten consecutive image acquisitions, window cropping, and evaluation value calculations, a sharpness evaluation record sequence of length ten is obtained.

[0140] Then, the candidate position pair with the largest sum of absolute gray-level gradient values ​​is determined as the mechanical focusing and error correction reference position for completing the target plane selection. Specifically, all sums of absolute gray-level gradient values ​​in the sharpness evaluation record sequence are read, and the magnitudes are compared item by item according to the sequence index. The target sequence index corresponding to the sum of absolute gray-level gradient values ​​is located, and the mechanical focusing position value and error correction position value in the candidate position pair corresponding to this index are extracted and combined to form the mechanical focusing and error correction reference position.

[0141] Furthermore, based on the mechanical focusing and aberration correction reference position, the focusing lens group and the aberration correction lens group are driven into position, including:

[0142] The mechanical focusing and correction reference position is decomposed into the first target pulse number of the focusing lens group and the second target pulse number of the correction lens group, and the focusing lens group and the correction lens group are driven to their positions synchronously according to the first target pulse number and the second target pulse number.

[0143] In one specific implementation, driving the focusing lens group and the aberration lens group into position according to the mechanical focusing aberration reference position includes: decomposing the mechanical focusing aberration reference position into a first target pulse number of the focusing lens group and a second target pulse number of the aberration lens group.

[0144] Specifically, the selected mechanical focusing and error correction reference position on the target plane is read, and the mechanical focusing position value and error correction position value are extracted from it. The mechanical focusing lens group position pulse conversion coefficient, error correction lens group position pulse conversion coefficient, mechanical focusing lens group zero-position pulse offset value, error correction lens group zero-position pulse offset value, mechanical focusing lens group motion direction mark, and error correction lens group motion direction mark are called. The mechanical focusing position value is converted to a proportional value from position quantity to pulse number and the direction is corrected to obtain the first target pulse number. The error correction position value is converted to a proportional value from position quantity to pulse number and the direction is corrected to obtain the second target pulse number. The calculation formula is:

[0145] ;

[0146] in, This indicates the number of target pulses in the mechanical focusing lens group (also known as the number of first target pulses). Indicates the direction of movement of the mechanical focusing lens group. Indicates the mechanical focusing position value. This represents the pulse conversion factor for the position of the mechanical focusing lens group. This indicates the zero-position pulse offset value of the mechanical focusing lens group.

[0147] ;

[0148] in, This indicates the number of target pulses in the aberration mirror group (also known as the number of second target pulses). Indicates the direction of movement of the aberration lens group. Indicates the position value for eliminating differences. This represents the position pulse conversion factor for the aberration mirror group. This indicates the zero-position pulse bias value of the aberration mirror group.

[0149] After completing the conversion of the two target pulses, the target pulse counts of the mechanical focusing lens group and the aberration lens group are processed using a unified data format to ensure that both results meet the pulse counting input requirements of the synchronous drive control interface. Specifically, the target pulse counts of the mechanical focusing lens group and the aberration lens group are integerized according to the data bit width specified by the controller. When the result of multiplying the position value by the pulse conversion coefficient contains a decimal part, the nearest integer pulse value is written according to a preset rounding rule, ensuring that the output target pulse count matches the minimum drive resolution of the actuator. Subsequently, the target pulse count of the mechanical focusing lens group is written to the mechanical focusing target field of the synchronous drive target register unit, and the target pulse count of the aberration lens group is written to the aberration target field of the synchronous drive target register unit. Both fields are written within the same control cycle, ensuring that the dual-channel control targets remain consistent in time.

[0150] Under a set of feasible working conditions, the mechanical focusing position value is taken as 2.365mm, the correction position value as 0.731mm, the position pulse conversion factor for the mechanical focusing lens group is taken as 800 pulses / mm, the position pulse conversion factor for the correction lens group is taken as 1000 pulses / mm, the zero-position pulse offset value for the mechanical focusing lens group is taken as 120 pulses, the zero-position pulse offset value for the correction lens group is taken as 35 pulses, the motion direction mark for the mechanical focusing lens group is taken as +1, and the motion direction mark for the correction lens group is taken as -1. After conversion, the first target pulse count is 2012 pulses, and the second target pulse count is -766 pulses.

[0151] Then, the focusing lens group and the correction lens group are synchronously driven into position according to the first target pulse count and the second target pulse count. Specifically, the first target pulse count and the second target pulse count are read from the synchronous drive target register unit, and the encoder counts of the current position of the focusing lens group and the correction lens group are acquired. The remaining displacement pulse count of each lens group is obtained based on the difference between the target pulse count and the current position encoder count. The calculation formula is:

[0152] ;

[0153] in, This indicates the number of remaining displacement pulses for the mechanical focusing lens group. This indicates the number of remaining displacement pulses in the aberration mirror group. This indicates the number of target pulses in the mechanical focusing lens group (also known as the number of first target pulses). This indicates the number of target pulses in the aberration mirror group (also known as the number of second target pulses). The encoder count indicates the current position of the mechanical focusing lens assembly. This indicates the encoder count at the current position of the differential correction lens assembly.

[0154] Under a set of feasible specific operating conditions, the target pulse number of the mechanical focusing lens group is 2012 pulses, and the current position encoder count of the mechanical focusing lens group is 1530 pulses, resulting in a remaining displacement pulse number of 482 pulses for the mechanical focusing lens group; the target pulse number of the aberration lens group is -766 pulses, and the current position encoder count of the aberration lens group is -420 pulses, resulting in a remaining displacement pulse number of -346 pulses for the aberration lens group.

[0155] The remaining displacement pulse count is decomposed into a drive pulse sequence according to a unified control cycle and synchronously sent to the actuators of the two mirror groups. Specifically, based on the output capability constraints under the unified control cycle, pulse decomposition is performed on the remaining displacement pulse count to ensure that the pulse quantity output in a single control cycle does not exceed the upper limit of the allowed periodic pulses for the corresponding actuator, while maintaining the pulse sign direction consistent with the remaining displacement direction. When the absolute value of the remaining displacement pulse count is greater than the upper limit of the periodic pulses, the upper limit of the periodic pulses is taken as the absolute value of the output pulse quantity for the current cycle; when the absolute value of the remaining displacement pulse count is not greater than the upper limit of the periodic pulses, the remaining displacement pulse count is directly taken as the output pulse quantity for the current cycle, to ensure that the last control cycle can accurately converge to the target pulse count. The calculation formula is:

[0156] ;

[0157] in, This indicates the number of drive pulses for the mechanical focusing lens group in the current control cycle. This indicates the number of drive pulses for the differential correction mirror group in the current control cycle. This indicates the number of remaining displacement pulses for the mechanical focusing lens group. This indicates the number of remaining displacement pulses in the aberration mirror group. This indicates the maximum number of drive pulses per cycle for the mechanical focusing lens group. This indicates the maximum number of drive pulses per cycle for the aberration mirror group. Represents a symbolic function.

[0158] Under a set of feasible operating conditions, the maximum number of drive pulses per cycle for the mechanical focusing lens group can be 120 pulses, and the maximum number of drive pulses per cycle for the aberration correction lens group can be 100 pulses. Under the aforementioned remaining displacement conditions, the number of drive pulses in the current control cycle of the mechanical focusing lens group can be decomposed into +120 pulses, and the number of drive pulses in the current control cycle of the aberration correction lens group can be decomposed into -100 pulses.

[0159] At the end of each control cycle, the current position encoder count is read back and the remaining displacement pulse count is refreshed. This cycle continues until the current position encoder counts of both lens groups are equal to the corresponding target pulse counts. To prevent end-point overshoot, when the absolute value of the remaining displacement pulse count in any channel is less than the upper limit of the corresponding cycle pulse, this remaining displacement pulse count is directly used as the drive pulse count for the current cycle for one-time compensation, ensuring that the channel accurately reaches the target value at the end of the cycle. Under a set of feasible operating conditions, when the remaining displacement pulse count of the mechanical focusing lens group converges to +52 pulses, +52 pulses can be directly output in the current control cycle; when the remaining displacement pulse count of the differential correction lens group converges to -31 pulses, -31 pulses can be directly output in the current control cycle.

[0160] Finally, after confirmation of positioning, the current positions of the focusing lens group and the aberration correction lens group are locked. Specifically, the encoder counts and target pulse counts of the current positions of the two lens groups are read, and consistency comparisons are performed separately. When the consistency comparison results of both channels are simultaneously true, the positioning stability holding count is started. After the positioning stability holding count reaches a preset confirmation threshold, a mechanical focusing and aberration correction positioning state indicating that the target plane alignment is complete is generated. The update formula for the positioning stability holding count is:

[0161] ;

[0162] in, This indicates that the current control cycle has stabilized and maintained a stable count. This indicates that the count of the arrival stability in the previous control cycle has been maintained. Indicates a consistency mark for mechanical focusing lens groups. This indicates a consistency marker for the aberration mirror group.

[0163] Then, the positioning status is associated with the mechanical focusing correction reference position and written into the autofocus result register. Based on the positioning status in the autofocus result register, the corresponding positions of the current target plane of the two lens groups are locked, so that the target plane pointed to by the center pixel coordinate of the reticle maintains the focusing completed state and the correction completed state, and prevents the distance value of the adjacent plane from entering the erroneous focal plane. Under a set of feasible specific operating conditions, the control cycle can be 2ms, and the positioning confirmation threshold can be 5. When the consistency mark of the two lens groups is simultaneously established within five consecutive control cycles, the positioning status is generated, and the mechanical focusing position value of 2.365mm and the correction position value of 0.731mm are locked as the current position holding reference.

[0164] Furthermore, after S1 and before S2, the method also includes:

[0165] Acquire N consecutive frames of laser ranging values, construct a ranging value sequence according to the acquisition time, and assign a frame number to each frame, where N is a preset positive integer;

[0166] Using the ranging values ​​within a sliding window preceding the current frame number in the ranging value sequence as samples, calculate the median of the ranging values ​​within that sliding window, and use this median as the current background distance estimate;

[0167] Maintain positive and negative cumulative statistics;

[0168] Extract the gray values ​​of all pixels on the horizontal line where the horizontal pixel coordinates of the center of the reticle are located from the current target image frame. Calculate the absolute value of the gray value difference between adjacent pixels point by point on the horizontal line. Record the maximum value in the sequence of absolute gray value differences and use the maximum value as the gray value gradient magnitude of the target boundary in the current frame.

[0169] The dynamic detection threshold is determined based on the gray-scale gradient magnitude of the target boundary.

[0170] The positive cumulative statistics are compared with the dynamic detection threshold. If the positive cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the first transition direction.

[0171] The negative cumulative statistics are compared with the dynamic detection threshold. If the negative cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the second transition direction.

[0172] The total number of edge transitions detected within a preset historical time window prior to the current moment is counted, and the current edge transition trigger frequency is determined based on this total number.

[0173] Based on the comparison between the current edge trigger frequency and the preset frequency threshold, the search range parameters for performing the left and right gray-scale transition boundary search are determined: when the edge trigger frequency is greater than or equal to the preset frequency threshold, the first search range is used; when the edge trigger frequency is less than the preset frequency threshold, the second search range is used, wherein the second search range is greater than the first search range.

[0174] The detected transition edge time, transition edge direction, and corresponding laser ranging value are output as transition edge feature information to S2.

[0175] Furthermore, after S1 and before S2, there are also transition edge detection and intermodulation steps:

[0176] Acquire N consecutive frames of laser ranging values, construct a ranging value sequence according to the acquisition time, and assign a frame number to each frame, where N is a preset positive integer;

[0177] Using the ranging values ​​within a sliding window preceding the current frame number in the ranging value sequence as samples, calculate the median of the ranging values ​​within that sliding window, and use this median as the current background distance estimate;

[0178] Maintain positive and negative cumulative statistics;

[0179] The current frame update method for positive cumulative statistics is as follows: take the larger of the difference between the current frame ranging value, the background distance estimate, and the preset fluctuation tolerance, and zero, and add the positive cumulative statistics of the previous frame.

[0180] The current frame update method for negative cumulative statistics is as follows: take the larger of the difference between the background distance estimate, the current frame ranging value, and the preset fluctuation tolerance, and zero, and add the negative cumulative statistics of the previous frame.

[0181] Extract all pixel gray values ​​along the horizontal line where the center of the reticle is located from the current target image frame. Calculate the absolute value of the gray value difference between adjacent pixels for each gray value on the horizontal line. Record the maximum value in the sequence of absolute gray value differences and use this maximum value as the target boundary gray gradient magnitude of the current frame.

[0182] A dynamic detection threshold is determined based on the gray-scale gradient magnitude of the target boundary, such that the dynamic detection threshold monotonically decreases when the gray-scale gradient magnitude of the target boundary increases and monotonically increases when the gray-scale gradient magnitude of the target boundary decreases.

[0183] The positive cumulative statistics are compared with the dynamic detection threshold. If the positive cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the first transition direction. The negative cumulative statistics are compared with the dynamic detection threshold. If the negative cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the second transition direction.

[0184] The total number of edge transitions detected within a preset historical time window prior to the current moment is counted, and the current edge transition trigger frequency is determined based on this total number.

[0185] Based on the comparison between the current edge triggering frequency and the preset frequency threshold, the search range parameters for performing the left and right grayscale transition boundary search in S1 are determined: when the edge triggering frequency is greater than or equal to the preset frequency threshold, the first search range parameter is used; when the edge triggering frequency is less than the preset frequency threshold, the second search range parameter is used, wherein the second search range parameter is greater than the first search range parameter.

[0186] The detected transition edge time, transition edge direction, and corresponding laser ranging value are output as transition edge feature information to S2.

[0187] After boundary extraction, angle conversion, and range lookup are completed in S1, and before coverage determination in S2, this embodiment also performs edge detection and intermodulation to identify whether the laser range value has changed significantly, and dynamically adjusts the boundary search strategy in S1 according to the edge detection result, while providing edge feature information to S2 to assist in reliable determination.

[0188] In close-range, narrow-target scenarios, a fixed lateral baseline offset exists between the laser rangefinder's optical axis and the aiming line of sight. When the target is moving or the operator's sight is unstable, the rangefinder spot may oscillate back and forth between the narrow target and the adjacent plane, causing a step jump in the laser rangefinder value. Relying solely on a static comparison between the spot coverage area and the target's lateral area in S2 may lead to incorrect judgments because the rangefinder value happens to be in a transitional state. By introducing transition edge detection, the changing trend of the rangefinder value can be tracked over time, identifying the moment when the rangefinder spot enters the target from the background or leaves the background from the target, thus providing richer dynamic information for S2.

[0189] In practice, the controller continuously acquires the ranging values ​​output by the laser ranging unit, assigns a frame number to each frame according to the order of acquisition time, and stores the ranging values ​​of the most recently acquired preset number of frames in a circular buffer, forming a ranging value sequence. The preset number of frames should ensure that it covers at least one complete background stabilization period, so that when the target does not enter the field of view or the ranging spot does not cover the target, the ranging values ​​in the buffer can reflect the stable background distance.

[0190] For the current frame, the controller uses the frame number as a reference and backtracks by one sliding window, taking all ranging values ​​within that window as samples. The median of these samples is then calculated and used as the current background distance estimate. The median is used instead of the mean because in narrow target scenes, the ranging spot may occasionally glide across a nearby plane, producing brief anomalous ranging values. The median is insensitive to these outliers and provides a more robust estimate of the background distance.

[0191] After obtaining the background distance estimate, the controller maintains two cumulative statistics to detect the increasing and decreasing trends of the ranging value relative to the background, respectively. The positive cumulative statistics are updated as follows: the current frame ranging value is subtracted from the background distance estimate, and then a preset fluctuation tolerance is subtracted. If the difference is positive, it is added to the positive cumulative statistics of the previous frame; if the difference is negative or zero, the positive cumulative statistics are cleared. The negative cumulative statistics are updated in a similar manner: the background distance estimate is subtracted from the current frame ranging value, and then the same fluctuation tolerance is subtracted. If the difference is positive, it is added to the negative cumulative statistics of the previous frame; otherwise, it is cleared. The physical meaning of this fluctuation tolerance is that it allows for a certain degree of normal measurement fluctuation in the ranging value near the background distance. Only when the deviation continuously exceeds this tolerance will the cumulative statistics increase, thus avoiding misinterpreting normal ranging noise as a jump edge.

[0192] Simultaneously, the controller extracts all pixel grayscale values ​​along the horizontal line containing the pixel coordinates of the center of the reticle from the current aiming image frame. It then calculates the absolute value of the grayscale difference between adjacent pixels on this horizontal line, recording the maximum value in the sequence. This maximum value is used as the target boundary grayscale gradient magnitude for the current frame. This gradient magnitude reflects the clarity of the narrow target's horizontal boundary in the current frame: a larger gradient magnitude occurs when the target boundary texture is clear and the contrast is high; a smaller gradient magnitude occurs when the target boundary is blurry, the lighting is uneven, or the target surface texture is weak.

[0193] The controller determines a dynamic detection threshold based on the gray-level gradient amplitude of the target boundary, creating an inverse correlation between the dynamic detection threshold and the target boundary gray-level gradient amplitude: when the target boundary gray-level gradient amplitude is large, it indicates that the target boundary in the current image is clearly discernible. In this case, the threshold for edge detection can be appropriately lowered, and the dynamic detection threshold can be reduced to make the system more sensitive to edge changes in the ranging value; when the target boundary gray-level gradient amplitude is small, it indicates that the target boundary in the current image is blurred. In this case, the threshold for edge detection should be increased, and the dynamic detection threshold should be increased to avoid hasty edge detection due to insufficient image information. This design, which modulates the image boundary sharpness and the ranging edge detection sensitivity, allows the stringency of edge detection to adaptively match the current image quality, actively capturing edge information when the boundary is clear and being conservative and cautious when the boundary is blurred.

[0194] In each frame, the controller compares the positive cumulative statistics with the dynamic detection threshold. If the positive cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the first transition direction, indicating that the ranging value has significantly increased relative to the background. Similarly, if the negative cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The transition edge time is recorded, and the direction is marked as the second transition direction, indicating that the ranging value has significantly decreased relative to the background.

[0195] The controller also counts the total number of edge transitions detected within a preset historical time window prior to the current moment, and determines the current edge transition trigger frequency based on this total number. This edge transition trigger frequency reflects the activity level of the target or ranging spot: when the target moves rapidly or the operator shakes the scope significantly, the ranging spot frequently switches between different distance planes, resulting in a higher edge transition trigger frequency; when the target is stationary or the scope is held steadily, the edge transition trigger frequency is lower.

[0196] Based on the comparison between the current edge trigger frequency and the preset frequency threshold, the controller determines the search range parameters for performing left and right grayscale abrupt boundary searches in S1. When the edge trigger frequency is greater than or equal to the preset frequency threshold, it indicates that the target is in an active motion state. In this case, a first search range parameter is used, which is a relatively small pixel range. This allows S1 to quickly locate the target within a narrow band near the center of the reticle during left and right boundary searches, reducing boundary drift interference caused by rapid target movement. When the edge trigger frequency is less than the preset frequency threshold, it indicates that the target is in a relatively stable state. In this case, a second search range parameter is used, which is larger than the first search range parameter. This allows S1 to cover a wider pixel range during left and right boundary searches, ensuring that no boundary is missed due to an excessively narrow search range. By linking the edge trigger frequency with the boundary search range, S1's boundary search strategy can adaptively match the target's dynamic characteristics, accurately locating the target when it is moving and fully covering the target when it is stable.

[0197] Finally, the controller outputs the detected transition edge time, transition edge direction, and corresponding laser ranging value as transition edge feature information to S2, for S2 to refer to when determining the ranging confidence marker and search distance interval. The specific calculation methods for the above-mentioned sliding window mean filtering, cumulative statistics maintenance, dynamic detection threshold determination, and search range parameter adjustment are conventional techniques in the field of signal processing, and will not be elaborated here in this embodiment. The execution of the above-mentioned transition edge detection and intermodulation steps does not affect the implementation of S1 to S5. The output transition edge feature information is passed to S2 as auxiliary information. S2 can enhance the reliability of the confidence determination based on this information, or rely solely on the end-to-end comparison results between the original spot coverage area and the target lateral area when information is insufficient.

[0198] Furthermore, before determining the ranging confidence marker in S2, the following steps are also included:

[0199] Obtain the left target boundary angle and the right target boundary angle determined in S1;

[0200] Two consecutive aiming images are acquired. The horizontal pixel coordinates of the target boundary in the image coordinate system are extracted from the two aiming images respectively. The horizontal movement direction of the line of sight of the reticle center on the target plane is determined based on the difference between the horizontal pixel coordinates of the next frame and the previous frame.

[0201] When the detected transition direction is the first transition direction, the identity label of the transition edge is determined according to the lateral movement direction: if the lateral movement direction is the first direction, it is labeled as the right boundary transition; if the lateral movement direction is the second direction, it is labeled as the left boundary transition.

[0202] When the detected transition direction is the second transition direction, the identity label of the transition edge is determined according to the lateral movement direction: if the lateral movement direction is the first direction, it is labeled as the left boundary transition; if the lateral movement direction is the second direction, it is labeled as the right boundary transition.

[0203] The transition edge identity marker is associated with and stored in relation to the corresponding transition edge time and transition edge direction. The transition edge identity marker can be either a left boundary transition or a right boundary transition.

[0204] Determining the jump edge identification marker requires utilizing the lateral movement of the target boundary in two consecutive aiming images. The lateral pixel coordinates of the target boundary in the image coordinate system are extracted from each of the two consecutive aiming images. The difference between the later and earlier frames is calculated to determine the lateral movement direction of the line of sight at the reticle center on the target plane. When the jump edge direction is triggered by a positive cumulative statistic, if the lateral movement direction is the first direction, it is marked as a right boundary jump; if it is the second direction, it is marked as a left boundary jump. When the jump edge direction is triggered by a negative cumulative statistic, if the lateral movement direction is the first direction, it is marked as a left boundary jump; if it is the second direction, it is marked as a right boundary jump. The physical logic of this mapping relationship lies in the fact that the relative position of the ranging spot and the target boundary changes accordingly when the line of sight moves laterally. By combining the increase or decrease of the ranging value at the time of the jump edge occurrence with the direction of the line of sight movement, it can be inferred whether the jump edge corresponds to the left or right boundary. The jump edge identification marker is stored in association with the corresponding jump edge time and direction.

[0205] Furthermore, when determining the ranging confidence marker in S2, the following is also included:

[0206] Based on the jump edge identity mark, select the target boundary angle on the same side from the target boundary angles determined in S1;

[0207] Based on the laser ranging value corresponding to the transition edge, the target boundary angle on the same side, and the spot radius calibration value, calculate the geometric deviation between the spot coverage area corresponding to the laser ranging value and the target boundary on the same side.

[0208] When the geometric deviation is less than the preset deviation threshold, the transition edge is marked as a valid transition edge, and the laser ranging value corresponding to the valid transition edge is stored as a candidate value of the target distance in the valid transition edge buffer.

[0209] The number of candidate target distance values ​​in the effective transition buffer is counted. If the number reaches a preset threshold, the ranging confidence mark is forcibly determined as confidence, and the end-to-end comparison operation between the spot coverage area and the target lateral area in S2 is skipped directly. If the number does not reach the preset threshold, the end-to-end comparison result between the spot coverage area and the target lateral area is maintained as the basis for determining the ranging confidence mark.

[0210] Before determining the reliable ranging marker, the target boundary angle on the same side is selected from the determined target boundary angles based on the transition edge identity marker. The geometric deviation between the laser spot coverage area and the target boundary on the same side at the laser ranging value corresponding to the transition edge moment is calculated. The specific calculation method of this geometric deviation is as follows: the lateral position of the target boundary on the target plane is calculated based on the laser ranging value and the target boundary angle on the same side, and then this position is compared with the lateral position of the laser spot edge on the same side to obtain the deviation value. When the geometric deviation is less than a preset deviation threshold, the transition edge is marked as a valid transition edge, and the corresponding laser ranging value is stored as a target distance candidate value in the valid transition edge buffer. When the number of target distance candidate values ​​in the buffer reaches a preset number threshold, the reliable ranging marker is forcibly determined as reliable, and the end-to-end comparison operation between the laser spot coverage area and the target lateral area is skipped. It should be understood that when multiple valid transition edges detected independently at different times all point to the same distance, their statistical confidence is better than the result of single-frame spatial coverage comparison.

[0211] Furthermore, when determining the search distance interval in S2, it also includes:

[0212] Read all candidate target distance values ​​corresponding to valid transition edges from the valid transition edge buffer;

[0213] Statistical processing is performed on all candidate target distance values. Outliers with relative deviations exceeding a preset threshold are removed. Then, a narrowing distance interval is constructed based on the statistical distribution characteristics of the remaining candidate target distance values.

[0214] Take the intersection of this narrowed distance interval with the search distance interval obtained in S2 by comparing the spot coverage interval with the target horizontal interval, and use this intersection as the updated search distance interval output.

[0215] When determining the search distance interval, all candidate target distance values ​​are read from the effective transition edge buffer. Outliers with relative deviations exceeding a preset threshold are removed, and a narrowed distance interval is constructed based on the distribution range of the remaining candidate values. This narrowed distance interval intersects with the original search distance interval obtained from spot coverage comparison, and this intersection is used as the updated search distance interval output. The purpose of taking the intersection is to use the distance constraints formed by the accumulation of multiple effective transition edges in the time dimension to correct the potentially overly broad interval range of a single-frame spatial comparison. If the two intervals do not intersect, the original search distance interval remains unchanged.

[0216] Furthermore, after S4 completes the determination of the mechanical focusing and aberration correction reference position, and before driving the focusing lens group and the aberration correction lens group into place and locking, the following steps are also included:

[0217] Centered on the mechanical focusing position determined in S4, apply small positional perturbations with amplitudes less than half of the focusing search step size configuration value in S3 in both the positive and negative directions, so that the focusing lens group sequentially reaches the negative perturbation position, the center position, and the positive perturbation position.

[0218] At each test position, the aiming image frame is captured, and the corresponding sharpness evaluation value is calculated to obtain the negative direction sharpness value, the center sharpness value, and the positive direction sharpness value.

[0219] The reliability of the reference position determined by S4 is determined based on the first difference between the negative direction sharpness value and the center sharpness value, and the second difference between the positive direction sharpness value and the center sharpness value.

[0220] When both the first difference and the second difference are greater than the preset steepness threshold, and the relative deviation between the first difference and the second difference is less than the preset symmetry threshold, the reference position is determined to be a reliable position and no correction is made.

[0221] When both the first difference and the second difference are greater than the preset steepness threshold, but the relative deviation between the first difference and the second difference is greater than or equal to the preset symmetry threshold, it is determined that the reference position is not at the peak of the sharpness peak. The deviation direction is determined according to the relationship between the magnitude of the first difference and the second difference, and the reference position is moved to the deviation direction by a correction amount to obtain the correction position. The correction amount is determined according to the proportional relationship between the first difference and the second difference.

[0222] When at least one of the first difference and the second difference is not greater than the preset steepness threshold, the sharpness curve of the area where the reference position is located is determined to be too flat. No position correction is made, but the boundary angle information, confidence marker information, search range information, and the first and second differences corresponding to this focus are recorded as a low confidence sample and stored in the experience database.

[0223] The mechanical focusing position value and its corresponding error correction position value, which are finally determined after the above verification and correction, are used as the corrected reference position and passed to the subsequent positioning drive and locking steps.

[0224] After determining the mechanical focusing and error correction reference position and before final drive into position, a micro-perturbation verification is performed on the reference position. A small positional perturbation is applied in both the positive and negative directions, centered on the reference position. The perturbation amplitude is less than half the configured focusing search step size to ensure it does not exceed the range between adjacent sampling points during the search. Images are captured and calculated at the negative perturbation position, the center position, and the positive perturbation position, respectively, yielding the negative direction sharpness value, the center sharpness value, and the positive direction sharpness value. The reliability of the reference position is determined based on the difference between the center sharpness and the sharpness on both sides: when the difference on both sides is greater than the preset steepness threshold and the relative deviation between the difference on both sides is less than the preset symmetry threshold, the reference position is determined to be at the peak of sharpness, and no correction is made; when the difference on both sides is greater than the steepness threshold but the relative deviation does not meet the symmetry requirement, the reference position is determined to be deviated from the peak, the deviation direction is determined according to the magnitude relationship of the difference on both sides, and a correction amount is moved in that direction, the correction amount is determined according to the ratio of the difference on both sides; when the difference on at least one side is not greater than the steepness threshold, the sharpness curve of the area where the reference position is located is determined to be too flat, no position correction is made, but the boundary angle information, confidence mark information, search range information, and the difference on both sides corresponding to this focus are recorded as a low confidence sample and stored in the experience base.

[0225] Furthermore, after the position correction step based on micro-perturbation verification is completed, parameter self-learning based on the experience base is also included, specifically including:

[0226] Read a predetermined number of low-confidence samples from the experience base. Each sample contains at least the boundary angle information extracted in S1 and the ranging confidence marker determined in S2.

[0227] Statistically analyze the gray-level gradient magnitude corresponding to the boundary angle in all low-confidence samples, and adjust the gray-level abrupt change threshold in S1 used for left and right boundary search based on the statistical results: when the statistical average of the gray-level gradient magnitude is lower than the preset lower threshold, adjust the gray-level abrupt change threshold to decrease; when the statistical average of the gray-level gradient magnitude is higher than the preset upper threshold, adjust the gray-level abrupt change threshold to increase.

[0228] The distribution ratio of reliable ranging markers in all low-confidence samples is statistically analyzed, and the geometric deviation threshold used to determine reliability in S2 is adjusted according to this distribution ratio: when the proportion of reliable ranging markers exceeds the preset upper limit of the reliable ratio, the geometric deviation threshold is adjusted to tighten; when the proportion of reliable ranging markers exceeds the preset upper limit of the unreliable ratio, the geometric deviation threshold is adjusted to relax.

[0229] The adjusted grayscale mutation threshold and geometric deviation threshold are written to the system parameter storage area for execution calls by S1 and S2.

[0230] After accumulating low-confidence samples, parameter self-learning is triggered. A preset number of low-confidence samples are read from the experience base, and the gray-level gradient magnitudes corresponding to the boundary angles in the samples are statistically analyzed. When the statistical average of the gray-level gradient magnitudes is lower than a preset lower limit, it indicates that the current boundary search threshold may be too high, leading to missed boundary detections, and the gray-level abrupt change threshold is adjusted to decrease. When it is higher than a preset upper limit, it indicates that the threshold may be too low, leading to false noise detections, and the gray-level abrupt change threshold is adjusted to increase. At the same time, the distribution ratio of reliable ranging markers in the samples is statistically analyzed. When the reliable ratio exceeds a preset upper limit, it indicates that the judgment standard may be too lenient, and the geometric deviation threshold is adjusted to tighten. When the unreliable ratio exceeds a preset upper limit, it indicates that the judgment standard may be too strict, and the geometric deviation threshold is adjusted to relax. The adjustment range can use a fixed step size or be determined according to the proportion of statistical deviations. The latter is only an alternative calculation method and is not the only one. The adjusted thresholds are written to the system parameter storage area for subsequent steps.

[0231] Furthermore, after the parameter self-learning step based on the experience base is completed, it also includes:

[0232] When the sharpness curve of the reference position area is determined to be too flat in the position correction step based on micro-perturbation verification, in addition to recording low-confidence samples, an active scanning process is triggered at the same time.

[0233] The active scanning process is as follows: a deflection control signal is sent to the beam deflection actuator set on the output optical path of the laser ranging unit to control the laser ranging beam to perform controlled deflection scanning in the lateral direction of the target plane. The deflection direction is determined according to the sign of the lateral offset of the current spot center, and the deflection amplitude is determined according to the target boundary angle determined in S1, the current laser ranging value, and the spot radius calibration value, so that the deflection amplitude covers the projection range of the target in the deflection direction of the laser ranging beam.

[0234] During active scanning, the results of edge detection are monitored in real time. When a new edge is detected, the effective edge determination is performed based on the laser ranging value corresponding to the edge, and the target distance candidate value is updated with the newly detected effective edge.

[0235] When the number of candidate values ​​for the target distance in the effective transition buffer reaches a preset threshold, the active scanning is terminated, and the updated search distance interval is passed to S3 to re-execute the generation of candidate position pair sequences and the sharpness search of S4.

[0236] When the sharpness curve is deemed too flat during the micro-perturbation verification step, in addition to recording low-confidence samples, an active scanning process is triggered. A deflection control signal is sent to the beam deflection actuator located on the output optical path of the laser ranging unit, controlling the laser ranging beam to perform controlled deflection scanning in the lateral direction of the target plane. The deflection direction is determined based on the sign of the current lateral offset of the spot center, and the deflection amplitude is determined based on the target boundary angle, the current laser ranging value, and the calibrated spot radius, ensuring that the deflection range covers the target's projection range in the deflection direction. During the scanning process, the jump edge detection results are monitored in real time. When a new jump edge is detected, a valid jump edge determination is performed, and the target distance candidate value buffer is updated with the new detection value. When the number of target distance candidate values ​​in the buffer reaches a preset threshold, the scanning is terminated, and the updated search distance interval is passed back to the candidate position to re-execute the sequence generation step.

[0237] Furthermore, the active scanning process also includes:

[0238] During the scanning process performed by the beam deflection actuator, the statistical characteristics of the current scanning speed, the current lateral offset of the beam center, and the target distance candidate values ​​in the effective transition buffer area are continuously acquired.

[0239] The current hypothetical target distance is determined based on statistical characteristics, and the predicted lateral positions of the left and right boundaries are determined based on the current hypothetical target distance and the left and right target boundary angles determined in S1, respectively.

[0240] Based on the spatial distances between the current lateral offset of the spot center and the predicted lateral positions of the left and right boundaries, respectively, and combined with the current scanning speed and the spot radius calibration value, the predicted times of reaching the left and right boundaries are determined respectively.

[0241] Take the earlier of the predicted arrival time of the left boundary and the predicted arrival time of the right boundary as the predicted arrival time of the next transition edge;

[0242] During the time period from the current moment to the predicted arrival time, the sampling rate of the laser ranging unit will be switched from the basic sampling rate to an enhanced sampling rate, which is higher than the basic sampling rate.

[0243] Within a preset time window near the predicted arrival time, ranging values ​​are collected at an enhanced sampling rate and edge detection is performed. If an edge is detected within the time window, the ranging value corresponding to the edge is stored as a valid edge in the valid edge buffer.

[0244] During active scanning, the current hypothetical target distance is determined based on the statistical characteristics of candidate target distance values ​​in the effective transition edge buffer. The predicted lateral positions of the left and right boundaries are then calculated based on this distance and the angles of the left and right target boundaries. Based on the spatial distance between the current lateral offset of the spot center and the predicted lateral positions of the left and right boundaries, combined with the current scanning speed and the spot radius calibration value, the arrival times at the left and right boundaries are predicted, and the earlier of the two is taken as the predicted arrival time of the next transition edge. From the current time to the predicted arrival time, the sampling rate of the laser ranging unit is switched from the basic sampling rate to a higher enhanced sampling rate. Within a preset time window near the predicted arrival time, ranging values ​​are acquired at the enhanced sampling rate, and transition edge detection is performed. If a transition edge is detected, its corresponding ranging value is stored as a valid transition edge in the buffer.

[0245] Furthermore, the parameter self-learning step based on the experience base also includes:

[0246] Record the timestamp of the time of storage for each low-confidence sample in the experience base;

[0247] Before each parameter self-learning step, all samples in the experience base are traversed, and expired samples are determined based on the time difference between the current time and the time when the sample was stored.

[0248] When performing the parameter self-learning step, only samples that have not expired are counted; if the number of samples that have not expired is less than the preset minimum number of samples, the parameter self-learning step will not be performed.

[0249] When the total number of samples stored in the experience base exceeds the preset storage limit, expired samples are eliminated in order of their storage time from earliest to latest until the total number of samples drops below the storage limit.

[0250] Each low-confidence sample in the experience base is recorded with a timestamp indicating its entry time. Before each parameter self-learning process, the experience base is traversed, and expired samples are determined based on the time difference between the current time and the sample's entry time. During self-learning, only non-expired samples are counted. If the number of non-expired samples is less than the preset minimum requirement, self-learning is temporarily suspended. When the total number of samples stored in the experience base exceeds the preset storage limit, expired samples are sequentially eliminated in ascending order of entry time until the total number of samples falls below the storage limit.

[0251] According to another aspect of the embodiments of this application, an automatic focusing system for mechanical sights based on laser rangefinding is also provided. For example... Figure 2 As shown, the system includes:

[0252] The parameter set determination module 41 is used to determine the target boundary angle based on the current aiming image frame, determine the lateral offset of the spot center based on the laser ranging value, and determine the coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value.

[0253] The reliable constraint result generation module 42 is used to convert the target boundary angle into the target lateral interval, determine the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value, and determine the ranging reliable marker and search distance interval based on the spot coverage interval and the target lateral interval to generate the ranging reliable constraint result.

[0254] The candidate position pair determination module 43 is used to determine the candidate position pair sequence based on the ranging confidence constraint result. Each candidate position pair in the candidate position pair sequence includes a focusing position and a correction position.

[0255] The reference position determination module 44 is used to drive the focusing lens group and the aberration lens group to simultaneously reach and stop at each candidate position pair based on the candidate position pair sequence, acquire image windows at each stopping position corresponding to each candidate position pair and calculate the sharpness evaluation value; and determine the candidate position pair with the highest sharpness evaluation value as the mechanical focusing aberration reference position.

[0256] The drive module 45 is used to drive the focusing lens group and the aberration lens group into position according to the mechanical focusing and aberration reference position, and lock the current position of the focusing lens group and the current position of the aberration lens group after the position is confirmed.

[0257] In one specific implementation, such as Figure 3 As shown, this embodiment provides an automatic focusing system for mechanical sights based on laser rangefinding, including an optical sight, a mechanical focusing lens group 3, a correction lens group 4, a laser rangefinding unit 6, a controller 13, an image acquisition / processing unit 14, a calibration parameter storage unit 15, a device housing 8, and a power interface / communication interface 16.

[0258] An optical sight is used to form the aiming field of view for the operator to observe the target, and to form the line of sight at the center of the reticle within the aiming field of view. Specifically, the optical sight includes, in sequence along the optical path, an objective lens group 1, a reticle assembly 2, and an eyepiece group 5. Light passes sequentially through the objective lens group 1, the mechanical focusing lens group 3, the aberration filter group 4, the reticle assembly 2, and the eyepiece group 5, forming the aiming field of view for the operator at the exit end of the eyepiece group 5. The reticle assembly 2 forms the reticle within the aiming field of view, and the line of sight corresponding to the center of the reticle is the line of sight at the center of the reticle. The optical sight is also equipped with an image acquisition / processing unit 14, used to acquire the current aiming image frame and output it to the controller 13.

[0259] The mechanical focusing lens group 3 is positioned in the imaging optical path corresponding to the optical sight, specifically after the objective lens group 1 and before the aberration lens group 4. It moves along the optical axis according to the focusing control result output by the controller 13 to change the target's image sharpness. The mechanical focusing lens group 3 is also equipped with a focusing drive mechanism 9 and a focusing position encoder 11. The focusing drive mechanism 9 receives the drive control signal from the controller 13 and drives the mechanical focusing lens group 3 to move along the optical axis. The focusing position encoder 11 collects the real-time position of the mechanical focusing lens group 3 and feeds it back to the controller 13, forming a closed-loop control.

[0260] The aberration correction lens group 4 is also positioned in the imaging optical path corresponding to the optical sight, specifically after the mechanical focusing lens group 3 and before the reticle assembly 2. It moves along the optical axis according to the aberration correction control result output by the controller 13 to compensate for image plane drift caused by the movement of the mechanical focusing lens group 3, and adjusts the correspondence between the reticle center line of sight and the target image plane. The aberration correction lens group 4 is also equipped with an aberration correction drive mechanism 10 and an aberration correction position encoder 12. The aberration correction drive mechanism 10 receives the drive control signal from the controller 13 and drives the aberration correction lens group 4 to move along the optical axis. The aberration correction position encoder 12 collects the real-time position of the aberration correction lens group 4 and feeds it back to the controller 13, forming a closed-loop control.

[0261] The laser rangefinder unit 6 is equipped with a laser emission / reception window 7, which is used to emit a rangefinder beam in the direction of the target and obtain the laser-measured distance value, and output the laser-measured distance value to the controller 13. Since the optical sight and the laser rangefinder unit 6 are arranged side by side in the compact device housing 8, there is a fixed lateral baseline offset between the line of sight at the center of the reticle and the rangefinder beam.

[0262] The controller 13 is connected in conjunction with the image acquisition / processing unit 14, the laser ranging unit 6, the focusing drive mechanism 9, the differential correction drive mechanism 10, the focusing position encoder 11, and the differential correction position encoder 12. The controller 13 is also equipped with a calibration parameter storage unit 15, which has a parameter read / write relationship with the controller 13. The storage unit contains a signed distance-range measurement spot lateral offset calibration table, a range measurement spot radius calibration value, a distance-mechanical focusing position-differential correction position mapping table, a focusing search step size configuration value, and a sharpness window size configuration value.

[0263] The controller 13 receives the current aiming image frame output by the image acquisition / processing unit 14 and the laser distance value output by the laser ranging unit 6, and generates the drive positions of the mechanical focusing lens group 3 and the aberration correction lens group 4 accordingly. Specifically:

[0264] The controller 13 uses the position of the reticle center line of sight in the current aiming image frame as a reference to extract the left and right boundaries of the target in the lateral direction, and converts these left and right boundaries into the lateral range of the target under the current distance conditions. At the same time, the controller 13 queries the signed distance-range spot lateral offset calibration table in the calibration parameter storage unit 15 according to the laser distance value output by the laser ranging unit 6, obtains the lateral offset of the spot center corresponding to the ranging beam under the current distance conditions, and determines the lateral coverage range of the ranging spot by combining it with the ranging spot radius calibration value.

[0265] The controller 13 compares the lateral range of the target with the lateral coverage of the ranging spot: when the lateral coverage of the ranging spot falls completely within the lateral range of the target, the controller 13 takes the distance value measured by the laser as the reliable distance, and converts it into the target driving position of the mechanical focusing lens group 3 and the correction lens group 4 through the distance-mechanical focusing position-correction position mapping table. The mechanical focusing lens group 3 and the correction lens group 4 are then driven to the position that matches the real target plane by the focusing drive mechanism 9 and the correction drive mechanism 10.

[0266] When the lateral coverage of the ranging spot exceeds the lateral range of the target, the controller 13, based on the target boundary and the lateral offset relationship of the ranging beam relative to the line of sight at different distances, traverses each distance node of the signed distance-range spot lateral offset calibration table to determine a limited search distance range. The controller 13 converts this search distance range into a candidate drive position sequence for the mechanical focusing lens group 3 and the aberration lens group 4 through a distance-mechanical focusing position-alteration position mapping table, and drives the mechanical focusing lens group 3 and the aberration lens group 4 sequentially according to the candidate drive position sequence through the focusing drive mechanism 9 and the aberration drive mechanism 10. Upon reaching each candidate drive position, the image acquisition / processing unit 14 acquires the corresponding current aiming image frame and outputs it to the controller 13. The controller 13 uses the image clarity near the line of sight at the reticle center as an evaluation criterion, compares the imaging state at different candidate drive positions, selects the candidate drive position with the highest clarity as the final drive position, and uses the focusing drive mechanism 9 and the aberration drive mechanism 10 to stably maintain the mechanical focusing lens group 3 and the aberration lens group 4 at this position.

[0267] The aforementioned structure is installed inside the device housing 8 and is powered and communicated externally via the power interface / communication interface 16.

[0268] With the above-mentioned structure, this system can identify whether the laser ranging value corresponds to the target itself when there is a lateral baseline offset between the line of sight at the center of the reticle and the ranging beam. It also avoids using the distance of the adjacent plane incorrectly for the drive control of the mechanical focusing lens group 3 and the aberration lens group 4 when the ranging beam falls on the adjacent plane.

[0269] It should be noted that the embodiments implemented on the side of the automatic focusing system of the mechanical sight based on laser rangefinding in this application can be referenced with the embodiments implemented on the side of the automatic focusing method of the mechanical sight based on laser rangefinding, and will not be described in detail in this application.

[0270] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. An automatic focusing method for a mechanical sight based on laser rangefinding, characterized in that, include: S1, determine the target boundary angle based on the current aiming image frame, and determine the lateral offset of the spot center based on the laser ranging value; determine the coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value. S2, convert the target boundary angle into a target lateral interval, determine the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value; determine the ranging confidence mark and search distance interval based on the spot coverage interval and the target lateral interval, so as to generate ranging confidence constraint results; S3, determine a candidate position pair sequence based on the ranging confidence constraint result, wherein each candidate position pair in the candidate position pair sequence includes a focusing position and a correction position; S4. Based on the candidate position pair sequence, drive the focusing lens group and the aberration lens group to simultaneously reach each candidate position pair and stay there. At each stay position corresponding to each candidate position pair, acquire an image window and calculate the sharpness evaluation value. The candidate positions with the highest sharpness evaluation value are determined as the mechanical focusing error correction benchmark positions; S5. Based on the mechanical focusing and correction reference position, drive the focusing lens group and the correction lens group to their positions. After confirming their positions are in place, lock the current positions of the focusing lens group and the correction lens group.

2. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 1, characterized in that, The target boundary angle includes the left target boundary angle and the right target boundary angle; determining the target boundary angle based on the current aiming image frame includes: Extract the horizontal grayscale sequence along the horizontal scan line where the horizontal pixel coordinates of the reticle center are located; Using the horizontal pixel coordinates of the center of the dividing line as a reference, calculate the absolute value of the gray level difference between adjacent pixels point by point to the left, and locate the pixel coordinates of the target boundary on the left according to the boundary gray level change condition. Using the horizontal pixel coordinates of the center of the dividing line as a reference, calculate the absolute value of the gray-level difference between adjacent pixels point by point to the right, and locate the right target boundary pixel coordinates according to the boundary gray-level change condition; The difference between the horizontal pixel coordinates of the reticle center and the horizontal pixel coordinates of the left target boundary is calculated to obtain the first pixel distance from the reticle center to the left target boundary. Calculate the difference between the horizontal pixel coordinates of the right target boundary and the horizontal pixel coordinates of the reticle center to obtain the second pixel distance from the reticle center to the right target boundary; According to the image horizontal pixel angle calibration coefficient, the first pixel distance is converted into the left target boundary angle, and the second pixel distance is converted into the right target boundary angle.

3. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 1, characterized in that, The step of determining the reliable ranging marker based on the light spot coverage area and the target lateral area includes: Compare the lateral position of the left edge of the light spot coverage area with the lateral position of the left edge of the target lateral area, and compare the lateral position of the right edge of the light spot coverage area with the lateral position of the right edge of the target lateral area. If the lateral position of the left edge of the light spot coverage area is not less than the lateral position of the left edge of the target lateral area, and the lateral position of the right edge of the light spot coverage area is not greater than the lateral position of the right edge of the target lateral area, then the ranging confidence mark is determined to be reliable. If the left edge of the light spot coverage area is smaller than the left edge of the target horizontal area, or the right edge of the light spot coverage area is larger than the right edge of the target horizontal area, then the ranging confidence mark is determined to be unreliable.

4. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 3, characterized in that, When the ranging confidence marker is deemed unreliable, the search distance interval is determined, including: Traverse each node of the signed distance-range measurement spot lateral offset calibration table; At each node, the lateral position of the left edge and the lateral position of the right edge of the node spot are calculated based on the calibrated value of the spot radius and the lateral offset of the center of the spot corresponding to that node. At each node, the lateral position of the target boundary to the left of the node and the lateral position of the target boundary to the right of the node are calculated based on the distance value corresponding to the node and the angle of the target boundary. Calculate the difference between the lateral position of the left edge of the node spot corresponding to each node and the lateral position of the target boundary on the right side of the node to obtain the right boundary constraint difference sequence; Calculate the difference between the lateral position of the right edge of the node spot corresponding to each node and the lateral position of the target boundary on the left side of the node to obtain the left boundary constraint difference sequence; In the left boundary constraint difference sequence, locate two adjacent nodes whose difference sign changes from positive to negative or from negative to positive, and perform linear interpolation based on the distance value corresponding to each of the two adjacent nodes and the left boundary constraint difference to obtain the lower limit of the search distance interval; In the right boundary constraint difference sequence, locate two adjacent nodes whose difference sign changes from positive to negative or from negative to positive, and perform linear interpolation based on the distance value corresponding to each of the two adjacent nodes and the right boundary constraint difference to obtain the upper limit of the search distance interval.

5. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 4, characterized in that, The generated ranging confidence constraint results include: The distance measurement confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval are combined to form the distance measurement confidence constraint result.

6. The automatic focusing method for a mechanical sight based on laser rangefinding according to claim 1, characterized in that, The step of determining the candidate position pair sequence based on the ranging confidence constraint result includes: Obtain the ranging confidence marker, the lower limit of the search distance interval, and the upper limit of the search distance interval from the ranging confidence constraint result; When the ranging confidence mark is confidence, the lower limit of the search distance interval is converted into the corresponding mechanical focusing position value and the difference elimination position value through the distance-mechanical focusing position-difference elimination position mapping table, and the mechanical focusing position value and the difference elimination position value are combined into a single candidate position pair; When the reliable distance measurement marker is deemed unreliable, the lower limit of the search distance range is converted into the corresponding mechanical focusing start position value and the error correction start position value using the distance-mechanical focusing position-error correction position mapping table; the upper limit of the search distance range is converted into the corresponding mechanical focusing end position value and the error correction end position value using the distance-mechanical focusing position-error correction position mapping table. The number of discrete sampling points is determined based on the position span between the mechanical focusing start position value and the mechanical focusing end position value and the focusing search step size configuration value, and the discrete mechanical focusing position value is generated point by point along the direction of mechanical focusing position change. Based on the distance-mechanical focusing position-error elimination position mapping table, look up the error elimination discrete position value corresponding to each mechanical focusing discrete position value; According to the generation order of the mechanical focusing discrete position values, each mechanical focusing discrete position value and the corresponding difference elimination discrete position value are combined into candidate position pairs in sequence.

7. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 6, characterized in that, Based on the candidate position pair sequence, the focusing lens group and the aberration lens group are driven to simultaneously reach and stop at each candidate position pair. Image windows are acquired at each stopping position corresponding to each candidate position pair, and a sharpness evaluation value is calculated, including: While staying at each candidate position pair, acquire the aiming image frame at the staying position corresponding to the current candidate position pair; Using the center pixel coordinates of the reticle as the center, the target image window is cropped from the aiming image frame according to the resolution window size configuration value; Calculate the absolute value of the horizontal grayscale difference and the absolute value of the vertical grayscale difference at each pixel position within the target image window; The absolute values ​​of the horizontal and vertical gray-level differences of all pixel positions within the target image window are summed to obtain the sum of the absolute values ​​of the gray-level gradients corresponding to the current candidate position. The sum of the absolute values ​​of the gray-level gradients is used as the sharpness evaluation value.

8. The automatic focusing method for mechanical sights based on laser rangefinding according to claim 1, characterized in that, The step of driving the focusing lens group and the correction lens group into position according to the mechanical focusing and correction reference position includes: The mechanical focusing and correction reference position is decomposed into the first target pulse number of the focusing lens group and the second target pulse number of the correction lens group, and the focusing lens group and the correction lens group are driven into position synchronously according to the first target pulse number and the second target pulse number.

9. The automatic focusing method for a mechanical sight based on laser rangefinding according to claim 1, characterized in that, The method further includes the following steps after S1 and before S2: Acquire N consecutive frames of laser ranging values, construct a ranging value sequence according to the acquisition time, and assign a frame number to each frame, where N is a preset positive integer; Using the ranging values ​​within a sliding window preceding the current frame number in the ranging value sequence as samples, calculate the median of the ranging values ​​within that sliding window, and use the median as the current background distance estimate; Maintain positive and negative cumulative statistics; Extract the gray values ​​of all pixels on the horizontal line where the horizontal pixel coordinates of the center of the reticle are located from the current target image frame. Calculate the absolute value of the gray value difference between adjacent pixels point by point on the horizontal line. Record the maximum value in the sequence of absolute gray value differences and use the maximum value as the gray value gradient magnitude of the target boundary of the current frame. The dynamic detection threshold is determined based on the grayscale gradient magnitude of the target boundary. The positive cumulative statistics are compared with the dynamic detection threshold. If the positive cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the first transition direction. The negative cumulative statistics are compared with the dynamic detection threshold. If the negative cumulative statistics are greater than the dynamic detection threshold, it is determined that a transition edge has occurred in the current frame. The frame number of the current frame is recorded as the transition edge time, and the direction of the transition edge is marked as the second transition direction. The total number of transition edges detected within a preset historical time window prior to the current moment is counted, and the current transition edge triggering frequency is determined based on the total number of transition edges. Based on the comparison between the current transition edge trigger frequency and the preset frequency threshold, the search range parameters for performing the left and right grayscale transition boundary search are determined. The detected transition edge time, transition edge direction, and corresponding laser ranging value are output as transition edge feature information to S2.

10. An automatic focusing system for a mechanical sight based on laser rangefinding, the system implementing the automatic focusing method for a mechanical sight based on laser rangefinding as described in claim 1, characterized in that, include: The parameter set determination module is used to determine the target boundary angle based on the current aiming image frame, determine the lateral offset of the spot center based on the laser ranging value, and determine the coverage determination parameter set based on the target boundary angle, the lateral offset of the spot center, and the spot radius calibration value. The reliable constraint result generation module is used to convert the target boundary angle into a target lateral interval, determine the spot coverage interval based on the lateral offset of the spot center and the spot radius calibration value, and determine the ranging reliable marker and search distance interval based on the spot coverage interval and the target lateral interval to generate ranging reliable constraint results. The candidate position pair determination module is used to determine a sequence of candidate position pairs based on the ranging confidence constraint result, wherein each candidate position pair in the candidate position pair sequence includes a focusing position and a correction position; The reference position determination module is used to drive the focusing lens group and the aberration lens group to simultaneously reach and stop at each candidate position pair based on the candidate position pair sequence, and to acquire image windows and calculate sharpness evaluation values ​​at each stopping position corresponding to each candidate position pair. The candidate positions with the highest sharpness evaluation value are determined as the mechanical focusing error correction benchmark positions; The drive module is used to drive the focusing lens group and the aberration lens group into position according to the mechanical focusing and aberration correction reference position, and lock the current position of the focusing lens group and the current position of the aberration lens group after the position is confirmed.