Method for automatically focusing image definition of three-dimensional endoscope camera
By using automatic focus technology in medical three-dimensional endoscopic cameras, the use of square gradient and two-step search strategy to achieve synchronous focus of dual-reverse lenses, the problem of unclear images caused by the lens movement after a long time is solved, and the utilization of equipment is improved rate and image quality.
Patent Information
- Application Number
- CN202411552421.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-18
AI Technical Summary
The existing medical three-dimensional endoscope cameras move the lens after the equipment is used for a long time, resulting in image imaging being affected, and after-sales maintenance costs are high, and lack of automatic focus function.
By determining the initial position of the left and right lenses of the three-dimensional endoscope camera, setting the effective process range of the focus motor, using a square gradient as an effective measure, and using a two-step search strategy to determine the peak position with the highest image clarity, realizing the dual-reverse lens Synchronous focus.
It effectively solves the problem of unclear images caused by lens movement in the later stage of the device, improves the utilization rate of the device, reduces medical costs, and ensures the clarity and consistency of the dual-channel image.
Smart Images

Figure CN119485013A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of endoscope image processing, and in particular to a method for automatically focusing an image clarity of a three-dimensional endoscope camera. Background Art
[0002] In recent years, with the continuous development of medical imaging technology, the application of three-dimensional endoscopic camera systems has gradually been vigorously developed and promoted, and applied to clinical surgery. The development prospects of medical 3D endoscopes are very broad. By combining 3D imaging technology and endoscope technology, doctors can obtain clearer and more three-dimensional images, which helps to improve the accuracy of diagnosis and treatment. This technology can play an important role in minimally invasive surgery, tumor resection, organ examination and other fields. With the continuous advancement of technology, medical 3D endoscopes may become more intelligent and portable, providing more convenience and support for doctors. With the continuous development of medical 3D endoscopes, they will eventually replace the existing conventional 2D endoscopes.
[0003] However, due to various factors such as mechanical appearance, one medical 3D camera can only match one 3D endoscope, and the focus has been adjusted during the assembly process, which results in: after the equipment is used for a long time, the lens will move, which will have a great impact on its imaging, and the after-sales maintenance cost is high. Therefore, it is urgent to add an autofocus function to the 3D endoscope camera. With the autofocus function, even if the lens moves, the image can be readjusted through autofocus to meet various application scenarios in the clinical process. Summary of the invention
[0004] In order to solve the shortcomings of existing medical three-dimensional endoscope technology, the purpose of the present invention is to provide a method for automatically focusing the image clarity of a three-dimensional endoscope camera. This method can effectively solve the problem of lens movement in the later stage of the equipment and the inability to form a clear image, thereby further improving the utilization rate of the equipment and reducing medical costs.
[0005] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0006] A method for automatically focusing an image definition of a three-dimensional endoscope camera comprises the following steps:
[0007] Step S1, determining the initial positions of the left and right lenses of the 3D endoscope camera, and setting the effective range of the focus motor;
[0008] Step S2, within the effective process range of the focus motor, taking at least one path of the three-dimensional endoscope camera as a standard, using the square gradient as an effective metric, to quantify the clarity of the current position of the image;
[0009] Step S3, using a two-step search strategy to determine the peak position with the highest image clarity;
[0010] Step S4, repeating steps S2 to S3 until both the left and right lenses of the three-dimensional endoscope camera reach a successful focusing state.
[0011] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, the quantification formula is expressed as:
[0012]
[0013] Wherein, M represents the height of the image, N represents the width of the image, f(x, y) represents the grayscale at the pixel coordinate (x, y), and ∮(P) represents the gradient focus square value of the image obtained when the lens is at position P.
[0014] According to a method for automatically focusing image clarity of a three-dimensional endoscope camera provided by the present invention, the two-step search strategy includes:
[0015] The constructed decision tree model is used to make predictions based on the calculated feature values to determine whether the next search direction is near focus or far focus, and whether it is necessary to continue searching or go back to the starting point, so as to determine the approximate range of the peak until a successful state is reached;
[0016] If the prediction result is successful, the traditional hill climbing method is used to perform local search within the range until the difference in clarity between the previous and next steps is less than the preset threshold, and the focus is determined to be successful.
[0017] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, the construction of the decision tree model includes:
[0018] Collect multiple sets of focusing data of 3D endoscope cameras at different positions and with different lens movements as training samples;
[0019] Extract feature values from training samples, including ratio, diffMax, diffMin, diffAvg, curving, curvingRatio, downtrend, and uptrend;
[0020] A decision tree is constructed based on the feature values, and the decision tree is trained through training samples to obtain a decision tree model that can predict the next search direction.
[0021] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, ratio is expressed as a ratio between clarity values or a ratio between other related parameters, and is used to evaluate the trend of clarity change;
[0022] diffMax represents the maximum difference in the change of the clarity value in three consecutive fine-step movements;
[0023] diffMin represents the minimum difference in the change of the clarity value in three consecutive fine-step movements;
[0024] diffAvg represents the average value of the change in the clarity value in three consecutive fine-step movements;
[0025] Curving refers to the curvature of the change in clarity value, that is, the second-order derivative or approximate value of the change in clarity value with lens position;
[0026] CurvingRatio refers to the ratio of curvature to a certain reference value or average curvature, which is used to evaluate the relative curvature size of the change in clarity value;
[0027] downtrend indicates a characteristic or indicator that the clarity value shows a downward trend;
[0028] Uptrend is a characteristic or indicator that indicates that the clarity value is on an upward trend.
[0029] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, the calculation formula of ratio is expressed as formula (2):
[0030]
[0031] The calculation formula of diffMax is expressed as formula (3):
[0032]
[0033] The calculation formula of diffMin is expressed as formula (4):
[0034]
[0035] The calculation formula of diffAvg is expressed as formula (5):
[0036]
[0037] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, the calculation formula of curving is expressed as formula (6):
[0038]
[0039] The calculation formula of curvingRatio is expressed as formula (7):
[0040]
[0041] According to a method for automatically focusing an image clarity of a three-dimensional endoscope camera provided by the present invention, the calculation formula of downtrend is expressed as formula (8):
[0042] downtrend=1if f k ≥f k+1 ≥f k+2
[0043] =0else (8)
[0044] The calculation formula of uptrend is expressed as formula (9):
[0045] uptrend=1if f k+2 ≥f k+1 ≥f k
[0046] =0else (9).
[0048] According to a method for automatically focusing image clarity of a three-dimensional endoscope camera provided by the present invention, if the prediction result is to continue, the search continues in the current direction; if the prediction result is to backtrack, the lens is returned to the starting position, the search process is repeated in the opposite direction, and the measured focus value list is reinitialized.
[0049] According to a method for automatically focusing image clarity of a three-dimensional endoscope camera provided by the present invention, the following steps are further performed:
[0050] For the matching of multiple 3D endoscopes and a single camera, the switch is performed through a preset intelligent switching mechanism, including:
[0051] Assign a unique identification to each 3D endoscope;
[0052] A corresponding reading device is provided at the camera end to identify the identity of the currently connected endoscope;
[0053] A mapping relationship between the endoscope identity and the pre-stored focus parameters is established within the system;
[0054] When a new endoscope is identified, the corresponding focus parameters are immediately retrieved from the mapping relationship;
[0055] The camera quickly adjusts to the preset state according to the retrieved focus parameters and prepares for autofocus;
[0056] If the pre-stored parameters are not available, a comprehensive focus search process is automatically initiated.
[0057] It can be seen that compared with the prior art, the method provided by the present invention has the following beneficial effects:
[0058] 1. After the three-dimensional endoscope camera is used for a certain period of time, the lens may move. The present invention can maintain the performance of the device to meet the clinical application requirements through automatic focusing;
[0059] 2. The present invention uses square gradient as an effective metric to quantify the clarity of the current position of the image. The square gradient can accurately reflect the sharpness of the edge of the image, thereby ensuring high precision of the focusing process.
[0060] 3. The present invention determines the peak position with the highest image clarity through a two-step search strategy, which can quickly and accurately find the best focus point and avoid the errors that may be caused by traditional focusing methods.
[0061] 4. The left and right lenses of the three-dimensional endoscope camera of the present invention both achieve a successful focusing state, ensuring the clarity and consistency of the two-way images, which is crucial for the application of three-dimensional endoscopes in the fields of medical treatment, industrial inspection, etc., because these fields usually require high-quality stereoscopic images.
[0062] 5. The present invention can reduce image distortion and blur through dual-lens synchronous focusing, improve the three-dimensional sense and realism of the image, and provide doctors or test personnel with more accurate diagnosis or test results.
[0063] 6. The present invention is applicable to various types of three-dimensional endoscope cameras, and can achieve high-precision autofocus regardless of whether it is used in medical diagnosis, industrial inspection or other fields.
[0064] 7. The present invention can adapt to the focusing requirements in different scenarios by adjusting the effective process range and search strategy of the focusing motor. For example, in an environment with low light or high image noise, the search strategy can be appropriately adjusted to improve the accuracy and stability of focusing.
[0065] 8. When the device of the present invention can automatically focus, one medical three-dimensional endoscope camera can match multiple three-dimensional endoscopes, which can improve the utilization rate of the device and reduce the cost of the device.
[0066] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 The present invention is a flowchart of a method embodiment of automatically focusing image clarity of a three-dimensional endoscope camera.
[0068] Figure 2 It is a schematic diagram of multiple clarity peaks in an embodiment of a method for automatically focusing image clarity of a three-dimensional endoscope camera in the present invention.
[0069] Figure 3It is a schematic diagram of the principle of a two-step search strategy in an embodiment of a method for automatically focusing an image clarity of a three-dimensional endoscope camera of the present invention. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0072] See also Figures 1 to 3 The present invention provides a method for automatically focusing an image clarity of a three-dimensional endoscope camera, the method comprising the following steps:
[0073] Step S1, determining the initial positions of the left and right lenses of the 3D endoscope camera, and setting the effective range of the focus motor;
[0074] Step S2, within the effective process range of the focus motor, taking at least one path of the three-dimensional endoscope camera as a standard, using the square gradient as an effective metric, to quantify the clarity of the current position of the image;
[0075] Step S3, using a two-step search strategy to determine the peak position with the highest image clarity;
[0076] Step S4, repeating steps S2 to S3 until both the left and right lenses of the three-dimensional endoscope camera reach a successful focusing state.
[0077] In the above step S1, the quantization formula is expressed as formula (1):
[0078]
[0079] Wherein, M represents the height of the image, N represents the width of the image, f(x, y) represents the grayscale at the pixel coordinate (x, y), and ∮(P) represents the gradient focus square value of the image obtained when the lens is at position P.
[0080] In the above step S2, the two-step search strategy of this embodiment includes:
[0081] The constructed decision tree model is used to make predictions based on the calculated feature values to determine whether the next search direction is near focus or far focus, and whether it is necessary to continue searching or go back to the starting point, so as to determine the approximate range of the peak until a successful state is reached;
[0082] If the prediction result is successful, the traditional hill climbing method is used to perform local search within the range until the difference in clarity between the previous and next steps is less than the preset threshold, and the focus is determined to be successful.
[0083] In this embodiment, the construction of the decision tree model includes:
[0084] Collect multiple sets of focusing data of 3D endoscope cameras at different positions and with different lens movements as training samples;
[0085] Extract feature values from training samples, including ratio, diffMax, diffMin, diffAvg, curving, curvingRatio, downtrend, and uptrend;
[0086] A decision tree is constructed based on the feature values, and the decision tree is trained through training samples to obtain a decision tree model that can predict the next search direction.
[0087] Wherein, ratio is expressed as the ratio between the clarity values or the ratio between other related parameters, which is used to evaluate the trend of clarity change;
[0088] Among them, diffMax represents the maximum difference in the change of the clarity value in three consecutive fine-step movements;
[0089] Among them, diffMin represents the minimum difference in the change of the clarity value in three consecutive fine-step movements;
[0090] Among them, diffAvg represents the average value of the change in the clarity value in three consecutive fine-step movements;
[0091] Among them, curving represents the curvature of the change of the clarity value, that is, the second-order derivative or approximate value of the change of the clarity value with the lens position;
[0092] Among them, curvingRatio refers to the ratio of curvature to a certain reference value or average curvature, which is used to evaluate the relative curvature size of the change in clarity value;
[0093] Among them, downtrend means the characteristic or indicator that the clarity value shows a downward trend;
[0094] Here, uptrend indicates a characteristic or indicator that the clarity value shows an upward trend.
[0095] Specifically, the calculation formula of ratio is expressed as formula (2):
[0096]
[0097] Specifically, the calculation formula of diffMax is expressed as formula (3):
[0098]
[0099] Specifically, the calculation formula of diffMin is expressed as formula (4):
[0100]
[0101] Specifically, the calculation formula of diffAvg is expressed as formula (5):
[0102]
[0103] Specifically, the calculation formula of curving is expressed as formula (6):
[0104]
[0105] Specifically, the calculation formula of curvingRatio is expressed as formula (7):
[0106]
[0107] Specifically, the calculation formula of downtrend is expressed as formula (8):
[0108] downtrend=1if f k ≥f k+1 ≥f k+2
[0109] =0 else (8)
[0110] Specifically, the calculation formula of uptrend is expressed as formula (9):
[0111] uptrend=1if f k+2 ≥f k+1 ≥f k
[0112] =0 else (9)
[0113] In the above step S3, if the prediction result is to continue, the search continues in the current direction; if the prediction result is to backtrack, the lens is returned to the starting position, the search process is repeated in the opposite direction, and the measured focus value list is reinitialized.
[0114] In this embodiment, the following is also performed:
[0115] For the matching of multiple 3D endoscopes and a single camera, the switch is performed through a preset intelligent switching mechanism, including:
[0116] Assign a unique identity to each 3D endoscope; set a corresponding reading device at the camera end to identify the identity of the currently connected endoscope; establish a mapping relationship between the endoscope identity and the pre-stored focus parameters within the system;
[0117] When a new endoscope is identified, the corresponding focus parameters are immediately retrieved from the mapping relationship; the camera quickly adjusts to the preset state based on the retrieved focus parameters and prepares for automatic focus; if the pre-stored parameters are not available, a comprehensive focus search process is automatically started.
[0118] During the use of the camera, the image clarity is continuously monitored. If the image clarity is found to be reduced, the focus calibration process is automatically triggered. The calibration process can refer to the two-step search strategy of this embodiment to quickly re-determine the best focus position.
[0119] An adaptive learning algorithm is designed to record information such as lens movement and focal length changes during each focusing process. Through continuous learning and optimization, the focusing speed and accuracy can be gradually improved. At the same time, the algorithm can also identify subtle differences between different endoscopes, thereby making more personalized focus adjustments.
[0120] Establish a user feedback mechanism to collect user experience and suggestions on the intelligent switching and calibration mechanism, and continuously optimize the algorithm and operating procedures based on user feedback to improve the practicality of the system and user experience.
[0121] Therefore, this embodiment can ensure that the focus adjustment can be completed quickly and accurately when switching multiple three-dimensional endoscopes by designing an intelligent switching and calibration mechanism, thereby improving the use efficiency and accuracy of medical three-dimensional endoscopes.
[0122] In this embodiment, the left and right lenses of the three-dimensional endoscope camera are initially stationary at any position, and it is necessary to determine whether the two lenses are looking for peaks in the near focus direction or in the far focus direction; that is, the two lenses are looking for the position with the best image clarity within the effective process of the focus motor. This embodiment quantifies the clarity of the image at the current motor position by using an effective metric called square gradient, as shown in formula (1), where ∮(P) represents the gradient focus square value of the image obtained when the lens is at position P. The larger the value, the clearer the image.
[0123] In actual focusing situations, there may be multiple sharpness peaks. Traditional hill climbing methods are prone to searching for local optimal points. In this case, it is necessary to search for the peak with the highest sharpness, i.e., the top peak (e.g., Figure 2 Therefore, this embodiment designs a two-step search strategy, such as Figure 3 As shown in the figure: (1) determine the approximate range of the peak based on the decision tree model, and (2) perform local search (i.e., traditional hill climbing). Figure 3 "Continue" means to continue along the current path when performing a search or exploration task, and to repeat the same steps to gradually advance the search, which is used in the process of algorithms or problem solving;
[0124] "Backtracking" means that the initially selected direction is predicted to be incorrect, and it is unlikely to find a peak (i.e., the best solution) in that direction. In this case, it is necessary to reverse the direction and return the lens to the starting position. Then, repeat the search process in the opposite direction and reinitialize the list of measured focus values. If this indication is obtained for the second time (i.e., the direction is predicted to be incorrect again), the search is considered to have failed and the algorithm will fall back to a full scan; "Success" means that a peak is predicted to be close to a lens position that has been visited before, reverse the direction and return the lens to the position with the highest focus value among the previously visited lens positions.
[0125] The first step of the search strategy is to determine the approximate range of the peak. In this embodiment, three sharpness values (f k 、f k+1 、f k+2 ), calculate the features required by the decision tree model, including ratio, diffMax, diffMin, diffAvg, curving, curvingRatio, downtrend, uptrend, as shown in formula (2-9). After the model predicts whether it is "near focus" or "far focus", the search begins; if the prediction is "successful", it means that the peak range is successfully found; if the prediction is "continue", the search continues; if the prediction is "backtracking", it returns to the starting point and searches in the opposite direction.
[0126] Regarding the second step of the search strategy, the traditional hill climbing method: the first step to determine the initial direction is a rough step, and the direction is determined by the larger of the two focus values. If the first step after determining the initial direction causes the focus value to drop, backtracking (i.e. returning to the previous step) will occur. The search is stopped according to a preset threshold, indicating that the peak has been reached.
[0127] In practical applications, for example, within the effective process range of the focus motor of a 3D endoscope camera, first take the left path of the 3D endoscope camera as an example, calculate the clarity of its three consecutive fine steps at the current position according to formula (1), and use the decision tree model constructed based on formula (2-9) to predict the next decision. Figure 2 When the “success” state is reached, the traditional hill-climbing method is used to find the optimal point. When the difference in clarity between the previous and next steps is less than the preset threshold, the focus is considered to be successful.
[0128] In summary, when the three-dimensional endoscope camera is used for a certain period of time, the lens may move. The present invention can maintain the performance of the device to meet the clinical application requirements through automatic focusing. The present invention uses the square gradient as an effective metric to quantify the clarity of the current position of the image. The square gradient can accurately reflect the sharpness of the edge of the image, thereby ensuring the high precision of the focusing process.
[0129] Furthermore, the present invention determines the peak position with the highest image clarity through a two-step search strategy, and can quickly and accurately find the best focus point, thus avoiding the errors that may be caused by traditional focusing methods.
[0130] Furthermore, the left and right lenses of the three-dimensional endoscope camera of the present invention both achieve a successful focusing state, ensuring the clarity and consistency of the dual-path images, which is crucial for the application of three-dimensional endoscopes in medical and industrial inspection fields, because these fields usually require high-quality stereoscopic images.
[0131] Furthermore, the present invention can reduce image distortion and blur through dual-lens synchronous focusing, improve the three-dimensional sense and realism of the image, and provide doctors or test personnel with more accurate diagnosis or test results.
[0132] Furthermore, the present invention is applicable to various types of three-dimensional endoscope cameras, and can achieve high-precision autofocus regardless of whether it is used in medical diagnosis, industrial inspection or other fields.
[0133] Furthermore, the present invention can adapt to the focusing requirements in different scenarios by adjusting the effective process range and search strategy of the focusing motor. For example, in an environment with low light or high image noise, the search strategy can be appropriately adjusted to improve the accuracy and stability of focusing.
[0134] Furthermore, when the device of the present invention can automatically focus, one medical three-dimensional endoscope camera can match multiple three-dimensional endoscopes, which can improve the utilization rate of the device and reduce the cost of the device.
[0135] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.
Claims
1. A method for automatically focusing image clarity of a three-dimensional endoscope camera, characterized in that: The following steps are involved: Step S1, determining the initial positions of the left and right lenses of the 3D endoscope camera, and setting the effective range of the focus motor; Step S2, within the effective process range of the focus motor, taking at least one path of the three-dimensional endoscope camera as a standard, using the square gradient as an effective metric, to quantify the clarity of the current position of the image; Step S3, using a two-step search strategy to determine the peak position with the highest image clarity; Step S4, repeating steps S2 to S3 until both the left and right lenses of the three-dimensional endoscope camera reach a successful focusing state.
2. The method according to claim 1, characterized in that: The quantization formula is expressed as the formula: Wherein, M represents the height of the image, N represents the width of the image, f(x, y) represents the grayscale at the pixel coordinates (x, y), and ∮(P) represents the gradient focus square value of the image obtained when the lens is at position P.
3. The method according to claim 1, characterized in that: The two-step search strategy includes: The constructed decision tree model is used to make predictions based on the calculated feature values to determine whether the next search direction is near focus or far focus, and whether it is necessary to continue searching or go back to the starting point, so as to determine the approximate range of the peak until a successful state is reached; If the prediction result is successful, the traditional hill climbing method is used to perform local search within the range until the difference in clarity between the previous and next steps is less than the preset threshold, and the focus is determined to be successful.
4. The method according to claim 3, characterized in that: The construction of the decision tree model includes: Collect multiple sets of focusing data of 3D endoscope cameras at different positions and with different lens movements as training samples; Extract feature values from training samples, including ratio, diffMax, diffMin, diffAvg, curving, curvingRatio, downtrend, and uptrend; A decision tree is constructed based on the feature values, and the decision tree is trained through training samples to obtain a decision tree model that can predict the next search direction.
5. The method according to claim 4, characterized in that: Ratio is expressed as the ratio between clarity values or other related parameters, which is used to evaluate the trend of clarity change; diffMax represents the maximum difference in the change of the sharpness value in three consecutive fine-step movements; diffMin represents the minimum difference in the change of the clarity value in three consecutive fine-step movements; diffAvg represents the average value of the change in the clarity value in three consecutive fine-step movements; Curving refers to the curvature of the change in clarity value, that is, the second-order derivative or approximate value of the change in clarity value with lens position; CurvingRatio refers to the ratio of curvature to a certain reference value or average curvature, which is used to evaluate the relative curvature size of the change in clarity value; downtrend indicates a characteristic or indicator that the clarity value shows a downward trend; Uptrend is a characteristic or indicator that indicates that the clarity value is on an upward trend.
6. The method according to claim 5, characterized in that: The calculation formula of ratio is expressed as formula (2): The calculation formula of diffMax is expressed as formula (3): The calculation formula of diffMin is expressed as formula (4): The calculation formula of diffAvg is expressed as formula (5):
7. The method according to claim 5, characterized in that: The calculation formula of curving is expressed as formula (6): The calculation formula of curvingRatio is expressed as formula (7):
8. The method according to claim 5, characterized in that: The calculation formula of downtrend is expressed as formula (8): downtrend=1 if f k ≥f k+1 ≥f k+2 =0else (8) The calculation formula of uptrend is expressed as formula (9): uptrend=1 if f k+2 ≥f k+1 ≥f k =0else (9).
9. The method according to any one of claims 1 to 8, characterized in that: If the prediction result is to continue, the search continues in the current direction; if the prediction result is to backtrack, the lens is returned to the starting position, the search process is repeated in the opposite direction, and the measured focus value list is reinitialized.
10. The method according to any one of claims 1 to 8, characterized in that: Also execute: For the matching of multiple 3D endoscopes and a single camera, the switch is performed through a preset intelligent switching mechanism, including: Assign a unique identification to each 3D endoscope; A corresponding reading device is provided at the camera end to identify the identity of the currently connected endoscope; A mapping relationship between the endoscope identity and the pre-stored focus parameters is established within the system; When a new endoscope is identified, the corresponding focus parameters are immediately retrieved from the mapping relationship; The camera quickly adjusts to the preset state according to the retrieved focus parameters and prepares for autofocus; If the pre-stored parameters are not available, a comprehensive focus search process is automatically initiated.
Citation Information
Cited By
Focusing calibration algorithm and system for assembling camera lens by Monte Carlo tree search
CN121309800A