Endoscope and automatic focusing method of endoscope

Through the detection module and motor guide system that cooperates with the optical coupling and baffle, the problem of accurate image distance acquisition in the endoscopic focus is solved, and the endoscopic automatic focus method with simple structure and low cost is realized, which improves focus adjustment Accuracy and efficiency.

CN119112070APending Publication Date: 2024-12-13GUANGDONG OPTO MEDIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411221281.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The current image distance cannot be accurately known during the focus process of existing endoscopes, resulting in the inability to accurately focus. The magnetic inductor occupies a large space and affects the operation of fine components. The operation accuracy of ordinary micro motors is low and the cost is high.

Method used

The detection module that cooperates with the baffle is adopted to obtain the current image and image distance signals through the image sensor, the control module judges and adjusts the image distance, and uses the motor and guides to achieve focus, reducing the space and cost requirements.

Benefits of technology

It realizes accurate identification of the object distance, has a simple structure and a small space occupancy, which reduces the motor's operation accuracy requirements, expands the position detection range, and effectively reduces production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119112070A_ABST
    Figure CN119112070A_ABST
Patent Text Reader

Abstract

The invention discloses an endoscope which comprises an endoscope body shell, an endoscope body connected to the front end of the endoscope body shell, an image sensor, an optical lens, a focusing module, a detection module and a control module, the control module is in signal connection with the image sensor, the focusing module and the detection module. The image sensor is used for acquiring a current image; the focusing module is used for carrying out image distance adjustment on the image sensor; the detection module is used for acquiring the current image distance of the image sensor and generating a corresponding photoelectric signal; the control module is used for judging whether the current image distance is matched with the object distance or not according to the current image and the photoelectric signal, and if not, the focusing module is controlled to adjust the image distance so as to be matched with the object distance of the current image. The image distance is accurately acquired through the detection module, the structure is simple, the operation is convenient, the occupied space is small, and the cost is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of endoscopes, and in particular to an endoscope and an endoscope automatic focusing method. Background Art

[0002] An endoscope is a detection instrument that integrates an image sensor, an optical lens, a light source, and a mechanical device. It can enter the stomach through the mouth or other natural channels. Endoscopes can be used to see lesions that cannot be shown by X-rays. Doctors can use endoscopes to observe ulcers or tumors in the stomach and develop the best treatment plan based on this. When an endoscope is used, the distance between the object being observed and the end of the endoscope varies greatly under different working conditions. Sometimes very close observation is required, and sometimes long-distance observation is required.

[0003] For example, a Chinese patent document with application number CN202210164877.9 discloses an automatic focusing device, a projection device and an automatic focusing method. The automatic focusing device includes a focusing lens, a focusing member, a driving mechanism and a position detection mechanism. The focusing lens includes a focusing lens barrel and a lens body that is retractable relative to the focusing lens barrel. The driving mechanism is used to drive the focusing member to rotate so as to drive the lens body to move relative to the focusing lens barrel in the direction of the optical axis while rotating around the optical axis. The position detection mechanism includes a sliding member, a magnetic member and a magnetic sensor that are linked to the focusing member. The driving mechanism is also used to drive the sliding member to move along the optical axis when driving the focusing member to rotate. One of the magnetic member and the magnetic sensor is arranged on the sliding member, and the other is fixedly arranged relative to the focusing lens barrel. The magnetic sensor is used to detect the magnetic signal of the magnetic member in real time to obtain the real-time position of the lens body. The automatic focusing device using the above technical solution reduces the detection range of the magnetic sensor, thereby improving the accuracy and efficiency of automatic focusing.

[0004] The above-mentioned technical solution actually uses a motor to drive the focusing part to drive the lens body to move and then achieve focusing. By using a micro motor with a corresponding focusing part, it can be applied to the endoscope focusing improvement technical solution. However, due to the small structure of the endoscope, the magnetic sensor is combined with a magnetic part to accurately obtain the lens position and then achieve focusing. It takes up a large space, and the strong magnetism will affect the normal operation of the fine components in the endoscope. At the same time, the movement accuracy of ordinary micro motors is low. If a special motor with high movement accuracy is used, the production cost will increase exponentially.

[0005] Therefore, improvements are made to address the above problems. Summary of the invention

[0006] In view of the above defects or improvement needs of the prior art, the present invention provides an endoscope and an endoscope automatic focusing method, which aims to solve the technical problem that the current image distance cannot be accurately known during the focusing process of the endoscope, resulting in inaccurate subsequent focusing. The detailed technical solution of the present invention is as follows.

[0007] An endoscope comprises an endoscope body shell, an endoscope body connected to the front end of the endoscope body shell, and an image sensor, an optical lens, a focusing module, a detection module and a control module all connected to the endoscope body shell, wherein the control module is respectively connected to the image sensor, the focusing module and the detection module by signal; wherein:

[0008] The optical lens is configured to be located at the rear end of the endoscope body;

[0009] The image sensor is configured to be connected to the focusing module and located on the optical axis of the optical lens, and the image sensor is used to acquire a current image and send it to the control module;

[0010] The focusing module is configured to be located at the rear end of the optical lens, and is used to adjust the image distance of the image sensor;

[0011] The detection module is configured to obtain a current image distance of the image sensor and generate a corresponding photoelectric signal to send to the control module;

[0012] The control module is configured to determine whether the current image distance matches the object distance based on the current image and the photoelectric signal, and if not, control the focus module to adjust the image distance to match the object distance of the current image.

[0013] Preferably, the focusing module includes a motor, a focusing mechanism and a guide rail, the focusing mechanism and the motor are both arranged on the optical axis and are sequentially arranged in the endoscope body housing along the front to rear direction, the guide rail is arranged around the outside of the optical lens, the focusing mechanism is movably connected to the guide rail, the image sensor is fixedly connected to the focusing mechanism, and the output shaft of the motor is connected to the focusing mechanism.

[0014] Preferably, the length direction of the guide rail is parallel to the optical axis direction.

[0015] Preferably, the detection module includes an optical coupler and a baffle, the baffle is connected to the focusing mechanism, and the optical coupler is fixedly connected to the endoscope body shell.

[0016] Preferably, the optical coupler is a reflective optical coupler or a transmissive optical coupler.

[0017] Preferably, the optical coupler includes a light emitting device for emitting a light signal and a light sensing device for sensing a light signal.

[0018] Preferably, the number of the light-emitting devices is one or more, and the number of the photosensitive devices is one or more.

[0019] An endoscope automatic focusing method, applied to the endoscope as described above, comprises the following steps:

[0020] S100, based on the image sensor, acquiring the current image and sending it to a control module;

[0021] S200, the control module determines whether the current image is in a focused state according to the defocus parameter in the current image. If the defocus parameter does not meet the preset condition, the current image is in a focused state and no subsequent operation is performed; otherwise, if the defocus parameter meets the preset condition, the current image is in an out-of-focus state and S300 is executed;

[0022] S300, the control module obtains the first photoelectric signal corresponding to the current image distance of the image sensor through the detection module, and the control module calculates the focusing parameters of the image sensor corresponding to the current image in a focused state through the defocus parameter and the first photoelectric signal, wherein the focusing parameters include the target image distance corresponding to the image sensor corresponding to the current image in a focused state and the second photoelectric signal corresponding to the target;

[0023] S400: Based on the focusing parameters, the control module controls the focusing module to drive the image sensor to move in the optical axis direction, and when the detection module detects the second photoelectric signal, the image sensor completes focusing at the target image distance.

[0024] Preferably, the photoelectric signal detected by the detection module is a photosensitive current, and the control module processes the photosensitive current into a corresponding photosensitive voltage, which corresponds one-to-one with the image distance.

[0025] Preferably, the control module processes the photosensitive current into a photosensitive voltage by the following formula and corresponds it to the image distance one by one:

[0026] U = IR;

[0027] v = f(U), v∈A;

[0028] v = u / k;

[0029] Among them, I is the photosensitive current detected by the detection module, R is the resistance of the fixed resistor through which the photosensitive current flows in the control module, U is the photosensitive voltage obtained after calculation by the control module, v is the image distance, u is the object distance, k is a constant, f(U) is the mapping of the photosensitive voltage U to the image distance v, and A is the travel range of the image sensor.

[0030] The beneficial effects of the present invention are:

[0031] (1) Accurately obtain the image distance through the cooperation of optical coupler and baffle, with simple structure, convenient operation and small space occupation;

[0032] (2) The motor does not need to have high motion accuracy during the focusing process, so there are more motor models to choose from, effectively reducing costs;

[0033] (3) By combining the light-emitting device and the light-sensing device on the optocoupler, a wider range of position detection can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is an overall schematic diagram of the endoscope of the present invention;

[0035] Figure 2 is a schematic diagram of the interior of the endoscope body of the present invention;

[0036] Figure 3 It is a schematic diagram of the relationship between the object, imaging and optical lens of the present invention and a current change diagram;

[0037] Figure 4 is a schematic diagram of the position and current variation of a reflective optical coupler according to a second embodiment of the present invention;

[0038] Figure 5 1 is a schematic diagram of the position of a transmission type optical coupler and a current variation diagram of a third embodiment of the present invention;

[0039] Figure 6 The fourth embodiment of the present invention has a light emitting device and two light sensing devices, and a current variation diagram;

[0040] Figure 7 is a schematic diagram of the positions of two light-emitting devices and one photosensitive device and a current variation diagram of embodiment 5 of the present invention;

[0041] Figure 8 is a schematic diagram of the positions of two light-emitting devices and two light-sensing devices according to a sixth embodiment of the present invention;

[0042] Fig. 9 This is a schematic diagram of the positions of multiple light-emitting devices and multiple photosensitive devices in embodiment 6 of the present invention.

[0043] In the figure: 1. endoscope; 1-1. endoscope body; 1-2. optical lens; 2. optical coupler; 3. focusing mechanism; 3-1. guide rail; 3-2. motor; 3-3. motor fixing bracket; 3-4. baffle. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0045] Embodiment 1

[0046] refer to Figure 1 , Figure 2 As shown, this embodiment protects an endoscope, including an endoscope body shell, an endoscope body connected to the front end of the endoscope body shell, and an image sensor, an optical lens, a focusing module, a detection module and a control module all connected to the endoscope body shell, wherein the control module is respectively connected to the image sensor, the focusing module and the detection module by signal; wherein,

[0047] The optical lens is configured to be located at the rear end of the endoscope body;

[0048] The image sensor is configured to be connected to the focusing module and located on the optical axis of the optical lens, and the image sensor is used to acquire a current image and send it to the control module;

[0049] The focusing module is configured to be located at the rear end of the optical lens, and is used to adjust the image distance of the image sensor;

[0050] The detection module is configured to obtain a current image distance of the image sensor and generate a corresponding photoelectric signal to send to the control module;

[0051] The control module is configured to determine whether the current image distance matches the object distance based on the current image and the photoelectric signal, and if not, control the focus module to adjust the image distance to match the object distance of the current image.

[0052] As a preferred solution of this embodiment, the focusing module includes a motor, a focusing mechanism and a guide rail. The focusing mechanism and the motor are both arranged on the optical axis and are sequentially arranged in the endoscope body housing along the front to back direction. The guide rail is arranged around the outside of the optical lens. The focusing mechanism is movably connected to the guide rail. The image sensor is fixedly connected to the focusing mechanism, and the output shaft of the motor is connected to the focusing mechanism.

[0053] Specifically, the control module includes an MCU (Microcontroller Unit) and a fixed-value resistor. The MCU is used to record the photosensitive voltage generated after the light flows through the fixed-value resistor and the image distance corresponding to the photosensitive voltage.

[0054] As a preferred solution of this embodiment, the length direction of the guide rail is parallel to the optical axis direction.

[0055] As a preferred solution of this embodiment, the detection module includes an optical coupler and a baffle, the baffle is connected to the focusing mechanism, and the optical coupler is fixedly connected to the endoscope body shell.

[0056] As a preferred solution of this embodiment, the optical coupler includes a light emitting device for emitting a light signal and a light sensing device for sensing a light signal.

[0057] As a preferred solution of this embodiment, the number of the light-emitting devices is one or more, and the number of the photosensitive devices is one or more.

[0058] Working process of each component:

[0059] Focusing movement: an endoscope body 1-1 is provided at one end of the endoscope 1, a guide rail 3-1 and a motor fixing frame 3-3 are fixedly connected to the inner side of the endoscope body 1-1, a focusing mechanism 3 is slidably connected to the guide rail 3-1, and a motor 3-2 is fixedly connected to the motor fixing frame 3-3. The motor 3-2 is started to drive the focusing mechanism 3 to move horizontally guided by the guide rail 3-1;

[0060] Photocoupler luminescence and light sensing: a photocoupler 2 is fixedly installed on the inner side of the endoscope 1, and the photocoupler 2 is started to emit and sense light signals; a baffle 3-4 for shielding or reflecting the photocoupler 2 is provided on one side of the focusing mechanism 3, and the focusing mechanism 3 moves away from or approaches the photocoupler 2, and the photocoupler 2 senses light signals due to the blocking or reflection of the baffle 3-4, and the photosensitive current IL output by the photocoupler 2 increases or decreases synchronously;

[0061] S4, voltage output: after the photosensitive current IL output by the optical coupler 2 changes, the photosensitive current IL is converted into a photosensitive voltage UL according to Ohm's law and output to the MCU;

[0062] S5. Circuit processing: An optical lens 1-2 is also provided inside the endoscope body 1-1. The optical lens 1-2 is fixedly connected to the endoscope 1. The MCU records the photosensitive voltage UL after the focusing mechanism 3 moves, through the function formula k=U / V, where k is a constant, U is the distance from the object to the center of the optical lens 1-2, and V is the distance from the image sensor to the center of the optical lens 1-2.

[0063] Embodiment 2

[0064] In this embodiment, based on the first embodiment, the optical coupler is a reflective optical coupler.

[0065] When in use, when the focusing mechanism 3 is away from the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 is reduced, and the photosensitive current IL output by the optical coupler 2 is synchronously reduced due to the reflection of the baffle 3-4; when the focusing mechanism 3 is close to the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 is increased, and the photosensitive current IL output by the optical coupler 2 is synchronously increased due to the reflection of the baffle 3-4. When the focusing mechanism 3 is marked as a negative number in the reverse direction of the optical coupler 2 and as a positive number in the positive direction of the optical coupler 2, the linear relationship between the distance d and the photosensitive current IL within the photosensitivity range is as follows: Figure 4 shown.

[0066] Embodiment 3

[0067] In this embodiment, based on the first embodiment, the optical coupler is a transmission type optical coupler.

[0068] When in use, when the focusing mechanism 3 is away from the light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 increases, is blocked by the baffle 3-4, and the photosensitive current IL output by the photosensitive device of the optical coupler 2 increases synchronously; when the focusing mechanism 3 is close to the light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 decreases, is blocked by the baffle 3-4, and the photosensitive current IL output by the photosensitive device of the optical coupler 2 decreases synchronously. When the focusing mechanism 3 is marked as a negative number in the reverse direction of the optical coupler 2 and as a positive number in the positive direction of the optical coupler 2, the linear relationship between the distance d and the photosensitive current IL within the photosensitivity range is as follows: Figure 5 shown.

[0069] Embodiment 4

[0070] In this embodiment, based on the third embodiment, the transmission type optical coupler includes a light emitting device for emitting light signals and two light sensing devices for sensing light signals.

[0071] When in use, when the focusing mechanism 3 is away from the light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 increases, and the first photosensitive current IL1 output by the first photosensitive device of the optical coupler 2 increases synchronously; when the focusing mechanism 3 is close to the light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 decreases, and the first photosensitive current IL1 output by the first photosensitive device of the optical coupler 2 decreases synchronously. The linear relationship between the distance d and the first photosensitive current IL1 in the first photosensitive range is as follows: Figure 6 As shown by the red solid line. When the focusing mechanism 3 continues to move away from the light-emitting device of the optical coupler 2 beyond the sensing range of the first photosensitive device and enters the photosensitive range of the second photosensitive device, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 continues to increase, and the second photosensitive current IL2 output by the second photosensitive device of the optical coupler 2 increases synchronously. The linear relationship between the distance d and the second photosensitive current IL2 in the second photosensitive range is as follows: Figure 6 As shown by the black solid line, the photosensitive current IL=the first photosensitive current IL1+the second photosensitive current IL2.

[0072] Embodiment 5

[0073] In this embodiment, based on the third embodiment, the transmission type optical coupler includes two light emitting devices for emitting light signals and one light sensing device for sensing light signals.

[0074] When in use, when the focusing mechanism 3 is away from the second light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 increases, and the second light-emitting current IL2 received by the photosensitive device of the optical coupler 2 increases synchronously; when the focusing mechanism 3 is close to the second light-emitting device of the optical coupler 2, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 decreases, and the second light-emitting current IL4 received by the photosensitive device of the optical coupler 2 decreases synchronously; the linear relationship between the distance d and the second light-emitting current IL4 in the second light-emitting range is as follows: Figure 7 As shown by the red dotted line. When the focusing mechanism 3 continues to move away from the second light-emitting device of the optical coupler 2 beyond the light-emitting range of the second light-emitting device and enters the light-emitting range of the first light-emitting device, the distance d between the focusing mechanism 3 and the center of the optical coupler 2 continues to increase, and the first light-emitting current IL3 received by the photosensitive device of the optical coupler 2 increases synchronously. The linear relationship between the distance d and the first light-emitting current IL3 within the first light-emitting range is as follows: Figure 7 The light-sensing current received by the photosensitive device is the sum of the first light-emitting current IL3 and the second light-emitting current IL4. Figure 7 Shown by the solid black line.

[0075] In the fourth embodiment, since the second photosensitive device is farther from the light emitting device than the first photosensitive device, the photosensitive current received is relatively small. Compared with the fourth embodiment, this embodiment can detect photosensitive currents of the same intensity, has a more sensitive operation, a wider detection range, and can directly obtain the photosensitive current data received by the photosensitive device.

[0076] Embodiment 6

[0077] In this embodiment, based on the fourth and fifth embodiments, the transmission type optical coupler includes two light emitting devices for emitting light signals and two light sensing devices for sensing light signals.

[0078] When using, Figure 8 As shown, when the focusing mechanism 3 is away from the second light-emitting device of the optocoupler 2, the distance d between the focusing mechanism 3 and the center of the optocoupler 2 increases, and the second light-emitting current IL4 received by the second photosensitive device of the optocoupler 2 increases synchronously; when the focusing mechanism 3 is close to the second light-emitting device of the optocoupler 2, the distance d between the focusing mechanism 3 and the center of the optocoupler 2 decreases, and the second light-emitting current IL4 received by the second photosensitive device of the optocoupler 2 decreases synchronously. When the focusing mechanism 3 continues to move away from the second light-emitting device of the optocoupler 2 beyond the luminous range of the second light-emitting device and enters the luminous range of the first light-emitting device, the distance d between the focusing mechanism 3 and the center of the optocoupler 2 continues to increase, and the first light-emitting current IL3 received by the photosensitive device of the optocoupler 2 increases synchronously, and the photosensitive current IL2 received by the second photosensitive device is the sum of the first light-emitting current IL3 and the second light-emitting current IL4; when the focusing mechanism 3 continues to move away from the first light-emitting device of the optocoupler 2 beyond the sensing range of the second photosensitive device and enters the photosensitive range of the first photosensitive device, the distance d between the focusing mechanism 3 and the center of the optocoupler 2 continues to increase, and the first photosensitive current IL1 output by the first photosensitive device of the optocoupler 2 increases synchronously, and the photosensitive current IL=first photosensitive current IL1+second photosensitive current IL2.

[0079] Based on this embodiment, Fig. 9 As shown, a third light emitting device, a third photosensitive device, a fourth light emitting device, a fourth photosensitive device, ... an Nth light emitting device, an Nth photosensitive device and other multiple light emitting devices and photosensitive devices can be provided by analogy.

[0080] Embodiment 7

[0081] Based on the first embodiment, this embodiment further provides an endoscope automatic focusing method, which is applied to the endoscope as described above and comprises the following steps:

[0082] S100, based on the image sensor, acquiring the current image and sending it to a control module;

[0083] S200, the control module determines whether the current image is in a focused state according to the defocus parameter in the current image. If the defocus parameter does not meet the preset condition, the current image is in a focused state and no subsequent operation is performed; otherwise, if the defocus parameter meets the preset condition, the current image is in an out-of-focus state and S300 is executed;

[0084] S300, the control module obtains the first photoelectric signal corresponding to the current image distance of the image sensor through the detection module, and the control module calculates the focusing parameters of the image sensor corresponding to the current image in a focused state through the defocus parameter and the first photoelectric signal, wherein the focusing parameters include the target image distance corresponding to the image sensor corresponding to the current image in a focused state and the second photoelectric signal corresponding to the target;

[0085] S400: Based on the focusing parameters, the control module controls the focusing module to drive the image sensor to move in the optical axis direction, and when the detection module detects the second photoelectric signal, the image sensor completes focusing at the target image distance.

[0086] As a preferred solution of this embodiment, the photoelectric signal detected by the detection module is a photosensitive current, and the control module processes the photosensitive current into a corresponding photosensitive voltage, which corresponds one-to-one with the image distance.

[0087] As a more preferred solution of this embodiment, the control module processes the photosensitive current into a photosensitive voltage by the following formula and corresponds it to the image distance one by one:

[0088] U = IR;

[0089] v = f(U), v∈A;

[0090] v = u / k;

[0091] Among them, I is the photosensitive current detected by the detection module, R is the resistance of the fixed resistor through which the photosensitive current flows in the control module, U is the photosensitive voltage obtained after calculation by the control module, v is the image distance, u is the object distance, k is a constant, and f(U) is the mapping of the photosensitive voltage U to the image distance v. This mapping can be obtained based on a finite number of experiments and will not be repeated here.

[0092] Specific examples:

[0093] 1) When the object distance u = a, record the photosensitive current IL a ; According to Ohm's law R = U L / I L ; In the formula, R is the resistance value, U L is the photosensitive voltage, I L is the photosensitive current, through the photosensitive current I L Calculate the photosensitive voltage U L , u=a’s photosensitive voltage is U La ;

[0094] 2) At the same time, according to v = u / k, the image distance at this time is v = a / k = a';

[0095] 3) Set the photosensitive voltage ULa Output to MCU and record, record all the photosensitive voltage U La and the corresponding total image distances, thereby forming a mapping f(U).

[0096] 4) When the object distance u=b, it is known that the image distance should be v=b', and the corresponding photosensitive voltage is U Lb , the corresponding photosensitive current is U Lb ;

[0097] 5) The control module controls the motor to drive the focusing mechanism to move until the detection module detects the photosensitive current U Lb , the focusing is now completed.

[0098] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An endoscope, characterized in that: It includes an endoscope body shell, an endoscope body connected to the front end of the endoscope body shell, and an image sensor, an optical lens, a focusing module, a detection module and a control module all connected to the endoscope body shell, wherein the control module is respectively connected to the image sensor, the focusing module and the detection module by signal; wherein, The optical lens is configured to be located at the rear end of the endoscope body; The image sensor is configured to be connected to the focusing module and located on the optical axis of the optical lens, and the image sensor is used to acquire a current image and send it to the control module; The focusing module is configured to be located at the rear end of the optical lens, and is used to adjust the image distance of the image sensor; The detection module is configured to obtain a current image distance of the image sensor and generate a corresponding photoelectric signal to send to the control module; The control module is configured to determine whether the current image distance matches the object distance based on the current image and the photoelectric signal, and if not, control the focus module to adjust the image distance to match the object distance of the current image.

2. An endoscope according to claim 1, characterized in that: The focusing module includes a motor, a focusing mechanism and a guide rail. The focusing mechanism and the motor are both arranged on the optical axis and are arranged in sequence in the endoscope body shell along the front to back direction. The guide rail is arranged around the outside of the optical lens. The focusing mechanism is movably connected to the guide rail. The image sensor is fixedly connected to the focusing mechanism, and the output shaft of the motor is connected to the focusing mechanism.

3. An endoscope according to claim 2, characterized in that: The length direction of the guide rail is parallel to the optical axis direction.

4. An endoscope according to claim 1, characterized in that: The detection module includes an optical coupler and a baffle, wherein the baffle is connected to the focusing mechanism, and the optical coupler is fixedly connected to the endoscope body shell.

5. An endoscope according to claim 4, characterized in that: The optical coupler is a reflective optical coupler or a transmissive optical coupler.

6. An endoscope according to claim 5, characterized in that: The optical coupler includes a light emitting device for emitting a light signal and a light sensing device for sensing a light signal.

7. An endoscope according to claim 6, characterized in that: The number of the light emitting devices is one or more, and the number of the photosensitive devices is one or more.

8. An endoscope automatic focusing method, applied to the endoscope according to any one of claims 1 to 7, characterized in that: The steps include: S100, based on the image sensor, acquiring the current image and sending it to a control module; S200, the control module determines whether the current image is in a focused state according to the defocus parameter in the current image. If the defocus parameter does not meet the preset condition, the current image is in a focused state and no subsequent operation is performed; otherwise, if the defocus parameter meets the preset condition, the current image is in an out-of-focus state and S300 is executed; S300, the control module obtains the first photoelectric signal corresponding to the current image distance of the image sensor through the detection module, and the control module calculates the focusing parameters of the image sensor corresponding to the current image in a focused state through the defocus parameter and the first photoelectric signal, wherein the focusing parameters include the target image distance corresponding to the image sensor corresponding to the current image in a focused state and the second photoelectric signal corresponding to the target; S400: Based on the focusing parameters, the control module controls the focusing module to drive the image sensor to move in the optical axis direction, and when the detection module detects the second photoelectric signal, the image sensor completes focusing at the target image distance.

9. The endoscope automatic focusing method according to claim 8, characterized in that: The photoelectric signal detected by the detection module is a photosensitive current, and the control module processes the photosensitive current into a corresponding photosensitive voltage, which corresponds one-to-one with the image distance.

10. The endoscope automatic focusing method according to claim 9, characterized in that: The control module processes the photosensitive current into a photosensitive voltage and corresponds to the image distance one by one through the following formula: U = IR; v = f(U), v∈A; v = u / k; Among them, I is the photosensitive current detected by the detection module, R is the resistance of the fixed resistor through which the photosensitive current flows in the control module, U is the photosensitive voltage obtained after calculation by the control module, v is the image distance, u is the object distance, k is a constant, f(U) is the mapping of the photosensitive voltage U to the image distance v, and A is the travel range of the image sensor.