CN115546039A - Image dimming method, device, equipment and storage medium of endoscope system - Google Patents
Image dimming method, device, equipment and storage medium of endoscope system Download PDFInfo
- Publication number
- CN115546039A CN115546039A CN202110745030.5A CN202110745030A CN115546039A CN 115546039 A CN115546039 A CN 115546039A CN 202110745030 A CN202110745030 A CN 202110745030A CN 115546039 A CN115546039 A CN 115546039A
- Authority
- CN
- China
- Prior art keywords
- image
- value
- brightness
- dimming
- sub
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000005375 photometry Methods 0.000 claims abstract description 45
- 238000004590 computer program Methods 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 4
- 238000003384 imaging method Methods 0.000 abstract description 8
- 238000012512 characterization method Methods 0.000 abstract 1
- 230000008569 process Effects 0.000 description 12
- 210000002784 stomach Anatomy 0.000 description 10
- 238000001514 detection method Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000003902 lesion Effects 0.000 description 3
- 210000001519 tissue Anatomy 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000004043 dyeing Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000002575 gastroscopy Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 210000000056 organ Anatomy 0.000 description 2
- 238000010186 staining Methods 0.000 description 2
- 206010028980 Neoplasm Diseases 0.000 description 1
- 208000025865 Ulcer Diseases 0.000 description 1
- 238000001574 biopsy Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000002932 luster Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000010339 medical test Methods 0.000 description 1
- 210000004877 mucosa Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 231100000915 pathological change Toxicity 0.000 description 1
- 230000036285 pathological change Effects 0.000 description 1
- 239000000049 pigment Substances 0.000 description 1
- 239000011148 porous material Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 231100000397 ulcer Toxicity 0.000 description 1
- 210000001835 viscera Anatomy 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/94—Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10068—Endoscopic image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Endoscopes (AREA)
Abstract
The application discloses an image dimming method, an image dimming device, electronic equipment and a computer readable storage medium of an endoscope system, wherein the method comprises the following steps: acquiring an image detected and generated by an endoscope system; calculating the image brightness value of each image sub-block in the image; determining a secondary bright part in the image, wherein the image brightness value of the secondary bright part is in a range corresponding to the specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level; calculating the average value of the image brightness values of the image sub-blocks in the secondary bright part as a dimming reference value; and adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value. This application has obtained the photometry result of whole image brightness of more accurate comprehensive characterization based on time bright photometry, provides scientific and reasonable's data basis for the regulation of endoscope light source light-emitting brightness, and the help realizes accurate adjusting luminance and image brightness is normal, has reduced the emergence of the image overexposure or the image condition of dark excessively, has improved the imaging quality.
Description
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image dimming method and apparatus for an endoscope system, an electronic device, and a computer-readable storage medium.
Background
An endoscope is a detection instrument integrating an image sensor, an optical lens, a light source illumination and a mechanical device, and is generally a tube equipped with a light source and a lens. The endoscope body can enter the stomach or other natural pore canals through the mouth, thereby observing the pathological changes which can not be shown by X-ray, for example, the ulcer or tumor in the stomach can be observed.
Because the scene in the human body is complex, the endoscope system generally needs to adjust the brightness of the light source in real time according to the photometric condition of the image to improve the imaging quality. In the related art, when an image of an endoscope system is measured, a peak metering scheme is often adopted, that is, an image brightness value of a brightest part in the image is used as a dimming reference value of a current image. However, after the brightness of the light emitted from the endoscope light source is adjusted based on the dimming reference value obtained in this way, the problem of too dark or overexposure easily occurs in images obtained in some scenes, which is not favorable for doctors to identify lesions.
In view of the above, it is an important need for those skilled in the art to provide a solution to the above technical problems.
Disclosure of Invention
An object of the present application is to provide an image dimming method and apparatus for an endoscope system, an electronic device, and a computer-readable storage medium, so as to improve a dimming effect and improve imaging quality by performing accurate photometry on an image.
In order to solve the above technical problem, in one aspect, the present application discloses an image dimming method of an endoscope system, including:
acquiring an image detected and generated by the endoscope system;
calculating the image brightness value of each image sub-block in the image;
determining a second-bright location in the image; the image brightness value of the secondary bright part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level;
calculating the average value of the image brightness values of the image subblocks in the secondary bright part to serve as a dimming reference value;
and adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value.
Optionally, the calculating an image brightness value of each image sub-block in the image includes:
taking the maximum value of the current pixel in three channel values of R, G and B as the image brightness value of the current pixel;
and calculating the average value of the image brightness values of all pixels in the current image sub-block as the image brightness value of the current image sub-block.
Optionally, the specifying the brightness level is a ranking level of brightness values of an image, and the determining a second-bright part in the image includes:
arranging the image brightness values of the image sub-blocks in a descending order;
and determining the image sub-blocks in the ranking interval corresponding to the specified brightness level as the secondary bright parts.
Optionally, the determining the second-bright part in the image, where the specified brightness level is a value level of a brightness value of the image, includes:
determining a value interval of an image brightness value corresponding to the specified brightness level;
and determining the image subblock with the image brightness value in the value range as the secondary bright part.
Optionally, after the adjusting the brightness of the light emitted from the endoscope light source based on the dimming reference value, the method further includes:
updating the acquired image and calculating the image brightness value of each image sub-block in the image;
judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not;
if not, continuing to execute the steps of determining the secondary bright part in the image and the subsequent steps;
and if so, updating the image brightness value of each image sub-block based on the photometric weight value so as to update and calculate the dimming reference value.
Optionally, the updating the image brightness value of each image sub-block based on the photometric weight value so as to update the calculated dimming reference value includes:
setting corresponding photometric weight values for the image sub-blocks;
updating and calculating an image brightness value for each image subblock based on the photometric weight value;
and calculating the average value of the image brightness values of the image subblocks in the image to serve as the updated dimming reference value.
Optionally, the setting of the corresponding photometric weight value for each image sub-block includes:
identifying the type of image content in the current image sub-block;
judging whether the type of the image content is a target type; the target type comprises a medical tool instrument;
if yes, setting the photometric weight value to be a value in the range of (0, 1);
if not, judging whether the current image subblock is positioned in the image central region or not; the image center area is an area with a distance from the image center point not less than a preset distance threshold;
if the current image subblock is not located in the image central area, setting the photometric weight value to be a value in the range of (0, 1);
and if the current image subblock is located in the image center area, setting the photometric weight value to 1.
Optionally, after determining that the current image subblock is not located in the image center region, the setting the photometric weight value to a value in a range of (0, 1) includes:
and setting the photometric weight value of the current image sub-block to be a value in the range of (0, 1), wherein the value is inversely related to the distance between the current image sub-block and the image central point.
In another aspect, the present application further discloses an image dimming device of an endoscope system, comprising a photometry module and a dimming module which are in communication connection;
the photometric module is used for acquiring an image detected and generated by the endoscope system; calculating the image brightness value of each image sub-block in the image; determining a second-bright location in the image; the image brightness value of the secondary bright part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level; calculating the average value of the image brightness values of the image subblocks in the secondary brightness position to serve as a dimming reference value, and sending the dimming reference value to the dimming module;
the dimming module is used for adjusting the light emitting brightness of the endoscope light source based on the dimming reference value.
Optionally, when the light metering module calculates the image brightness value of each image sub-block in the image, the light metering module is specifically configured to:
taking the maximum value of the current pixel in three channel values of R, G and B as the image brightness value of the current pixel; and calculating the average value of the image brightness values of all pixels in the current image sub-block as the image brightness value of the current image sub-block.
Optionally, the specified brightness level is a ranking level of a brightness value of the image, and the light metering module is specifically configured to, when determining a second-bright part in the image:
arranging the image brightness values of the image sub-blocks in a descending order; and determining the image sub-blocks in the ranking interval corresponding to the specified brightness level as the secondary bright parts.
Optionally, the specified brightness level is a value level of a brightness value of the image, and the photometry module is specifically configured to, when determining a next-bright part in the image:
determining a value interval of an image brightness value corresponding to the specified brightness level; and determining the image subblock with the image brightness value in the value range as the secondary bright part.
Optionally, after the dimming module adjusts the light output brightness of the endoscope light source based on the dimming reference value, the photometry module is further configured to:
updating the acquired image and calculating the image brightness value of each image sub-block in the image;
judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not;
if not, continuing to execute the steps of determining the secondary bright part in the image and the subsequent steps;
and if so, updating the image brightness value of each image sub-block based on the photometric weight value so as to update and calculate the dimming reference value.
Optionally, the photometry module is specifically configured to, when updating the image brightness value of each image sub-block based on the photometry weight value so as to update the dimming reference value:
setting corresponding photometric weight values for the image sub-blocks; updating and calculating an image brightness value for each image subblock based on the photometric weight value; and calculating the average value of the image brightness values of the image sub-blocks in the image to serve as the updated dimming reference value.
The setting of the corresponding photometric weight value for each image sub-block includes:
identifying the type of image content in the current image sub-block;
judging whether the type of the image content is a target type; the target type comprises a medical tool instrument;
if yes, setting the photometric weight value to be a value in the range of (0, 1);
if not, judging whether the current image subblock is located in the image central area or not; the image center area is an area with a distance from the image center point not less than a preset distance threshold;
if the current image subblock is not located in the image central area, setting the photometric weight value to be a value in the range of (0, 1);
and if the current image subblock is located in the image center area, setting the photometric weight value to 1.
Optionally, after determining that the current image subblock is not located in the image center region, when the photometry weight value is set to a value in a range of (0, 1), the photometry module is specifically configured to:
and setting the photometric weight value of the current image sub-block to be a value in the range of (0, 1), wherein the value is inversely related to the distance between the current image sub-block and the image central point.
In another aspect, the present application also discloses an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of any one of the image dimming methods of the endoscope system as described above.
In yet another aspect, the present application also discloses a computer readable storage medium having a computer program stored therein, which when executed by a processor, is used to implement the steps of any one of the image dimming methods of the endoscope system as described above.
The image dimming method, the image dimming device, the electronic equipment and the computer-readable storage medium of the endoscope system have the advantages that: this application obtains can represent the photometry result of whole image luminance more accurately comprehensively based on time bright photometry, provides more scientific and reasonable's data foundation for the regulation of the light-emitting luminance of endoscope light source, and the help realizes accurate adjusting luminance and image luminance is normal, has reduced the emergence of image overexposure or the image condition of excessively dark forcefully, has improved system imaging quality.
Drawings
In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings that are needed to be used in the description of the prior art and the embodiments of the present application will be briefly described below. Of course, the following description of the drawings related to the embodiments of the present application is only a part of the embodiments of the present application, and it will be obvious to those skilled in the art that other drawings can be obtained from the provided drawings without any creative effort, and the obtained other drawings also belong to the protection scope of the present application.
Fig. 1 is a flowchart of an image dimming method of an endoscope system according to an embodiment of the present disclosure;
FIG. 2 is a prior art image of the stomach wall obtained after peak photometry based dimming;
FIG. 3 is an image of a stomach wall after dimming based on sub-bright portion photometry as disclosed in an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a process comparison of sub-luminance photometry and weighted average photometry as disclosed in the present application;
FIG. 5 is a flowchart of an image dimming method of an endoscope system according to an embodiment of the present disclosure;
fig. 6 is a block diagram showing an arrangement of an image dimming device of an endoscope system according to an embodiment of the present invention;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The core of the application is to provide an image dimming method and device of an endoscope system, an electronic device and a computer readable storage medium, so that the dimming effect is improved by performing accurate photometry on an image, and the imaging quality is improved.
In order to more clearly and completely describe the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Endoscopes are now widely used in medical testing and treatment. In order to improve the photographing illumination condition of the endoscope in the complex application environment of the human body, the endoscope system is provided with a dimming function: luminance detection is carried out on an image generated by system detection to obtain a photometric value, and the light emitting luminance of an endoscope light source is adjusted by taking the photometric value as a dimming reference, so that a clear image with reasonable exposure is shot.
The application provides an image dimming scheme of an endoscope system, which can effectively solve the problem that the image overexposure or the image too dark is easily caused by a peak photometry adopted during dimming of the current endoscope system.
Referring to fig. 1, an embodiment of the present application discloses an image dimming method of an endoscope system, which mainly includes:
s101: an image generated by detection by the endoscope system is acquired.
S102: and calculating the image brightness value of each image sub-block in the image.
S103: the next brighter location in the image is determined. The image brightness value of the sub-bright part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level.
S104: and calculating the average value of the image brightness values of the image sub-blocks in the secondary bright part as an image dimming reference value.
S105: and adjusting the light emitting brightness of the endoscope light source based on the image brightness value.
The technical scheme provided by the application is particularly 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 realized based on an LED lamp and the like, is driven by a corresponding driving circuit to emit light and is used for illuminating in the shooting process of the camera.
The image in the present application is specifically an image obtained when an endoscope is used to perform lesion examination or surgical treatment on an internal organ, tissue, or the like of a human body. Taking gastroscopy as an example, the image may be specifically one or more frames of images in a video shot by a camera in the gastroscopy process, or may be a single image shot by the camera. Specifically, the brightness detection of the image is the basis for dimming, and therefore, whether the brightness value of the image is accurate or not is directly related to the imaging quality of the dimmed image: if the brightness value of the image obtained by photometry is too large relative to the brightness of the actual image, the reduction of the brightness in the dimming process is large compared with the actual requirement, and the image obtained after dimming is easy to have the problem of too dark; conversely, if the luminance value of the image obtained by photometry is too small relative to the actual luminance of the image, the image obtained by dimming is likely to have a problem of overexposure.
In the conventional peak photometry, the average value of the brightness values of the brightest parts in the image is used as the dimming reference value of the whole image for dimming, so that the problem of over-dark or over-exposure of the image is easy to occur. Therefore, the method adopts a sub-brightness metering scheme, namely, the method specifically selects a sub-brightness part from the image, and takes the average value of the image brightness values of the sub-brightness part as the dimming reference value of the whole image to participate in dimming.
Specifically, the image acquired in real time can be divided into a plurality of image sub-blocks according to a preset size division standard, and each image sub-block comprises a plurality of pixels. Preferably, the size of each image sub-block may be kept uniform. Alternatively, the division criterion of the image sub-blocks may be selected as the type of the image content, for example, a continuous region where the image content is a stomach wall may be divided into one image sub-block, and a continuous region where the image content is empty may be divided into another image sub-block. And aiming at each image subblock, calculating the image brightness value of each pixel point in the image subblock according to the RGB value of each pixel, and further calculating the image brightness value of the image subblock. Wherein R represents red, G green, and B blue.
The image brightness value is a numerical representation of the image brightness. It is easily understood that the luminance of each image sub-block in an image is different in size, and there are different luminance levels, and one skilled in the art can set the distinguishing standard between the luminance levels based on the image luminance values. In the present application, the brightness value of the image of the sub-bright portion to be determined is within a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level.
In one embodiment, the image brightness may be divided into ten levels, ordered sequentially from high to low as the first, second, third, \8230;, tenth brightness level. Then, the second luminance level or the third luminance level or the fourth luminance level may be set as the designated luminance level corresponding to the sub-bright portion; alternatively, both the third luminance level and the fourth luminance level may be determined as the designated luminance level corresponding to the sub-bright portion.
Therefore, according to the brightness level to which the image brightness value of each image sub-block belongs, which image sub-blocks are included in the sub-bright part in the image can be determined, and further, the average value can be obtained for the image brightness value of each image sub-block belonging to the sub-bright part and used as the dimming reference value of the image to participate in dimming: if the dimming reference value of the image is higher than the set value, the light-emitting brightness of the endoscope light source is properly reduced; and if the image brightness value of the image is lower than the set value, the light-emitting brightness of the endoscope light source is properly increased.
Referring to fig. 2 and 3 in comparison, fig. 2 is a prior art image of the stomach wall after dimming based on the peak photometry, and it is obvious that the image of the stomach wall in fig. 2 is overexposed, so that the doctor cannot accurately identify the focus of the stomach of the patient according to the image. Fig. 3 is an image of the stomach wall after light adjustment based on the sub-bright portion photometry disclosed in the embodiment of the present application, which shows that the image brightness is normal, so that a doctor can normally perform lesion judgment. Based on fig. 2 and fig. 3, it can be known that the sub-luminance photometry provided by the present application can effectively solve the problem of image overexposure in some image scenes.
Therefore, the image dimming method of the endoscope system, provided by the application, obtains the photometric result capable of representing the brightness of the whole image more accurately and comprehensively based on the secondary brightness photometry, provides a more scientific and reasonable data basis for the adjustment of the light-emitting brightness of the endoscope light source, helps to realize accurate dimming and normal image brightness, powerfully reduces the occurrence of the situation of image overexposure or image overlong, and improves the imaging quality of the system.
As a specific embodiment, the method for adjusting brightness of an image in an endoscope system according to an embodiment of the present application, based on the above, includes:
taking the maximum value of the current pixel in three channel values of R, G and B as the image brightness value of the current pixel;
and calculating the average value of the image brightness values of all pixels in the current image sub-block as the image brightness value of the current image sub-block.
It should be noted that, in the present embodiment, when the image brightness value of each pixel is calculated, a V-photometry scheme is specifically adopted, that is, the maximum value of the pixel in three channel values of R, G, and B is calculated and used as the image brightness value of the corresponding pixel.
In a traditional light measuring scheme, an RGB value of a pixel is converted into a YCbCr value, and a Y luminance value therein is used as an image luminance value of the pixel. For this method, when the B channel component is high and other components are low in the blue condition, i.e., the image RGB, the Y luminance value calculated accordingly is also low, and at this time, even if the blue component reaches the maximum value to cause the B channel overexposure, the Y luminance value is still low. Therefore, overexposure is likely to occur in an image that is dimmed using this Y luminance value as feedback. Among them, blue staining is a staining means, i.e., pigment is sprayed locally under an endoscope, so that the stained focus has good contrast with normal mucosa tissues, thereby facilitating the focus discovery.
In order to solve the problem of B-channel overexposure under the blue-dyeing condition, the present embodiment specifically adopts a V-photometry to calculate the brightness value of an image. Since the V photometry selects the maximum value in the RGB three channels, the brightness value of the image obtained under the blue dyeing condition is larger, and the brightness value of the image is used as a dimming reference value, so that the dimming can be more effectively carried out, and the brightness of the image is normal.
As a specific embodiment, the image dimming method of an endoscope system according to the embodiment of the present application, based on the above, specifies a brightness level as a ranking level of a brightness value of an image, and determines a sub-bright portion in the image, including:
arranging the image brightness values of the image sub-blocks in a descending order;
and determining the image sub-blocks in the ranking interval corresponding to the designated brightness level as sub-bright parts.
For example, as a specific example, an image sub-block whose image luminance value size ranks within the top 5% (including 5%) may correspond to a first luminance level, belonging to the brightest region; the image sub-block with the image brightness value ranked in the size of (5%, 15% ] (including two endpoints) may correspond to the second brightness level and belong to the second bright region, that is, the ranking interval of the image brightness value corresponding to the second bright portion is specifically set to (5%, 15% ]inthe present embodiment, and 5% and 15% thereof may be replaced by other values.
Of course, one skilled in the art may also arrange the brightness values of the images in order from small to large, and select an appropriate middle section as the sub-bright section at the position after the arrangement.
As a specific embodiment, the image dimming method of an endoscope system according to the embodiment of the present application, based on the above, specifies a brightness level as a value level of a brightness value of an image, and determines a sub-bright portion in the image, including:
determining a value interval of an image brightness value corresponding to the specified brightness level;
and determining the image sub-block with the image brightness value in the value range as a secondary bright part.
Specifically, in this embodiment, a value range of the image luminance values is set for the sub-bright portion in advance, so that all image sub-blocks with image luminance values within the value range can be determined as the sub-bright portion.
As a specific embodiment, the image dimming method of the endoscope system provided in the embodiments of the present application, after adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value, further includes:
updating the acquired image and calculating the image brightness value of each image sub-block in the image;
judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not;
if not, continuously determining a secondary bright part in the image and subsequent steps thereof;
and if so, updating the image brightness value of each image sub-block based on the photometric weight value so as to update the calculated dimming reference value.
In particular, in some special application scenarios, for example, when the brightest part and the second-bright part of the image have brightness much higher than the overall real brightness level due to local position reflection in the field of view, the problem of too dark image may occur when dimming is performed by using the second-bright metering scheme provided in this application. For this problem, the embodiment can update and detect the image brightness values of the image sub-blocks, and when the image brightness values of not less than a preset number of image sub-blocks are all too small (less than a preset limit value), it can be determined that the image is too dark at this time, and another standby photometry scheme can be switched to use, that is, the image brightness values of the image sub-blocks are optimized and calculated by setting a photometry weight value, so that a more reasonable dimming reference value is obtained to avoid the image after dimming from being too dark. Due to the introduction of the photometric weight value, this scheme may be referred to as weighted average photometry.
As a specific embodiment, the image dimming method of an endoscope system provided in the embodiment of the present application, based on the above, updates an image brightness value of each image sub-block based on a photometric weight value so as to update a calculated dimming reference value, and includes:
setting corresponding photometric weight values for the image sub-blocks;
updating and calculating the brightness value of the image for each image sub-block based on the photometric weight value;
and calculating the average value of the image brightness values of the image sub-blocks in the image as the updated dimming reference value.
Specifically, in order to further optimize the calculation of the dimming reference value, the present embodiment introduces a photometric weight value to update the image brightness value of each image sub-block, i.e., a product of the initial image brightness value of the image sub-block and the photometric weight value is taken as an updated image brightness value. Wherein, the photometric weight value is a parameter with a value in the range of (0, 1).
In addition, since the photometric weight value is introduced to optimize the photometric result of each image sub-block, when the dimming reference value of the entire image is calculated, the image brightness values of all image sub-blocks in the image may be specifically involved in the average calculation.
In order to facilitate comparison of the processes of the secondary luminance photometry and the weighted average photometry, the present application further provides a schematic diagram for comparing two photometry schemes, and specifically refer to fig. 4. As shown in fig. 4, the main processes of the sub-brightness photometry include dividing the image into image sub-blocks, calculating the image brightness values of the image sub-blocks, determining the sub-brightness portions according to the sequence or value, extracting the image brightness values of the image sub-blocks of the sub-brightness portions, calculating the average value of the image brightness values of the sub-brightness portions, and adjusting the brightness of the endoscope light source.
The main process of the weighted average photometry comprises the steps of dividing an image into image sub-blocks, calculating the image brightness value of each image sub-block, setting a photometric weight value for each image sub-block, updating the image brightness value of each image sub-block, calculating the average value of the image brightness values of all the image sub-blocks, and adjusting the light-emitting brightness of an endoscope light source.
As a specific embodiment, the image dimming method of an endoscope system according to the embodiment of the present application, based on the above, sets a corresponding photometric weight value for each image sub-block, including:
identifying the type of image content in the current image sub-block;
judging whether the type of the image content is a target type, wherein the target type comprises a medical tool instrument;
if yes, setting the photometric weight value to be a value in the range of (0, 1);
if not, judging whether the current image subblock is located in an image central region, wherein the image central region is a region, and the distance from the image central point is not less than a preset distance threshold;
if the current image subblock is not located in the image center area, setting the photometric weight value to be a value in a range of (0, 1);
and if the current image subblock is located in the image center area, setting the photometric weight value to 1.
Specifically, the image content may be specifically considered when setting the photometric weight value, and for some image contents belonging to the target type, a photometric weight value whose value is less than 1 may be set. Generally, in an endoscope system application, the types of image content may specifically include human organs, diseased tissues, medical tools and instruments located in the human body, and the like.
In particular, a physician may work with some medical tool instruments (e.g., biopsy forceps) to assist in the performance of a procedure within a patient during examination or treatment of the patient using an endoscope. These medical instruments have a certain interference to the organs or tissues of the human body to be examined, and some of the medical instruments have metallic luster and are easy to reflect light to cause image overexposure, so the embodiment can set the photometric weight value of the image subblock in the range of (0, 1) for the image subblock in which the medical instrument is displayed.
It will be readily appreciated that the type of target may be something other than a medical tool, such as food left behind in the patient's stomach, etc.
In addition to this, in the present embodiment, the photometric weight value may be set to 1 for an image sub-block of the image center region, considering that the focus in clinical application is mainly concentrated on the center region of the image, and the image edge position is dark with respect to the image center position due to the attenuation of the light source; and for image sub-blocks other than the image center region, the photometric weight value thereof may be set to a value in the range of (0, 1). As the name implies, the image center area is an area with the image center point as the center, and the size and shape of the area can be set by a person skilled in the art according to the actual situation.
As a specific embodiment, the image dimming method of an endoscope system provided by the embodiment of the present application, based on the above, after determining that the current image sub-block is not located in the image center area, sets the photometric weight value to a value in a range of (0, 1), and includes:
and setting the photometric weight value of the current image sub-block to be a value in the range of (0, 1), wherein the value is inversely related to the distance between the current image sub-block and the image central point.
Specifically, in this embodiment, the photometric weight values between image sub-blocks in the non-image center region may take different values within a range of (0, 1). Specifically, the smaller the distance between the image subblock and the image center area is, the larger the photometric weight value may be; the larger the distance between the image sub-block and the image center area is, the smaller the photometric weight value may be.
Referring to fig. 5, fig. 5 discloses another image dimming method of an endoscope system according to an embodiment of the present application, which mainly includes:
s201: images generated by detection by the endoscope system are acquired.
S202: and calculating the image brightness value of each image sub-block in the image.
S203: and arranging the image brightness values of the image sub-blocks in descending order.
S204: and determining the image sub-blocks in the ranking interval corresponding to the designated brightness level as second-bright parts.
S205: and calculating the average value of the image brightness values of the image subblocks in the second bright part as a dimming reference value.
S206: and adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value.
S207: and updating the acquired image and calculating the image brightness value of each image sub-block in the image.
S208: judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not; if not, entering S203; if yes, the process proceeds to S209.
S209: and setting a corresponding photometric weight value for each image sub-block, and updating and calculating the image brightness value for each image sub-block based on the photometric weight value.
S210: calculating the average value of the image brightness values of all the image sub-blocks in the image to serve as an updated dimming reference value; the process proceeds to S211.
S211: and adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value.
Referring to fig. 6, an embodiment of the present application discloses an image dimming device 300 of an endoscope system, which mainly includes a photometry module 301 and a dimming module 302 that are connected in communication;
the light metering module 301 is used for acquiring an image detected and generated by the endoscope system; calculating the image brightness value of each image sub-block in the image; determining a secondary bright part in the image, wherein the image brightness value of the secondary bright part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level; calculating the average value of the image brightness values of the image sub-blocks in the sub-bright part as the dimming reference value of the image, and sending the average value to the dimming module 302;
the dimming module 302 is used for adjusting the light emitting brightness of the endoscope light source based on the dimming reference value.
Specifically, the photometry module 301 may be in communication connection with an image sensor in the endoscope system, so as to acquire an image from the image sensor for image photometry. Meanwhile, the dimming module 302 may be specifically connected to a driving circuit of the endoscope light source so as to adjust the brightness of the light emitted from the endoscope light source. Wherein the endoscope light source is used for illuminating during the shooting of an image sensor of the endoscope.
Therefore, the image dimming device of the endoscope system, disclosed by the embodiment of the application, obtains the photometric result capable of representing the brightness of the whole image more accurately and comprehensively based on the secondary brightness photometry, provides a more scientific and reasonable data basis for the adjustment of the light-emitting brightness of the endoscope light source, helps to realize accurate dimming and normal image brightness, powerfully reduces the occurrence of the image overexposure or image overlong condition, and improves the imaging quality of the system.
For the details of the image dimming device of the endoscope system, reference may be made to the detailed description of the image dimming method of the endoscope system, and details thereof are not repeated here.
As a specific embodiment, in the image dimming device of the endoscope system disclosed in the embodiment of the present application, on the basis of the above contents, when the light metering module 301 calculates the image brightness values of the image sub-blocks in the image, the light metering module is specifically configured to:
taking the maximum value of the current pixel in three channel values of R, G and B as the image brightness value of the current pixel; and calculating the average value of the image brightness values of all pixels in the current image sub-block as the image brightness value of the current image sub-block.
As a specific embodiment, the image dimming device of the endoscope system disclosed in the embodiment of the present application specifies the brightness level as a ranking level of the brightness value of the image on the basis of the above contents, and the photometry module 301 is specifically configured to:
arranging the image brightness values of the image sub-blocks in a descending order; and determining the image sub-blocks in the ranking interval corresponding to the designated brightness level as sub-bright parts.
As a specific embodiment, in addition to the above, the image dimming device of the endoscope system disclosed in the embodiment of the present application specifies the brightness level as a value level of the brightness value of the image, and the light measurement module 301 is specifically configured to, when determining a second-bright portion in the image:
determining a value interval of an image brightness value corresponding to the specified brightness level; and determining the image subblocks with the image brightness values in the value range as secondary bright parts.
As a specific embodiment, the image dimming device of the endoscope system disclosed in the embodiment of the present application is based on the above, and after the dimming module 302 adjusts the light-emitting brightness of the endoscope light source based on the dimming reference value, the light metering module 301 is further configured to:
updating the acquired image and calculating the image brightness value of each image sub-block in the image;
judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not;
if not, continuously determining a secondary bright part in the image and subsequent steps;
and if so, updating the image brightness value of each image sub-block based on the photometric weight value so as to update and calculate the dimming reference value.
As a specific embodiment, in the image dimming device of the endoscope system disclosed in the embodiment of the present application, on the basis of the above contents, the photometry module 301, when updating the image brightness value of each image sub-block based on the photometry weight value so as to update the calculated dimming reference value, is specifically configured to:
setting corresponding photometric weight values for the image sub-blocks; updating and calculating the brightness value of the image for each image sub-block based on the photometric weight value; and calculating the average value of the image brightness values of the image sub-blocks in the image as the updated dimming reference value.
Setting corresponding photometric weight values for each image sub-block, including:
identifying the type of image content in the current image sub-block;
judging whether the type of the image content is a target type; the target type includes a medical tool instrument;
if yes, setting the photometric weight value to be a value in the range of (0, 1);
if not, judging whether the current image subblock is located in the image central area or not; the image center area is an area with the distance from the image center point not less than a preset distance threshold;
if the current image subblock is not located in the image central area, setting the photometric weight value to be a value in the range of (0, 1);
and if the current image subblock is located in the image center area, setting the photometric weight value to 1.
As a specific embodiment, in the image dimming device of the endoscope system disclosed in the embodiment of the present application, on the basis of the above contents, the photometry module 301, after determining that the current image sub-block is not located in the image center area, is specifically configured to:
and setting the photometric weight value of the current image subblock to be a value within the range of (0, 1), wherein the value is inversely related to the distance between the current image subblock and the image center point.
Referring to fig. 7, an embodiment of the present application discloses an electronic device, including:
a memory 401 for storing a computer program;
a processor 402 for executing the computer program to implement the steps of any of the image dimming methods of the endoscope system as described above.
Further, the present application also discloses a computer-readable storage medium, in which a computer program is stored, and the computer program is used for implementing the steps of any one of the image dimming methods of the endoscope system as described above when executed by a processor.
For details of the electronic device and the computer-readable storage medium, reference may be made to the foregoing detailed description of the image dimming method of the endoscope system, and details thereof are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the equipment disclosed by the embodiment, the description is relatively simple because the equipment corresponds to the method disclosed by the embodiment, and the relevant parts can be referred to the method part for description.
It is further noted that, throughout this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The technical solutions provided in the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall into the protection scope of the present application.
Claims (11)
1. An image dimming method of an endoscope system, comprising:
acquiring an image detected and generated by the endoscope system;
calculating the image brightness value of each image sub-block in the image;
determining a second-bright location in the image; the image brightness value of the secondary brightness part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level;
calculating the average value of the image brightness values of the image subblocks in the secondary brightness position as a dimming reference value;
and adjusting the light-emitting brightness of the endoscope light source based on the dimming reference value.
2. The method according to claim 1, wherein said calculating an image brightness value of each image sub-block in the image comprises:
taking the maximum value of the current pixel in three channel values of R, G and B as the image brightness value of the current pixel;
and calculating the average value of the image brightness values of all pixels in the current image sub-block as the image brightness value of the current image sub-block.
3. The image dimming method of claim 2, wherein the designated brightness level is a ranking level of brightness values of an image, and the determining of a second-brighter portion in the image comprises:
arranging the image brightness values of the image sub-blocks in a descending order;
and determining the image sub-blocks in the ranking interval corresponding to the specified brightness level as the secondary bright parts.
4. The image dimming method according to claim 2, wherein the specified brightness level is a value level of a brightness value of an image, and the determining a sub-bright portion in the image comprises:
determining a value interval of an image brightness value corresponding to the specified brightness level;
and determining the image subblock with the image brightness value in the value range as the secondary bright part.
5. The image dimming method according to any one of claims 1 to 4, further comprising, after the adjusting the brightness of the light output from the endoscope light source based on the dimming reference value:
updating the acquired image and calculating the image brightness value of each image sub-block in the image;
judging whether the image brightness values of not less than a preset number of image sub-blocks are less than a preset limit value or not;
if not, continuing to execute the steps of determining the secondary bright part in the image and the subsequent steps;
and if so, updating the image brightness value of each image sub-block based on the photometric weight value so as to update the calculated dimming reference value.
6. The image dimming method according to claim 5, wherein the updating the image brightness value of each image sub-block based on the photometric weight value so as to update the calculated dimming reference value comprises:
setting corresponding photometric weight values for the image sub-blocks;
updating and calculating an image brightness value for each image sub-block based on the photometric weight value;
and calculating the average value of the image brightness values of the image subblocks in the image to serve as the updated dimming reference value.
7. The image dimming method according to claim 6, wherein the setting of the corresponding photometric weight value for each image sub-block comprises:
identifying the type of image content in the current image sub-block;
judging whether the type of the image content is a target type; the target type comprises a medical tool instrument;
if yes, setting the photometric weight value to be a value in the range of (0, 1);
if not, judging whether the current image subblock is located in the image central area or not; the image center area is an area with the distance from the image center point not less than a preset distance threshold;
if the current image subblock is not located in the image center area, setting the photometric weight value to be a value in a range of (0, 1);
and if the current image subblock is located in the image center area, setting the photometric weight value to 1.
8. The image dimming method according to claim 7, wherein the setting the photometric weight value to a value in a range of (0, 1) after determining that the current image subblock is not located in the image center region comprises:
and setting the photometric weight value of the current image subblock to be a value within the range of (0, 1), wherein the value is inversely related to the distance between the current image subblock and the image center point.
9. An image dimming device of an endoscope system is characterized by comprising a photometry module and a dimming module which are in communication connection;
the photometric module is used for acquiring an image detected and generated by the endoscope system; calculating the image brightness value of each image sub-block in the image; determining a second-bright location in the image; the image brightness value of the secondary bright part is in a range corresponding to a specified brightness level, and the specified brightness level is between the highest brightness level and the lowest brightness level; calculating the average value of the image brightness values of the image subblocks in the secondary bright part to serve as a dimming reference value, and sending the dimming reference value to the dimming module;
the dimming module is used for adjusting the light emitting brightness of the endoscope light source based on the dimming reference value.
10. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the image dimming method of an endoscope system according to any of claims 1 to 8.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the image dimming method of an endoscope system according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110745030.5A CN115546039A (en) | 2021-06-30 | 2021-06-30 | Image dimming method, device, equipment and storage medium of endoscope system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110745030.5A CN115546039A (en) | 2021-06-30 | 2021-06-30 | Image dimming method, device, equipment and storage medium of endoscope system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115546039A true CN115546039A (en) | 2022-12-30 |
Family
ID=84723046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110745030.5A Pending CN115546039A (en) | 2021-06-30 | 2021-06-30 | Image dimming method, device, equipment and storage medium of endoscope system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115546039A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116245771A (en) * | 2023-03-22 | 2023-06-09 | 新光维医疗科技(苏州)股份有限公司 | Endoscope image brightness automatic enhancement method and system based on image secondary enhancement |
-
2021
- 2021-06-30 CN CN202110745030.5A patent/CN115546039A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116245771A (en) * | 2023-03-22 | 2023-06-09 | 新光维医疗科技(苏州)股份有限公司 | Endoscope image brightness automatic enhancement method and system based on image secondary enhancement |
CN116245771B (en) * | 2023-03-22 | 2024-04-02 | 新光维医疗科技(苏州)股份有限公司 | Endoscope image brightness automatic enhancement method and system based on image secondary enhancement |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5968944B2 (en) | Endoscope system, processor device, light source device, operation method of endoscope system, operation method of processor device, operation method of light source device | |
CN112351724B (en) | Electronic endoscope system | |
JP5814698B2 (en) | Automatic exposure control device, control device, endoscope device, and operation method of endoscope device | |
CN109310301A (en) | Fujinon electronic video endoscope processor and electronic endoscope system | |
JPWO2018159363A1 (en) | Endoscope system and operation method thereof | |
JP5269921B2 (en) | Electronic endoscope system and method for operating electronic endoscope system | |
WO2016185763A1 (en) | Light-source control device, light-source control method, and imaging system | |
BRPI0609099A2 (en) | biological observation apparatus | |
CN112351723B (en) | Electronic endoscope system and data processing device | |
CN111107778B (en) | Medical image processing system, endoscope system, diagnosis support device, and medical service support device | |
CN112930136B (en) | Electronic endoscope system and data processing device | |
US20190328218A1 (en) | Image processing device, image processing method, and computer-readable recording medium | |
CN115546039A (en) | Image dimming method, device, equipment and storage medium of endoscope system | |
US20120071718A1 (en) | Endoscope apparatus and method of controlling endoscope apparatus | |
CN109152520A (en) | Image signal processing apparatus, image-signal processing method and image signal processing program | |
CN108463157A (en) | Endoscope-use processor | |
US20230237659A1 (en) | Image processing apparatus, endoscope system, operation method of image processing apparatus, and non-transitory computer readable medium | |
JP2022053845A (en) | Processor for endoscope and endoscope system | |
US10462440B2 (en) | Image processing apparatus | |
JP7214886B2 (en) | Image processing device and its operating method | |
JP6926242B2 (en) | Electronic Endoscope Processor and Electronic Endoscope System | |
JP2017123997A (en) | Imaging system and processing device | |
WO2022059233A1 (en) | Image processing device, endoscope system, operation method for image processing device, and program for image processing device | |
JP3842995B2 (en) | Electronic endoscope device | |
CN115670351A (en) | Endoscope exposure control method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |