Endoscope light adjusting device, method, system, and computer readable storage medium
By analyzing image data from the endoscope, it can determine whether the light source is too close to the tissue and reduce its power, thus solving the problem of tissue burns caused by the endoscope light source and improving safety.
Patent Information
- Application Number
- CN202611392729.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-11-27
AI Technical Summary
During the use of existing endoscopes, the continuous high-power output of the illumination source may cause local tissue burns.
Image data is acquired by the image sensor at the endoscope lens. The power monitoring and adjustment module, image texture analysis module and contact monitoring and judgment module are used to determine whether the endoscope lens is close to the target object. If it is close, the output power of the endoscope light source is reduced.
It effectively avoids burns to tissues caused by the endoscope, improves safety, and does not increase additional hardware costs.
Smart Images

Figure CN123166555A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of endoscopy, and in particular to an endoscope dimming device, method, system, and computer-readable storage medium. Background Technology
[0002] Electronic endoscopes are widely used in assisting the examination and treatment of the digestive tract. They can acquire images of the inside of body cavities and transmit them to a display device for doctors to observe. To achieve the best observation results, electronic endoscopes are usually equipped with an illumination source and a dimming system that adjusts the power of the illumination source to maintain the brightness of the acquired images at an ideal observation level.
[0003] Currently, the power adjustment of illumination sources for electronic endoscopes generally follows the principle of increasing the output power of the illumination source when the overall image brightness is too low. However, in practical applications, there is a problem of local tissue burns caused by continuous high-power output of the illumination source.
[0004] Therefore, improving the safety of endoscope use and avoiding tissue burns is an urgent problem to be solved in the application of endoscopes. Summary of the Invention
[0005] The purpose of this invention is to provide an endoscope dimming device, method, system, and computer-readable storage medium that can improve the safety of endoscope use to a certain extent.
[0006] To solve the above-mentioned technical problems, the present invention provides an endoscope dimming device, comprising:
[0007] The power monitoring and adjustment module is used to adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens.
[0008] The image texture analysis module is used to perform image texture analysis on the image data when the output power exceeds the high power threshold, and obtain the image texture analysis result;
[0009] The contact monitoring and judgment module is used to determine whether the endoscope lens is in close proximity to the target object based on the image texture analysis results.
[0010] The power monitoring and adjustment module is also used to control the output power of the endoscope light source to be reduced to a safe power value if the endoscope lens is in the state of being adjacent to the target object.
[0011] In one embodiment, the contact monitoring and judgment module includes:
[0012] The contact analysis unit is used to determine whether the endoscope lens end meets the single-frame close proximity state based on the current image analysis results.
[0013] The cumulative calculation unit is used to reset the cumulative proximity count to zero when the endoscope lens does not meet the single-frame close proximity condition, and to increment the cumulative proximity count by 1 when the endoscope lens meets the single-frame close proximity condition.
[0014] The cumulative determination unit is used to determine whether the cumulative number of close proximity attempts has reached a preset cumulative threshold. If so, the endoscope lens is in the state of being close to the target object.
[0015] In one embodiment, the image texture analysis module includes:
[0016] An image filtering unit is used to perform spatial domain filtering on the image data to obtain a filtered image.
[0017] An edge detection unit is used to perform edge detection operations on the filtered image to obtain an edge image;
[0018] A morphological processing unit is used to perform morphological processing on the edge image to obtain a morphologically processed image; and to count the number of edge pixels in the morphologically processed image.
[0019] Accordingly, the contact analysis unit is used to compare the number of edge pixels with a preset pixel number threshold. If the number of edge pixels is less than the preset pixel number threshold, the endoscope lens end satisfies the single-frame close proximity state. The preset pixel number threshold is four to seven per thousand of the total number of pixels in the image data.
[0020] In one embodiment, the image texture analysis module further includes a type recognition unit, which is used to identify the image data using a pre-learned and trained target object type classifier to determine the target object type corresponding to the imaging target object;
[0021] Accordingly, the image filtering unit is used to determine the kernel size parameter and standard deviation parameter of the Gaussian filter operator according to the target object type of the imaging target object, and to perform filtering operation on the image data using the Gaussian filter operator to obtain the filtered image;
[0022] The edge detection unit is used to select an edge detection operator from multiple candidate edge detection operators according to the target object type, and to perform edge detection operations on the filtered image using the selected edge detection operator to obtain an edge image; the candidate edge detection operators include Roberts operator, Sobel operator, Prewitt operator and Canny operator;
[0023] Accordingly, the contact analysis unit is used to determine the preset pixel number threshold according to the target type of the imaging target; and compare the number of edge pixels with the preset pixel number threshold.
[0024] In one embodiment, the morphological processing unit is used to perform image dilation and image erosion operations on the edge image sequentially to obtain the morphologically processed image.
[0025] In one embodiment, the power monitoring and adjustment module is used to control the output power of the endoscope light source to remain at the safe power value for a preset time period if the endoscope lens is in the state of being adjacent to the target object; to obtain re-acquired image data, and if the image data of a preset number of consecutively acquired frames all determine that the endoscope lens does not meet the single-frame adjacent state, then the output power of the endoscope light source is adjusted according to the current image data.
[0026] In one embodiment, the power monitoring and adjustment module is used to determine the current illumination brightness of the endoscope light source based on the image data; and to adjust the output power of the endoscope light source based on the deviation between the current illumination brightness and the preset desired image brightness.
[0027] An endoscopic light adjustment method includes:
[0028] Adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens.
[0029] When the output power exceeds the high power threshold, image texture analysis is performed on the image data to obtain the image texture analysis results;
[0030] Based on the image texture analysis results, determine whether the endoscope lens is in close proximity to the target object;
[0031] If the endoscope lens is in a state of being close to the target object, the output power of the endoscope light source is controlled to be reduced to a safe power value.
[0032] An endoscope system includes an endoscope body, an image sensor and an endoscope light source disposed at the endoscope lens end of the endoscope body, and a controller and a memory disposed within the endoscope body.
[0033] The memory is used to store computer programs;
[0034] The controller is configured to execute the computer program to perform the steps of the endoscopic light adjustment method as described above.
[0035] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the endoscope dimming method as described above.
[0036] The present invention provides an endoscope dimming device, method, system, and computer-readable storage medium. The endoscope dimming device includes a power monitoring and adjustment module for adjusting the output power of the endoscope light source based on image data collected by an image sensor in the endoscope lens; an image texture analysis module for performing image texture analysis on the image data when the output power exceeds a high power threshold to obtain image texture analysis results; a contact monitoring and judgment module for determining whether the endoscope lens is in close proximity to a target object based on the image texture analysis results; the power monitoring and adjustment module is further used to control the output power of the endoscope light source to reduce to a safe power value if the endoscope lens is in close proximity to a target object.
[0037] This application addresses two main causes of endoscopic burns to local tissues: excessively high light source power and excessive proximity of the light source to the tissue. The power monitoring and adjustment module monitors the output power of the endoscopic light source when adjusting it based on image data. If the output power is too high, the image analysis module and contact monitoring module jointly analyze whether the endoscope lens is in close proximity to the target object. If both excessive power and proximity to the target object are met, the power monitoring and adjustment module reduces the output power of the endoscopic light source. This precisely prevents unintended interference with the normal high-power operation of the endoscopic light source when the lens is not in contact with the target object. Therefore, this application achieves accurate identification of potential tissue burns from the endoscope and effectively improves the safety of endoscopic use by reducing the light source output power without increasing additional hardware costs. Attached Figure Description
[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 A schematic diagram of the frame structure of the endoscope dimming device provided in the embodiments of this application;
[0040] Figure 2 A schematic diagram of the first type of image data and edge image provided in the embodiments of this application;
[0041] Figure 3 A schematic diagram of the second type of image data and edge image provided in the embodiments of this application;
[0042] Figure 4A statistical coordinate diagram of the number of edge pixels provided in the embodiments of this application;
[0043] Figure 5 A schematic flowchart of the endoscopic dimming method provided in the embodiments of this application;
[0044] In the attached diagram: 100 is the power monitoring and adjustment module, 200 is the image texture analysis module, 201 is the type recognition unit, 202 is the image filtering unit, 203 is the edge detection unit, 204 is the morphological processing unit, 300 is the contact monitoring and judgment module, 301 is the contact analysis unit, 302 is the cumulative calculation unit, and 303 is the cumulative determination unit. Detailed Implementation
[0045] During endoscopic examinations and colonoscopy, surgeons often need to keep the endoscope tip close to the mucosal surface for extended periods to facilitate imaging. When the endoscope tip is so close to the mucosa, the amount of scattered light from the mucosal surface is significantly reduced, resulting in insufficient incident light received by the image sensor and a generally dark image. In such cases, the endoscope's automatic dimming system may misinterpret this as a greater distance between the mucosa and the endoscope tip, continuously increasing the light source's output power to compensate for the insufficient brightness until maximum output is reached. However, when the endoscope tip is so close to the mucosa, the lack of scattering space causes a large amount of illumination light to be absorbed by the tissue rather than scattered. This energy is converted into heat and accumulates on the mucosal surface. If the light source continues to output maximum power, the local tissue temperature will rise rapidly, potentially causing mucosal burns and unnecessary harm to the patient.
[0046] In view of this, the core of the present invention is to provide a technical solution for adjusting the power of the light source in an endoscope, which can accurately and reasonably adjust the output power of the light source by fully combining the output power of the light source and the contact state between the endoscope and the tissue mucosa, thereby effectively avoiding burns to the tissue mucosa caused by the endoscope and improving the safety of endoscope use.
[0047] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] It is understood that the endoscope in this application may have a capsule-like structure, housing an image sensor (e.g., a CMOS image sensor), an endoscope light source (LED cold light source), a controller (which may be an FPGA chip, DSP, or ARM processor), and a wireless communication module. The image sensor and endoscope light source are typically located at the end of the endoscope lens, with the endoscope light source positioned adjacent to the image sensor to provide supplementary lighting for image acquisition. Furthermore, the controller maintains communication connections with the image sensor, endoscope light source, and wireless communication module. In addition to uploading images acquired by the image sensor to the host computer via the wireless communication module, the controller also performs power adjustment functions for the endoscope light source.
[0049] Based on this, such as Figure 1 As shown, Figure 1 This is a schematic diagram of the frame structure of the endoscope dimming device provided in an embodiment of this application. It is understood that... Figure 1 Each module shown is a built-in functional module in the endoscope's controller.
[0050] In one specific embodiment of this application, the endoscope dimming device may include:
[0051] The power monitoring and adjustment module 100 is used to adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens end;
[0052] The image texture analysis module 200 is used to perform image texture analysis on image data when the output power exceeds the high power threshold, and obtain the image texture analysis results.
[0053] The contact detection and judgment module 300 is used to determine whether the endoscope lens is in close proximity to the target object based on the image texture analysis results.
[0054] The power monitoring and adjustment module 100 is also used to control the output power of the endoscope light source to be reduced to a safe power value if the endoscope lens is in close proximity to the target object.
[0055] In this embodiment, the power monitoring and adjustment module 100 can obtain image data collected by the image sensor according to a set sampling period (e.g., 30 frames / second). This image data is the image of the target object in the digestive system captured by the endoscope. Obviously, under normal circumstances, the brightness of this image data should be positively correlated with the output power of the endoscope light source.
[0056] Therefore, in one specific embodiment, the power monitoring and regulation module 100 can be used to:
[0057] The current illumination brightness of the endoscope light source is determined based on the image data, and the output power of the endoscope light source is adjusted according to the deviation between the current illumination brightness and the preset desired image brightness.
[0058] In this embodiment, the power monitoring and adjustment module 100 can acquire image data collected by the image sensor, calculate the corresponding current illumination brightness, and specifically use the average pixel value of the overall image data to represent the current illumination brightness; and dynamically adjust the output power of the endoscope light source using a PID control algorithm based on the deviation between the current illumination brightness and the preset desired illumination brightness; when the current illumination brightness is lower than the preset desired illumination brightness, the output power of the endoscope light source can be increased to improve the image brightness; when the current illumination brightness is higher than the preset desired illumination brightness, the output power of the endoscope light source can be reduced to avoid overexposure of the image data.
[0059] Furthermore, the endoscope light source can be an LED cold light source, and its output power can be controlled by PWM (pulse width modulation) or current regulation. The power monitoring and regulation module 100 obtains the current light source output power value by detecting the actual output current of the light source drive circuit or the PWM duty cycle.
[0060] The power monitoring and adjustment module 100 also compares the output power of the endoscope light source with a preset high power threshold, which can be 80% of the maximum power of the endoscope light source. Currently, the specific value of this high power threshold can be adaptively adjusted according to different endoscope models, light source types, and clinical application scenarios. For example, it can be set in the range of 70% to 90% of the maximum power of the endoscope light source. In short, the high power threshold should be set close to the maximum power of the endoscope light source.
[0061] When the output power of the endoscope light source exceeds the high-power threshold, it indicates that the endoscope light source is operating at high power, posing a risk of burning the imaging target. This triggers the image texture analysis module 200 to start working. Specifically, it needs to determine whether the endoscope lens is in close contact with the imaging target. The image texture analysis module 200 performs image texture analysis on the currently acquired image data.
[0062] In this embodiment, both the high power threshold and the safe power value can be set as a percentage of the maximum output power of the endoscope light source, which facilitates universal compatibility between different types of light sources.
[0063] It is understandable that when there are different relative distances between the endoscope lens and the imaging target, the relative position between the image sensor set at the endoscope lens and the imaging target will also be different, and the imaging texture of the imaging target in the image data collected by the image sensor will also change accordingly. Therefore, in this embodiment, based on this, the image texture analysis module 200 first performs texture recognition analysis on the image data, and then the contact monitoring judgment module 300 further judges whether the endoscope lens is close to the imaging target based on the image texture analysis results.
[0064] In one embodiment, the image texture analysis module 200 may include:
[0065] Image filtering unit 202 is used to perform spatial domain filtering on image data to obtain a filtered image;
[0066] Edge detection unit 203 is used to perform edge detection operations on the filtered image to obtain an edge image;
[0067] The morphological processing unit 204 is used to perform morphological processing on the edge image to obtain a morphologically processed image; and to count the number of edge pixels in the morphologically processed image.
[0068] Accordingly, the contact analysis unit 301 is used to compare the number of edge pixels with a preset pixel number threshold. If the number of edge pixels is less than the preset pixel number threshold, the endoscope lens meets the single-frame close proximity state. The preset pixel number threshold is five per thousand of the total number of pixels in the image data.
[0069] In this embodiment, the image filtering unit 202 can use Gaussian filtering to perform spatial filtering on the image data. Gaussian filtering is a linear smoothing filter that suppresses image noise by calculating the weighted average of each pixel and its neighboring pixels. Specifically, the image filtering unit 202 uses a two-dimensional Gaussian filter kernel to perform convolution operations on the image data. The size (kernel size parameter) and standard deviation of the filter kernel can be configured according to the actual application scenario. The Gaussian filter kernel parameter uses a 5×5 sliding window, and the standard deviation is set to 2. Through Gaussian filtering, thermal noise and shot noise generated by the image sensor under low illumination conditions can be effectively removed.
[0070] Furthermore, the edge detection unit 203 performs edge detection operations on the filtered image to extract edge information from the image. Edge contours are imaging regions in image data where grayscale changes drastically, reflecting texture and structural information within the image data. For example... Figure 2 and Figure 3 As shown, Figure 2 This refers to the image data and edge images corresponding to a relatively greater distance between the endoscope lens and the imaging target. Figure 3This refers to the image data and edge images corresponding to the point where the endoscope lens tip and the imaging target are almost in contact with each other; Figure 2 and Figure 3 The edge images in the images are all binarized images obtained after edge detection of the image data. The white pixels in the binarized images are the corresponding edge texture pixels; while in contrast... Figure 2 and Figure 3 It is obvious Figure 2 The number of white pixels in the image is greater than Figure 3 The number of white pixels; that is, relative to the number of white pixels in the middle; Figure 2 In other words, Figure 3 The edge image contains richer texture and structural information. Therefore, in this embodiment, the richness of edge texture information can be used as a basis for determining whether the endoscope lens is adjacent to the imaging target.
[0071] Furthermore, considering that the endoscope may be located in various parts of the digestive system, such as the esophagus, stomach, and small intestine, the texture of the esophageal mucosa is relatively smooth and sparse, while the villi of the small intestine have a richer texture, and the texture of the gastric mucosa is relatively moderate.
[0072] In an optional embodiment, the image texture analysis module 200 may further include a type recognition unit 201, which is used to identify the image data using a pre-learned target type classifier to determine the target type corresponding to the imaging target.
[0073] This embodiment considers that different parts of the digestive tract system have different surface texture features. For example, the esophageal mucosa has a uniform texture and regular cell arrangement; the gastric mucosa has a large number of glands and gastric pits, with a texture that presents glandular and pitted features; the small intestinal mucosa has a large number of finger-like villi, with a texture that presents villous and tufted features; and the colorectal mucosa has glandular opening structures, with the glandular openings being the main feature of its texture. Therefore, the texture features of imaging targets in different parts of the digestive tract system differ significantly, and their sensitivity to edge detection and optimal parameters also differ. Therefore, automatically identifying the target type corresponding to the current image through a pre-trained target type classifier can provide a basis for subsequent image processing parameter selection.
[0074] In this embodiment, the target object type classifier can employ machine learning models such as Support Vector Machines, Random Forests, or Lightweight Convolutional Neural Networks. During training, a large number of image samples labeled with target object types from endoscopy are collected as training samples. Texture features of the image samples (such as contrast, energy, and homogeneity statistics of the gray-level co-occurrence matrix) are extracted as input features, and the target object type labels are used as supervisory signals for model training. In practical applications, the type recognition unit 201 inputs the current image data into the trained target object type classifier, which then outputs the corresponding target object type recognition result. This recognition process can be completed within milliseconds, without affecting the system's real-time performance.
[0075] Accordingly, the image filtering unit 202 is used to determine the kernel size parameter and standard deviation parameter of the Gaussian filter operator according to the target object type of the imaging target object, and to perform filtering operation on the image data using the Gaussian filter operator to obtain a filtered image.
[0076] When the type recognition unit 201 identifies the imaging target in the image data as esophageal mucosa through the target object type classifier, that is, the corresponding target object type is esophageal mucosa, then the kernel size parameter of the Gaussian filter operator can be selected as 3×3 and the standard deviation is 1. At this time, the smoothing force of the Gaussian filter operator is light, which can preserve the subtle texture of the image data to the greatest extent.
[0077] When the type recognition unit 201 identifies the imaging target in the image data as gastric mucosa through the target object type classifier, that is, the corresponding target object type is gastric mucosa, then the kernel size parameter of the Gaussian filter operator can be selected as 5×5 and the standard deviation is 2. At this time, the Gaussian filter operator uses a medium-sized convolution kernel and standard deviation, which achieves a balance between noise reduction and preservation of detail texture to a certain extent.
[0078] When the type recognition unit 201 identifies the imaging target in the image data as the small intestine through the target type classifier, that is, the corresponding target type is small intestinal villi, then the kernel size parameter of the Gaussian filter operator can be selected as 7×7 and the standard deviation is 2.5. At this time, the smoothing force of the Gaussian filter operator is strong, which will smooth out the fine texture and only retain the more macroscopic outline.
[0079] Based on the above discussion, in this embodiment, for the esophageal mucosa with uniform and smooth texture, a smaller kernel size (e.g., 3×3) and a smaller standard deviation (e.g., 1.0) can be used to avoid erasing the only faint edges. For the gastric mucosa with rich texture, a medium kernel size (e.g., 5×5) and a medium standard deviation (e.g., 2.0) can be used to balance noise reduction and detail preservation. For the small intestinal villi with rich high-frequency texture, a larger kernel size (e.g., 7×7) and a larger standard deviation (e.g., 2.5) can be used to suppress the tiny noise generated by respiration or peristalsis and avoid noise being misjudged as edges. By adaptively selecting the filtering parameters according to the type of target object, the filtering process can be made more accurate, effectively suppressing noise while preserving the true texture information to the greatest extent.
[0080] Furthermore, the edge detection unit 203 can select an edge detection operator from multiple candidate edge detection operators according to the type of the target object, and use the selected edge detection operator to perform edge detection operation on the filtered image to obtain an edge image; the candidate edge detection operators include the Roberts operator, the Sobel operator, the Prewitt operator, and the Canny operator.
[0081] It should be noted that the Roberts operator is computationally simple and fast, suitable for scenes with relatively clear textures and low noise; the Sobel and Prewitt operators are direction-sensitive and incorporate a certain smoothing effect, offering better noise resistance than the Roberts operator; the Canny operator has the best edge detection performance. The optimal edge detection operator varies depending on the target object type: for the well-structured esophageal and colonic mucosa, the Roberts operator can be used to pursue computational efficiency; for the complex structured gastric and duodenal mucosa, the Sobel or Prewitt operators can be used to better extract directional textures; for scenes requiring fine edges, the Canny operator can be used. By adaptively selecting the edge detection operator based on the target object type, an optimal balance between computational efficiency and detection accuracy can be achieved.
[0082] Based on this, the morphological processing unit 204 in the image texture analysis module 200 can be used to perform image dilation and image erosion operations on the edge image in sequence to obtain the morphologically processed image.
[0083] Dilation and erosion are two fundamental operations in mathematical morphology. Dilation, by convolving a structuring element with the image, expands the boundaries of edge regions in the image, filling in small breaks and holes in the edge image and connecting broken edges into complete contours. Erosion, by convolving a structuring element with the image, shrinks the boundaries of edge regions in the image, eliminating isolated noise points and small false edges in the edge image. Performing dilation and erosion operations sequentially (i.e., dilation followed by erosion) can effectively connect real edge segments while filtering out isolated noise points, making the edge image more complete and accurate. The morphological processing unit 204 also counts the number of edge pixels in the morphologically processed image, specifically, it can count the number of non-zero pixels in the morphologically processed image (i.e.,... Figure 3 and Figure 4 The number of white pixels in the image (the number of non-zero pixels) directly reflects the amount of edge information in the image, i.e., the texture complexity of the image.
[0084] Therefore, the contact monitoring and judgment module 300 further analyzes and identifies whether the endoscope lens is close to the imaging target based on the number of edge pixels obtained by the morphological processing unit 204.
[0085] In one specific embodiment, the contact monitoring and judgment module 300 includes:
[0086] The contact analysis unit 301 is used to determine whether the endoscope lens end meets the single-frame close proximity state based on the current image analysis results.
[0087] The cumulative calculation unit 302 is used to reset the cumulative proximity count to zero when the endoscope lens does not meet the single-frame close proximity condition, and to increment the cumulative proximity count by 1 when the endoscope lens meets the single-frame close proximity condition.
[0088] The cumulative determination unit 303 is used to determine whether the cumulative number of close proximity has reached the preset cumulative threshold. If so, the endoscope lens is in a state of being close to the target object.
[0089] In this embodiment, the state of being close to the target object specifically refers to the state in which the endoscope tip is continuously close to or even almost in contact with the tissue mucosa surface, rather than the momentary contact of the endoscope tip briefly passing over the tissue surface.
[0090] It should be noted that during actual endoscopic operation, brief proximity of the endoscope tip to tissue is normal (such as brief contact during insertion). Even with high-power endoscope light source operation, it will not cause burns to the tissue mucosa. Therefore, reducing the output power of the endoscope light source should not be triggered. Power reduction is only necessary as the endoscope light source remains in close proximity to the imaging target for an extended period. Therefore, in this embodiment, a close proximity state is only determined after multiple consecutive frames meet the single-frame close proximity condition, thus distinguishing between brief contact and continuous close proximity and preventing false triggering. Furthermore, the single-frame close proximity state refers to the state determined based on a single frame of image data (generally the current frame image data), where the endoscope tip is close to or even almost in contact with the tissue mucosa surface during image data acquisition.
[0091] As described above, the morphological processing unit 204 can count the number of edge pixels in the morphologically processed image. Correspondingly, the contact analysis unit 301 can be used to compare the number of edge pixels with a preset pixel number threshold. If the number of edge pixels is less than the preset pixel number threshold, the endoscope lens end satisfies the single-frame close proximity state; wherein, the preset pixel number threshold is four to seven per thousand of the total number of pixels in the image data.
[0092] Reference Figure 2 and Figure 3 It can be seen that when the endoscope tip is close to the imaging target, the scattered light from the tissue surface is significantly reduced, and there are very few texture details in the image; while when the endoscope tip is far away from the imaging target, the image contains rich mucosal texture information.
[0093] like Figure 4 As shown, Figure 4 This is a statistical coordinate graph showing the number of edge pixels based on 34 images as samples. Figure 4 The horizontal axis represents the image number (1~34), and the vertical axis represents the statistical value of white pixels in the binarized image after edge detection. Image numbers 1~6 and 27, 29, and 31 are image samples close to the target object. Figure 4 As can be seen, the number of edge pixels is significantly lower when the image is close to the tissue than when it is not. Setting an appropriate pixel count threshold can effectively distinguish scenes that are adjacent to the imaging target. Figure 4 In the embodiment shown, setting the preset pixel threshold to around 6000 is sufficient to achieve accurate differentiation.
[0094] Therefore, the contact analysis unit 301 is specifically used to compare the number of edge pixels in the morphologically processed image with a preset pixel count threshold. If the number of edge pixels is less than the preset pixel count threshold, it indicates that the texture information in the current frame image is very small and the image is smooth, which meets the requirements. Figure 3The image features shown indicate that the endoscopic lens meets the single-frame close proximity condition (i.e., close proximity state). If the number of edge pixels is greater than a preset pixel number threshold, it indicates that the current frame image has rich texture information and meets the requirements. Figure 2 The image features shown are in the normal inspection state. At this time, it is determined that the endoscope lens does not meet the single-frame close proximity condition.
[0095] Furthermore, as mentioned above, in practical applications, different types of tissues exhibit varying texture richness in their normal (non-adjacent) states. Therefore, the preset pixel count threshold used to determine single-frame adjacency should be adjusted accordingly. For example, for sparsely textured esophageal mucosa, the number of edge pixels in the normal state is relatively small, so the preset pixel count threshold should be set low, such as 2‰ to 3‰ of the total pixels, to avoid misjudging it as a single-frame adjacency state in the normal state. For moderately textured gastric mucosa, the preset pixel count threshold can be set to 4‰ to 7‰ of the total pixels. For textured intestinal villi, the number of edge pixels in the normal state is relatively large, so the preset pixel count threshold should be set high, such as 8‰ to 10‰ of the total pixels, to ensure that it is only judged as a single-frame adjacency state when it is truly adjacent (the image is extremely smooth). By adaptively adjusting the preset pixel count threshold according to the target object type, the judgment of single-frame adjacency states can be made more accurate, effectively reducing the misjudgment rate.
[0096] In practical applications, the image texture analysis module 200 and the contact detection judgment module 300 can cooperate with each other. After the category recognition unit identifies the target type of the imaging target, the kernel size parameter and standard deviation of the Gaussian filter operator, the selection of the edge detection operator, and the preset pixel number threshold are adjusted in a coordinated manner based on the target type. For example, when a larger Gaussian filter kernel (stronger smoothing force) is selected, some real fine edges will be smoothed out, resulting in a decrease in the base number of edge pixels under normal conditions. In this case, the preset pixel number threshold should be increased (i.e., the judgment threshold should be lowered) to compensate for the loss of effective edge information caused by the enhanced filtering. Conversely, when a smaller Gaussian filter kernel (weaker smoothing force) is selected, the threshold should be lowered accordingly. This coordinated adjustment strategy ensures the consistency and accuracy of adjacent state judgment under different target types and different parameter combinations. Examples of parameter configurations are as follows: For esophageal mucosa, a 3×3 Gaussian kernel with a standard deviation of 1.0, the Roberts operator, and a preset pixel threshold of 2‰~3‰ of the total pixels are used; for gastric mucosa, a 5×5 Gaussian kernel with a standard deviation of 2.0, the Sobel operator, and a preset pixel threshold of 4‰~7‰ of the total pixels are used; for small intestine or colonic mucosa, a 7×7 Gaussian kernel with a standard deviation of 2.5, the Prewitt or Canny operator, and a preset pixel threshold of 8‰~10‰ of the total pixels are used. By establishing a mapping relationship between the target object type and the Gaussian filter operator parameters, the edge detection operator, and the preset pixel threshold, the image texture analysis module 200 and the contact detection judgment module 300 can jointly achieve fully automatic parameter adaptation. Of course, in practical applications, it is not excluded that the target object type signal can be directly output manually. The image texture analysis module 200 and the contact detection judgment module 300 select different Gaussian filter operator parameters, edge detection operators and preset pixel number thresholds based on the input target object type, which will not affect the implementation of this application.
[0097] After the contact analysis unit 301 determines whether the endoscope lens meets the single-frame close proximity condition based on the currently acquired image data, the accumulation calculation unit 302 further accumulates and counts the number of close proximity events. Specifically, when the contact analysis unit 301 determines that the current frame meets the single-frame close proximity condition, the accumulation calculation unit 302 increments the number of close proximity events by 1; when the contact analysis unit 301 determines that the current frame does not meet the single-frame close proximity condition, the accumulation calculation unit 302 resets the number of close proximity events to zero. This accumulation counting method confirms the determination of whether the endoscope lens is in close proximity to the target object in a time dimension. Only when multiple consecutive frames of image data determine that the endoscope lens meets the single-frame close proximity condition can the number of close proximity events reach the preset accumulation threshold. This method can effectively distinguish between normal short-term contact in clinical practice (such as the endoscope lens quickly passing over the tissue surface, lasting only a few frames) and dangerous continuous close proximity (such as prolonged close proximity to tissue during endoscopy, lasting tens or even hundreds of frames), avoiding accidental power reduction due to short-term contact and ensuring the smoothness of clinical operations.
[0098] The cumulative judgment unit 303 is used to determine whether the cumulative number of close-up contacts has reached a preset cumulative threshold. If the cumulative number of close-up contacts is greater than the preset cumulative threshold, it is determined that the endoscope lens is in close proximity to the target object; if the cumulative number of close-up contacts is less than or equal to the preset cumulative threshold, it is determined that the endoscope lens is not in close proximity to the target object. This preset cumulative threshold can be set according to the frame rate of the image sensor. For example, when the image sensor in the endoscope acquires images at a frame rate of 30 frames / second, the preset cumulative threshold can be set to 15 frames, corresponding to a continuous contact time of 0.5 seconds. That is, when the endoscope lens is in close proximity to the tissue for 0.5 seconds, it is determined to be in close proximity to the target object and a safety intervention is triggered. This time threshold can be adaptively adjusted according to different application scenarios and safety requirements. For example, for tissues with high heat sensitivity, such as esophageal mucosa, a smaller preset cumulative threshold can be set to trigger protection faster; for small intestinal villi with better heat tolerance, a larger threshold can be set to reduce false triggering.
[0099] When the contact monitoring and judgment module 300 determines that the endoscope lens is in close proximity to the target object, the power monitoring and adjustment module 100 controls the output power of the endoscope light source to be reduced to a safe power value. This safe power can be set according to the maximum output power of the endoscope light source. For example, the safe power can be set to 50% of the maximum output power. This safe power effectively reduces the risk of heat accumulation on the tissue surface (halving the output power can significantly reduce the heat input of the imaging target per unit time) while maintaining basic illumination requirements, ensuring that the image sensor can acquire observable images. It should be noted that the specific value of this safe power can be adjusted according to different needs, for example, it can be set in the range of 30% to 60%.
[0100] In one specific embodiment, the power monitoring and adjustment module 100 is used to control the output power of the endoscope light source to remain at a safe power value for a preset time period if the endoscope lens is in a state of being close to the target object; and to obtain re-acquired image data. If the image data of a preset number of consecutively acquired frames all determine that the endoscope lens does not meet the single-frame close proximity state, the output power of the endoscope light source is adjusted according to the current image data.
[0101] In this embodiment, the power monitoring and adjustment module 100 reduces the output power of the light source to a safe power value and then controls the endoscope light source to maintain this safe power for at least a predetermined time. This ensures that the imaging target has sufficient time to dissipate heat and avoids affecting the safety protection effect due to frequent power fluctuations. During the process of maintaining the safe power, image data can be continuously acquired for texture analysis. If, at the predetermined time point, a preset number of consecutive frames (e.g., 30 consecutive frames) of image data all indicate that the endoscope lens does not meet the single-frame close proximity condition, it means that the endoscope lens has moved away from the surface of the imaging target. At this time, the safe control state is automatically exited, and the power monitoring and adjustment module 100 resumes normal automatic dimming based on the image brightness. This ensures that the system can automatically return to normal working mode after the danger is eliminated, without manual intervention, thus improving ease of use.
[0102] Based on the above discussion, the workflow of the endoscope dimming device in this application may include: a power monitoring and adjustment module 100 monitors the output power of the light source in real time, and triggers a safety monitoring state when the output power exceeds a preset high power threshold; subsequently, an image texture analysis module 200 performs image texture complexity analysis on real-time image frames; a contact monitoring and judgment module 300 determines whether the head end is in a state of close proximity to tissue based on the texture analysis results, and introduces time accumulation confirmation; when it is determined to be a single frame close proximity state, the accumulated frame count is incremented; when it is determined to be a non-close proximity state, the accumulated frame count is cleared to zero; when the accumulated frame count exceeds a preset frame count threshold, the power detection and adjustment module generates a power suppression command to control the output power of the endoscope light source to be reduced to a safe power value.
[0103] In summary, this application addresses two main causes of endoscopic burns to local tissues: excessively high light source power and excessive proximity of the light source to the tissue. When the power monitoring and adjustment module adjusts the output power of the endoscopic light source based on image data, it monitors the output power. If the output power is too high, the image analysis module and contact monitoring module jointly analyze whether the endoscope lens is in close proximity to the target object. If both excessive output power and proximity to the target object are met, the power monitoring and adjustment module reduces the output power of the endoscopic light source. This precisely avoids unintended interference with the normal high-power operation of the endoscopic light source when the endoscope lens is in a non-contact state. Therefore, this application, without increasing additional hardware costs, automatically and accurately identifies potential tissue burns from the endoscope and takes appropriate intervention measures, effectively improving the safety of endoscope use.
[0104] like Figure 5 As shown, Figure 5 This is a schematic flowchart of the endoscope dimming method provided in the embodiments of this application.
[0105] In one specific embodiment, the endoscopic light adjustment method may include:
[0106] S1: Adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens;
[0107] S2: When the output power exceeds the high power threshold, perform image texture analysis on the image data to obtain the image texture analysis results;
[0108] S3: Based on the image texture analysis results, determine whether the endoscope lens is in close proximity to the target object;
[0109] S4: If the endoscope lens is in close proximity to the target object, control the output power of the endoscope light source to reduce to a safe power value.
[0110] In one specific embodiment, step S1 above may further include:
[0111] Based on the image data, the current illumination brightness of the endoscope light source is determined; based on the deviation between the current illumination brightness and the preset desired image brightness, the output power of the endoscope light source is adjusted.
[0112] In one specific embodiment, step S2 above may further include:
[0113] S21: Perform spatial filtering on the image data to obtain a filtered image;
[0114] S22: Perform edge detection operation on the filtered image to obtain an edge image;
[0115] S23: Perform morphological processing on the edge image to obtain a morphologically processed image; count the number of edge pixels in the morphologically processed image;
[0116] Accordingly, step S3 above may include:
[0117] The number of edge pixels is compared with a preset pixel number threshold. If the number of edge pixels is less than the preset pixel number threshold, the endoscope lens end satisfies the single-frame close proximity state. The preset pixel number threshold is five per thousand of the total number of pixels in the image data.
[0118] In one specific embodiment, step S23 above may include performing image dilation and image erosion operations on the edge image sequentially to obtain the morphologically processed image.
[0119] In one specific embodiment, step S2 above may further include:
[0120] S200: Using a pre-learned target object type classifier, the image data is identified to determine the target object type corresponding to the imaging target object;
[0121] S210: Based on the target object type of the imaging target, determine the kernel size parameter and standard deviation parameter of the Gaussian filter operator, and use the Gaussian filter operator to perform filtering operations on the image data to obtain the filtered image;
[0122] S220: Select an edge detection operator from multiple candidate edge detection operators according to the target object type, and perform edge detection operation on the filtered image using the selected edge detection operator to obtain an edge image; the candidate edge detection operators include Roberts operator, Sobel operator, Prewitt operator and Canny operator;
[0123] S230: Perform morphological processing on the edge image to obtain a morphologically processed image; count the number of edge pixels in the morphologically processed image.
[0124] Accordingly, step S3 above may include: determining the preset pixel number threshold based on the target type of the imaging target; and comparing the number of edge pixels with the preset pixel number threshold.
[0125] In one specific embodiment, the above-described S3 step may further include:
[0126] S31: Based on the current image analysis results, determine whether the endoscope lens end meets the single-frame close proximity state;
[0127] S32: If the endoscope lens does not meet the single-frame close proximity condition, the cumulative close proximity count is reset to zero; if the endoscope lens meets the single-frame close proximity condition, the cumulative close proximity count is incremented by 1.
[0128] S33: Determine whether the cumulative number of close approaches has reached a preset cumulative threshold. If so, the endoscope lens is in the state of being close to the target object.
[0129] In one specific embodiment, step S4 above may further include:
[0130] S41: If the endoscope lens is in the state of being close to the target object, control the output power of the endoscope light source to remain at the safe power value for a preset time.
[0131] S42: Obtain reacquired image data. If the image data of the preset number of consecutively acquired frames all determine that the endoscope lens does not meet the single-frame close proximity state, then adjust the output power of the endoscope light source according to the current image data.
[0132] The specific implementation steps and principles of the endoscopic light adjustment method in this embodiment correspond to the functions of each module of the aforementioned endoscopic light adjustment device, and will not be repeated here. This method can also achieve the technical effect of accurately identifying special scenarios where the tip is close to the tissue and avoiding tissue thermal damage caused by misadjustment of the light source.
[0133] This application also discloses an endoscope system, comprising:
[0134] Endoscope body;
[0135] An image sensor and an endoscope light source are installed at the endoscope lens end of the endoscope body, and a controller and memory are installed inside the endoscope body;
[0136] Memory is used to store computer programs;
[0137] The controller is used to execute the computer program to implement the steps of the aforementioned endoscopic dimming method.
[0138] This endoscope system implements the dimming scheme of this application through a combination of hardware and software, and has the advantages of low implementation cost, easy deployment and upgrade.
[0139] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned endoscope dimming method.
[0140] The computer-readable storage medium may be random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art; the computer-readable storage medium can be applied to various endoscopic devices or general-purpose computer devices, which facilitates the widespread dissemination and application of the technical solution of this application.
[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0142] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. An endoscope dimming device, characterized in that, include: The power monitoring and adjustment module is used to adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens. The image texture analysis module is used to perform image texture analysis on the image data when the output power exceeds the high power threshold, and obtain the image texture analysis result; The contact monitoring and judgment module is used to determine whether the endoscope lens is in close proximity to the target object based on the image texture analysis results. The power monitoring and adjustment module is also used to control the output power of the endoscope light source to be reduced to a safe power value if the endoscope lens is in the state of being adjacent to the target object.
2. The endoscope dimming device as described in claim 1, characterized in that, The contact monitoring and judgment module includes: The contact analysis unit is used to determine whether the endoscope lens end meets the single-frame close proximity state based on the current image analysis results. The cumulative calculation unit is used to reset the cumulative proximity count to zero when the endoscope lens does not meet the single-frame close proximity condition, and to increment the cumulative proximity count by 1 when the endoscope lens meets the single-frame close proximity condition. The cumulative determination unit is used to determine whether the cumulative number of close proximity attempts has reached a preset cumulative threshold. If so, the endoscope lens is in the state of being close to the target object.
3. The endoscope dimming device as described in claim 2, characterized in that, The image texture analysis module includes: An image filtering unit is used to perform spatial domain filtering on the image data to obtain a filtered image. An edge detection unit is used to perform edge detection operations on the filtered image to obtain an edge image; A morphological processing unit is used to perform morphological processing on the edge image to obtain a morphologically processed image; and to count the number of edge pixels in the morphologically processed image. Accordingly, the contact analysis unit is used to compare the number of edge pixels with a preset pixel number threshold. If the number of edge pixels is less than the preset pixel number threshold, the endoscope lens end satisfies the single-frame close proximity state. The preset pixel number threshold is four to seven per thousand of the total number of pixels in the image data.
4. The endoscope dimming device as described in claim 3, characterized in that, The image texture analysis module also includes a type recognition unit, which is used to identify the image data using a pre-learned and trained target object type classifier, and determine the target object type corresponding to the imaging target object in the image data; Accordingly, the image filtering unit is used to determine the kernel size parameter and standard deviation parameter of the Gaussian filter operator according to the target object type, and to perform filtering operation on the image data using the Gaussian filter operator to obtain the filtered image; The edge detection unit is used to select an edge detection operator from multiple candidate edge detection operators according to the target object type, and to perform edge detection operations on the filtered image using the selected edge detection operator to obtain an edge image; the candidate edge detection operators include Roberts operator, Sobel operator, Prewitt operator and Canny operator; Accordingly, the contact analysis unit is used to determine the preset pixel number threshold according to the target type of the imaging target; and compare the number of edge pixels with the preset pixel number threshold.
5. The endoscope dimming device as described in claim 3, characterized in that, The morphological processing unit is used to perform image dilation and image erosion operations on the edge image sequentially to obtain the morphologically processed image.
6. The endoscope dimming device as described in any one of claims 1 to 5, characterized in that, The power monitoring and adjustment module is used to control the output power of the endoscope light source to remain at the safe power value for a preset time period if the endoscope lens is in the state of being close to the target object. If the image data is reacquired and the image data of a preset number of consecutive frames are all determined to be in a state of single-frame contiguousness at the endoscope lens end, then the output power of the endoscope light source is adjusted according to the current image data.
7. The endoscope dimming device as described in claim 1, characterized in that, The power monitoring and adjustment module is used to determine the current illumination brightness of the endoscope light source based on the image data; and to adjust the output power of the endoscope light source based on the deviation between the current illumination brightness and the preset desired image brightness.
8. An endoscope light adjustment method, characterized in that, include: Adjust the output power of the endoscope light source based on the image data collected by the image sensor in the endoscope lens. When the output power exceeds the high power threshold, image texture analysis is performed on the image data to obtain the image texture analysis results; Based on the image texture analysis results, determine whether the endoscope lens is in close proximity to the target object; If the endoscope lens is in a state of being close to the target object, the output power of the endoscope light source is controlled to be reduced to a safe power value.
9. An endoscope system, characterized in that, It includes an endoscope body, an image sensor and an endoscope light source disposed at the endoscope lens end of the endoscope body, and a controller and a memory disposed within the endoscope body; The memory is used to store computer programs; The controller is configured to execute the computer program to perform the steps of the endoscopic dimming method as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the endoscopic dimming method as described in claim 8.
