Ranging method and device, image processing equipment and endoscope system

The image of the target object is taken through the endoscope and the distance is calculated using color and brightness, which solves the problem of adding hardware to the endoscope distance measurement, and realizes efficient and accurate distance measurement, reducing manufacturing costs and complexity.

CN119157450APending Publication Date: 2024-12-20CHANGZHOU UNITED IMAGING HEALTHCARE SURGICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411180579.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

When measuring the spatial distance between the endoscope and the target object, existing endoscopes need to add hardware such as infrared probes or laser emitters, resulting in increased manufacturing processes and costs, and are small in size and integrated with a large number of precision components, which is difficult to achieve. Efficient distance measurement.

Method used

The image of the target object is taken through the endoscope, the target color and brightness are determined, and the target distance is calculated using the mapping relationship between the target color and brightness and the endoscope, so as to achieve distance measurement without additional hardware.

Benefits of technology

There is no need to add endoscope hardware, reduce manufacturing processes and costs, improve the accuracy and efficiency of ranging, and simplify endoscope design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119157450A_ABST
    Figure CN119157450A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of image processing, and provides a distance measuring method and device, image processing equipment and an endoscope system.The method comprises the steps that according to an image which is shot by an endoscope and comprises a to-be-measured object, the target color of the to-be-measured object is determined; determining the target brightness of the to-be-measured object; and determining a target distance between the to-be-measured object and the endoscope according to the target color and the target brightness. According to the invention, distance measurement can be realized without adding extra hardware to the endoscope.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular relates to a distance measurement method, device, image processing equipment and endoscope system. Background Art

[0002] Endoscope is a common medical device that relies on light source to enter the human body through natural channels or small incisions made by surgery, so as to directly observe the changes in relevant parts. It is an essential tool for fine internal and surgical examinations and minimally invasive treatments. In recent years, with the development of artificial intelligence, people have used machine learning algorithms, deep learning algorithms, etc. to train a large number of endoscopic image data sets and build models to automatically detect lesions, physiological parts and other objects, and have achieved good results.

[0003] In some scenarios, it is necessary to measure the spatial distance between the endoscope and some target objects (such as lesions, foreign objects or physiological parts, etc.) to assist doctors in clinical operations or judgments, such as measuring the distance between the endoscope and specific physiological parts to assist doctors in biopsy and other operations. Related practices require adding specific hardware to the end of the endoscope head to achieve ranging, such as by adding an infrared probe or laser transmitter to achieve ranging. Although the method of adding specific hardware can achieve ranging, it will bring great challenges to the manufacturing process and cost of the endoscope due to the extremely small size of the end of the endoscope head and the integration of a large number of precision components. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a distance measurement method, an apparatus, an image processing device and an endoscope system, which can achieve distance measurement without adding additional hardware to the endoscope.

[0005] A first aspect of an embodiment of the present application provides a ranging method, including:

[0006] Determining a target color of the object to be measured based on an image including the object to be measured taken by the endoscope;

[0007] Determining the target brightness of the object to be measured;

[0008] The target distance between the object to be measured and the endoscope is determined according to the target color and the target brightness.

[0009] In an implementation of the first aspect, determining the target distance between the object to be measured and the endoscope according to the target color and the target brightness includes:

[0010] The target distance between the object to be measured and the endoscope is determined according to the target mapping relationship associated with the target color and the target brightness, wherein the target mapping relationship is used to characterize the mapping relationship between brightness and distance under a specific color.

[0011] In an implementation of the first aspect, after determining the target distance between the object to be measured and the endoscope, the method further includes:

[0012] When the object to be measured is the wall of the digestive tract and the target distance is less than a first distance threshold, a first prompt information is output, where the first prompt information is used to prompt the user to control the endoscope to stay away from the object to be measured.

[0013] In an implementation of the first aspect, after determining the target distance between the object to be measured and the endoscope, the method further includes:

[0014] When the object to be measured is a polyp and the target distance is greater than a second distance threshold, second prompt information is output, where the second prompt information is used to prompt the user to control the endoscope to approach the object to be measured.

[0015] After determining the target distance between the object to be measured and the endoscope, the method further includes:

[0016] When the object to be measured is a lesion, the target distance is output to a display device so that the display device visually displays the target distance.

[0017] In an implementation of the first aspect, after determining the target distance between the object to be measured and the endoscope, the method further includes:

[0018] Based on the target distance, the size of the object to be measured is measured to obtain the actual size of the object to be measured.

[0019] In an implementation of the first aspect, before determining the target distance between the object to be measured and the endoscope according to the target mapping relationship associated with the target color and the target brightness, the method further includes:

[0020] Determine a designated light source mode when the endoscope captures the image; wherein the endoscope is adapted to multiple light source modes, the colors of the light irradiated by the endoscope to the object to be measured under different light source modes are not completely the same, and the first preset mapping relationship associated with each light source mode is not completely the same, and the designated light source mode is any light source mode among the multiple light source modes;

[0021] The target mapping relationship corresponding to the target color is determined from the first preset mapping relationship associated with the specified light source mode.

[0022] In an implementation of the first aspect, determining the target mapping relationship corresponding to the target color from the first preset mapping relationship associated with the specified light source mode includes:

[0023] Determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not completely the same, and the designated brightness level is any brightness level among the multiple brightness levels;

[0024] Determining the second preset mapping relationship associated with the specified brightness level from the first preset mapping relationship associated with the specified light source mode;

[0025] The target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

[0026] In an implementation of the first aspect, before determining the target distance between the object to be measured and the endoscope according to the target mapping relationship associated with the target color and the target brightness, the method includes:

[0027] Determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not completely the same, and the designated brightness level is any brightness level among the multiple brightness levels;

[0028] The target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

[0029] In an implementation manner of the first aspect, the target mapping relationship associated with the target color is associated with the type of the endoscope, and the content of the target mapping relationship associated with the target color is not completely the same under different types of endoscopes.

[0030] In an implementation of the first aspect, measuring the size of the object to be measured based on the target distance to obtain the actual size of the object to be measured includes:

[0031] determining an actual size of a pixel in the image based on the target distance;

[0032] Acquiring the number of pixels occupied by the object to be measured in the image;

[0033] The product of the number and the actual size of the pixel is determined, and the product is used as the actual size of the object to be measured.

[0034] A second aspect of an embodiment of the present application provides a distance measuring device, including:

[0035] A recognition module, used to determine the target color of the object to be measured based on an image including the object to be measured taken by the endoscope;

[0036] A first determination module, used to determine the target brightness of the object to be measured;

[0037] The second determination module is used to determine the target distance between the object to be measured and the endoscope according to the target color and the target brightness.

[0038] A third aspect of an embodiment of the present application provides an image processing device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0039] A fourth aspect of the embodiments of the present application provides an endoscope system, comprising: a light source device, the image processing device provided in the third aspect above, and an endoscope;

[0040] The endoscope is used to capture the image of the physiological part and send it to the image processing device; the image contains the object to be measured;

[0041] The image processing device is used to perform the distance measurement method based on the image containing the object to be measured.

[0042] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0043] In a first aspect, the embodiment of the present application first extracts the target color and target brightness of the object to be measured from the image taken by the endoscope, and then determines the target distance between the object to be measured and the endoscope in combination with the target brightness and target color, so that the distance can be inferred by using the change of color and brightness. The embodiment of the present application can achieve distance measurement without relying on a specific hardware structure, which can avoid adding burden to the endoscope structure, can reduce the manufacturing process requirements of the endoscope, and effectively reduce the cost required for endoscope distance measurement.

[0044] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 is a schematic diagram of an endoscope system provided in an embodiment of the present application;

[0047] Figure 2 It is a schematic diagram of the implementation process of the ranging method provided in the embodiment of the present application;

[0048] Figure 3 This is an example diagram of the mapping relationship between different colors provided in the embodiment of the present application;

[0049] Figure 4 is an example diagram of the mapping relationship of colors under different shooting conditions provided by an embodiment of the present application;

[0050] Figure 5 It is a flowchart of a method for determining a target mapping relationship provided in an embodiment of the present application;

[0051] Figure 6 is another flowchart of a method for determining a target mapping relationship provided in an embodiment of the present application;

[0052] Figure 7 is another flowchart of a method for determining a target mapping relationship provided in an embodiment of the present application;

[0053] Figure 8 It is a schematic flow chart of a method for determining the actual size of an object provided in an embodiment of the present application;

[0054] Fig. 9 is a schematic diagram of a distance measuring device provided in an embodiment of the present application;

[0055] Fig.10 It is a schematic diagram of an image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0057] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0058] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0059] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0060] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0061] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0062] Please refer to Figure 1 , Figure 11 is a schematic diagram of an endoscope system provided in an embodiment of the present application. The endoscope system may include: a light source device 101, an endoscope 102 (or referred to as a mirror body), an image processing device 103, and a display 104. Among them, the image processing device 103 is the execution subject of the distance measurement method in each of the following embodiments, and completes the distance measurement required by the embodiment of the present application. The following describes each device in turn:

[0063] For Light Source Equipment 101:

[0064] The light source device 101 may include a light source device and an optical element. The light source device is used to generate a light beam of a specific wavelength. The number of light source devices may be one or more, such as 1, 2, 3, 4, 5 or 6. The type of the light source device may be a light-emitting diode (LED) light source or a laser light source, etc., which are not limited here. The optical element may include one or more lenses, such as including but not limited to a collimating lens, a focusing lens, etc.; the optical element may be used to collimate, filter and combine the light beam emitted by the light source device to achieve the combined output of the required specific wavelength band light beam.

[0065] After the light source device 101 and the endoscope 102 are successfully connected through their respective connection parts, the light source device 101 can be used to inject the combined light beam (light) into the end face of the light guide of the endoscope 102, so that the light beam is emitted from the head end of the endoscope 102 to provide illumination light for the endoscope 102. For example, when using the endoscope 102 to perform a digestive tract examination, the light source device 101 injects light into the endoscope 102, and after being transmitted through the light guide in the endoscope 102, the light is irradiated to the digestive tract part being observed through the illumination window at the head end of the endoscope 102, thereby achieving effective illumination of the digestive tract part.

[0066] In some optional embodiments of the present application, the light source device 101 has a variety of light source modes and / or a variety of brightness gears to meet different clinical use requirements. Among them, in different light source modes, the band content covered in the light emitted by the light source device 101 is not exactly the same, that is, the color of the light emitted by the light source device 101 in different light source modes is not exactly the same. For example, in some embodiments, the light source device 101 can support a normal light mode that emits white light or pseudo-white light, and a special light mode that supports emitting special light (non-white other color monochromatic light or composite light). Different brightness gears correspond to the difference in light output brightness of the light source device 101, which can be achieved by adjusting the luminous power of the light source device, or by other means, such as adjusting the physical blocking degree of the emitted light to achieve the final light output brightness change, etc. The specific method is not too limited here. The embodiment of the present application does not make too many restrictions on the number of light source modes and brightness gears supported by the light source device 101, which can be determined according to actual conditions. For example, the light source modes supported by the light source device 101 can be 3, 4, 5, 6 or 7. The number of brightness levels of the light source device 101 can be more flexible. For example, in some embodiments, several to dozens of brightness levels can be set for the user to choose from. In other embodiments, in order to support a more accurate automatic exposure function, hundreds to thousands of brightness levels can be set for use in automatic adjustment. On this basis, only some of the brightness levels can be provided to the user for manual selection, thereby meeting differentiated brightness level adjustment requirements.

[0067] It should be understood that since the endoscope 102 transmits the light emitted by the light source device 101 and then emits it, on the basis that the light source device 101 has multiple light source modes and / or multiple brightness levels, the endoscope 102 can be adapted to multiple light source modes and / or multiple brightness levels accordingly. That is, when the light source device 101 changes the light source mode and / or the brightness level, the color and / or brightness of the light emitted by the endoscope 102 will also be adjusted.

[0068] For Endoscopy 102:

[0069] The endoscope 102 may include: a connecting portion, a hose, an operating portion, and an insertion portion in an elongated shape. The connecting portion is used to connect to the connecting portion of the light source device 101, and the hose contains a light-conducting medium (such as an optical fiber) to transmit light. At the same time, the light-conducting medium runs through the hose, the operating portion, and the insertion portion. The operating portion contains a plurality of control knobs or buttons to control the relevant movements of the insertion portion. The insertion portion includes an insertion tube, a bending portion, and a head end portion, wherein the head end portion is provided with a lighting window for installing a lighting module, an imaging window for installing an imaging module, and an instrument channel window for the use of instruments. More specifically, the lighting module includes a light-conducting medium and a lighting lens group, and the lighting lens group is used to emit the light transmitted by the light-conducting medium at a preset appropriate divergence angle to form a better lighting environment. The imaging module includes an imaging lens group and an image sensor (camera element), and the imaging lens group includes a plurality of lenses. A cable is provided behind the image sensor, and the cable is passed through the entire endoscope 102 to transmit uplink image data and downlink command data.

[0070] Endoscopes can be divided into fixed-focus endoscopes and variable-focus endoscopes (such as bifocal endoscopes and magnifying endoscopes) according to whether the endoscope includes a zoom function. When the endoscope 102 is a fixed-focus endoscope, the spatial positions of the multiple lenses included in the imaging lens group are relatively fixed, so that the focal length of the entire imaging lens group is a fixed value. When the endoscope 102 is a variable-focus endoscope, at least one of the multiple lenses included in the imaging lens group is a movable lens, and the movable lens can move relative to the other lenses, so that the focal length of the entire imaging lens group is variable.

[0071] For the image processing device 103:

[0072] The image processing device 103 is a dedicated processing device specifically used for the endoscope system. The image processing device 103 can perform image processing based on the image collected by the endoscope 102, and send the image processing results to the display 104. At the same time, the image processing device 103 can also perform image analysis processing on the image to achieve some preset functions. For example, in some optional embodiments, the image processing device 103 can perform enhancement processing, physiological part recognition and other processing on the image. The specific image analysis functions supported by the image processing device 103 are not limited here, and can be determined according to the actual application situation.

[0073] In some embodiments, the image processing device 103 and the light source device 101 may be an integrated device (all-in-one machine), that is, a single device has the functions of both the image processing device 103 and the light source device 101 .

[0074] For display 104:

[0075] The display 104 may be a liquid crystal display (LCD), an LED display, a virtual reality (VR) helmet, or other display devices with display capabilities. The display 104 may display the image processing results provided by the image processing device 103. In some examples, the display 104 may display the images captured by the imaging module of the endoscope 102 and the recognition results of the image recognition (such as lesion recognition) performed by the image processing device 103 in real time. In other examples, the display 104 may also display the three-dimensional model obtained by the image processing device 103 based on the image through three-dimensional reconstruction.

[0076] In the embodiments of the present application, the display 104 may also be used to display prompt information. The prompt information may be used to prompt the doctor of a specific event, such as prompting the doctor to approach an object or move away from an object. It should be noted that in some embodiments, the display 104 may be used as a part of the image processing device 103.

[0077] The following describes the workflow of the endoscope system in common clinical scenarios:

[0078] When examining a patient, the medical staff (i.e., the user) can first connect and start the various devices of the endoscope system, and then insert the insertion part into the patient's body. At this time, the light source device 101 emits light into the endoscope 102, and the light is emitted from the lighting window at the head end of the endoscope 102 to the physiological part of the patient's body containing the object to be measured. After being irradiated by the light, the physiological part reflects the irradiated light into the imaging module at the head end, and the imaging module generates an image of the physiological part based on the received reflected light, and transmits the image to the light source device 101 via a cable. The light source device 101 then transmits the image to the image processing device 103. Finally, the image processing device 103 processes the image and sends it to the display 104 for output display. On this basis, the image processing device 103 can also be used as an execution subject to perform the distance measurement method in each of the following embodiments to achieve distance measurement of the physiological part. Among them, according to the different physiological parts actually inspected by the endoscope 102 and the different actual conditions of the specific physiological parts, the specific object content represented by the object to be measured may also be different, which is not too limited here and can be set according to actual needs. For example, in some optional embodiments, the object to be measured may be a normal physiological part such as a part of the digestive tract, or may be some lesion tissues such as polyps, or may be a foreign body in the digestive tract.

[0079] It should also be noted that Figure 1It does not constitute a limitation on the endoscope system. In actual applications, the endoscope system may also include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the endoscope system may also include a trolley, accessory equipment (such as a carbon dioxide air pump), an AI processing device (such as an AI host or a remote server, etc.) specifically used to execute an artificial intelligence (AI) algorithm, etc., which can be determined according to the actual application situation, and this application does not limit this. In addition, there may be certain differences in the connection relationship between the various devices. For example, in some optional embodiments, the endoscope 102 can be connected to the image processing device 103 for communication. For example, in other optional embodiments, when the endoscope system includes an AI processing device, the AI ​​processing device can be set between the image processing device 103 and the display 104, so as to realize the secondary processing and re-display of the image output by the image processing device 103. Correspondingly, depending on the different connection relationships, the data transmission path of the endoscope 102 will also have differences in adaptability, which will not be repeated here.

[0080] like Figure 2 As shown, the ranging method provided in the embodiment of the present application is applied to Figure 1 The image processing device comprises the following steps S101 to S103:

[0081] Step S101 : determining a target color of the object to be measured based on an image of the object to be measured taken by an endoscope.

[0082] In the application, the object to be measured is the object that the endoscope needs to photograph, which can be a lesion on a physiological part (such as a polyp, diseased tissue, etc.), or a foreign body inside a physiological part. In the medical detection scenario, the endoscope relies on a light source to assist in entering the human body through the natural channels of the human body or a small incision made by surgery to collect images of physiological parts (such as the stomach, intestines, etc.). The object to be measured reflects light differently in response to the light source device under different light source modes. Under different light source modes, the color of the object to be measured photographed by the endoscope in the image is different. The light source mode of the endoscope includes but is not limited to ordinary light modes of white light or pseudo-white light, special light modes that emit special light (monochromatic light of other colors other than white or composite light), etc.

[0083] In the application, multiple continuous candidate images can be obtained at one time during the endoscope shooting process. In order to accurately measure the size of the object to be measured, the image used by the image processing device needs to include the complete object to be measured. The image processing device detects the integrity of the object to be measured in the candidate image in real time, and uses the candidate image including the complete object to be measured as the key image. The specific detection method can be a traditional machine learning method or a deep learning method. If the detection result indicates that the candidate image does not include the object to be measured or the object to be measured is incomplete, the subsequent analysis of the image is terminated.

[0084] If the detection result characterizes that the object to be measured is complete, the image processing device may select an image including the complete object to be measured from the key image to measure the distance between the object to be measured and the endoscope.

[0085] In an application, after acquiring an image including a complete object to be measured, the image processing device performs a color recognition operation on the object to be measured in the image to determine a target color presented by the object to be measured in the image.

[0086] Step S102: determining the target brightness of the object to be measured.

[0087] In the application, the color, brightness and distance of the object to be measured in the image are mutually constrained, where the distance refers to the distance between the object to be measured and the endoscope when the endoscope takes the image. In order to determine the distance between the object to be measured and the endoscope, the image processing device also needs to determine the target brightness of the object to be measured in the image. Generally, if the object to be measured is located in the central area of ​​the image, the central brightness of the image can be used as the target brightness of the object to be measured. In other cases, the image processing device can also determine the target brightness of the object to be measured in the following ways: determine multiple pixels associated with the object to be measured in the image; determine the brightness of each pixel, and determine the target brightness of the object to be measured based on the brightness of each pixel. Specifically, the median, variance, mean, etc. of the brightness of all pixels can be used as the target brightness of the object to be measured in the image.

[0088] Step S103: determining a target distance between the object to be measured and the endoscope according to the target color and the target brightness.

[0089] In the application, the image processing device can determine the target distance between the object to be measured and the endoscope according to the target color and the target brightness. Under any shooting condition, the color presented by the object to be measured in the image is associated with a preset mapping relationship, and the preset mapping relationship represents the mapping relationship between the brightness and distance of the object to be measured in the image under the shooting condition. The shooting condition is determined based on at least one of the type of endoscope, the light source mode adapted by the endoscope, and the brightness gear adapted by the endoscope. In the application, if divided according to the purpose, the type of endoscope may include but is not limited to: digestive tract endoscope (such as colonoscope, gastroscope, etc.), body cavity endoscope (such as laparoscope, thoracoscope, etc.), respiratory tract endoscope (such as bronchoscope, etc.). For any type of endoscope, the endoscope is adapted with a variety of light source modes, and the color of the light irradiated by the endoscope to the object to be measured under different light source modes is not exactly the same. The endoscope is adapted with a variety of brightness gears, and the light intensity irradiated by the endoscope to the object to be measured under different brightness gears is different.

[0090] In the application, for each shooting condition, at least one preset mapping relationship can be pre-calibrated through a large amount of experimental data. The image processing device determines the specified shooting condition applied when the endoscope shoots an image including the object to be measured, and then selects the preset mapping relationship associated with the target color from the preset mapping relationship of the specified shooting condition, and determines the target distance between the object to be measured and the endoscope through the preset mapping relationship associated with the target brightness and the target color.

[0091] In the above-mentioned ranging method, the target color and target brightness of the object to be measured are first extracted from the image taken by the endoscope, and then the target distance between the object to be measured and the endoscope is determined by combining the target brightness and target color. In this way, the distance can be inferred by utilizing the changes in color and brightness. The entire process can achieve ranging without relying on a specific hardware structure, which can avoid adding burden to the endoscope structure, reduce the manufacturing process requirements of the endoscope, and effectively reduce the cost required for endoscope ranging.

[0092] In one embodiment, the specific implementation process of step S103 includes: determining the target distance between the object to be measured and the endoscope according to the target mapping relationship associated with the target color and the target brightness, wherein the target mapping relationship is used to characterize the mapping relationship between brightness and distance under a specific color.

[0093] In the application, the mapping relationship associated with any color indicates the relationship between the brightness and distance of the object to be measured under the color, and the target mapping relationship associated with the target color indicates the relationship between the target brightness and distance of the object to be measured under the target color. The mapping relationship of color association can usually be represented by a brightness-distance curve. For any shooting condition (determined based on at least one of the type of endoscope, the light source mode adapted by the endoscope, and the brightness gear adapted by the endoscope), the calibration process of the mapping relationship of each color under any shooting condition includes: first, through a large amount of experimental data, calibrate multiple brightness-distance two-dimensional discrete points for any color under any shooting condition. Then, in a two-dimensional coordinate system constructed by brightness and distance, calibrate multiple discrete points of the color; wherein each discrete point represents the brightness and distance of the corresponding color under specific shooting conditions; finally, fit multiple discrete points in the coordinate system to obtain the brightness-distance curve of the color under specific shooting conditions, and use the brightness-distance curve as the mapping relationship of color association.

[0094] For example, Figure 3 As shown in the figure, the corresponding mapping relationship of a specified color under different shooting conditions (same endoscope, same light source mode, 7 different brightness levels), that is, the brightness-distance curve, under the same light source mode, the trends of different mapping relationships of any specified color under different brightness levels are similar. Figure 4 As shown, the figure shows the mapping relationship between different colors (red, purple) under the same light source mode and the same brightness level (brightness level L1, brightness level L7).

[0095] In the application, the image processing device first obtains the shooting conditions when the endoscope shoots the image of the object to be measured, and then obtains the target mapping relationship of the target color under the shooting conditions. After finding the target mapping relationship, the image processing device inputs the target brightness into the target mapping relationship to obtain the target distance between the object to be measured and the endoscope.

[0096] In this embodiment, the target distance between the object to be measured and the endoscope is determined according to the mapping relationship between the brightness under a specific color and the distance, which can improve the accuracy of the distance measurement.

[0097] In one embodiment, after determining the target distance between the object to be measured and the endoscope, when the object to be measured is the wall of the digestive tract and the target distance is less than a first distance threshold, a first prompt information is output, and the first prompt information is used to prompt the user to control the endoscope away from the object to be measured.

[0098] In the application, when the object to be measured is the wall of the digestive tract, during the process of the endoscope photographing the wall of the digestive tract, if the target distance (i.e., the distance between the endoscope and the wall of the digestive tract) is less than the preset first distance threshold, the object to be measured in the photographed image may not be fully displayed, or the endoscope may cause damage to the wall of the digestive tract (the temperature of the endoscope during operation is higher than the temperature inside the digestive tract, and when the distance is close, there is a risk of burning the wall of the digestive tract). Therefore, when the target distance is less than the preset first distance threshold, the image processing device can output a first prompt message, and the first prompt message can be used to prompt the user (i.e., the endoscope operator) to control the endoscope to stay away from the wall of the digestive tract.

[0099] In the application, the output form of the first prompt information can be text, image, audio, video, etc. Specifically, the image processing device obtains the preset first output form for the first prompt information, converts the first prompt information into warning information adapted to the first output form, and outputs the warning information through the display device. If the first output form is audio, the warning information can be output through the audio player of the display device, and if the first output form is video, the warning information can be played through the video player of the display device, etc.

[0100] In this embodiment, the safety distance monitoring mechanism can not only ensure the integrity of the photographing of the object to be measured, but also avoid damage to physiological parts to improve the safety during the photographing process.

[0101] In one embodiment, after determining the target distance between the object to be measured and the endoscope, when the object to be measured is a polyp and the target distance is greater than a second distance threshold, a second prompt information is output, and the second prompt information is used to prompt the user to control the endoscope to approach the object to be measured.

[0102] In the application, when the object to be measured is a polyp, when the endoscope is used to photograph the polyp, if the target distance (i.e., the distance between the polyp and the endoscope) is greater than the preset second distance threshold, the clarity of the polyp in the captured image may not reach the clarity threshold, which is not conducive to the user observing the morphology of the polyp. Therefore, when the target distance is greater than the preset second distance threshold, the image processing device outputs the second prompt information, which is used to prompt the user to control the endoscope to approach the polyp.

[0103] In the application, the output form of the second prompt information can be text, image, audio, video, etc. The image processing device obtains the preset second output form for the second prompt information, converts the second prompt information, obtains the warning information adapted to the second output form, and outputs it through the display device. If the second output form is audio, the warning information can be output through the audio player of the display device; if the second output form is video, the warning information can be output through the video player of the display device, etc.

[0104] In this embodiment, by setting the second distance threshold, the target distance between the endoscope and the polyp can be accurately measured while meeting the clarity requirement.

[0105] In one embodiment, after determining the target distance between the object to be measured and the endoscope, when the object to be measured is a lesion, the target distance is output to a display device so that the display device visually displays the target distance.

[0106] In applications, when the object to be measured is a lesion (including polyps, cancerous tissues, etc.) in a physiological part, the target distance can be directly output to a display device so that the target distance can be displayed in real time and visually through the display device.

[0107] In this embodiment, the operator can intuitively locate the lesion through the visual display of the target distance, thereby improving the accuracy of lesion positioning.

[0108] In one embodiment, for any object to be measured in a physiological part (such as a polyp, cancerous tissue, foreign body, etc.), after measuring the target distance, the image processing device can output the target distance to a display device for visual display in the display device. In addition, for the case where the object to be measured is the wall of the digestive tract, in the process of visually displaying the target distance, if the target distance (the distance between the wall of the digestive tract and the endoscope) is less than a preset first distance threshold, a first prompt message can be output at the same time, and a preset first output style is adopted, and an alarm message determined based on the first prompt message is output through the display device to prompt the user to control the endoscope away from the wall of the digestive tract. For the case where the object to be measured is a polyp, if the target distance (i.e., the distance between the polyp and the endoscope) is greater than a preset second distance threshold, a second prompt message can be output at the same time, and a preset second output style is adopted, and an alarm message determined based on the second prompt message is output through the display device to prompt the user to control the endoscope to move closer to the polyp.

[0109] In one embodiment, Figure 5 As shown, the step of the image processing device acquiring the target mapping relationship associated with the target color includes the following steps S201 to S202:

[0110] Step S201, determining a designated light source mode when the endoscope captures the image; wherein the endoscope is adapted to a plurality of light source modes, the colors of light irradiated by the endoscope to the object to be measured under different light source modes are not exactly the same, and the first preset mapping relationship associated with each light source mode is not exactly the same, and the designated light source mode is any light source mode among the plurality of light source modes.

[0111] In application, the endoscope is adapted to multiple light source modes. The colors of the light irradiated by the endoscope to the object to be measured in different light source modes are not exactly the same, and the first preset mapping relationship (used to indicate the relationship between the brightness of the color and the distance) associated with each light source mode is not exactly the same. The designated light source mode used by the endoscope when taking images is any light source mode among the multiple light source modes.

[0112] In the application, for the case where the shooting conditions of the endoscope are determined based on the light source mode, a first preset mapping relationship for any light source mode is pre-calibrated through a large amount of experimental data. The first preset mapping relationship is used to indicate the correlation between the brightness of the object to be measured in the image taken by the endoscope and the distance between the object to be measured and the endoscope in any light source mode. The first preset mapping relationship includes the mapping relationship of different colors and different brightness levels in the corresponding light source mode. The image processing device can group the first preset mapping relationship under the light source mode according to color and brightness level to obtain the first preset mapping relationship associated with various colors and the first preset relationship associated with various brightness levels.

[0113] Step S202: determining the target mapping relationship corresponding to the target color from the first preset mapping relationship associated with the specified light source mode.

[0114] In the application, the image processing device first screens all first preset mapping relationships associated with the endoscope by specifying the light source mode, and obtains at least one first preset mapping relationship associated with the specified light source mode. Then, the at least one first preset mapping relationship associated with the specified light source mode is screened for a second time according to the target color, and the target mapping relationship corresponding to the target color is obtained from the first preset mapping relationship.

[0115] In this embodiment, for a scene in which the shooting condition of the endoscope is determined based on the light source mode, the screening operation can be simplified and the screening efficiency can be improved by specifying the light source mode and the target color screening target mapping relationship.

[0116] In one embodiment, Figure 6 As shown, the step of the image processing device acquiring the target mapping relationship associated with the target color includes the following steps S301 to S303:

[0117] Step S301, determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not exactly the same, and the designated brightness level is any brightness level among the multiple brightness levels.

[0118] In the application, for a specified light source mode, the endoscope is adapted to multiple brightness levels. The light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not exactly the same. The specified brightness level when the endoscope takes an image is any brightness level among the multiple brightness levels.

[0119] In the application, for the situation where the shooting conditions of the endoscope are determined based on the light source mode and the brightness level, a second preset mapping relationship for any brightness level is pre-calibrated through a large amount of experimental data, and the second preset mapping relationship is used to indicate the relationship between the brightness of the object to be measured in the image shot by the endoscope and the distance between the object to be measured and the endoscope at any brightness level. The second preset mapping relationship can be grouped according to color and brightness level to obtain the second preset mapping relationship for the association of various colors under the light source mode and the second preset relationship for the corresponding association of various brightness levels.

[0120] Step S302: determining the second preset mapping relationship associated with the specified brightness level from the first preset mapping relationship associated with the specified light source mode.

[0121] In an application, the image processing device screens at least one first preset mapping relationship associated with the specified light source mode according to the specified brightness level when the endoscope captures the image, and obtains at least one second preset mapping relationship associated with the specified brightness level.

[0122] Step S303: determining the target mapping relationship corresponding to the target color from the second preset mapping relationship associated with the specified brightness level.

[0123] In the application, the second preset mapping relationship associated with the specified brightness level includes mapping relationships corresponding to different colors. The second preset mapping relationship associated with the specified brightness level is screened again according to the target color to obtain the target mapping relationship corresponding to the target color.

[0124] In this embodiment, in the specified light source mode, the target mapping relationship is screened by specifying the brightness level and the target color, so that the target mapping relationship can be determined quickly and accurately.

[0125] In one embodiment, Figure 7As shown, the step of the image processing device acquiring the target mapping relationship associated with the target color includes the following steps S401 to S402:

[0126] Step S401, determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not exactly the same, and the designated brightness level is any brightness level among the multiple brightness levels.

[0127] In the application, the endoscope can adapt to a single light source mode, and there are no multiple selection operations for the light source mode. At this time, the shooting condition of the endoscope is determined based on the brightness level. The endoscope can be adapted to multiple brightness levels. For each brightness level, at least one second preset mapping relationship can be calibrated by color, and the second preset mapping relationship associated with each brightness level is not exactly the same. The image processing device determines the specified brightness level when the endoscope shoots an image, and the specified brightness level is any brightness level among the multiple brightness levels adapted by the endoscope.

[0128] Step S402: determining the target mapping relationship corresponding to the target color from the second preset mapping relationship associated with the specified brightness level.

[0129] In an application, according to the target color of the object to be measured, a target mapping relationship associated with the target color is selected from the second preset mapping relationship associated with the specified brightness level.

[0130] In this embodiment, the influence of the light source mode on the distance measurement is ignored, and the target mapping relationship is screened only by specifying the brightness level and the target color, so that the target mapping relationship can be determined quickly and accurately.

[0131] It should be noted that, in one embodiment, the target mapping relationship associated with the target color is associated with the type of the endoscope, and the content of the target mapping relationship associated with the target color is not completely the same under different types of endoscopes.

[0132] In the application, the shooting conditions of the endoscope are determined based on at least one of the type of endoscope, the light source mode adapted by the endoscope, and the brightness level adapted by the endoscope. Therefore, for different types of endoscopes, the content of the target mapping relationship associated with the target color of the object to be measured is not exactly the same. In the application, if divided according to the purpose, the types of endoscopes may include but are not limited to: digestive tract endoscopes (such as colonoscopes, gastroscopes, etc.), body cavity endoscopes (such as laparoscopes, thoracoscopes, etc.), respiratory tract endoscopes (such as bronchoscopes, etc.).

[0133] In this embodiment, the target mapping relationship associated with the target color is selected in combination with the type of endoscope, so that the accuracy of the obtained target mapping relationship can be improved.

[0134] In one embodiment, after executing step 103 , the image processing device may further perform a size measurement operation on the object to be measured: based on the target distance, the size of the object to be measured is measured to obtain the actual size of the object to be measured.

[0135] In applications, in order to determine the size of the object to be measured without adding additional hardware, the distance (the distance between the object to be measured and the endoscope) can be introduced for calculation. The principle of determining the size of the object to be measured based on the distance is that the actual size of the receiving unit of the endoscope's sensor is fixed, and the actual size of the receiving unit actually refers to the size of a single pixel on the imaging sensor on the endoscope. The actual size of each pixel in the image is obtained through the magnification, that is, the size of each pixel in the image is equal to the actual size of the receiving unit divided by the magnification. The magnification is related to the distance and the object distance of the objective lens. Based on this, when the distance is determined, the actual size represented by each pixel is also determined. The size of the object to be measured can be determined by using the number of pixels occupied by the object to be measured and the actual size of the pixel.

[0136] In the application, the image processing device first determines the ratio of the size of a single pixel in the imaging sensor of the endoscope to the magnification as the actual size of the pixel in the image. The magnification is the ratio between the target distance and the object distance of the endoscope. The size of a single pixel on the imaging sensor is usually measured in microns (μm). Then, the total number of pixels occupied by the object to be measured in the image is obtained, and the total number of pixels occupied by the object to be measured in the image is multiplied by the actual size of each pixel in the image to obtain the actual size of the object to be measured.

[0137] For example, if the size of each pixel of the imaging sensor is 2.4 microns and the magnification of the objective lens is 40 times, then the actual size of each pixel on the image is: the actual size of each pixel = 2.4 microns / 40 = 0.06 microns.

[0138] In this embodiment, the target distance is introduced to perform dimension measurement on the object to be measured, which can improve the accuracy of dimension measurement.

[0139] In one embodiment, Figure 8 As shown, the size measurement operation can be implemented through steps S501 to S503:

[0140] Step S501, determining the actual size of pixels in the image based on the target distance.

[0141] In the application, the image processing device determines the ratio between the target distance and the object distance of the endoscope, and determines the magnification of the shooting device based on the ratio. The ratio of the specified size of a single pixel in the imaging sensor of the endoscope to the magnification when the image is captured is used as the actual size of the pixel in the image. The size of a single pixel on the imaging sensor is usually measured in microns (μm).

[0142] Step S502: obtaining the number of pixels occupied by the object to be measured in the image.

[0143] In applications, the actual size of the object to be measured in the image is determined by the number of pixels occupied by the object to be measured and the actual size of the pixels in the image.

[0144] Step S503: determine the product of the number and the actual size of the pixel, and use the product as the actual size of the object to be measured.

[0145] In applications, the actual size of the object to be measured can be obtained by multiplying the total number of pixels occupied by the object to be measured in the image by the actual size of each pixel in the image.

[0146] In this embodiment, by determining the actual size of the pixels in the image based on the target distance, and then calculating the number of pixels occupied by the target object in the image, combined with the actual size of each pixel, the actual size of the object to be measured can be accurately calculated. It provides a simple method for non-contact measurement of the actual size of an object from an image, which is particularly suitable for situations where it is necessary to quickly estimate the size of the object but it is inconvenient to measure it directly.

[0147] The present application also provides a distance measuring device for executing the steps in the distance measuring method embodiment. The distance measuring device can be a virtual appliance in the image processing device, which is run by a processor of the image processing device, or it can be the image processing device itself.

[0148] like Fig. 9 As shown, the distance measuring device 400 provided in the embodiment of the present application includes:

[0149] The recognition module 410 is used to determine the target color of the object to be measured based on the image including the object to be measured taken by the endoscope.

[0150] The first determination module 420 is configured to determine the target brightness of the object to be measured.

[0151] The second determination module 430 is used to determine the target distance between the object to be measured and the endoscope according to the target color and the target brightness.

[0152] In one embodiment, the second determination module is further used to determine the target distance between the object to be measured and the endoscope based on the target mapping relationship associated with the target color and the target brightness, and the target mapping relationship is used to characterize the mapping relationship between brightness and distance under a specific color.

[0153] In one embodiment, the second determination module is further used to output a first prompt message when the object to be measured is a wall of the digestive tract and the target distance is less than a first distance threshold, wherein the first prompt message is used to prompt the user to control the endoscope to move away from the object to be measured.

[0154] In one embodiment, the second determination module is further used to output second prompt information when the object to be measured is a polyp and the target distance is greater than a second distance threshold, wherein the second prompt information is used to prompt the user to control the endoscope to approach the object to be measured.

[0155] In one embodiment, the second determination module is further configured to output the target distance to a display device when the object to be measured is a lesion, so that the display device visually displays the target distance.

[0156] In one embodiment, the second determining module is further configured to measure the size of the object to be measured based on the target distance to obtain an actual size of the object to be measured.

[0157] In one embodiment, the second determination module is also used to determine the designated light source mode when the endoscope captures the image; wherein the endoscope is adapted to multiple light source modes, and the colors of light irradiated by the endoscope to the object to be measured under different light source modes are not exactly the same, and the first preset mapping relationship associated with each light source mode is not exactly the same, and the designated light source mode is any light source mode among the multiple light source modes; the target mapping relationship corresponding to the target color is determined from the first preset mapping relationship associated with the designated light source mode.

[0158] In one embodiment, the second determination module is also used to determine the specified brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, and the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not exactly the same, and the specified brightness level is any brightness level among the multiple brightness levels; the second preset mapping relationship associated with the specified brightness level is determined from the first preset mapping relationship associated with the specified light source mode; the target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

[0159] In one embodiment, the second determination module is also used to determine the specified brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, and the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not exactly the same, and the specified brightness level is any brightness level among the multiple brightness levels; the target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

[0160] In one embodiment, the target mapping relationship associated with the target color is associated with the type of the endoscope, and the content of the target mapping relationship associated with the target color is not completely the same under different types of endoscopes.

[0161] In one embodiment, the second determination module is further used to determine the actual size of the pixels in the image based on the target distance; obtain the number of pixels occupied by the object to be measured in the image; determine the product of the number and the actual size of the pixels, and use the product as the actual size of the object to be measured.

[0162] In applications, each module in the distance measuring device may be a software program module, or may be implemented by different logic circuits integrated in a processor, or may be implemented by multiple distributed processors.

[0163] like Fig.10 As shown, the structure diagram of the image processing device 103 provided in the embodiment of the present application includes: at least one processor 510 ( Fig.10 Only one processor is shown in the figure), a memory 520, and a computer program 530 stored in the memory 520 and executable on the at least one processor 510, wherein the processor 510 implements the steps in any of the above-mentioned embodiments of the ranging method when executing the computer program 530.

[0164] The image processing device 103 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The image processing device may include, but is not limited to, a processor 510 and a memory 520. Those skilled in the art will appreciate that Fig.10 This is only an example of the image processing device 103 and does not constitute a limitation on the image processing device 103 . The image processing device 103 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0165] The processor 510 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0166] In some embodiments, the memory 520 may be an internal storage unit of the image processing device 103, for example, a hard disk or memory of the image processing device 103. In other embodiments, the memory 520 may also be an external storage device of the image processing device 103, for example, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the image processing device 103. Further, the memory 520 may also include both an internal storage unit of the image processing device 103 and an external storage device. The memory 520 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 520 may also be used to temporarily store data that has been output or is to be output.

[0167] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0168] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0169] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0170] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the image processing device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0172] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0173] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0174] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0176] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A distance measurement method, characterized in that: include: Determining a target color of the object to be measured based on an image including the object to be measured taken by the endoscope; Determining the target brightness of the object to be measured; The target distance between the object to be measured and the endoscope is determined according to the target color and the target brightness.

2. The distance measurement method according to claim 1, characterized in that: Determining the target distance between the object to be measured and the endoscope according to the target color and the target brightness includes: The target distance between the object to be measured and the endoscope is determined according to the target mapping relationship associated with the target color and the target brightness, wherein the target mapping relationship is used to characterize the mapping relationship between brightness and distance under a specific color.

3. The distance measurement method according to claim 1 or 2, characterized in that: After determining the target distance between the object to be measured and the endoscope, the method further includes: When the object to be measured is the wall of the digestive tract and the target distance is less than a first distance threshold, a first prompt information is output, where the first prompt information is used to prompt the user to control the endoscope to stay away from the object to be measured.

4. The distance measurement method according to claim 1 or 2, characterized in that: After determining the target distance between the object to be measured and the endoscope, the method further includes: When the object to be measured is a polyp and the target distance is greater than a second distance threshold, second prompt information is output, where the second prompt information is used to prompt the user to control the endoscope to approach the object to be measured.

5. The distance measurement method according to claim 1 or 2, characterized in that: After determining the target distance between the object to be measured and the endoscope, the method further includes: When the object to be measured is a lesion, the target distance is output to a display device so that the display device visually displays the target distance.

6. The distance measurement method according to claim 1 or 2, characterized in that: After determining the target distance between the object to be measured and the endoscope, the method further includes: Based on the target distance, the size of the object to be measured is measured to obtain the actual size of the object to be measured.

7. The distance measurement method according to claim 2, characterized in that: Before determining the target distance between the object to be measured and the endoscope according to the target mapping relationship associated with the target color and the target brightness, the method further includes: Determine a designated light source mode when the endoscope captures the image; wherein the endoscope is adapted to multiple light source modes, the colors of the light irradiated by the endoscope to the object to be measured under different light source modes are not completely the same, and the first preset mapping relationship associated with each light source mode is not completely the same, and the designated light source mode is any light source mode among the multiple light source modes; The target mapping relationship corresponding to the target color is determined from the first preset mapping relationship associated with the specified light source mode.

8. The distance measurement method according to claim 7, characterized in that: The determining the target mapping relationship corresponding to the target color from the first preset mapping relationship associated with the specified light source mode includes: Determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not completely the same, and the designated brightness level is any brightness level among the multiple brightness levels; Determining the second preset mapping relationship associated with the specified brightness level from the first preset mapping relationship associated with the specified light source mode; The target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

9. The distance measurement method according to claim 2, characterized in that: Before determining the target distance between the object to be measured and the endoscope according to the target mapping relationship associated with the target color and the target brightness, the method includes: Determining a designated brightness level when the endoscope captures the image; wherein the endoscope is adapted to multiple brightness levels, the light intensity irradiated by the endoscope to the object to be measured is different at different brightness levels, and the second preset mapping relationship associated with each brightness level is not completely the same, and the designated brightness level is any brightness level among the multiple brightness levels; The target mapping relationship corresponding to the target color is determined from the second preset mapping relationship associated with the specified brightness level.

10. The distance measurement method according to claim 2, 7, 8 or 9, characterized in that: The target mapping relationship associated with the target color is associated with the type of the endoscope, and the content of the target mapping relationship associated with the target color is not completely the same under different types of endoscopes.

11. The distance measurement method according to claim 6, characterized in that: The step of measuring the size of the object to be measured based on the target distance to obtain the actual size of the object to be measured includes: determining an actual size of a pixel in the image based on the target distance; Acquiring the number of pixels occupied by the object to be measured in the image; The product of the number and the actual size of the pixel is determined, and the product is used as the actual size of the object to be measured.

12. A distance measuring device, characterized in that: include: A recognition module, used to determine the target color of the object to be measured based on an image including the object to be measured taken by the endoscope; A first determination module, used to determine the target brightness of the object to be measured; The distance measuring module is used to determine the target distance between the object to be measured and the endoscope according to the target color and the target brightness.

13. An image processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. An endoscope system, characterized in that: include: A light source device, an image processing device and an endoscope as claimed in claim 13; The endoscope is used to capture the image of the physiological part and send it to the image processing device; the image contains the object to be measured; The image processing device is used to implement the steps of the method according to any one of claims 1 to 11 based on the image containing the object to be measured.