Endoscope light source brightness adjustment method and device, electronic device and storage medium
By employing technical means, including methods for adjusting the brightness of the endoscopic light source, the problem of the light source brightness not being able to adapt to the working environment in existing technologies has been solved. This has enabled adaptive adjustment of the endoscopic light source brightness, thereby improving the accuracy of diagnosis.
Patent Information
- Application Number
- CN202310026402.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-01-09
AI Technical Summary
The existing methods for adjusting the brightness of electronic endoscope light sources are not suitable for current working scenarios, leading to missed or false lesions. Furthermore, manual adjustment increases surgical time and the burden on users.
By acquiring the current frame image of the endoscope light source at the current brightness, determining the brightness evaluation value based on the image brightness value and the position information of the target object, and adjusting the light source brightness to adapt to the current scene.
It improves the accuracy of endoscopic light source brightness adjustment, avoids missed or false lesion detection, reduces the need for manual adjustment, and improves diagnostic accuracy.
Smart Images

Figure CN116528056B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical equipment, in particular to an endoscope light source brightness adjustment method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the vigorous development of electronic endoscopy technology and related medical instrument industry in recent years, the types of electronic endoscopes are rapidly increasing, the application scenarios of electronic endoscopes are also increasing, and further, the demand for intelligence of electronic endoscopes is also increasing.
[0003] Most of the existing electronic endoscopes use fixed brightness or brightness fixed and step-adjustable illumination devices as light sources. If an electronic endoscope with a fixed brightness light source is used for lesion detection, due to the complex internal tissue structure of the human body and the absence of a natural light source, the doctor may miss or misdiagnose the lesion due to an overly dark or overly bright picture. Even if a brightness fixed and step-adjustable illumination device is used as the light source of the endoscope, when the endoscope is used for lesion detection, the light source brightness can only be adjusted according to the set brightness level, and the adjusted light source brightness cannot adapt to the current working scenario, thereby causing the doctor to miss or misdiagnose the lesion.
[0004] To address the issue of the endoscope light source brightness adjustment method being unable to adapt to the current working scenario in the related art, there is no effective solution yet. SUMMARY
[0005] An endoscope light source brightness adjustment method, device, electronic device and storage medium are provided in the embodiments to address the issue of the endoscope light source brightness adjustment method being unable to adapt to the current working scenario in the related art.
[0006] In a first aspect, an endoscope light source brightness adjustment method is provided in the embodiments, including:
[0007] Obtaining a current frame image of an endoscope light source at a current brightness;
[0008] Determining a brightness evaluation value of the current frame image according to a brightness value of the current frame image and position information of a target object in the current frame image;
[0009] Adjusting the brightness of the light source of the endoscope according to the brightness evaluation value.
[0010] In some embodiments, the determining of the brightness evaluation value of the current frame image according to the brightness value of the current frame image and the position information of the target object in the current frame image includes:
[0011] Dividing the current frame image into a plurality of sub-images;
[0012] determining a brightness value of a target sub-image, and position information of a target object in the target sub-image, the target sub-image being any one of a plurality of sub-images;
[0013] determining a position saliency parameter of the target object in the target sub-image according to the position information;
[0014] determining a brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter;
[0015] determining a brightness evaluation value of the current frame image according to brightness evaluation values of all sub-images.
[0016] In some embodiments, the determining the brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter comprises:
[0017] multiplying the brightness value of the target sub-image by the position saliency parameter to determine the brightness evaluation value of the target sub-image;
[0018] the determining the brightness evaluation value of the current frame image according to brightness evaluation values of all sub-images comprises:
[0019] determining a minimum value among the brightness evaluation values of all sub-images as the brightness evaluation value of the current frame image.
[0020] In some embodiments, the determining the brightness value of the target sub-image comprises:
[0021] determining pixel values of each pixel point in the target sub-image in R, G, and B channels;
[0022] determining brightness evaluation weights of the current frame image in R, G, and B channels according to a working level of an endoscope light source when the current frame image is acquired;
[0023] determining a brightness value of each pixel point in the target sub-image according to the pixel values of each pixel point in R, G, and B channels and the brightness evaluation weights of the corresponding channels;
[0024] determining the brightness value of the target sub-image as an average value of the brightness values of all pixel points in the target sub-image.
[0025] In some embodiments, the position information of the target object in the target sub-image comprises:
[0026] determining a minimum circumscribed rectangle of the target object in the target sub-image;
[0027] According to a distance between a midpoint of the minimum circumscribed rectangle and a midpoint of the target sub-image, position information of the target sub-image is determined.
[0028] In some embodiments, adjusting the light source brightness of the endoscope according to the brightness evaluation value comprises:
[0029] Determining a working level of the endoscope light source when the current frame image is acquired;
[0030] According to the working level, determining a target brightness range of the current frame image;
[0031] According to the target brightness range and the brightness evaluation value, adjusting the light source brightness of the endoscope.
[0032] In some embodiments, adjusting the light source brightness of the endoscope according to the target brightness range and the brightness evaluation value comprises:
[0033] If the brightness evaluation value is greater than a maximum threshold of the target brightness range, then according to a difference between the brightness evaluation value and the maximum threshold, a difference between a maximum threshold and a minimum threshold of the target brightness range, and the working level, a step size of the light source brightness adjustment is determined;
[0034] Or, if the brightness evaluation value is less than the minimum threshold of the target brightness range, then according to a difference between the minimum threshold and the brightness evaluation value, a difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level, a step size of the light source brightness adjustment is determined;
[0035] According to the step size, the light source brightness is adjusted until a brightness evaluation value of an image after the light source brightness adjustment is within a corresponding target brightness range.
[0036] In some embodiments, after adjusting the light source brightness of the endoscope according to the brightness evaluation value, the method further comprises:
[0037] Acquiring the adjusted light source brightness;
[0038] According to the adjusted light source brightness and a maximum value of the brightness of the endoscope light source, determining an adjusted working level of the endoscope light source.
[0039] In a second aspect, an endoscope light source brightness adjustment device is provided in the present embodiment, comprising:
[0040] An acquisition module is configured to acquire a current frame image of an endoscope light source under a current brightness;
[0041] determining a brightness evaluation value of the current frame image according to the brightness value of the current frame image and position information of a target object in the current frame image;
[0042] adjusting the brightness of the light source of the endoscope according to the brightness evaluation value.
[0043] In a third aspect, an electronic device is provided in the embodiment, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the endoscope light source brightness adjustment method in the first aspect when executing the computer program.
[0044] In a fourth aspect, a storage medium is provided in the embodiment, which stores a computer program executable by a processor to implement the endoscope light source brightness adjustment method in the first aspect.
[0045] Compared with the related art, the endoscope light source brightness adjustment method provided in the embodiment, by acquiring a current frame image of the endoscope light source at a current brightness, further determining a brightness evaluation value of the current frame image according to the brightness value of the current frame image and position information of a target object in the current frame image, facilitating adjustment of the brightness of the light source of the endoscope according to the brightness evaluation value, and taking the position information of the target object in the current frame image and the current brightness of the image as reference factors when the brightness of the light source of the endoscope is adjusted, so that the adjusted brightness of the light source can adapt to the target object in the image, avoiding missed detection, false detection and other situations of lesions caused by the fact that the brightness of the light source of the endoscope cannot adapt to the current working scene in the use process of the endoscope, and improving the accuracy of the endoscope light source brightness adjustment.
[0046] Details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects and advantages of the present application more apparent. BRIEF DESCRIPTION OF DRAWINGS
[0047] The drawings described herein are intended to provide further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their description serve to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0048] Figure 1 is a use scenario diagram of an endoscope light source brightness adjustment method provided in the embodiment of the present application;
[0049] Figure 2 is a flowchart of an endoscope light source brightness adjustment method provided in the embodiment of the present application;
[0050] Figure 3is a setting method flowchart of a fixed value of an exposure time and a fixed value of a gain parameter of an endoscope camera provided by an embodiment of the present application.
[0051] Figure 4 is an embodiment flowchart of endoscope light source brightness adjustment provided by an embodiment of the present application.
[0052] Figure 5 is a structural block diagram of an endoscope light source brightness adjustment device provided by an embodiment of the present application.
[0053] Figure 6 is a schematic diagram of an internal structure of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and explained below in conjunction with the drawings and embodiments.
[0055] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the general meaning understood by a person with ordinary skill in the art to which the present application belongs. In the present application, "one", "a", "an", "the", "these" and similar words do not represent a quantitative limitation, and they can be singular or plural. In the present application, the terms "include", "contain", "have" and any variants thereof have the purpose of covering non-exclusive inclusion; for example, a process, method and system, product or device containing a series of steps or modules (units) are not limited to the listed steps or modules (units), but can include steps or modules (units) not listed, or can include other steps or modules (units) inherent to the process, method, product or device. In the present application, the terms "connected", "connected", "coupled" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. In the present application, "multiple" means two or more. The association between the associated objects is described by the term "and / or", which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. In general, the character " / " represents an "or" relationship between the objects before and after it. In the present application, the terms "first", "second", "third" and the like are only used to distinguish similar objects, and do not represent a specific order of the objects.
[0056] The endoscope light source brightness adjustment method provided by the embodiments of the present application can be applied in the application environment as shown in Figure 1 Figure 1 It is a use scene diagram of an endoscope light source brightness adjustment method provided by an embodiment of the present application. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0057] With the vigorous development of electronic endoscopy technology and related medical instrument industry in recent years, the types of electronic endoscopes are rapidly increasing, the application scenarios of electronic endoscopes are also increasing, and further, the demand for intelligence of electronic endoscopes is also increasing.
[0058] Most of the existing electronic endoscopes use fixed brightness or brightness fixed and step-adjustable illumination devices as light sources. If the electronic endoscope with fixed brightness light source is used for lesion detection, due to the complex structure of human body and the absence of natural light source, the doctor may miss or misdiagnose the lesion because the picture is too dark or too bright. Even if the brightness fixed and step-adjustable illumination device is used as the light source of the endoscope, when the endoscope is used for lesion detection, the light source brightness can only be adjusted according to the set brightness level, and the adjusted light source brightness cannot adapt to the current working scene, thereby causing the doctor to miss or misdiagnose the lesion, etc.
[0059] Moreover, in the use process of the existing electronic endoscope, the user may cause the local brightness to be too large due to the endoscope head device being too close to the human body tissue, resulting in overexposure of the image and loss of image information; the endoscope head is too far away from the human body tissue target, resulting in too low local brightness, causing the image information to be underexposed, and the image information is lost; due to the unevenness of the surface of the human body tissue organs, the brightness is not uniformly distributed, the recessed part of the tissue cannot be clearly seen, and the image information is lost; the user manually adjusts the brightness of the light source device during the use of the endoscope, which increases the operation time and the burden of the user, and affects the use experience; improper manual adjustment of the brightness of the light source device by the user may cause the real-time picture to be too bright or too dark, causing the risk of missing or misdiagnosing the lesion; and the brightness fixed and step-adjustable light source device cannot be applied to all endoscope working scenes due to the fact that part of the brightness values cannot be realized; the brightness fixed and step-adjustable light source device may cause the picture brightness to change suddenly during brightness adjustment, the picture is unnatural, and the user's correct diagnosis and treatment judgment is affected.
[0060] Therefore, how to adapt the brightness of the endoscope's light source to the current working environment, thereby improving the accuracy of diagnosis, is a problem that needs to be solved.
[0061] This embodiment provides a method for adjusting the brightness of an endoscope light source. Figure 2 This is a flowchart of an endoscope light source brightness adjustment method provided in an embodiment of this application. The execution subject of this method can be an electronic device. Optionally, the electronic device can be a server or a terminal device, but this application is not limited thereto. Specifically, as shown... Figure 2 As shown, the process includes the following steps:
[0062] Step S201: Obtain the current frame image of the endoscope light source at the current brightness.
[0063] For example, during the process of adjusting the brightness of the endoscope's light source, the endoscope's light source acquires the current frame image through the endoscope's camera at the current brightness. The format of the current frame image can be RGB888 format or other formats, without limitation.
[0064] Specifically, depending on the work scenario, the endoscope's light source can be set to a normal brightness level, with the corresponding endoscope light source brightness value set to 10 and the endoscope working distance set to 5cm.
[0065] Step S202: Determine the brightness evaluation value of the current frame image based on the brightness value of the current frame image and the position information of the target object in the current frame image.
[0066] Step S203: Adjust the brightness of the endoscope's light source according to the brightness assessment value.
[0067] Furthermore, the brightness value of the current frame image and the position information of the target object in the current frame image are determined. Based on the brightness value and position information of the current frame image, the brightness of the current frame image is evaluated to obtain the brightness evaluation value of the current frame image. Further, the light source of the endoscope is adjusted according to the brightness evaluation value.
[0068] If the brightness assessment value of the current frame image is within the normal brightness range, there is no need to adjust the endoscope's light source brightness; if the brightness assessment value of the current frame image is lower than the normal brightness range, the endoscope's light source brightness is increased according to the brightness assessment value; if the brightness assessment value of the current frame image is higher than the normal brightness range, the endoscope's light source brightness is decreased according to the brightness assessment value.
[0069] In the implementation process, the brightness value of the current frame image and the position information of the target object in the current frame image are taken as reference factors for adjusting the light source brightness of the endoscope, so that the adjusted light source brightness of the endoscope can adapt to the target object in the image, the adaptive adjustment of the light source brightness of the endoscope is realized, and the situation that the lesion is missed, misdetected and the like caused by the fact that the light source brightness of the endoscope cannot adapt to the current working scene in the use process of the endoscope is effectively avoided, and thus the accuracy of the light source brightness adjustment of the endoscope is improved.
[0070] In some embodiments, the brightness evaluation value of the current frame image is determined according to the brightness value of the current frame image and the position information of the target object in the current frame image, which can include the following steps:
[0071] Step 1: divide the current frame image into a plurality of sub-images.
[0072] For example, the current frame image is divided into a plurality of sub-images of equal size, and the number of sub-images can be determined according to the size of the current frame image. As an embodiment, the current frame image can be divided into 16 (4*4) sub-images of equal size.
[0073] Step 2: determine the brightness value of the target sub-image and the position information of the target object in the target sub-image, the target sub-image being any one of the plurality of sub-images.
[0074] Further, any one of the plurality of sub-images is taken as a target sub-image, and the brightness value of the target sub-image and the position information of the target object in the target sub-image are determined. Specifically, the target object can be a body tissue in the image, such as a stomach tissue, a lung tissue and the like.
[0075] Step 3: determine the position saliency parameter of the target object in the target sub-image according to the position information.
[0076] Further, the position saliency parameter of the target object in the target sub-image is determined according to the position information of the target object in the target sub-image.
[0077] For example, the distance from the target object in the target sub-image to the center point of the target sub-image can be determined as the position information of the target object, and further, the position saliency parameter of the target object in the target sub-image can be determined according to the distance from the target object in the target sub-image to the center point of the target sub-image and the corresponding relationship between the distance and the position saliency parameter.
[0078] As one of the embodiments, the distance-position saliency parameter correspondence can be expressed as: when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [p0*w, p1*w), the position saliency parameter is r0; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [p1*w, p2*w), the position saliency parameter is r1; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [p2*w, p3*w), the position saliency parameter is r2; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [p3*w, +∞), the position saliency parameter is r3, wherein w can be the width of the target sub-image or other preset constant, which is not limited here, the value range of p0 is 0-0.2, the value range of p1 is 0.1-0.3, the value range of p2 is 0.3-0.6, the value range of p3 is 0.6-0.9, the value range of r0 is 0.95-1, r1=0.9*r0, r2=0.8*r0, r3=0.6, and the same method should be used when p0 to p3 and r0 take values in the corresponding range.
[0079] Specifically, p0=0, p1=0.1, p2=0.5, p3=0.8, r0=1, r1=0.9, r2=0.8, r3=0.6, then the distance-position saliency parameter correspondence can be expressed as: when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [0, 0.1w), the position saliency parameter is 1; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [0.1w, 0.5w), the position saliency parameter is 0.9; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [0.5w, 0.8w), the position saliency parameter is 0.8; when the distance between the target object in the target sub-image and the center point of the target sub-image is in the range of [0.8w, +∞), the position saliency parameter is 0.6, wherein w can be the width of the target sub-image.
[0080] Further, the position saliency parameter of the target object in the target sub-image can be determined according to the distance between the target object in the target sub-image and the center point of the target sub-image, and the distance-position saliency parameter correspondence.
[0081] Step 4: determining the brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter.
[0082] Further, the brightness evaluation value of the target sub-image is determined according to the brightness value of the target sub-image and the position saliency parameter.
[0083] Step 5: determining the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images.
[0084] Exemplarily, an average value of the brightness evaluation values of all the sub-images can be determined as the brightness evaluation value of the current frame image, a maximum value of the brightness evaluation values of all the sub-images can be determined as the brightness evaluation value of the current frame image, or a minimum value of the brightness evaluation values of all the sub-images can be determined as the brightness evaluation value of the current frame image. The specific determination manner of the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images can be any one of the above manners, which is not limited herein.
[0085] In the above implementation process, the current frame image is divided into a plurality of sub-images, and further, the brightness value of each sub-image and the position information of the target object in each sub-image are determined, and the position saliency parameter is determined according to the position information of the target object, so that the position information of the target object is quantized, which is convenient for further determining the brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter, and then determining the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images, thereby improving the accuracy of the determination of the brightness evaluation value of the current frame.
[0086] In some embodiments, determining the brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter can include: determining the product of the brightness value of the target sub-image and the position saliency parameter as the brightness evaluation value of the target sub-image.
[0087] Determining the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images can include: determining the minimum value of the brightness evaluation values of all the sub-images as the brightness evaluation value of the current frame image.
[0088] Exemplarily, the product of the brightness value of the target sub-image and the position saliency parameter is determined as the brightness evaluation value of the target sub-image, so that the brightness evaluation values of all the sub-images can be determined according to this manner.
[0089] Further, the minimum value of the brightness evaluation values of all the sub-images is determined as the brightness evaluation value of the current frame image.
[0090] In the implementation process, the product of the brightness value of the target sub-image and the position saliency parameter is determined as the brightness evaluation value of the target sub-image, thereby realizing quantization of the brightness value of the target sub-image and the position information of the target object, and then accurately obtaining the brightness evaluation value of the target sub-image according to the quantized value. In addition, the minimum value in the brightness evaluation values of all sub-images is determined as the brightness evaluation value of the current frame image, so that the adjusted brightness of the endoscope light source can adapt to the target object corresponding to the minimum brightness evaluation value in the current frame image, thereby ensuring that the brightness of the endoscope light source can adapt to all target objects in the image.
[0091] In some embodiments, determining the brightness value of the target sub-image can include the following steps:
[0092] Step 1: Determine the pixel value of each pixel point in the R, G, and B channels in the target sub-image.
[0093] For example, the pixel value of each pixel point in the R, G, and B channels in the target sub-image is determined, and the working level of the current endoscope light source is determined.
[0094] Specifically, the working level of the endoscope light source can include a low brightness level, a normal brightness level, and a high brightness level. Further, the working level of the current endoscope light source can be determined according to the current brightness value of the endoscope light source and the maximum brightness value of the endoscope light source. As an example, when the image data bit depth is 8 bits, the maximum brightness value of the endoscope light source can be 255.
[0095] If the current brightness value of the endoscope light source is less than 5% of the maximum brightness value of the endoscope light source, the working level of the current endoscope light source is the low brightness level. If the current brightness value of the endoscope light source is greater than or equal to 5% of the maximum brightness value of the endoscope light source and less than 80% of the maximum brightness value of the endoscope light source, the working level of the current endoscope light source is the normal brightness level. If the current brightness value of the endoscope light source is greater than or equal to 80% of the maximum brightness value of the endoscope light source, the working level of the current endoscope light source is the high brightness level.
[0096] If the image data bit depth is other values, the brightness range of the working level of the endoscope light source can be reduced or enlarged by the bit depth variation ratio.
[0097] Step 2: Determine the brightness evaluation weight of the current frame image in the R, G, and B channels according to the working level of the endoscope light source when the current frame image is obtained.
[0098] Further, the brightness evaluation weights of the current frame image corresponding to each working level on the R, G, B three channels can be different or the same. Specifically, when the working level of the endoscope light source is a low brightness level, the brightness evaluation weights on the R, G, B three channels are respectively: 0.33, 0.33, 0.33; when the working level of the endoscope light source is a normal brightness level, the brightness evaluation weights on the R, G, B three channels are respectively: 0.3, 0.6, 0.1; when the working level of the endoscope light source is a high brightness level, the brightness evaluation weights on the R, G, B three channels are respectively: 0.3, 0.6, 0.1. Further, the brightness evaluation weights of the current frame image on the R, G, B three channels can be determined according to the working level of the endoscope light source when the current frame image is acquired.
[0099] Step 3: According to the pixel value of each pixel point on the R, G, B three channels and the brightness evaluation weight on the corresponding channel, the brightness value of each pixel point in the target sub-image is determined.
[0100] Further, the brightness value of each pixel point in the target sub-image is determined according to the pixel value of each pixel point on the R, G, B three channels and the determined brightness evaluation weight.
[0101] Specifically, the brightness value of each pixel point in the target sub-image can be obtained by weighted sum of the pixel value of each pixel point on the R, G, B three channels and the brightness evaluation weight on the corresponding channel. That is, if the current working level of the endoscope light source is a low brightness level, the brightness value of each pixel point in the target sub-image = 0.33*R+0.33*G+0.33*B; if the current working level of the endoscope light source is a normal brightness level, the brightness value of each pixel point in the target sub-image = 0.3*R+0.6*G+0.1*B; if the current working level of the endoscope light source is a high brightness level, the brightness value of each pixel point in the target sub-image = 0.3*R+0.6*G+0.1*B.
[0102] Step 4: The average value of the brightness values of all pixel points in the target sub-image is determined as the brightness value of the target sub-image.
[0103] Further, the brightness values of all pixel points in the target sub-image are determined by the above-mentioned manner, and the average value of the brightness values of all pixel points is determined as the brightness value of the target sub-image.
[0104] In the implementation process, the brightness evaluation weight on the RGB three channels is determined according to the current working level of the endoscope light source, and the brightness value of the target sub-image is further determined according to the determined brightness evaluation weight, so that the determination manner of the brightness value of the target sub-image can be adaptively adjusted according to the current working level of the endoscope light source, and the accuracy of the determination of the brightness value of the target sub-image is improved.
[0105] In some embodiments, the position information of the target object in the target sub-image can include the following steps:
[0106] Step 1: Determine the minimum circumscribed rectangle of the target object in the target sub-image.
[0107] Step 2: Determine the position information of the target sub-image according to the distance between the midpoint of the minimum circumscribed rectangle and the midpoint of the target sub-image.
[0108] Exemplarily, the Canny edge detection function can be used to determine the minimum circumscribed rectangle of the target object in the target sub-image, and if multiple minimum circumscribed rectangles corresponding to objects in the target sub-image are detected, the object with the largest minimum circumscribed rectangle is determined as the target object in the target sub-image, so as to obtain the minimum circumscribed rectangle of the target object in the target sub-image.
[0109] Further, the distance between the center point of the target sub-image and the midpoint of the minimum circumscribed rectangle of the target object in the target sub-image is determined, and the distance is determined as the position information of the target object, so that the position saliency parameter of the target object can be determined according to the distance, and if there is no target object in the target sub-image, the position saliency parameter of the target sub-image is 1.
[0110] In the implementation process, the distance between the center point of the minimum circumscribed rectangle of the target object and the center point of the target sub-image is determined as the position information of the target object, so that the quantization of the position information of the target object is realized, and the position saliency parameter can be determined according to the quantized position information.
[0111] In some embodiments, adjusting the light source brightness of the endoscope according to the brightness evaluation value can include the following steps:
[0112] Step 1: Determine the working level of the endoscope light source when the current frame image is acquired.
[0113] Step 2: Determine the target brightness range of the current frame image according to the working level.
[0114] Step 3: Adjust the light source brightness of the endoscope according to the target brightness range and the brightness evaluation value.
[0115] Exemplarily, the working level of the endoscope light source when acquiring the current frame image is determined, and the target brightness range of the current frame image is further determined according to the working level of the endoscope light source. The target brightness range can also be the normal brightness range corresponding to the working level.
[0116] As one of the embodiments, when the bit depth of the acquired image data is 8 bits, the maximum brightness of the endoscope light source can be 255. When the working level of the endoscope light source is different, the corresponding target brightness range can be the same or different. Specifically, when the working level of the endoscope light source is a low brightness level, the corresponding target brightness range can be [60, 120]; when the working level of the endoscope light source is a normal brightness level, the corresponding target brightness range can be [60, 120]; and when the working level of the endoscope light source is a high brightness level, the corresponding target brightness range can be [100, 140]. If the bit depth of the image data is other values, the target brightness range can be reduced or enlarged according to the bit depth variation ratio.
[0117] Further, the light source brightness of the endoscope is adjusted according to the target brightness range and the brightness evaluation value of the current frame image.
[0118] In the above implementation process, the target brightness range is determined according to the working level of the endoscope light source, and the light source brightness of the endoscope is adjusted according to the target brightness range and the brightness evaluation value of the current frame image, so that the adjusted endoscope light source can adapt to different working levels, thereby improving the accuracy of the light source brightness adjustment.
[0119] In some embodiments, adjusting the light source brightness of the endoscope according to the target brightness range and the brightness evaluation value can include the following steps:
[0120] If the brightness evaluation value is greater than the maximum threshold of the target brightness range, the adjustment step of the light source brightness is determined according to the difference between the brightness evaluation value and the maximum threshold, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level.
[0121] Or, if the brightness evaluation value is less than the minimum threshold of the target brightness range, the adjustment step of the light source brightness is determined according to the difference between the minimum threshold and the brightness evaluation value, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level.
[0122] The light source brightness is adjusted according to the adjustment step until the brightness evaluation value of the image after the light source brightness adjustment is within the corresponding target brightness range.
[0123] Exemplarily, if the brightness evaluation value of the current frame image is within the target brightness range, the light source brightness of the endoscope does not need to be adjusted.
[0124] If the brightness evaluation value of the current frame image is greater than the maximum threshold value of the target brightness range, then the adjustment step of the light source brightness is determined according to the difference between the brightness evaluation value and the maximum threshold value, the difference between the maximum threshold value and the minimum threshold value of the target brightness range, and the working level.
[0125] If the brightness evaluation value of the previous frame image is less than the minimum threshold value of the target brightness range, then the adjustment step of the light source brightness is determined according to the difference between the minimum threshold value and the brightness evaluation value, the difference between the maximum threshold value and the minimum threshold value of the target brightness range, and the working level.
[0126] Specifically, when the difference between the brightness evaluation value and the maximum threshold value is less than or equal to 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, or the difference between the minimum threshold value and the brightness evaluation value is less than or equal to 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, the adjustment step of the light source brightness of the endoscope is small, and different adjustment steps can be set according to the working level of the endoscope light source.
[0127] As one of the embodiments, when the difference between the brightness evaluation value and the maximum threshold value is less than or equal to 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, or the difference between the minimum threshold value and the brightness evaluation value is less than or equal to 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, the adjustment step of the light source brightness is 0.5 when the working level of the endoscope light source is the low brightness level, the adjustment step of the light source brightness is 2 when the working level of the endoscope light source is the normal brightness level, and the adjustment step of the light source brightness is 5 when the working level of the endoscope light source is the high brightness level.
[0128] Specifically, when the difference between the brightness evaluation value and the maximum threshold value is greater than 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, and the difference between the brightness evaluation value and the maximum threshold value is less than or equal to 80% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, or the difference between the minimum threshold value and the brightness evaluation value is greater than 30% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, and the difference between the minimum threshold value and the brightness evaluation value is less than or equal to 80% of the difference between the maximum threshold value and the minimum threshold value of the target brightness range, the adjustment step of the light source brightness of the endoscope is moderate, and different adjustment steps can be set according to the working level of the endoscope light source.
[0129] As one of the embodiments, when the difference between the luminance evaluation value and the maximum threshold value is greater than 30% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, and the difference between the luminance evaluation value and the maximum threshold value is less than or equal to 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, or the difference between the minimum threshold value and the luminance evaluation value is greater than 30% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, and the difference between the minimum threshold value and the luminance evaluation value is less than or equal to 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, the adjustment step of the light source luminance is 0.8 when the working level of the endoscope light source is the low brightness level, the adjustment step of the light source luminance is 3 when the working level of the endoscope light source is the normal brightness level, and the adjustment step of the light source luminance is 6 when the working level of the endoscope light source is the high brightness level.
[0130] Specifically, when the difference between the luminance evaluation value and the maximum threshold value is greater than 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, or the difference between the minimum threshold value and the luminance evaluation value is greater than 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, the adjustment step of the light source luminance of the endoscope is larger, and different adjustment steps can be set according to the working level of the endoscope light source.
[0131] As one of the embodiments, when the difference between the luminance evaluation value and the maximum threshold value is greater than 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, or the difference between the minimum threshold value and the luminance evaluation value is greater than 80% of the difference between the maximum threshold value and the minimum threshold value of the target luminance range, the adjustment step of the light source luminance is 1 when the working level of the endoscope light source is the low brightness level, the adjustment step of the light source luminance is 5 when the working level of the endoscope light source is the normal brightness level, and the adjustment step of the light source luminance is 10 when the working level of the endoscope light source is the high brightness level.
[0132] It should be noted that the adjustment step of the light source luminance is described in the embodiments of the present application and the above, in actual application, only need to meet the greater the difference between the luminance evaluation value and the target luminance range, the greater the corresponding adjustment step, the smaller the difference between the luminance evaluation value and the target luminance range, the smaller the corresponding adjustment step, and the higher the working level of the endoscope light source, the greater the adjustment step, the lower the working level of the endoscope light source, the smaller the adjustment step, and the specific adjustment step value can be set as needed, which is not limited herein.
[0133] Further, the light source luminance of the endoscope is adjusted according to the determined adjustment step, and after the light source luminance of the endoscope is adjusted once according to the adjustment step, the above steps S201 to S203 are cycled until the luminance evaluation value of the image after the light source luminance is adjusted is within the target luminance range corresponding to the adjusted working level.
[0134] In the implementation process, the adjustment step of the endoscope light source is determined according to the difference between the brightness evaluation value and the target brightness range and the difference between the two thresholds of the target brightness range, that is, when the difference between the brightness evaluation value and the target brightness range is large, the light source brightness is adjusted with a larger adjustment step, which can improve the efficiency of the light source brightness adjustment, and when the difference between the brightness evaluation value and the target brightness range is small, the light source brightness is adjusted with a smaller adjustment step, which can improve the accuracy of the light source brightness adjustment, thereby realizing adaptive adjustment of the endoscope light source brightness, and effectively avoiding the problem that the endoscope light source brightness cannot adapt to the current working scene through manual adjustment or fixed-step adjustment.
[0135] In some embodiments, after adjusting the light source brightness of the endoscope according to the brightness evaluation value, the following steps can be further included:
[0136] Step 1: Obtain the adjusted light source brightness.
[0137] Step 2: Determine the adjusted working level of the endoscope light source according to the adjusted light source brightness and the maximum brightness of the endoscope light source.
[0138] For example, after adjusting the light source brightness of the endoscope according to the brightness evaluation value, the adjusted endoscope light source brightness can be obtained, and the adjusted working level of the endoscope light source can be determined according to the adjusted endoscope light source brightness and the maximum brightness of the endoscope light source.
[0139] Specifically, if the adjusted brightness value of the endoscope light source is less than 5% of the maximum brightness of the endoscope light source, the working level of the current endoscope light source is the low brightness level; if the adjusted brightness value of the endoscope light source is greater than or equal to 5% of the maximum brightness of the endoscope light source and less than 80% of the maximum brightness of the endoscope light source, the working level of the current endoscope light source is the normal brightness level; if the adjusted brightness value of the endoscope light source is greater than or equal to 80% of the maximum brightness of the endoscope light source, the working level of the current endoscope light source is the high brightness level.
[0140] In the implementation process, when adjusting the light source brightness of the endoscope, the working level of the endoscope light source is determined in real time according to the adjusted light source brightness value, the working level of the endoscope light source can be adjusted adaptively without manual intervention, and then the brightness value evaluation of the next frame image can be facilitated according to the determined working level.
[0141] In some embodiments, before obtaining the current frame image of the endoscope light source under the current brightness, the following steps can be further included: setting the exposure time and gain parameters of the camera of the endoscope to fixed values according to the use scene of the endoscope to be adjusted.
[0142] It should be noted that the fixed value of the exposure time and the fixed value of the gain parameter can be preset according to the use scene of the endoscope to be adjusted and the working level of the endoscope, or can be adjusted according to the use scene, which is not limited here.
[0143] Figure 3 is a flow chart of a method for setting a fixed value of an exposure time and a fixed value of a gain parameter of an endoscope camera provided by the embodiment of the present application, as shown in Figure 3 , the flow chart comprises:
[0144] Step S301: Under the current working level, set the endoscope camera to the highest exposure time and the lowest gain parameter.
[0145] Specifically, the working level of the endoscope light source can include a low brightness level, a normal brightness level and a high brightness level. In the embodiment of the present application, the current working level of the endoscope light source is taken as an example for illustration. Under the normal brightness level of the endoscope light source, the endoscope camera is set to the highest exposure time and the lowest gain parameter.
[0146] It should be noted that setting the gain parameter to the lowest can ensure the least noise introduction, and setting the exposure time of the endoscope camera to the highest is to select the highest exposure time parameter for the case that the real-time image of the endoscope camera is not easy to be too dark under the lowest gain parameter.
[0147] Step S302: Obtain a test image under the current exposure time and the current gain parameter.
[0148] Further, the test image is obtained by the endoscope camera under the current exposure time and the current gain parameter.
[0149] If the current exposure time of the endoscope camera is the highest exposure time and the current gain parameter is the lowest gain parameter, the test image is obtained by the endoscope camera under the highest exposure time and the lowest gain parameter. If the current exposure time of the endoscope camera is the adjusted exposure time and the current gain parameter is the adjusted gain parameter, the test image is obtained by the endoscope camera under the adjusted exposure time and the adjusted gain parameter.
[0150] Specifically, the test image can be an image obtained by the endoscope camera shooting a flat blank paper, and the shooting distance can be adjusted according to actual working conditions.
[0151] Step S303: Determine whether the brightness evaluation value of the test image is within the normal brightness value range under the current working level.
[0152] Further, if the working level of the light source of the endoscope is a normal brightness level, it is determined whether the brightness evaluation value of the test image is within the normal brightness range of the normal brightness level.
[0153] Specifically, the test image is divided into a plurality of region images of equal size, and the number of region images can be determined according to the size of the test image. For example, the test image can be divided into 16 region images of equal size (4*4).
[0154] Further, the pixel values of all pixel points in each region image on the RGB three channels are determined, and the brightness evaluation weights of the test image on the R, G, and B three channels under the current working level are determined. If the working level of the light source of the endoscope is a normal brightness level, the brightness evaluation weights of the test image on the R, G, and B three channels are 0.3, 0.6, and 0.1, respectively. Further, in the region image, the brightness value of each pixel point is equal to 0.3*R+0.6*G+0.1*B.
[0155] The average value of the brightness values of all pixel points in the region image is determined as the brightness value of the region image.
[0156] Further, the position saliency parameter of the target object in the region image is determined. Since there is no target object in the region image, the position saliency parameter of the region image can be 1.
[0157] The product of the brightness value of each region image and the corresponding position saliency parameter is determined as the brightness evaluation value of each region image.
[0158] Further, the minimum value of the brightness evaluation values of all region images is determined as the brightness evaluation value of the test image.
[0159] Step S304: If the brightness evaluation value of the test image is not within the normal brightness value range under the current working level, the exposure time and / or gain parameter of the endoscope camera is adjusted until the brightness evaluation value of the test image is within the normal brightness value range under the current working level.
[0160] Specifically, the exposure time parameter of the endoscope camera can be divided into X levels, and the exposure time parameter of the endoscope camera can be increased from 1 to X with a step of 1. Under the condition that the brightness of the light source of the endoscope does not change, the brightness of the picture captured by the camera is improved in turn. The gain parameter of the endoscope camera can be divided into Y levels, and the gain parameter of the endoscope camera can be increased from 1 to Y with a step of 1. Under the condition that the brightness of the light source of the endoscope does not change, the brightness of the picture captured by the camera is improved in turn. Therefore, the brightness adjustable level of the endoscope camera has X*Y levels. In a specific implementation, the adjustment step of the exposure time parameter and the gain parameter is set to 1 each time.
[0161] Specifically, if the current working level of the endoscope light source is a normal brightness level, the normal brightness value range of the normal brightness level is [60, 120], if the brightness evaluation value of the test image is higher than 120, it indicates that the picture brightness is too high, if the brightness evaluation value of the test image is lower than 60, it indicates that the brightness is too low.
[0162] If the brightness value of the test image is within the normal brightness value range, the endoscope camera exposure time parameter is reduced by one level, and the step S302 is returned until the brightness value of the test image is lower than the normal brightness range, and the camera exposure time before the last reduction is selected as the endoscope camera exposure time fixed parameter.
[0163] In the above implementation process, under the initial conditions of the highest exposure time parameter and the lowest gain parameter, if the brightness of the test image is within the normal brightness range, reducing the camera exposure time parameter can improve the imaging quality.
[0164] If the brightness value of the test image is lower than the normal brightness range and the brightness of the test image before the last adjustment is within the normal brightness range, the camera exposure time parameter before the last adjustment is set as the camera exposure time parameter fixed value, and the gain parameter before the last adjustment is set as the gain parameter fixed value; if the brightness value of the test image is lower than the normal brightness range and the brightness of the test image before the last adjustment is not within the normal brightness range, the gain parameter is increased, and the step S302 is returned until the brightness value of the test image is within the normal brightness range, and the gain parameter after the last increase is selected as the gain parameter fixed value.
[0165] If the brightness value of the test image is higher than the normal brightness range and the brightness value of the test image before the last adjustment is within the normal brightness range, the camera exposure time parameter before the adjustment is set as the camera exposure time parameter fixed value, and the gain parameter before the adjustment is set as the gain parameter fixed value; if the brightness value of the test image is higher than the normal brightness range and the test image before the last adjustment is not within the normal brightness range, the camera exposure time parameter is reduced, the step S302 is returned until the brightness value of the test image is within the normal brightness range, and the camera exposure time parameter after the last reduction is selected as the camera exposure time parameter fixed value.
[0166] In the above implementation process, before the initial adjustment of the brightness of the endoscope light source, the exposure time and the gain parameter of the camera of the endoscope are respectively set as fixed values, and during the adjustment of the brightness of the endoscope light source, the exposure time and the gain parameter remain unchanged, which can effectively avoid the influence of the exposure time and the gain parameter on the image brightness value, thereby ensuring the accuracy of the brightness adjustment of the endoscope light source.
[0167] Figure 4 is an embodiment flowchart of the brightness adjustment of the endoscope light source provided by the embodiment of the present application, asFigure 4 As shown in the figure, the flow chart comprises:
[0168] Step S401: Set the exposure time and gain parameters of the camera of the endoscope to fixed values.
[0169] Specifically, if the endoscope light source is a normal brightness level, the exposure time and gain parameters of the camera of the endoscope are set to fixed values under the normal brightness level; if the endoscope light source is a low brightness level, the exposure time and gain parameters of the camera of the endoscope are set to fixed values under the low brightness level; if the endoscope light source is a high brightness level, the exposure time and gain parameters of the camera of the endoscope are set to fixed values under the high brightness level.
[0170] Step S402: Acquire the current frame image by the endoscope camera under the current setting.
[0171] Further, according to the current setting, the current frame image is acquired by the endoscope camera.
[0172] Step S403: Determine the brightness evaluation value of the current frame image according to the brightness value of the current frame image and the position information of the target object in the current frame image.
[0173] Further, the current frame image is divided into multiple sub-images of equal size, and the pixel values of all pixel points in each sub-image under the RGB three channels are determined, and the corresponding brightness evaluation weights of the current frame image under the RGB three channels are determined according to the normal brightness level, and further, the pixel values of each pixel point in each sub-image under the RGB three channels are weighted and summed to obtain the brightness value of each pixel point, i.e. the brightness value of each pixel point in each sub-image = a1*R+a2*G+a3*B, wherein a1, a2, a3 are the brightness evaluation weights under the R, G, B three channels, and R, G, B are the pixel values under the corresponding channels.
[0174] Further, the average value of all pixel points in each sub-image is determined as the brightness value of the corresponding sub-image.
[0175] Further, the position saliency parameter of each sub-image is determined according to the position information of the target object in each sub-image, and the product of the brightness value of each sub-image and the corresponding position saliency parameter is taken as the brightness evaluation value of the sub-image, and the minimum value of the brightness evaluation values of all sub-images is determined as the brightness evaluation value of the current frame image.
[0176] Step S404: Adjust the light source brightness of the endoscope according to the brightness evaluation value.
[0177] Specifically, a corresponding target brightness range is determined according to the working level of the endoscope light source, if the brightness evaluation value of the current frame image is within the target brightness range, the light source brightness of the endoscope does not need to be adjusted; if the brightness evaluation value of the current frame image is lower than the target brightness range, the light source brightness of the endoscope is adjusted higher according to the brightness evaluation value; if the brightness evaluation value of the current frame image is higher than the target brightness range, the light source brightness of the endoscope is adjusted lower according to the brightness evaluation value, and the target brightness range is also the normal brightness range corresponding to the working level.
[0178] If the brightness evaluation value of the current frame image is not within the target brightness range, a brightness adjustment instruction is sent to the endoscope light source device, and the brightness adjustment instruction includes a single brightness adjustment step, which can be determined according to the difference between the brightness evaluation value and the target brightness range.
[0179] When the endoscope light source device receives the light source brightness adjustment instruction, the brightness adjustment instruction is parsed, and the PWM duty cycle of the light intensity in the instruction is sent to the light source driving circuit, so that the current through the LED is adjusted steplessly by PWM to adjust the brightness of the light source box, so as to adjust the brightness of the endoscope light source device. After single brightness adjustment, return to step S402 until the brightness evaluation value of the adjusted image is within the corresponding target brightness range.
[0180] It should be noted that although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise stated herein, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.
[0181] In the present embodiment, an endoscope light source brightness adjustment device is also provided, which is used to implement the above embodiments and preferred embodiments, and has been described above. The terms "module", "unit", "sub-unit" and the like used below can be a combination of software and / or hardware that can implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0182] Figure 5 is a structural block diagram of an endoscope light source brightness adjustment device provided by the present application, as Figure 5As shown, the device comprises:
[0183] The acquisition module 501 is configured to acquire a current frame image of the endoscope light source at a current brightness;
[0184] The determination module 502 is configured to determine a brightness evaluation value of the current frame image according to a brightness value of the current frame image and position information of a target object in the current frame image.
[0185] The adjustment module 503 is configured to adjust the brightness of the endoscope light source according to the brightness evaluation value.
[0186] In some embodiments, the determination module 502 is specifically configured to:
[0187] divide the current frame image into a plurality of sub-images;
[0188] determine a brightness value of a target sub-image and position information of the target object in the target sub-image, the target sub-image being any one of the plurality of sub-images;
[0189] determine a position saliency parameter of the target object in the target sub-image according to the position information;
[0190] determine a brightness evaluation value of the target sub-image according to the brightness value of the target sub-image and the position saliency parameter;
[0191] determine the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images.
[0192] In some embodiments, the determination module 502 is specifically configured to:
[0193] determine the product of the brightness value of the target sub-image and the position saliency parameter as the brightness evaluation value of the target sub-image;
[0194] determine the brightness evaluation value of the current frame image according to the brightness evaluation values of all the sub-images, including:
[0195] determine the minimum value among the brightness evaluation values of all the sub-images as the brightness evaluation value of the current frame image.
[0196] In some embodiments, the determination module 502 is specifically configured to:
[0197] determine the pixel value of each pixel point in the target sub-image in R, G and B channels;
[0198] determine the brightness evaluation weight of the current frame image in R, G and B channels according to the working level of the endoscope light source when the current frame image is acquired;
[0199] According to the pixel value of each pixel point on the R, G, B three channels, and the brightness evaluation weight on the corresponding channel, the brightness value of each pixel point in the target sub-image is determined.
[0200] The average value of the brightness values of all pixel points in the target sub-image is determined as the brightness value of the target sub-image.
[0201] In some embodiments, the determining module 502 is specifically configured to:
[0202] Determine the minimum circumscribed rectangle of the target object in the target sub-image;
[0203] According to the distance between the midpoint of the minimum circumscribed rectangle and the midpoint of the target sub-image, the position information of the target sub-image is determined.
[0204] In some embodiments, the adjusting module 503 is specifically configured to:
[0205] Determine the working level of the endoscope light source when the current frame image is acquired;
[0206] According to the working level, the target brightness range of the current frame image is determined;
[0207] According to the target brightness range and the brightness evaluation value, the light source brightness of the endoscope is adjusted.
[0208] In some embodiments, the adjusting module 503 is specifically configured to:
[0209] If the brightness evaluation value is greater than the maximum threshold of the target brightness range, then according to the difference between the brightness evaluation value and the maximum threshold, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level, the adjustment step of the light source brightness is determined;
[0210] Or, if the brightness evaluation value is less than the minimum threshold of the target brightness range, then according to the difference between the minimum threshold and the brightness evaluation value, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level, the adjustment step of the light source brightness is determined;
[0211] According to the adjustment step, the light source brightness is adjusted until the brightness evaluation value of the image after the light source brightness is adjusted is within the corresponding target brightness range.
[0212] In some embodiments, the adjusting module 503 is further configured to:
[0213] Acquire the adjusted light source brightness;
[0214] According to the adjusted light source brightness and the maximum value of the brightness of the endoscope light source, the adjusted working level of the endoscope light source is determined.
[0215] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 6 Figure 6 is a computer device internal structure diagram provided by an embodiment of the present application. The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store endoscope light source brightness adjustment data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement an endoscope light source brightness adjustment method.
[0216] Those skilled in the art can understand that Figure 6 the structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0217] In one embodiment, an electronic device is also provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in each of the above method embodiments.
[0218] In one embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in each of the above method embodiments.
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0220] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0221] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0222] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of patent protection. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for adjusting the brightness of an endoscope light source, characterized in that, include: Acquire the current frame image of the endoscope light source at the current brightness; The brightness evaluation value of the current frame image is determined based on the brightness value of the current frame image and the position information of the target object in the current frame image. Adjust the endoscope's light source brightness according to the brightness assessment value; Adjusting the endoscope's light source brightness according to the brightness assessment value includes: Determine the operating level of the endoscope light source when acquiring the current frame image; The target brightness range of the current frame image is determined based on the working level; Adjust the endoscope's light source brightness according to the target brightness range and the brightness evaluation value; The step of adjusting the endoscope's light source brightness according to the target brightness range and the brightness evaluation value includes: If the brightness assessment value is greater than the maximum threshold of the target brightness range, then the adjustment step size of the light source brightness is determined based on the difference between the brightness assessment value and the maximum threshold, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level. Alternatively, if the brightness assessment value is less than the minimum threshold of the target brightness range, the adjustment step size of the light source brightness is determined based on the difference between the minimum threshold and the brightness assessment value, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level. The brightness of the light source is adjusted according to the adjustment step size until the brightness evaluation value of the image after the light source brightness adjustment is within the corresponding target brightness range.
2. The method for adjusting the brightness of an endoscope light source according to claim 1, characterized in that, The step of determining the brightness evaluation value of the current frame image based on the brightness value of the current frame image and the position information of the target object in the current frame image includes: Divide the current frame image into multiple sub-images; Determine the brightness value of the target sub-image and the position information of the target object in the target sub-image, wherein the target sub-image is any one of multiple sub-images; Based on the location information, determine the positional salience parameter of the target object in the target sub-image; The brightness evaluation value of the target sub-image is determined based on the brightness value of the target sub-image and the positional salience parameter. The brightness assessment value of the current frame image is determined based on the brightness assessment values of all sub-images.
3. The method for adjusting the brightness of an endoscope light source according to claim 2, characterized in that, Determining the brightness evaluation value of the target sub-image based on the brightness value of the target sub-image and the positional saliency parameter includes: The product of the brightness value of the target sub-image and the positional saliency parameter is determined as the brightness evaluation value of the target sub-image; Determining the brightness assessment value of the current frame image based on the brightness assessment values of all sub-images includes: The minimum value among all the brightness evaluation values of the sub-images is determined as the brightness evaluation value of the current frame image.
4. The method for adjusting the brightness of an endoscope light source according to claim 2, characterized in that, Determining the brightness value of the target sub-image includes: Determine the pixel value of each pixel in the target sub-image on the R, G, and B channels; Based on the working level of the endoscope light source when the current frame image is acquired, determine the brightness evaluation weights of the current frame image on the R, G, and B channels respectively. The brightness value of each pixel in the target sub-image is determined based on the pixel value of each pixel in the R, G, and B channels, and the brightness evaluation weight of the corresponding channel. The average value of the brightness of all pixels in the target sub-image is determined as the brightness value of the target sub-image.
5. The method for adjusting the brightness of an endoscope light source according to claim 2, characterized in that, The location information of the target object in the target sub-image includes: Determine the minimum bounding rectangle of the target object in the target sub-image; The position information of the target sub-image is determined based on the distance between the midpoint of the minimum bounding rectangle and the midpoint of the target sub-image.
6. The method for adjusting the brightness of an endoscope light source according to any one of claims 1-5, characterized in that, After adjusting the endoscope's light source brightness according to the brightness assessment value, the method further includes: Obtain the adjusted light source brightness; The adjusted working level of the endoscope light source is determined based on the adjusted light source brightness and the maximum brightness value of the endoscope light source.
7. An endoscope light source brightness adjustment device, characterized in that, include: The acquisition module is used to acquire the current frame image of the endoscope light source at the current brightness. The determining module is used to determine the brightness evaluation value of the current frame image based on the brightness value of the current frame image and the position information of the target object in the current frame image; An adjustment module is used to adjust the brightness of the endoscope's light source according to the brightness assessment value; The adjustment module is also used to determine the operating level of the endoscope light source when acquiring the current frame image; The target brightness range of the current frame image is determined according to the working level; the light source brightness of the endoscope is adjusted according to the target brightness range and the brightness evaluation value. The adjustment module is further configured to: if the brightness assessment value is greater than the maximum threshold of the target brightness range, determine the adjustment step size of the light source brightness based on the difference between the brightness assessment value and the maximum threshold, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level; or, if the brightness assessment value is less than the minimum threshold of the target brightness range, determine the adjustment step size of the light source brightness based on the difference between the minimum threshold and the brightness assessment value, the difference between the maximum threshold and the minimum threshold of the target brightness range, and the working level; and adjust the light source brightness according to the adjustment step size until the brightness assessment value of the image after the light source brightness adjustment is within the corresponding target brightness range.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the endoscope light source brightness adjustment method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the endoscope light source brightness adjustment method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for determining brightness of endoscope image and related equipment
CN111861928A
Brightness control parameter adjustment method and device, electronic equipment and readable storage medium
CN112203021A
Image processing apparatus
US20080278632A1
Method for adjusting an exposure of an endoscope
US20210195081A1