Image brightness correction method and device, equipment and storage medium
By obtaining the brightness values and current values of each pixel point of the endoscope, the target brightness compensation relationship is constructed based on the preset brightness display range and standard brightness compensation relationship, which solves the brightness problem caused by the degradation of image sensor performance and realizes the brightness of image uniform correction.
Patent Information
- Application Number
- CN202411262965.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-13
AI Technical Summary
The degradation in the performance of the endoscopic image sensor leads to uneven image brightness, which is difficult to effectively solve in the prior art.
By obtaining the brightness values and current values of each pixel point of the endoscope, based on the preset brightness display range and standard brightness compensation relationship, the current value of the undisplayed brightness value is determined, and the target brightness compensation relationship is constructed to perform brightness on the displayed image to be corrected. Correction.
When the image sensor performance deteriorates, the image brightness uniformity correction is achieved to ensure the displayed image brightness uniformity.
Smart Images

Figure CN119136062A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image brightness correction method, device, equipment and storage medium. Background Art
[0002] In the display system of the endoscope, the image sensor at the front end of the endoscope converts the incident light signal into an electrical signal, and the current sensor collects the current value of each pixel in the image sensor at different brightness. Then, the current value of each pixel is transmitted to the display device for display in the form of grayscale. However, with the long-term use of the endoscope, the performance of the image sensor decreases, resulting in uneven brightness of the image displayed under the same light signal intensity. Summary of the invention
[0003] In view of this, the present invention provides an image brightness correction method, device, equipment and storage medium to solve the problem of uneven image brightness caused by the degradation of image sensor performance.
[0004] In a first aspect, the present invention provides an image brightness correction method, the method comprising:
[0005] Acquire a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto;
[0006] Determine, based on a correspondence between the first brightness value and the first current value, a second current value corresponding to a second brightness value that is not displayed, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value;
[0007] Determining a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a corresponding relationship between a standard brightness value and a current value;
[0008] Using the third brightness value and the fourth brightness value as corrected brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship;
[0009] The brightness value of the display image to be corrected is corrected based on the target brightness compensation relationship to obtain a target display image.
[0010] In some implementations, determining the second current value corresponding to the second brightness value that is not displayed based on the correspondence between the first brightness value and the first current value includes:
[0011] Determine a plurality of adjacent brightness values of each of the second brightness values from the first brightness values;
[0012] Based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, the second current value corresponding to each of the second brightness values is determined.
[0013] In some implementations, determining the second current value corresponding to each of the second brightness values based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value includes:
[0014] Based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, each of the second brightness values is interpolated to obtain a second current value corresponding to each of the second brightness values.
[0015] In some embodiments, the plurality of adjacent brightness values of the second brightness value include a first adjacent brightness value and a second adjacent brightness value; and interpolating each of the second brightness values based on a fitting relationship between each of the adjacent brightness values and the corresponding first current value to obtain a second current value corresponding to each of the second brightness values includes:
[0016] Based on the difference between the second brightness value and the corresponding second adjacent brightness value, obtaining the first brightness difference value corresponding to each second brightness value;
[0017] Based on the difference between the first adjacent brightness values and the corresponding second adjacent brightness values, obtaining a second brightness difference value corresponding to each of the second brightness values;
[0018] Based on the difference between the first current value of the first adjacent brightness value and the first current value of the corresponding second adjacent brightness value, obtaining the target current difference corresponding to each of the second brightness values;
[0019] Based on the ratio between the target current difference and the corresponding second brightness difference, obtaining a fitting coefficient corresponding to each second brightness value;
[0020] Obtaining a current compensation value corresponding to each of the second brightness values based on the product of the first brightness difference value and the corresponding fitting coefficient;
[0021] Based on the sum of the first current values of the second adjacent brightness values and the corresponding current compensation values, the second current values corresponding to each of the second brightness values are obtained.
[0022] In some implementations, the preset standard brightness compensation relationship is obtained by the following steps:
[0023] Dividing the preset display brightness range into a plurality of brightness value levels, each brightness value level corresponding to one standard brightness value;
[0024] Performing white balance based on each of the brightness value levels to obtain current values corresponding to each of the brightness value levels, so as to determine current values corresponding to each of the standard brightness values;
[0025] Based on each of the standard brightness values and their corresponding current values, the preset standard brightness compensation relationship is obtained.
[0026] In some implementations, the step of correcting the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain the target display image includes:
[0027] Dividing the displayed image to be corrected into a plurality of image units to be corrected;
[0028] Acquire a fifth brightness value corresponding to each of the image units to be corrected;
[0029] querying sixth brightness values corresponding to each of the fifth brightness values based on the target brightness compensation relationship;
[0030] The brightness value of each of the to-be-corrected image units is corrected based on the sixth brightness value to obtain the target display image.
[0031] In some embodiments, obtaining a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto includes:
[0032] When a preset brightness correction condition is met, the first brightness value of each pixel point and the first current value corresponding thereto are obtained.
[0033] In a second aspect, the present invention provides an image brightness correction device, the device comprising:
[0034] A data acquisition module, used to acquire a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto;
[0035] a current calculation module, configured to determine, based on a correspondence between the first brightness value and the first current value, a second current value corresponding to a second brightness value that is not displayed, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value;
[0036] a brightness query module, used to determine a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a correspondence between a standard brightness value and a current value;
[0037] a brightness compensation module, configured to use the third brightness value and the fourth brightness value as correction brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship;
[0038] The brightness correction module is used to correct the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain a target display image.
[0039] In a third aspect, the present invention provides an endoscope control device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the image brightness correction method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image brightness correction method of the first aspect or any corresponding embodiment thereof.
[0041] The image brightness correction method provided by the embodiment of the present invention first obtains the first brightness value of each pixel displayed by the endoscope and its corresponding first current value. Then, based on the correspondence between the first brightness value and the first current value, the second current value corresponding to the second brightness value that is not displayed is determined. And based on the preset standard brightness compensation relationship used to characterize the correspondence between the standard brightness value and the current value, the third brightness value corresponding to the first current value and the fourth brightness value corresponding to the second current value are determined. The third brightness value and the fourth brightness value are used as the corrected brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine the target brightness compensation relationship. Therefore, the correspondence between the displayed brightness value and the standard brightness value can be determined by the target brightness compensation relationship. Then, when the performance of the image sensor decreases, the brightness value of the displayed image to be corrected is corrected using the constructed target brightness compensation relationship to obtain the target display image, so that the brightness of the target display image finally displayed is uniform. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a schematic flow chart of an image brightness correction method according to an embodiment of the present invention;
[0044] Figure 2 is a schematic diagram of a fitting curve of brightness value and current value after performance degradation of an image sensor according to an embodiment of the present invention;
[0045] Figure 3 is a schematic diagram of a fitting curve of brightness value and current value at factory delivery according to an embodiment of the present invention;
[0046] Figure 4 is a structural block diagram of an image brightness correction device according to an embodiment of the present invention;
[0047] Figure 5 is a structural block diagram of an endoscope control device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0049] In the related art, with the long-term use of the endoscope, the image sensor of the endoscope will age and the image sensor's sensitivity to color will decrease, resulting in uneven brightness of the image displayed under the same light signal intensity.
[0050] In view of this, according to an embodiment of the present invention, an embodiment of an image brightness correction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] In this embodiment, a method for image brightness correction is provided, which can be used for the above-mentioned endoscope. Figure 1 FIG. 1 is a flow chart of an image brightness correction method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0052] Step S101, obtaining a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto.
[0053] Specifically, the endoscope includes an image sensor, a current sensor and a display device. The image sensor is used to convert the incident light signal into an electrical signal, and collect the current value under different incident light signal brightness through the current sensor of each pixel point in the image sensor, and convert it into a brightness value for display on the display device.
[0054] When using the endoscope, in different use environments, due to the different brightness of the light signal, the current value corresponding to each pixel of the image sensor is different, resulting in different brightness values and corresponding current values of each pixel displayed by the endoscope. In actual use, each pixel displayed by the endoscope may only involve part of the brightness value within the preset brightness display range, and some brightness values are not displayed.
[0055] Therefore, according to the use environment, several brightness values between 0 and 255 and corresponding current values of each pixel displayed by the endoscope can be obtained. 0 , Y 1 , Y 2 , Y 3 , ..., Y n And the corresponding current value I 0 ,I 1 ,I 2 ,I 3 ,...,I n . To determine the brightness value that is not displayed and its corresponding current value.
[0056] Step S102, based on the correspondence between the first brightness value and the first current value, determining a second current value corresponding to a second brightness value that is not displayed, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value.
[0057] For example, assuming that the preset brightness display range includes brightness value 0, brightness value 32, brightness value 64, brightness value 96, brightness value 128, brightness value 192, brightness value 224, and brightness value 255, if the displayed first brightness value does not include brightness value 64, brightness value 64 is used as the second brightness value. After determining that the second brightness value is brightness value 64, if brightness value 32, brightness value 96, and the corresponding current value are known, the corresponding relationship between brightness value 32 and current value 96 can be determined according to brightness value 32, brightness value 96, the first current value corresponding to brightness value 32, and the first current value corresponding to brightness value 96. Based on the idea of interpolation, the current value corresponding to brightness value 64 can be obtained according to the corresponding relationship.
[0058] Specifically, Figure 2As shown, the first brightness value and the first current value can be used as x-axis and y-axis variables respectively, and the first brightness value and the first current value can be fitted to obtain a fitting curve of the brightness value and the current value, and the second current value corresponding to the second brightness value can be determined based on the fitting curve.
[0059] Step S103, determining a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a correspondence between a standard brightness value and a current value.
[0060] Specifically, when the image sensor leaves the factory, each standard brightness value and its corresponding current value can be obtained through the white balance cap to establish a preset standard brightness compensation relationship. Alternatively, when the image sensor is in a normal working state, each standard brightness value and its corresponding current value can be obtained through the white balance cap to establish a preset standard brightness compensation relationship.
[0061] It should be noted that if Figure 2 As shown in the figure, after the performance of the image sensor is degraded, the brightness value of each pixel corresponding to the image sensor will change significantly, but under the same light signal brightness, the current value corresponding to each pixel changes slightly (negligible). m Descend to Y m ', the brightness value is from Y m+1 Descend to Y m+1 ', but the original current value changes little / remains unchanged. Therefore, the current value with a small change can be used to determine the standard brightness value (ie, the corrected brightness value) corresponding to each brightness value of the image sensor in the current state.
[0062] Step S104 : Using the third brightness value and the fourth brightness value as corrected brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship.
[0063] Specifically, the first brightness value and the second brightness value are used as the brightness values to be displayed corresponding to the image sensor, and the third brightness value and the fourth brightness value are used as the corrected brightness values corresponding to the respective brightness values to be displayed, so as to obtain a target brightness compensation relationship, which is used to characterize the correspondence between the brightness values to be displayed and the corrected brightness values (or standard brightness values).
[0064] Step S105 , correcting the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain a target display image.
[0065] Specifically, the correction brightness values corresponding to the brightness values of the display image to be corrected are queried based on the target brightness compensation relationship, and the brightness values of the pixels are corrected based on the queried correction brightness values to obtain the target display image.
[0066] Specifically, the target display image may be sent to a display device of the endoscope, and the target display image may be displayed on the display device.
[0067] The image brightness correction method provided in this embodiment first obtains the first brightness value of each pixel displayed by the endoscope and its corresponding first current value. Then, based on the correspondence between the first brightness value and the first current value, the second current value corresponding to the second brightness value that is not displayed is determined. And based on the preset standard brightness compensation relationship used to characterize the correspondence between the standard brightness value and the current value, the third brightness value corresponding to the first current value and the fourth brightness value corresponding to the second current value are determined. The third brightness value and the fourth brightness value are used as the corrected brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine the target brightness compensation relationship. Therefore, the correspondence between the displayed brightness value and the standard brightness value can be determined by the target brightness compensation relationship. Then, when the performance of the image sensor decreases, the brightness value of the displayed image to be corrected is corrected using the constructed target brightness compensation relationship to obtain the target display image, so that the brightness of the target display image finally displayed is uniform.
[0068] In some optional embodiments, obtaining the first brightness value of each pixel point displayed by the endoscope and the first current value corresponding thereto in the above-mentioned step S101 includes: obtaining the first brightness value of each pixel point and the first current value corresponding thereto when a preset brightness correction condition is met.
[0069] Optionally, the preset brightness correction condition includes a preset period at each interval.
[0070] For example, the preset period is one month or one quarter, and the first brightness value and the corresponding first current value of each pixel displayed by the endoscope are obtained every month or every quarter.
[0071] The image brightness correction method provided in this embodiment obtains the first brightness value of each pixel and its corresponding first current value when the preset brightness correction condition is met, so as to be used for subsequently determining the target brightness compensation relationship. Therefore, frequent changes in the target brightness compensation relationship can be avoided, and computing resource usage can be reduced.
[0072] In some optional implementations, determining the second current value corresponding to the undisplayed second brightness value based on the correspondence between the first brightness value and the first current value in step S102 includes:
[0073] Step a1: determining a plurality of adjacent brightness values of each of the second brightness values from the first brightness values.
[0074] For example, it is assumed that the preset brightness display range includes brightness value 0, brightness value 16, brightness value 32, brightness value 48, brightness value 64, brightness value 80, brightness value 96, brightness value 112, brightness value 128, brightness value 146... If brightness value 64 is the second brightness value, and brightness value 32, brightness value 48, brightness value 80, and brightness value 96 are the first brightness values, then brightness value 32 and brightness value 96 can be used as adjacent brightness values of brightness value 64. Brightness value 32, brightness value 48, brightness value 80, and brightness value 96 can also be used as adjacent brightness values of brightness value 64.
[0075] It should be noted that the multiple adjacent brightness values should include at least one first brightness value on the left and right sides of the second brightness value.
[0076] Step a2: determining the second current value corresponding to each of the second brightness values based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value.
[0077] Specifically, the second current value corresponding to each of the second brightness values may be determined based on a linear interpolation approach and a fitting relationship between each of the adjacent brightness values and the corresponding first current value.
[0078] The image brightness correction method provided in this embodiment determines the second current value corresponding to each second brightness value based on the fitting relationship between multiple adjacent brightness values of the second brightness value and the corresponding first current value. Therefore, it can better reflect the data characteristics between the brightness value and the current value in the local area, so as to improve the accuracy of the second current value corresponding to the second brightness value.
[0079] In some optional embodiments, the step a2 described in above is based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value to determine the second current value corresponding to each of the second brightness values, including: based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, interpolating each of the second brightness values to obtain the second current value corresponding to each of the second brightness values.
[0080] Specifically, based on a linear fitting curve between each adjacent brightness value and the corresponding first current value, a linear interpolation process may be performed on each second brightness value to obtain the second current value corresponding to each second brightness value. Alternatively, based on a quadratic linear fitting curve between each adjacent brightness value and the corresponding first current value, a quadratic linear interpolation process may be performed on each second brightness value to obtain the second current value corresponding to each second brightness value. Alternatively, based on an exponential curve between each adjacent brightness value and the corresponding first current value, an exponential interpolation process may be performed on each second brightness value to obtain the second current value corresponding to each second brightness value.
[0081] Further, the plurality of adjacent brightness values of the second brightness value include a first adjacent brightness value and a second adjacent brightness value. Among them, one of the first adjacent brightness value and the second adjacent brightness value is greater than the corresponding second brightness value, and the other is less than the corresponding second brightness value. For example, the first adjacent brightness value is greater than the corresponding second brightness value, and the second adjacent brightness value is less than the corresponding second brightness value. Then, based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, each of the second brightness values is interpolated to obtain the second current value corresponding to each of the second brightness values, including:
[0082] Step b1, obtaining a first brightness difference value corresponding to each second brightness value based on a difference between the second brightness value and the corresponding second adjacent brightness value;
[0083] Step b2, obtaining a second brightness difference value corresponding to each of the second brightness values based on the difference between the first adjacent brightness values and the corresponding second adjacent brightness values;
[0084] Step b3, obtaining a target current difference corresponding to each of the second brightness values based on a difference between the first current value of the first adjacent brightness values and the first current value of the corresponding second adjacent brightness values;
[0085] Step b4, obtaining a fitting coefficient corresponding to each second brightness value based on a ratio between the target current difference and the corresponding second brightness difference;
[0086] Step b5, obtaining a current compensation value corresponding to each of the second brightness values based on the product of the first brightness difference value and the corresponding fitting coefficient;
[0087] Step b6, obtaining the second current value corresponding to each of the second brightness values based on the sum of the first current values of the second adjacent brightness values and the corresponding current compensation value.
[0088] Specifically, the second current value corresponding to each of the second brightness values is calculated by the following formula:
[0089]
[0090] Among them, I n ' is the second current value corresponding to the second brightness value, Y n is the second brightness value, Y m+1 ' is the first adjacent brightness value, Y m ' is the second adjacent brightness value, I m+1 ' is the first current value corresponding to the first adjacent brightness value, I m ' is the first current value corresponding to the second adjacent brightness value.
[0091] It should be noted that the above formula is obtained by performing a linear interpolation fitting based on each adjacent brightness value corresponding to the second brightness value and its first current value. In addition, according to actual conditions, an exponential curve or a quadratic linear interpolation fitting can be performed based on each adjacent brightness value corresponding to the second brightness value and its first current value to obtain a fitting relationship between each adjacent brightness value and the corresponding first current value, and the fitting relationship between each adjacent brightness value and the corresponding first current value is not limited here.
[0092] Furthermore, in order to improve the accuracy of the interpolation process, the plurality of adjacent luminance values may include at least two first luminance values adjacent to the second luminance value.
[0093] In some optional embodiments, the preset standard brightness compensation relationship in the above step S103 is obtained by the following steps: dividing the preset display brightness range into multiple brightness value levels, each brightness value level corresponds to a standard brightness value; performing white balance based on each of the brightness value levels to obtain the current value corresponding to each of the brightness value levels to determine the current value corresponding to each of the standard brightness values; and obtaining the preset standard brightness compensation relationship based on each of the standard brightness values and their corresponding current values.
[0094] Specifically, when the image sensor leaves the factory or is in a normal working state, the preset display brightness range is divided into a plurality of brightness value levels, each of which corresponds to a standard brightness value. According to the brightness value level, the current value of each pixel of the image sensor is obtained to obtain a preset standard brightness compensation relationship.
[0095] Specifically, during the implementation process, a white balance cap is used to perform white balance, and the current values corresponding to all brightness levels are recorded. For example, the current value corresponding to brightness level 1 is I 0始 , the current value corresponding to brightness level 2 is I 32始 , the current value corresponding to brightness level 3 is I 64始 , the current value corresponding to brightness level 4 is I 96始 , the current value corresponding to the brightness level 5 is I128始 , the current value corresponding to brightness level 6 is I 192始 , the current value corresponding to the brightness level 7 is I 224始 , the current value corresponding to brightness level 8 is I 225始 Then, with the brightness value as the variable corresponding to the y-axis and the current value as the variable corresponding to the x-axis, we can draw a Figure 3 The fitting curve of brightness value and current value shown is used to obtain the preset standard brightness compensation relationship.
[0096] It should be noted that, in actual operation, the preset standard brightness compensation relationship can be stored in the flash inside the processor of the endoscope, so that in the subsequent process, the preset standard brightness compensation relationship can be called from the flash to correct the brightness value of the pixel point.
[0097] In some optional embodiments, the step S105 in which the brightness value of the display image to be corrected is corrected based on the target brightness compensation relationship to obtain the target display image includes: dividing the display image to be corrected into a plurality of image units to be corrected; obtaining a fifth brightness value corresponding to each of the image units to be corrected; querying a sixth brightness value corresponding to each of the fifth brightness values based on the target brightness compensation relationship; and correcting the brightness value of each of the image units to be corrected based on the sixth brightness value to obtain the target display image.
[0098] The image brightness correction method provided in this embodiment, when correcting the brightness value of the display image to be corrected, first divides the display image to be corrected into a plurality of image units to be corrected, each image unit to be corrected shares a brightness value, and then performs brightness correction based on the image units to be corrected. Therefore, the efficiency of image brightness correction can be effectively improved.
[0099] In addition, due to problems such as manufacturing process, some pixels of image sensors may produce bad pixels after long-term use before leaving the factory or during use. Therefore, the image brightness correction method of the present invention also includes: evaluating each pixel of the image sensor to determine the damaged target pixel; and determining the brightness value of the target pixel based on the brightness values of the adjacent pixels of the target pixel.
[0100] For example, the average of the brightness values of four adjacent pixels around the target pixel is used as the brightness value of the target pixel.
[0101] In this embodiment, an image brightness correction device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0102] This embodiment provides an image brightness correction device, such as Figure 4 As shown, including:
[0103] The data acquisition module 201 is used to acquire the first brightness value of each pixel displayed by the endoscope and the first current value corresponding thereto;
[0104] A current calculation module 202, configured to determine a second current value corresponding to a second brightness value that is not displayed based on a correspondence between the first brightness value and the first current value, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value;
[0105] A brightness query module 203, used to determine a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a correspondence between a standard brightness value and a current value;
[0106] A brightness compensation module 204, configured to use the third brightness value and the fourth brightness value as correction brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship;
[0107] The brightness correction module 205 is used to correct the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain a target display image.
[0108] In some optional implementations, the data acquisition module 201 includes:
[0109] The display data acquisition unit is used to acquire the first brightness value of each pixel point and the first current value corresponding thereto when a preset brightness correction condition is met.
[0110] In some optional implementations, the current calculation module 202 includes:
[0111] an adjacent brightness determination unit, configured to determine a plurality of adjacent brightness values of each of the second brightness values from the first brightness values;
[0112] The target current calculation unit is used to determine the second current value corresponding to each of the second brightness values based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value.
[0113] In some optional implementations, the target current calculation unit includes:
[0114] The current operation subunit is used to perform interpolation processing on each of the second brightness values based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, so as to obtain the second current value corresponding to each of the second brightness values.
[0115] In some optional implementations, the plurality of adjacent brightness values of the second brightness value include a first adjacent brightness value and a second adjacent brightness value; and the current operation subunit is specifically configured to:
[0116] Based on the difference between the second brightness value and the corresponding second adjacent brightness value, obtaining the first brightness difference value corresponding to each second brightness value;
[0117] Based on the difference between the first adjacent brightness values and the corresponding second adjacent brightness values, obtaining a second brightness difference value corresponding to each of the second brightness values;
[0118] Based on the difference between the first current value of the first adjacent brightness value and the first current value of the corresponding second adjacent brightness value, obtaining the target current difference corresponding to each of the second brightness values;
[0119] Based on the ratio between the target current difference and the corresponding second brightness difference, obtaining a fitting coefficient corresponding to each second brightness value;
[0120] Obtaining a current compensation value corresponding to each of the second brightness values based on the product of the first brightness difference value and the corresponding fitting coefficient;
[0121] Based on the sum of the first current values of the second adjacent brightness values and the corresponding current compensation values, the second current values corresponding to each of the second brightness values are obtained.
[0122] In some optional implementations, the preset standard brightness compensation relationship in the brightness query module 203 is obtained by the following steps:
[0123] Dividing the preset display brightness range into a plurality of brightness value levels, each brightness value level corresponding to one standard brightness value;
[0124] Performing white balance based on each of the brightness value levels to obtain current values corresponding to each of the brightness value levels, so as to determine current values corresponding to each of the standard brightness values;
[0125] Based on each of the standard brightness values and their corresponding current values, the preset standard brightness compensation relationship is obtained.
[0126] In some optional implementations, the brightness correction module 205 includes:
[0127] An image division unit, used for dividing the displayed image to be corrected into a plurality of image units to be corrected;
[0128] A brightness acquisition unit, used to acquire a fifth brightness value corresponding to each of the image units to be corrected;
[0129] a brightness query unit, configured to query a sixth brightness value corresponding to each of the fifth brightness values based on the target brightness compensation relationship;
[0130] A brightness correction unit is used to correct the brightness value of each of the image units to be corrected based on the sixth brightness value to obtain the target display image.
[0131] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0132] The image brightness correction device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0133] The embodiment of the present invention also provides an endoscope control device having the above Figure 4 The image brightness correction device shown.
[0134] See also Figure 5 , Figure 5 is a structural block diagram of an endoscope control device provided by an optional embodiment of the present invention, such as Figure 5As shown, the endoscope control device includes: one or more processors 301, a memory 302, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the endoscope control device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple endoscope control devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 301 is taken as an example.
[0135] The processor 301 may be a central processing unit, a network processor or a combination thereof. The processor 301 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0136] The memory 302 stores instructions executable by at least one processor 301 , so that the at least one processor 301 executes the method shown in the above embodiment.
[0137] The memory 302 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the endoscope control device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 302 may optionally include a memory remotely arranged relative to the processor 301, and these remote memories may be connected to the endoscope control device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The memory 302 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 302 may also include a combination of the above types of memory.
[0139] The endoscope control device further includes a communication interface 303 for the endoscope control device to communicate with other devices or a communication network.
[0140] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0141] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for image brightness correction, characterized in that: The method comprises: Acquire a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto; Determine, based on a correspondence between the first brightness value and the first current value, a second current value corresponding to a second brightness value that is not displayed, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value; Determining a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a corresponding relationship between a standard brightness value and a current value; Using the third brightness value and the fourth brightness value as corrected brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship; The brightness value of the display image to be corrected is corrected based on the target brightness compensation relationship to obtain a target display image.
2. The image brightness correction method according to claim 1, characterized in that: The determining, based on the correspondence between the first brightness value and the first current value, a second current value corresponding to a second brightness value that is not displayed includes: Determine a plurality of adjacent brightness values of each of the second brightness values from the first brightness values; Based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, the second current value corresponding to each of the second brightness values is determined.
3. The image brightness correction method according to claim 2, characterized in that: The determining, based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, the second current value corresponding to each of the second brightness values comprises: Based on the fitting relationship between each of the adjacent brightness values and the corresponding first current value, each of the second brightness values is interpolated to obtain a second current value corresponding to each of the second brightness values.
4. The image brightness correction method according to claim 3, characterized in that: The plurality of adjacent brightness values of the second brightness value include a first adjacent brightness value and a second adjacent brightness value; and interpolating each of the second brightness values based on a fitting relationship between each of the adjacent brightness values and the corresponding first current value to obtain a second current value corresponding to each of the second brightness values includes: Based on the difference between the second brightness value and the corresponding second adjacent brightness value, obtaining the first brightness difference value corresponding to each second brightness value; Based on the difference between the first adjacent brightness values and the corresponding second adjacent brightness values, obtaining a second brightness difference value corresponding to each of the second brightness values; Based on the difference between the first current value of the first adjacent brightness value and the first current value of the corresponding second adjacent brightness value, obtaining the target current difference corresponding to each of the second brightness values; Based on the ratio between the target current difference and the corresponding second brightness difference, obtaining a fitting coefficient corresponding to each second brightness value; Obtaining a current compensation value corresponding to each of the second brightness values based on the product of the first brightness difference value and the corresponding fitting coefficient; Based on the sum of the first current values of the second adjacent brightness values and the corresponding current compensation values, the second current values corresponding to each of the second brightness values are obtained.
5. The image brightness correction method according to claim 1, characterized in that: The preset standard brightness compensation relationship is obtained by the following steps: Dividing the preset display brightness range into a plurality of brightness value levels, each brightness value level corresponding to one standard brightness value; Performing white balance based on each of the brightness value levels to obtain current values corresponding to each of the brightness value levels, so as to determine current values corresponding to each of the standard brightness values; Based on each of the standard brightness values and their corresponding current values, the preset standard brightness compensation relationship is obtained.
6. The image brightness correction method according to claim 1, characterized in that: The step of correcting the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain the target display image includes: Dividing the displayed image to be corrected into a plurality of image units to be corrected; Acquire a fifth brightness value corresponding to each of the image units to be corrected; querying sixth brightness values corresponding to each of the fifth brightness values based on the target brightness compensation relationship; The brightness value of each of the to-be-corrected image units is corrected based on the sixth brightness value to obtain the target display image.
7. The image brightness correction method according to claim 1, characterized in that: The step of obtaining a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto includes: When a preset brightness correction condition is met, the first brightness value of each pixel point and the first current value corresponding thereto are obtained.
8. An image brightness correction device, characterized in that: The device comprises: A data acquisition module, used to acquire a first brightness value of each pixel displayed by the endoscope and a first current value corresponding thereto; a current calculation module, configured to determine, based on a correspondence between the first brightness value and the first current value, a second current value corresponding to a second brightness value that is not displayed, wherein the second brightness value is determined based on a preset brightness display range and the first brightness value; a brightness query module, used to determine a third brightness value corresponding to the first current value and a fourth brightness value corresponding to the second current value based on a preset standard brightness compensation relationship, wherein the preset standard brightness compensation relationship is used to characterize a correspondence between a standard brightness value and a current value; a brightness compensation module, configured to use the third brightness value and the fourth brightness value as correction brightness values of the corresponding first brightness value and the second brightness value, respectively, to determine a target brightness compensation relationship; The brightness correction module is used to correct the brightness value of the display image to be corrected based on the target brightness compensation relationship to obtain a target display image.
9. An endoscope control device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image brightness correction method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the image brightness correction method according to any one of claims 1 to 7.
Citation Information
Cited By
Image processing method, system and device, storage medium and program product
CN119722544A
Image processing method, system, device, storage medium and program product
CN119722544B
