An image dimming method, device, and equipment of an endoscope system and a storage medium
By calculating the brightness value of the second brightest part in the image of the endoscope system using the second brightness metering method, the problem of overexposure or underexposure in the image adjustment of the endoscope system is solved, thus improving the image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SONOSCAPE MEDICAL CORP
- Filing Date
- 2021-06-30
- Publication Date
- 2026-06-12
Smart Images

Figure CN115546039B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image dimming method, apparatus, electronic device, and computer-readable storage medium for an endoscope system. Background Technology
[0002] An endoscope is a diagnostic instrument that integrates an image sensor, optical lens, light source, and mechanical devices. It typically consists of a tube equipped with a light source and lens. The endoscope can be inserted into the stomach through the mouth or other natural orifices to observe lesions that cannot be detected by X-rays, such as ulcers or tumors in the stomach.
[0003] Because of the complexity of the human body, endoscopic systems typically require real-time adjustments to the light source brightness based on image metering values to improve image quality. In related technologies, peak metering is often used when metering images from endoscopic systems; that is, the brightness value of the brightest part of the image is used as the current image's dimming reference value. However, after adjusting the endoscope's light source brightness based on this dimming reference value, images obtained in certain scenarios can easily become too dark or overexposed, hindering lesion identification by doctors.
[0004] Therefore, providing a solution to the above-mentioned technical problems is something that those skilled in the art urgently need to focus on. Summary of the Invention
[0005] The purpose of this application is to provide an image dimming method, apparatus, electronic device, and computer-readable storage medium for an endoscope system, so as to improve the dimming effect and enhance the imaging quality by performing accurate photometry on the image.
[0006] To address the aforementioned technical problems, this application discloses an image dimming method for an endoscope system, comprising:
[0007] Acquire the images generated by the endoscope system;
[0008] Calculate the image brightness value of each image sub-block in the image;
[0009] Identify the secondary bright areas in the image; the image brightness value of the secondary bright areas is within the range corresponding to a specified brightness level, where the specified brightness level is between the highest and lowest brightness levels.
[0010] The average image brightness value of each image sub-block in the secondary bright area is calculated as the dimming reference value;
[0011] Adjust the output brightness of the endoscope light source based on the dimming reference value.
[0012] Optionally, calculating the image brightness value of each image sub-block in the image includes:
[0013] The maximum value of the current pixel among the R, G, and B channel values is taken as the image brightness value of the current pixel;
[0014] Calculate the average value of the image brightness of each pixel in the current image sub-block, and use it as the image brightness value of the current image sub-block.
[0015] Optionally, the specified brightness level is a ranking level of the image brightness value, and determining the second brightest part in the image includes:
[0016] Arrange the image brightness values of each image sub-block in descending order;
[0017] The image sub-blocks within the ranking range corresponding to the specified brightness level are determined as the secondary bright areas.
[0018] Optionally, the specified brightness level is a value level of the image brightness, and determining the secondary bright areas in the image includes:
[0019] Determine the range of image brightness values corresponding to the specified brightness level;
[0020] The image sub-block whose image brightness value is within the range of values is determined as the secondary bright part.
[0021] Optionally, after adjusting the output brightness of the endoscope light source based on the dimming reference value, the method further includes:
[0022] Update the acquired image and calculate the image brightness value of each image sub-block in the image;
[0023] Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit;
[0024] If not, continue with the steps of determining the second brightest areas in the image and subsequent steps;
[0025] If so, the image brightness values of each image sub-block are updated based on the photometric weight values in order to update the dimming reference values.
[0026] Optionally, updating the image brightness values of each image sub-block based on the photometric weight values to update the calculated dimming reference values includes:
[0027] Set corresponding metering weight values for each image sub-block;
[0028] The image brightness value is updated and calculated for each of the image sub-blocks based on the photometric weight value;
[0029] The average image brightness value of each image sub-block in the image is calculated as the updated dimming reference value.
[0030] Optionally, setting corresponding metering weight values for each image sub-block includes:
[0031] Identify the type of image content within the current image sub-block;
[0032] Determine whether the type of the image content is a target type; the target type includes medical tools and instruments;
[0033] If so, the photometric weight value is set to a value within the range of (0,1);
[0034] If not, determine whether the current image sub-block is located in the image center region; the image center region is the region whose distance from the image center point is not less than a preset distance threshold;
[0035] If the current image sub-block is not located in the center region of the image, the metering weight value is set to a value within the range of (0,1);
[0036] If the current image sub-block is located in the center region of the image, then the metering weight value is set to 1.
[0037] Optionally, after determining that the current image sub-block is not located in the image center region, setting the metering weight value to a value within the range of (0,1) includes:
[0038] The photometric weight value of the current image sub-block is set to a value within the range of (0,1), and the value is inversely correlated with the distance between the current image sub-block and the center point of the image.
[0039] In another aspect, this application also discloses an image dimming device for an endoscope system, including a photometer module and a dimming module connected in communication;
[0040] The photometric module is used to acquire the image generated by the endoscope system; calculate the image brightness value of each image sub-block in the image; determine the secondary bright area in the image; the image brightness value of the secondary bright area is within the range corresponding to a specified brightness level, the specified brightness level is between the highest brightness level and the lowest brightness level; calculate the average image brightness value of each image sub-block in the secondary bright area as a dimming reference value, and send it to the dimming module;
[0041] The dimming module is used to adjust the output brightness of the endoscope light source based on the dimming reference value.
[0042] Optionally, when calculating the image brightness value of each image sub-block in the image, the photometric module is specifically used for:
[0043] The maximum value of the current pixel among the R, G, and B channels is taken as the image brightness value of the current pixel; the average value of the image brightness values of each pixel in the current image sub-block is calculated and taken as the image brightness value of the current image sub-block.
[0044] Optionally, the specified brightness level is a ranking level of the image brightness value, and the metering module, when determining the second brightest area in the image, is specifically used for:
[0045] Arrange the image brightness values of each image sub-block in descending order; determine the image sub-blocks within the ranking interval corresponding to the specified brightness level as the secondary bright areas.
[0046] Optionally, the specified brightness level is a value level of the image brightness, and the metering module, when determining the second brightest part in the image, is specifically used for:
[0047] Determine the range of image brightness values corresponding to the specified brightness level; identify the image sub-blocks whose image brightness values are within the range as the secondary bright areas.
[0048] Optionally, after the dimming module adjusts the output brightness of the endoscope light source based on the dimming reference value, the photometer module is further configured to:
[0049] Update the acquired image and calculate the image brightness value of each image sub-block in the image;
[0050] Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit;
[0051] If not, continue with the steps of determining the second brightest areas in the image and subsequent steps;
[0052] If so, the image brightness values of each image sub-block are updated based on the photometric weight values in order to update the dimming reference values.
[0053] Optionally, when the photometric module updates the image brightness values of each image sub-block based on the photometric weight value in order to update the dimming reference value, it is specifically used for:
[0054] Set a corresponding photometric weight value for each image sub-block; update the calculated image brightness value for each image sub-block based on the photometric weight value; calculate the average image brightness value of each image sub-block in the image as the updated dimming reference value.
[0055] The step of setting corresponding metering weight values for each image sub-block includes:
[0056] Identify the type of image content within the current image sub-block;
[0057] Determine whether the type of the image content is a target type; the target type includes medical tools and instruments;
[0058] If so, the photometric weight value is set to a value within the range of (0,1);
[0059] If not, determine whether the current image sub-block is located in the image center region; the image center region is the region whose distance from the image center point is not less than a preset distance threshold;
[0060] If the current image sub-block is not located in the center region of the image, the metering weight value is set to a value within the range of (0,1);
[0061] If the current image sub-block is located in the center region of the image, then the metering weight value is set to 1.
[0062] Optionally, after determining that the current image sub-block is not located in the center region of the image, the metering module, when setting the metering weight value to a value within the range of (0,1), specifically uses the following:
[0063] The photometric weight value of the current image sub-block is set to a value within the range of (0,1), and the value is inversely correlated with the distance between the current image sub-block and the center point of the image.
[0064] In another aspect, this application also discloses an electronic device, comprising:
[0065] Memory, used to store computer programs;
[0066] A processor for executing the computer program to implement the steps of the image dimming method for any of the endoscope systems described above.
[0067] In another aspect, this application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image dimming method for any of the endoscope systems described above.
[0068] The beneficial effects of the image dimming method, device, electronic equipment, and computer-readable storage medium of the endoscope system provided in this application are as follows: Based on the sub-brightness photometry method, this application obtains photometric results that can more accurately and comprehensively characterize the brightness of the entire image, providing a more scientific and reasonable data basis for adjusting the output brightness of the endoscope light source, helping to achieve precise dimming and normal image brightness, effectively reducing the occurrence of image overexposure or underexposure, and improving the imaging quality of the system. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the prior art and the embodiments of this application, the accompanying drawings used in the description of the prior art and the embodiments of this application will be briefly introduced below. Of course, the accompanying drawings described below with respect to the embodiments of this application are only a part of the embodiments in this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort, and such other drawings also fall within the protection scope of this application.
[0070] Figure 1 This is a flowchart of an image dimming method for an endoscope system disclosed in an embodiment of this application;
[0071] Figure 2 This is an image of the stomach wall obtained after light adjustment based on peak photometry in the existing technology;
[0072] Figure 3 This is a gastric wall image after light adjustment based on the photometric method for the second brightest region disclosed in the embodiments of this application;
[0073] Figure 4 This is a schematic diagram comparing the processes of the sub-brightness photometric method and the weighted average photometric method disclosed in this application;
[0074] Figure 5 This is a flowchart illustrating another image dimming method for an endoscope system disclosed in an embodiment of this application;
[0075] Figure 6 This is a structural block diagram of an image dimming device for an endoscope system disclosed in an embodiment of this application;
[0076] Figure 7 This is a structural block diagram of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0077] The core of this application is to provide an image dimming method, device, electronic device, and computer-readable storage medium for an endoscope system, so as to improve the dimming effect and enhance the imaging quality by performing precise photometry on the image.
[0078] To provide a clearer and more complete description of the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be described below with reference to the accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0079] Endoscopes are now widely used in medical testing and treatment. To improve the lighting conditions for endoscopic imaging in the complex environment of the human body, endoscopic systems often have built-in dimming functions: by measuring the brightness of the images generated by the system to obtain photometric values, the brightness of the endoscope's light source is adjusted based on the photometric values, helping to capture clear images with reasonable exposure.
[0080] In view of the problem that the peak metering method used in current endoscope systems for dimming can easily cause overexposure or underexposure of images in some scenarios, this application provides an image dimming scheme for endoscope systems that can effectively solve this problem.
[0081] See Figure 1 As shown in the figure, this application discloses an image dimming method for an endoscope system, which mainly includes:
[0082] S101: Acquire the images generated by the endoscope system.
[0083] S102: Calculate the image brightness value of each image sub-block in the image.
[0084] S103: Determine the secondary bright areas in the image. The image brightness values of the secondary bright areas are within the range corresponding to a specified brightness level, which is between the highest and lowest brightness levels.
[0085] S104: Calculate the average image brightness value of each image sub-block in the secondary bright area as the image dimming reference value.
[0086] S105: Adjust the output brightness of the endoscope light source based on the image brightness value.
[0087] The technical solution provided in this application is specifically applied to an endoscope system. An endoscope is generally a tube equipped with a lens (or camera) and a light source. The endoscope light source can be specifically based on LED lights, etc., and is driven by a corresponding driving circuit to emit light for illumination during the camera's shooting process.
[0088] The images in this application specifically refer to images obtained during endoscopic examination or surgical treatment of internal organs and tissues of the human body. Taking gastroscopy as an example, the image can be one or more frames from a video captured by a camera during the gastroscopy procedure, or it can be a single image captured by the camera. Specifically, brightness detection of the image is the basis for dimming; therefore, the accuracy of the image brightness value directly affects the imaging quality of the dimmed image: if the brightness value of the measured image is too large compared to the actual image brightness, the reduction in light output during dimming will be greater than the actual requirement, and the dimmed image will easily appear too dark; conversely, if the brightness value of the measured image is too small compared to the actual image brightness, the dimmed image will easily appear overexposed.
[0089] Traditional peak metering uses the average brightness value of the brightest part of the image as the lighting reference value for the entire image, which can easily lead to problems such as the image being too dark or too exposed. Therefore, this application adopts a secondary brightness metering scheme. Specifically, this application selects the secondary brightest part of the image and uses the average brightness value of this secondary brightest part as the lighting reference value for the entire image.
[0090] Specifically, this application can divide a real-time acquired image into several image sub-blocks according to a pre-set size division standard, and each image sub-block contains several pixels. Preferably, the size of each image sub-block can be kept consistent. Alternatively, the division standard for image sub-blocks can be selected as the type of image content. For example, a continuous region of stomach wall content can be divided into one image sub-block, and a continuous region of empty content can be divided into another image sub-block. For each image sub-block, the image brightness value of each pixel in the image sub-block can be calculated based on the RGB value of each pixel, and thus the image brightness value of the image sub-block can be calculated. Here, R represents red, G represents green, and B represents blue.
[0091] Image brightness value is a numerical representation of image brightness. It is easy to understand that different image sub-blocks within an image have different brightness levels, and those skilled in the art can set their own criteria for distinguishing between these brightness levels based on the image brightness value. The secondary bright areas to be determined in this application have image brightness values within the range corresponding to a specified brightness level, which is between the highest and lowest brightness levels.
[0092] In one embodiment, image brightness can be divided into ten levels, ordered from highest to lowest as first, second, third, ..., tenth brightness levels. Then, the second, third, or fourth brightness level can be designated as the specified brightness level corresponding to the second brightest area; alternatively, both the third and fourth brightness levels can be designated as the specified brightness levels corresponding to the second brightest areas.
[0093] Therefore, based on the brightness level to which the image brightness value of each image sub-block belongs, it is possible to determine which image sub-blocks are included in the secondary bright area of the image. Then, the average value of the image brightness value of each image sub-block belonging to the secondary bright area can be calculated as the dimming reference value of the image for dimming: if the dimming reference value of the image is higher than the set value, the output brightness of the endoscope light source is appropriately reduced; if the image brightness value of the image is lower than the set value, the output brightness of the endoscope light source is appropriately increased.
[0094] See comparison Figure 2 and Figure 3 , Figure 2 This is an image of the stomach wall after light adjustment based on peak photometry in the existing technology. Obviously, Figure 2 The stomach wall image in the image was overexposed, so doctors could not accurately identify lesions in the patient's stomach based on the image. Figure 3 The image shown is a gastric wall image after light adjustment based on the sub-brightness region photometry method disclosed in this application embodiment. It is evident that the image brightness is normal and can be used by doctors for normal lesion assessment. Based on Figure 2 and Figure 3 It is evident that the sub-brightness metering method provided in this application can effectively solve the image overexposure problem in certain image scenarios.
[0095] As can be seen, the image dimming method of the endoscope system provided in this application, based on the sub-brightness photometry method, obtains photometric results that can more accurately and comprehensively characterize the brightness of the entire image. This provides a more scientific and reasonable data basis for adjusting the output brightness of the endoscope light source, helps to achieve precise dimming and normal image brightness, effectively reduces the occurrence of image overexposure or underexposure, and improves the imaging quality of the system.
[0096] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, calculates the image brightness value of each image sub-block in the image, including:
[0097] The maximum value among the R, G, and B channels of the current pixel is used as the image brightness value of the current pixel;
[0098] Calculate the average value of the image brightness of each pixel in the current image sub-block, and use it as the image brightness value of the current image sub-block.
[0099] It should be noted that in this embodiment, when calculating the image brightness value of each pixel, the V metering scheme is specifically used, that is, the maximum value of the pixel among the R, G and B channel values is calculated as the image brightness value of the corresponding pixel.
[0100] Traditional metering methods convert the RGB values of pixels to YCbCr values, using the Y luminance value as the pixel's image luminance. However, under indigo staining conditions (where the B channel component is high and other components are low in the RGB image), the calculated Y luminance value is also low. Even if the blue component reaches its maximum value, causing overexposure of the B channel, the Y luminance value remains low. Therefore, images adjusted using this Y luminance value are prone to overexposure. Indigo staining is a staining technique where pigment is locally sprayed under endoscopy to create good contrast between the stained lesion and normal mucosal tissue, facilitating lesion detection.
[0101] To address the overexposure issue in the B channel under indigo dyeing conditions, this embodiment employs the V-metering method to calculate the image brightness value. Since the V-metering method selects the maximum value among the RGB channels, the resulting image brightness value is relatively large under indigo dyeing conditions. Therefore, using this image brightness value as a dimming reference value allows for more effective dimming and ensures normal image brightness.
[0102] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, specifies the brightness level as the ranking level of the image brightness value and determines the second brightest areas in the image, including:
[0103] Arrange the image brightness values of each image sub-block in descending order;
[0104] The image sub-blocks within the ranking range corresponding to the specified brightness level are identified as the second brightest areas.
[0105] For example, in a specific embodiment, image sub-blocks with brightness values ranking in the top 5% (inclusive) can correspond to the first brightness level, belonging to the brightest region; image sub-blocks with brightness values ranking in the range of (5%, 15%) (inclusive of both endpoints) can correspond to the second brightness level, belonging to the second brightest region. That is, in this embodiment, the ranking range of image brightness values corresponding to the second brightest regions is specifically set to (5%, 15%). The 5% and 15% can be replaced with other values.
[0106] Of course, those skilled in the art can also arrange the image brightness values in ascending order and select a suitable middle segment as the secondary bright part in the lower position.
[0107] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, specifies the brightness level as the value level of the image brightness and determines the secondary bright areas in the image, including:
[0108] Determine the range of image brightness values corresponding to a specified brightness level;
[0109] Image sub-blocks whose image brightness values fall within a certain range are identified as secondary bright areas.
[0110] Specifically, in this embodiment, a range of image brightness values is pre-defined for the secondary bright areas. In this way, all image sub-blocks whose image brightness values are within this range can be identified as secondary bright areas.
[0111] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above description, further includes, after adjusting the output brightness of the endoscope light source based on a dimming reference value:
[0112] Update the acquired image and calculate the image brightness value of each image sub-block in the image;
[0113] Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit;
[0114] If not, continue with the steps to determine the second brightest areas in the image and subsequent steps.
[0115] If so, the image brightness values of each image sub-block are updated based on the photometric weight values in order to update the dimming reference values.
[0116] Specifically, in some special application scenarios, such as when the brightness of the brightest and second brightest parts of an image is much higher than the overall true brightness level due to local reflections in the field of view, the image may be too dark when using the second-brightness metering scheme provided in this application for dimming. To address this issue, this embodiment can update the image brightness values of each image sub-block. When the image brightness values of at least a preset number of image sub-blocks are too low (less than a preset limit), it can be determined that the image is too dark, and an alternative metering scheme can be switched to. That is, by setting metering weight values, the image brightness values of each image sub-block are optimized, thereby obtaining a more reasonable dimming reference value to avoid the image being too dark after dimming. Due to the introduction of metering weight values, this scheme can be called the weighted average metering method.
[0117] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, updates the image brightness values of each image sub-block based on photometric weight values in order to update the dimming reference values, including:
[0118] Set corresponding metering weight values for each image sub-block;
[0119] The image brightness value is updated and calculated for each image sub-block based on the photometric weight value;
[0120] The average image brightness value of each image sub-block in the image is calculated as the updated dimming reference value.
[0121] Specifically, to further optimize the calculation of the dimming reference value, this embodiment introduces a metering weight value to update the image brightness value of each image sub-block. That is, the product of the initial image brightness value of the image sub-block and the metering weight value is used as the updated image brightness value. The metering weight value is a parameter that takes a value in the range (0,1).
[0122] Additionally, it should be noted that since a metering weight value has been introduced to optimize the metering results of each image sub-block, when calculating the dimming reference value of the entire image, the image brightness values of all image sub-blocks in the image can be included in the average value calculation.
[0123] To facilitate a comparison of the sub-brightness metering method and the weighted average metering method, this application also provides a comparative schematic diagram of the two metering schemes, see details below. Figure 4 .like Figure 4 As shown, the main process of the secondary brightness metering method includes dividing the image into image sub-blocks, calculating the image brightness value of each image sub-block, determining the secondary bright area according to the sorting or value, extracting the image brightness value of the image sub-block of the secondary bright area, calculating the average value of the image brightness value of the secondary bright area, and adjusting the output brightness of the endoscope light source.
[0124] The main process of weighted average photometry includes dividing the image into image sub-blocks, calculating the image brightness value of each image sub-block, setting photometric weight values for each image sub-block, updating the image brightness values of each image sub-block, calculating the average image brightness values of all image sub-blocks, and adjusting the output brightness of the endoscope light source.
[0125] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, sets corresponding photometric weight values for each image sub-block, including:
[0126] Identify the type of image content within the current image sub-block;
[0127] Determine whether the image content type matches the target type, which includes medical tools and instruments;
[0128] If so, the photometric weight value is set to a value within the range of (0,1);
[0129] If not, determine whether the current image sub-block is located in the image center region. The image center region is the region whose distance from the image center point is not less than a preset distance threshold.
[0130] If the current image sub-block is not located in the center region of the image, the metering weight value is set to a value within the range of (0,1);
[0131] If the current image sub-block is located in the center region of the image, then the metering weight value is set to 1.
[0132] Specifically, when setting the metering weight value, the image content should be taken into account. For image content that belongs to the target type, a metering weight value less than 1 can be set. Generally, in the application of endoscopic systems, the types of image content can specifically include human organs, diseased tissues, and medical tools and instruments located in the human body.
[0133] Specifically, when doctors use endoscopes to examine and treat patients, they may use medical instruments (such as biopsy forceps) inside the patient's body to assist in the operation. These medical instruments can interfere with the human organs or tissues being examined, and some medical instruments have a metallic luster that is prone to reflection, causing image overexposure. Therefore, in this embodiment, for image sub-blocks displaying medical instruments, the photometric weight value can be set to a value within the range of (0,1).
[0134] It is easy to understand that, in addition to medical tools and instruments, the target type could also be other things, such as food residue in a patient's stomach.
[0135] In addition, considering that clinical applications primarily focus on the central region of the image, and that the image edges are darker than the center due to light source attenuation, this embodiment sets the metering weight value to 1 for image sub-blocks in the central region; while for image sub-blocks outside the central region, the metering weight value can be set to a value within the range of (0,1). As the name suggests, the central region is an area centered on the image center point; those skilled in the art can set its size and shape according to the actual situation.
[0136] As a specific embodiment, the image dimming method for an endoscope system provided in this application, based on the above content, after determining that the current image sub-block is not located in the image center region, sets the photometric weight value to a value within the range of (0,1), including:
[0137] Set the metering weight value of the current image sub-block to a value within the range of (0,1), and the value is inversely correlated with the distance between the current image sub-block and the center point of the image.
[0138] Specifically, in this embodiment, the metering weight values between image sub-blocks in the non-center region can take different values within the range of (0,1). Specifically, the smaller the distance between the image sub-block and the center region, the larger the metering weight value can be; the larger the distance between the image sub-block and the center region, the smaller the metering weight value can be.
[0139] For details, please refer to the above information. Figure 5 , Figure 5 This application discloses yet another image dimming method for an endoscope system, which mainly includes:
[0140] S201: Acquire the images generated by the endoscope system.
[0141] S202: Calculate the image brightness value of each image sub-block in the image.
[0142] S203: Arrange the image brightness values of each image sub-block in descending order.
[0143] S204: Identify the image sub-blocks within the ranking range corresponding to the specified brightness level as the secondary bright areas.
[0144] S205: Calculate the average image brightness value of each image sub-block in the secondary bright area as a dimming reference value.
[0145] S206: Adjust the output brightness of the endoscope light source based on the dimming reference value.
[0146] S207: Update the acquired image and calculate the image brightness value of each image sub-block in the image.
[0147] S208: Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit; if not, proceed to S203; if yes, proceed to S209.
[0148] S209: Set corresponding metering weight values for each image sub-block, and update the calculated image brightness values for each image sub-block based on the metering weight values.
[0149] S210: Calculate the average image brightness value of each image sub-block in the image as the updated dimming reference value; proceed to S211.
[0150] S211: Adjust the output brightness of the endoscope light source based on the dimming reference value.
[0151] See Figure 6 As shown in the figure, this application discloses an image dimming device 300 for an endoscope system, which mainly includes a photometer module 301 and a dimming module 302 connected by communication.
[0152] The light metering module 301 is used to acquire the image generated by the endoscope system; calculate the image brightness value of each image sub-block in the image; determine the secondary bright area in the image, wherein the image brightness value of the secondary bright area is within the range corresponding to a specified brightness level, wherein the specified brightness level is between the highest brightness level and the lowest brightness level; calculate the average value of the image brightness value of each image sub-block in the secondary bright area as the dimming reference value of the image, and send it to the dimming module 302;
[0153] The dimming module 302 is used to adjust the output brightness of the endoscope light source based on the dimming reference value.
[0154] Specifically, the photometry module 301 can be communicatively connected to the image sensor in the endoscope system to acquire images from the image sensor for image photometry. Simultaneously, the dimming module 302 can be specifically connected to the drive circuit of the endoscope light source to adjust the output brightness of the endoscope light source. The endoscope light source is used for illumination during image capture by the endoscope's image sensor.
[0155] As can be seen, the image dimming device of the endoscope system disclosed in this application obtains a more accurate and comprehensive photometric result that can characterize the brightness of the entire image based on the sub-brightness photometric method. This provides a more scientific and reasonable data basis for adjusting the output brightness of the endoscope light source, helps to achieve accurate dimming and normal image brightness, effectively reduces the occurrence of image overexposure or underexposure, and improves the imaging quality of the system.
[0156] For details regarding the image dimming device of the aforementioned endoscope system, please refer to the aforementioned detailed introduction to the image dimming method of the endoscope system, which will not be repeated here.
[0157] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, specifically uses the photometer module 301 to calculate the image brightness value of each image sub-block in the image, for the following purposes:
[0158] The maximum value of the current pixel among the R, G, and B channels is taken as the image brightness value of the current pixel; the average value of the image brightness values of each pixel in the current image sub-block is calculated and taken as the image brightness value of the current image sub-block.
[0159] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, specifies the brightness level as the ranking level of the image brightness value. When determining the second brightest part in the image, the photometer module 301 is specifically used for:
[0160] Arrange the image brightness values of each image sub-block in descending order; determine the image sub-blocks within the ranking range corresponding to the specified brightness level as the second brightest parts.
[0161] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, specifies the brightness level as the value level of the image brightness. When determining the secondary bright areas in the image, the photometer module 301 is specifically used for:
[0162] Determine the range of image brightness values corresponding to a specified brightness level; identify image sub-blocks whose brightness values fall within the range as secondary bright areas.
[0163] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, further includes, after the dimming module 302 adjusts the output brightness of the endoscope light source based on the dimming reference value, the photometer module 301 is also used for:
[0164] Update the acquired image and calculate the image brightness value of each image sub-block in the image;
[0165] Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit;
[0166] If not, continue with the steps to determine the second brightest areas in the image and subsequent steps.
[0167] If so, the image brightness values of each image sub-block are updated based on the photometric weight values in order to update the dimming reference values.
[0168] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, wherein the photometer module 301, when updating the image brightness value of each image sub-block based on the photometer weight value in order to update the dimming reference value, is specifically used for:
[0169] Set corresponding metering weight values for each image sub-block; update and calculate the image brightness value for each image sub-block based on the metering weight values; calculate the average image brightness value of each image sub-block in the image as the updated dimming reference value.
[0170] Set corresponding metering weight values for each image sub-block, including:
[0171] Identify the type of image content within the current image sub-block;
[0172] Determine whether the image content type matches the target type; target types include medical tools and instruments.
[0173] If so, the photometric weight value is set to a value within the range of (0,1);
[0174] If not, determine whether the current image sub-block is located in the image center region; the image center region is the region whose distance from the image center point is not less than a preset distance threshold;
[0175] If the current image sub-block is not located in the center region of the image, the metering weight value is set to a value within the range of (0,1);
[0176] If the current image sub-block is located in the center region of the image, then the metering weight value is set to 1.
[0177] As a specific embodiment, the image dimming device of the endoscope system disclosed in this application, based on the above content, specifically uses the following when the photometer module 301 determines that the current image sub-block is not located in the center region of the image, and sets the photometer weight value to a value within the range of (0,1):
[0178] Set the metering weight value of the current image sub-block to a value within the range of (0,1), and the value is inversely correlated with the distance between the current image sub-block and the center point of the image.
[0179] See Figure 7 As shown in the figure, an embodiment of this application discloses an electronic device, including:
[0180] Memory 401 is used to store computer programs;
[0181] Processor 402 is configured to execute the computer program to implement the steps of the image dimming method for any of the endoscope systems described above.
[0182] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the steps of the image dimming method of any of the endoscope systems described above.
[0183] For details regarding the aforementioned electronic devices and computer-readable storage media, please refer to the aforementioned detailed introduction to the image dimming method for endoscope systems, which will not be repeated here.
[0184] The various embodiments in this application are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0185] It should also be noted that in this application, 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 a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. 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.
[0186] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. An image dimming method for an endoscope system, characterized in that, include: Acquire the images generated by the endoscope system; Calculate the image brightness value of each image sub-block in the image; Identify the secondary bright areas in the image; the image brightness values of the secondary bright areas are within the range corresponding to a specified brightness level, where the specified brightness level is the ranking level of the image brightness values, and the specified brightness level is between the highest brightness level and the lowest brightness level. The average image brightness value of each image sub-block in the secondary bright area is calculated as the dimming reference value; Adjust the output brightness of the endoscope light source based on the dimming reference value.
2. The image dimming method according to claim 1, characterized in that, The calculation of the image brightness value of each image sub-block in the image includes: The maximum value of the current pixel among the R, G, and B channel values is taken as the image brightness value of the current pixel; Calculate the average value of the image brightness of each pixel in the current image sub-block, and use it as the image brightness value of the current image sub-block.
3. The image dimming method according to claim 1, characterized in that, Determining the secondary bright areas in the image includes: Arrange the image brightness values of each image sub-block in descending order; The image sub-blocks within the ranking range corresponding to the specified brightness level are determined as the secondary bright areas.
4. The image dimming method according to any one of claims 1 to 3, characterized in that, After adjusting the output brightness of the endoscope light source based on the dimming reference value, the method further includes: Update the acquired image and calculate the image brightness value of each image sub-block in the image; Determine whether the image brightness values of at least a preset number of image sub-blocks are less than a preset limit; If not, continue with the steps of determining the second brightest areas in the image and subsequent steps; If so, the image brightness values of each image sub-block are updated based on the photometric weight values in order to update the dimming reference values.
5. The image dimming method according to claim 4, characterized in that, The step of updating the image brightness values of each image sub-block based on the photometric weight values in order to update the dimming reference values includes: Set corresponding metering weight values for each image sub-block; The image brightness value is updated and calculated for each of the image sub-blocks based on the photometric weight value; The average image brightness value of each image sub-block in the image is calculated as the updated dimming reference value.
6. The image dimming method according to claim 5, characterized in that, The step of setting corresponding metering weight values for each image sub-block includes: Identify the type of image content within the current image sub-block; Determine whether the type of the image content is a target type; the target type includes medical tools and instruments; If so, the photometric weight value is set to a value within the range of (0,1); If not, determine whether the current image sub-block is located in the image center region; the image center region is the region whose distance from the image center point is not less than a preset distance threshold; If the current image sub-block is not located in the center region of the image, the metering weight value is set to a value within the range of (0,1); If the current image sub-block is located in the center region of the image, then the metering weight value is set to 1.
7. The image dimming method according to claim 6, characterized in that, After determining that the current image sub-block is not located in the image center region, setting the metering weight value to a value within the range of (0,1) includes: The photometric weight value of the current image sub-block is set to a value within the range of (0,1), and the value is inversely correlated with the distance between the current image sub-block and the center point of the image.
8. An image dimming device for an endoscope system, characterized in that, This includes a photometer module and a dimming module for communication connectivity; The photometric module is used to acquire the image generated by the endoscope system and calculate the image brightness value of each image sub-block in the image. Identify the second brightest region in the image; the image brightness value of the second brightest region is within the range corresponding to a specified brightness level, the specified brightness level is the ranking level of the image brightness value, and the specified brightness level is between the highest brightness level and the lowest brightness level; calculate the average image brightness value of each image sub-block in the second brightest region as a dimming reference value, and send it to the dimming module; The dimming module is used to adjust the output brightness of the endoscope light source based on the dimming reference value.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the image dimming method for the endoscope system as claimed in any one of claims 1 to 7.
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 image dimming method for the endoscope system as described in any one of claims 1 to 7.