Method, host and system for adaptively adjusting output luminance of medical light source
By using real-time image analysis and brightness control signal drive, the problem of unstable brightness of medical endoscope light sources in complex scenarios has been solved, achieving precision and stability of brightness adjustment, reducing high light interference and overexposure risks, and improving the safety and comfort of surgical operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING TUGE HEALTHCARE CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-05-29
AI Technical Summary
Existing medical endoscope light sources cannot balance brightness stability and response speed in complex reflective environments, leading to overexposure or underexposure issues.
By acquiring images in real time, performing brightness feature analysis, calculating effective brightness values, and generating brightness control signals based on differences, the light source device is driven to adjust the output brightness. By combining spatial weight matrix and highlight area processing, interference factors are eliminated, and precise brightness adjustment is achieved.
It achieves precise and stable brightness adjustment, avoids inaccurate metering caused by high light interference and the risk of overexposure in close-to-the-wall scenes, and reduces visual fatigue and tissue thermal damage during surgical procedures.
Smart Images

Figure CN122121017A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical endoscope imaging and lighting control technology, and in particular, a method, host and system for adaptively adjusting the output brightness of a medical light source. Background Technology
[0002] In minimally invasive surgery, the clear field of vision provided by the medical endoscope system is one of the key aspects of surgical safety. A high-performance cold light source must be able to automatically adjust the light intensity according to changes in the surgical environment to avoid overexposure due to the probe being too close to the tissue or dimming due to it being too far away. Stable brightness control not only reduces visual fatigue for surgeons but also prevents damage to human tissue due to excessive heat.
[0003] Existing endoscopic light source adjustment techniques mainly rely on feedback control based on the average brightness or the brightness of the central region of the image. For example, some methods calculate the average grayscale value of all pixels in the image, increasing the light source power when the average value is below a set threshold and decreasing it when it is above. Other methods introduce a simple metering window, only collecting brightness information from the central region of the image, attempting to simulate the gaze point of the human eye, and using this as the basis for light source adjustment.
[0004] The aforementioned existing technologies have limitations when dealing with complex reflective scenarios. Therefore, further research is needed to address these issues. Summary of the Invention
[0005] Purpose of the invention: In view of the above-mentioned problems in the prior art, this application provides a method, host and system for adaptively adjusting the output brightness of a medical light source, in order to solve the above-mentioned problems in the prior art.
[0006] Technical solution: First aspect, a method for adaptively adjusting the output brightness of a medical light source, comprising:
[0007] Real-time acquisition of the current frame image;
[0008] Perform brightness feature analysis on the current frame image to calculate the effective brightness value of the current scene;
[0009] A brightness control signal is generated based on the difference between the effective brightness value and the preset target brightness value;
[0010] The brightness control signal is sent to the light source device, which then drives the light source device to adjust the output brightness.
[0011] Secondly, a medical light source host that adaptively adjusts output brightness includes:
[0012] Including processor and memory,
[0013] The memory stores a computer program, and when the processor executes the computer program, it implements the medical light source method for adaptively adjusting output brightness based on image analysis as described in any of the preceding claims.
[0014] Thirdly, a medical light source system that adaptively adjusts output brightness includes:
[0015] A light source device used to output illumination light;
[0016] A medical light source host that adaptively adjusts output brightness is used to acquire images and control the light source device;
[0017] The control line connects the host and the light source device and is used to transmit data and control signals.
[0018] Beneficial effects: This invention solves the problems of inaccurate metering caused by high light interference and the risk of overexposure in wall-mounted scenes, and achieves accuracy and stability in brightness adjustment.
[0019] Beneficial effects: It solves the problems of inaccurate metering caused by high light interference and the risk of overexposure in wall-mounted scenes, and achieves accuracy and stability in brightness adjustment. Attached Figure Description
[0020] Figure 1 A flowchart illustrating a method for adaptively adjusting output brightness in a medical light source, as provided in an embodiment of this application.
[0021] Figure 2 This is a flowchart for performing brightness feature analysis on the current frame image, provided as an embodiment of this application.
[0022] Figure 3 This is a flowchart illustrating the generation of a weighted adjustment mask based on the highlight region in the luminance component, as provided in an embodiment of this application.
[0023] Figure 4 This is a flowchart illustrating the point-by-point correction of the spatial weight matrix using a weight adjustment mask, as provided in an embodiment of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] To address the aforementioned issues, the applicant conducted in-depth searches and analyses, and discovered:
[0027] Correspondingly, traditional average metering is susceptible to interference from highlighting points. Tiny highlighting points on surgical instruments or moist tissue surfaces can inflate the average brightness value, causing the system to misjudge the environment as too bright and incorrectly reduce the light source output, thus plunging the surrounding normal tissue into darkness.
[0028] Next, a simple specular highlight removal algorithm, when faced with panoramic specular highlights, will discard all pixels as if they were highlights, resulting in a lack of effective pixels. The calculated brightness value will then approach zero, inducing the light source to output maximum power, causing a serious risk of thermal damage, such as when the probe is pressed against a wall or covered with gauze. Furthermore, brightness adjustment lacking a smoothing mechanism can easily cause frequent image flickering, affecting surgical procedures.
[0029] To solve these problems, combined with Figures 1 to 4 The present invention will be specifically described through the following embodiments.
[0030] In some embodiments, a method for adaptively adjusting the output brightness of a medical light source is provided to solve the technical problem that existing medical endoscope light sources cannot simultaneously achieve brightness stability and response speed in complex scenarios, and a closed-loop control scheme based on image analysis is provided.
[0031] Step 101: Acquire the current frame image in real time.
[0032] In this embodiment, the current frame image specifically refers to digital image data acquired by a medical image sensor, such as a CMOS or CCD sensor, and output after preprocessing by an image signal processor (ISP). The current frame image typically contains information from the red, green, and blue color channels, and the format can be RGB888 or YUV4:4:4. The acquisition frequency is usually consistent with the acquisition frame rate, for example, 60 frames per second. This step is the data source for the entire closed-loop control, ensuring that brightness adjustment is based on the actual observed surgical scene, rather than blind adjustment in an open loop.
[0033] Step 102: Calculate the effective brightness value of the current scene.
[0034] In this approach, the effective brightness value is not the average brightness of the entire image, but rather a weighted calculation that reflects the brightness of the area of focus for the doctor (e.g., the image center) after removing interfering factors (e.g., highlights and reflections). The specific calculation process involves algorithms such as channel separation, highlight recognition, and spatial weighting. By calculating this effective brightness value, the system accurately assesses whether the current lighting intensity meets the observation requirements. For example, in laparoscopic surgery, when surgical instruments cause reflections, average metering will result in an overall darker image, but the calculated effective brightness value can eliminate reflection interference and maintain normal exposure of the tissue area.
[0035] Step 103: Generate a brightness control signal based on the difference between the effective brightness value and the preset target brightness value.
[0036] Specifically, the preset target brightness value is an ideal brightness level set according to human visual comfort or the requirements of machine vision algorithms. For example, for an 8-bit grayscale image, the target brightness value can be set to 128. The system calculates the difference between the effective brightness value and the target brightness value, and this difference generates an adjustment command through a feedback control algorithm. The brightness control signal is specifically manifested as a value used to control the light source driving circuit, such as the duty cycle value of pulse width modulation (PWM) or the current control code value of the digital-to-analog converter (DAC).
[0037] Step 104: Send the brightness control signal to the light source device to drive the light source device to adjust the output brightness.
[0038] Specifically, the light source can be an LED cold light source or a xenon lamp light source. The host transmits the generated brightness control signal to the drive controller inside the light source via a physical connection cable (such as a serial communication cable or a CAN bus). The drive controller changes the current flowing through the light-emitting element or the PWM duty cycle according to the signal, thereby changing the output luminous flux. This closed-loop drive mechanism enables the light source brightness to adaptively adjust as the endoscope probe moves within the body cavity, causing changes in distance, thus maintaining a constant image brightness.
[0039] As an alternative implementation, a spatial weight matrix with the same size as the luminance component is used, where the weight values in the central region of the spatial weight matrix are higher than those in the edge regions. Specifically, the luminance component is extracted from the real-time captured current frame image, and a spatial weight matrix is constructed using a Gaussian distribution. An adaptive weighting factor β is used to correct the weights of the highlight regions. β is dynamically adjusted based on the proportion of highlight pixels: in sporadic reflections, β tends to 0 to eliminate interference; in panoramic highlights, β tends to 1 to retain the weights. Based on the corrected matrix, the effective luminance value is calculated, and a control signal is generated using a PID algorithm and an exponential smoothing strategy to drive the light source to adjust its output.
[0040] In other embodiments, the specific implementation process of extracting luminance components from the original image and constructing a spatial weight matrix is described. This embodiment lays the data foundation and spatial evaluation standard for calculating effective luminance values, including the following steps:
[0041] Step 201: Extract the luminance component of each pixel in the current frame image.
[0042] The brightness feature analysis of the current frame image includes: obtaining the pixel values of the red, green and blue channels of the current frame image; using a preset brightness conversion coefficient to perform a weighted summation of the pixel values of the red, green and blue channels to obtain a single-channel brightness image with the same resolution as the current frame image, which is used as the brightness component.
[0043] In luminance characteristic analysis, considering the varying sensitivities of the human eye to different colors of light, the luminance conversion coefficient is typically set according to the ITU-R BT.601 standard. The specific calculation formula is as follows:
[0044] L(x, y)=0.299R(x, y)+0.587×G(x, y)+0.114×B(x, y);
[0045] Where L(x, y) represents the luminance component value at coordinates (x, y), R(x, y) represents the red channel pixel value, G(x, y) represents the green channel pixel value, and B(x, y) represents the blue channel pixel value. 0.299, 0.587, and 0.114 are preset luminance conversion coefficients. This process reduces the dimensionality of the three-channel color image into a single-channel grayscale image, preserving scene brightness and darkness information and reducing the computational load of subsequent algorithms.
[0046] Step 202: Construct a spatial weight matrix that reflects the focus on the center of the image.
[0047] The spatial weight matrix is pre-constructed based on a two-dimensional Gaussian distribution function, with its center located at the center of the image. The element values in the spatial weight matrix decrease from the center to the edge. That is, the weight values in the central region of the spatial weight matrix are higher than the weight values in the edge regions.
[0048] In medical endoscopy, the surgical field of view is circular, and the lesion area that the surgeon is most likely to focus on is usually located in the center of the field of view. This embodiment uses a two-dimensional Gaussian function to generate the spatial weight matrix; the specific calculation formula is as follows:
[0049] Ws(x, y) = exp(-((xx) _0 ) 2 +(yy _0 ) 2 ) / (2×σ 2 ));
[0050] Where Ws(x, y) represents the weight value of the spatial weight matrix at coordinates (x, y), exp represents the exponential function with base e, and x _0 and y _0 The x and y coordinates represent the center of the image, and σ represents the standard deviation of the Gaussian distribution.
[0051] In this embodiment, the parameter σ determines the rate of weight decay, i.e., the size of the area of interest. In some alternative implementations, different σ values are preset according to different surgical types; or the actual distribution range of the light spot is detected by an image recognition algorithm, and the σ value is dynamically adjusted so that the high-weight area always covers the main illumination area.
[0052] Step 203: Calculate the effective brightness value of the current scene.
[0053] In this step, the effective brightness value of the current scene is calculated, which specifically includes: identifying the highlight regions in the image based on the brightness components; constructing a spatial weight matrix that reflects the focus of the image center; and combining the highlight regions and the spatial weight matrix to perform weighted calculations on the brightness components to obtain the effective brightness value.
[0054] The above employs a normalized weighted average strategy. Unlike arithmetic averaging, this method considers the spatial importance of pixels (determined by Ws) and introduces a special processing mechanism for highlight areas. In other words, the system generates a correction mask for highlight areas, which, combined with the spatial weight matrix, allows the calculation results to shield against the interference of highlight points and reflect the true tissue brightness. This processing method solves the problem of underexposure in dark areas caused by localized extremely bright areas raising the overall average. This step involves calculating the sum of the products of the pixel values of the brightness components and the corresponding weights in the correction weight matrix as the brightness weighted sum; calculating the sum of all weight elements in the correction weight matrix as the weight normalization factor; and dividing the brightness weighted sum by the weight normalization factor to obtain the effective brightness value.
[0055] As an optional implementation, an adaptive weight correction algorithm to resist specular interference is provided. This algorithm dynamically resolves the contradiction between specular interference and panoramic specular metering failure through an adaptive weight factor (β factor). This embodiment introduces the concept of a corrected weight matrix to achieve intelligent switching between removing specular highlights in ordinary reflective scenes and retaining specular weights in extreme all-white scenes.
[0056] Step 301: Generate a weighted adjustment mask based on the highlight region in the luminance component.
[0057] In this step, identifying the highlight region in the image includes: obtaining a preset highlight determination threshold; traversing all pixels of the brightness component, marking pixels with pixel values greater than the highlight determination threshold as highlight pixels, and marking pixels with pixel values less than or equal to the highlight determination threshold as non-highlight pixels; and generating a binarized weight adjustment mask based on the distribution of highlight pixels and non-highlight pixels.
[0058] In this embodiment, the highlight determination threshold is a parameter that distinguishes between normal tissue reflection and specular highlight reflection. For example, for an 8-bit image, it is denoted as T. _h Its brightness ranges from 0 to 255, T _h It can be preset to 240. Pixels with a brightness value greater than 240 are marked as overexposed highlights.
[0059] In some alternative implementations, the highlight determination threshold T _h It can be dynamically calculated. In other words, the system calculates the brightness histogram of the current frame image and uses the lower bound of the brightness of the preset percentage of pixels with the highest brightness in the histogram as the dynamic highlight detection threshold, such as the top 5%. This method can capture relatively bright reflective points in generally dark scenes.
[0060] Step 302: Calculate the proportion of the number of highlight pixels in the total number of pixels in the current frame image, and use this as the highlight percentage.
[0061] Based on the distribution of highlight and non-highlight pixels, a binarized weight adjustment mask is generated. The spatial weight matrix is then corrected point by point using the weight adjustment mask. Specifically, this includes: calculating the proportion of highlight pixels in the total number of pixels in the current frame image as the highlight ratio.
[0062] In this step, the system calculates the highlight ratio R. _h R _h = Total number of highlight pixels / Total number of pixels in the image. This ratio directly indicates whether the current field of view is occupied by scattered reflective points, or by large areas of white objects, such as white gauze.
[0063] Step 303: Dynamically calculate the adaptive weighting factor based on the highlight ratio.
[0064] Optionally, an adaptive weighting factor is dynamically calculated based on the highlight ratio, specifically through the following preset mapping relationship: a first threshold and a second threshold are set, wherein the second threshold is greater than the first threshold; when the highlight ratio is less than the first threshold, the adaptive weighting factor is set to a preset minimum weighting coefficient; when the highlight ratio is greater than the second threshold, the adaptive weighting factor is set to a preset maximum weighting coefficient; when the highlight ratio is between the first threshold and the second threshold, the adaptive weighting factor is set to a value that monotonically increases with the highlight ratio.
[0065] Accordingly, the adaptive weighting factor is denoted as β. The first threshold can be set to 5%, denoted as T. _low The second threshold can be set to 50%, denoted as T. _high The minimum weighting coefficient is usually set to 0, denoted as β. _min The maximum weighting coefficient is usually set to 1.0, denoted as β. _max .
[0066] When R _h When it is less than 5%, it means there are only sporadic highlights, β=0, and the influence of the highlights needs to be completely eliminated;
[0067] When R _h When β > 50%, it indicates that most areas within the field of view are very bright, possibly representing panoramic highlights. Continuing to remove highlights at this point would result in very few pixels participating in the calculation, leading to extremely low calculated brightness. This could mislead the light source into increasing its brightness, causing even more severe overexposure. Therefore, when β = 1.0, the weight of highlight points is retained, allowing them to participate in the averaging process, thus increasing the calculated effective brightness value and causing the light source to reduce its brightness.
[0068] When 5%≤R _h When ≤50%, β increases linearly from 0 to 1.0, and its linear calculation formula is as follows:
[0069] β=(R _h -T _low ) / (T _high -T _low )×(β _max -β _min )+β _min ;
[0070] In some preferred embodiments, to achieve a smoother transition, the mapping relationship can be replaced by an S-curve instead of a linear piecewise function. The formula is as follows:
[0071] β=1 / (1+exp(-k×(R _h -T _mid )));
[0072] Among them, T _mid For example, (T) is the threshold value for the inflection point. _low +T _high ) / 2; k is the slope control parameter. The derivative of the S-shaped curve is continuous near the threshold, avoiding abrupt changes in the control parameter.
[0073] Step 304: Use a weight adjustment mask to correct the spatial weight matrix point by point to obtain the corrected weight matrix.
[0074] Furthermore, in the weight adjustment mask, the position corresponding to the non-highlight pixel is assigned a value of 1, and the position corresponding to the highlight pixel is assigned an adaptive weight factor; the weight adjustment mask with the assigned values is multiplied at the corresponding positions by the spatial weight matrix to obtain the corrected weight matrix.
[0075] In this embodiment, the weight matrix W is corrected. _mod Each element of (x, y) is determined by the following formula:
[0076] W _mod (x, y)=Ws(x, y)×Mh(x, y);
[0077] Where Mh(x, y) is the weighted adjustment mask after assignment. If the coordinates (x, y) are non-highlight points, Mh(x, y) = 1, then W _mod (x, y) = Ws(x, y), which preserves the original spatial weights; if the coordinates (x, y) are the highlight points, Mh(x, y) = β, then W _mod (x, y) = Ws(x, y) × β. The weight of the highlight point is dynamically discounted or cleared to zero.
[0078] Step 305: Combine the highlight region and spatial weight matrix to perform weighted calculation on the luminance components to obtain the effective luminance value.
[0079] Specifically, the effective luminance value L is calculated using the following formula:
[0080] L=(∑ _(x,y) [L(x, y)×Ws(x, y)×Mh(x, y)]) / (∑ _(x,y) [Ws(x,y)×Mh(x,y)]);
[0081] Where L(x, y) is the luminance component, Ws(x, y) is the spatial weight matrix, Mh(x, y) is the weight adjustment mask, and (x, y) are the pixel coordinates.
[0082] By normalizing the denominator, even if the weights of a large number of pixels are set to zero or removed, the weighted average of the remaining pixels can still reflect the brightness level of the scene.
[0083] For example, in a scene there is a highlight with a brightness of 255, with a weight of Ws=0.8, and a normal point with a brightness of 100, with a weight of Ws=1.0.
[0084] Case A, i.e., β=0, is eliminated:
[0085] The numerator is calculated as follows: 255 × 0.8 × 0 + 100 × 1.0 × 1 = 100.
[0086] Denominator = 0.8 × 0 + 1.0 × 1 = 1.0;
[0087] L eff =100 / 1.0=100. The result correctly reflects the brightness of normal tissue.
[0088] Case B, i.e., β=1, is retained:
[0089] The numerator is calculated as follows: 255 × 0.8 × 1 + 100 × 1.0 × 1 = 304.
[0090] Denominator = 0.8 × 1 + 1.0 × 1 = 1.8;
[0091] L eff =304 / 1.8≈169. The result reflects an overall brightness bias, therefore the system will reduce the light source output.
[0092] As an optional implementation, a dual-modal closed-loop feedback control and anti-shake strategy is provided to realize the conversion process from the effective brightness value to the final control signal. This embodiment solves the balance problem between adjustment speed and visual stability, and proposes a comprehensive control strategy including PID control, exponential smoothing anti-shake, and scene change bypass mechanism.
[0093] Step 401: Generate a brightness control signal based on the difference between the effective brightness value and the preset target brightness value.
[0094] Specifically, a brightness control signal is generated based on the difference between the effective brightness value and the preset target brightness value. This includes: calculating the difference between the preset target brightness value and the effective brightness value; and using a preset proportional-integral adjustment algorithm to calculate the difference to obtain the original brightness control signal.
[0095] In this embodiment, an incremental PID algorithm or a positional PID algorithm is used, and its discretization calculation formula is as follows:
[0096] u(k)=K p ×e(k)+K i ×∑e(i)+K d ×(e(k)-e(k-1));
[0097] Where u(k) represents the original brightness control signal of the k-th frame, e(k) represents the difference between the target brightness value and the effective brightness value of the k-th frame, and e(i) has the same meaning as e(k), representing the difference between the target brightness value and the effective brightness value of the i-th frame. p K i K d These are the proportional, integral, and derivative coefficients, respectively. In medical light source control, a relatively small K is typically set to avoid brightness fluctuations. p and moderate K i K d It can be set to 0 or a very small value.
[0098] Step 402: Perform timing smoothing on the original brightness control signal.
[0099] Specifically, after obtaining the original brightness control signal, the process also includes performing time-series smoothing on the original brightness control signal, specifically including: obtaining the historical control signal corresponding to the previous frame image; obtaining a preset smoothing coefficient, the value of which ranges from 0 to 1; and using the smoothing coefficient to perform a weighted average of the original brightness control signal and the historical control signal to obtain the final brightness control signal.
[0100] In this embodiment, an exponential moving average (EMA) filter is used to achieve image stabilization, and its calculation formula is as follows:
[0101] S _t =α×X _t +(1-α)×S _(t-1) ;
[0102] Among them, S _t X represents the final output brightness control signal for the current frame. _t S represents the calculated original brightness control signal. _(t-1) This represents the brightness control signal output in the previous frame, and α represents the smoothing coefficient.
[0103] The parameter α determines the smoothness. For example, setting α=0.1 means that the current output mainly relies on historical values and responds slowly to new changes, which can filter out brightness flickering caused by image noise or slight shaking.
[0104] According to one aspect of this application, a scene mutation detection and bypass response mechanism is also provided.
[0105] In this case, to address the issue of sluggish system response to sudden events caused by strong smoothing, such as probe removal or sudden occlusion, this embodiment also introduces scene change detection logic. The specific processing procedure is as follows:
[0106] Calculate the absolute value of the difference between the original brightness control signal and the historical control signal:
[0107] Δ=|X _t -S _(t-1) |;
[0108] Determine whether Δ is greater than the preset mutation detection threshold T. _jump .
[0109] If Δ>T _jump This indicates a sudden change in the scene. At this point, S is directly ordered... _t =X _t This allows the light source to respond immediately to significant changes in brightness requirements.
[0110] If Δ≤T _jump The fluctuation is determined to be a steady-state fluctuation, and smoothing processing will continue.
[0111] Furthermore, the original brightness control signal is subjected to rate-of-change limitation processing.
[0112] As an alternative to exponential smoothing, a rate-of-change limiting strategy can also be adopted. Specifically, after obtaining the original brightness control signal, the process also includes rate-of-change limiting processing of the original brightness control signal, which includes: calculating the change amplitude between the original brightness control signal and the control signal of the previous frame; when the change amplitude exceeds a preset maximum change threshold, the original brightness control signal is truncated according to the maximum change threshold to obtain the final brightness control signal.
[0113] In this scheme, the system mandates that the change in control signal between two adjacent frames cannot exceed a fixed value, such as a PWM value change of no more than 5. This rigid limitation method requires less computation and also prevents drastic changes in brightness.
[0114] Step 601: Calculate the target light source brightness output based on the brightness deviation.
[0115] Furthermore, a brightness control signal is generated based on the difference between the effective brightness value and the preset target brightness value, specifically employing an iterative mapping algorithm based on historical output. Unlike conventional absolute value control, this step fully utilizes the actual light source state of the previous frame to ensure the continuity of adjustment.
[0116] In this embodiment, the target light source brightness output is calculated using the following linear iterative formula:
[0117] B _target (t)=B _out (t-1)+K _adj ×(L _target -L eff (t));
[0118] Among them, B _target (t) represents the theoretical target light source brightness value calculated in frame t, B _out (t-1) represents the actual brightness control value output to the light source device in the (t-1)th frame, K _adj L represents the preset adjustment gain coefficient. _target This represents the preset target image brightness value, such as a grayscale value of 128, L. eff (t) represents the effective luminance value calculated for the t-th frame.
[0119] Through calculation, the system only considers the current brightness deviation (L) _target -L eff(t) Fine-tunes the output from the previous time step. When the deviation is 0, the output remains unchanged, achieving zero steady-state error control.
[0120] Step 602: Limit the brightness output of the target light source within a safe range.
[0121] Specifically, in order to prevent excessive output power of the light source from causing thermal damage to human tissue, or excessive output power from causing complete loss of vision, it is necessary to perform safety clamping on the calculated theoretical target value.
[0122] This step uses the following logic for B. _target (t) is corrected:
[0123] If B _target (t)>B _max Then B _target (t)=B _max ;
[0124] If B _target (t) _min Then B _target (t)=B _min ;
[0125] Among them, B _max This indicates the preset maximum luminance value that the light source is allowed to output, corresponding to the highest safe luminous flux, B. _min This indicates the preset minimum brightness value that the light source is allowed to output, corresponding to the baseline brightness required to maintain the lowest field of view.
[0126] For example, in PWM control mode, B _max It can be set to 95% duty cycle, B _min It can be set to a 10% duty cycle.
[0127] Step 603: Generate the final brightness control signal by combining the rate of change limit.
[0128] Based on this, in order to further avoid inter-frame flicker, this embodiment uses rate-of-change limiting filtering as a smoothing method.
[0129] Specifically, the system calculates the target value B for the current frame. _target (t) and the output value B of the previous frame _out The difference Δ between (t-1).
[0130] Set the maximum allowable brightness change Δ per frame _max Among them, Δ _max The range of values for is B _max 5% to 10%.
[0131] The final brightness control signal B _out The calculation logic for (t) is as follows:
[0132] If the difference Δ>Δ _max Then B _out (t)=B _out (t-1)+Δ _max ;
[0133] If the difference Δ < -Δ _max Then B _out (t)=B _out (t-1)-Δ _max ;
[0134] Otherwise, B _out (t)=B _target (t);
[0135] Based on this, this embodiment constructs a complete control chain integrating iterative calculation, safe amplitude limiting, and dynamic image stabilization, ensuring that the light source can output safe and shaky illumination light under any extreme image input.
[0136] In other embodiments, a medical light source host that adaptively adjusts output brightness is provided. Specifically, the host includes: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the medical light source methods for adaptively adjusting output brightness.
[0137] In this embodiment, the processor can be a system-on-a-chip (SoC) inside the medical host, such as an ARM-based processor, or a combination of a field-programmable gate array (FPGA) and a digital signal processor (DSP). The FPGA is responsible for high-speed image acquisition and preprocessing, such as an ISP pipeline, while the DSP or ARM core is responsible for executing the complex brightness analysis algorithms of this embodiment, such as highlight recognition, spatial weighting, and PID calculation. The memory can be DDR SDRAM for caching image data and Flash memory for storing program code.
[0138] In other embodiments, a medical light source system with adaptively adjustable output brightness is provided. This system includes: a medical light source host for adaptively adjusting output brightness, used to acquire images and control the light source device; a light source device, communicatively connected to the medical light source host, used to provide illumination light and adjust its output brightness according to received control signals; and a control line connecting the host and the light source device for transmitting data and control signals.
[0139] In this embodiment, the communication connection between the host and the light source device adopts an industrial-grade high-reliability interface.
[0140] In one specific implementation, UART serial communication is used, with the baud rate set to 115200bps. The host sends a data packet containing brightness instructions to the light source every 16ms (corresponding to 60fps).
[0141] In another preferred embodiment, a CAN bus connection is used, which utilizes its differential transmission characteristics to improve the anti-electromagnetic interference capability and adapt to the complex electromagnetic environment of the operating room.
[0142] As a further improvement to the system, the light source device also includes a manual adjustment module and a channel switching module.
[0143] The manual adjustment module may include a rotary potentiometer, button, or touch screen on the light source panel, used to generate a manually set brightness signal.
[0144] The channel switching module is used for arbitration switching between adaptive mode and manual mode. The specific implementation logic is as follows:
[0145] When the user operates the manual adjustment module, the channel switching module detects the level change, immediately cuts off the automatic control signal from the host, prioritizes the execution of the manual setting value, and locks the system status to manual mode.
[0146] When the user presses the Auto / Automatic physical button, the channel switching module connects to the host's communication interface, and the light source brightness begins to adaptively adjust according to the algorithm output. This dual-mode switching mechanism allows doctors to still control the light source even in the event of algorithm failure or special emergency situations.
[0147] In some scenarios, under manual control mode, operators can adjust the brightness of the light source output module manually. For example, rotating the adjustment knob changes the input electrical signal, thereby controlling the output brightness of the light source to meet specific usage requirements.
[0148] When switching to the host adaptive control mode, the host begins to play its core role. The host acquires image information in real time, including parameters such as brightness, color, and contrast. Based on a built-in brightness adjustment algorithm, the host analyzes and calculates the acquired image parameters to determine the optimal brightness value for the current scene. Correspondingly, the host sends control signals to the light source output module via the control cable. Upon receiving the control signals, the light source output module automatically adjusts its output brightness, ensuring the entire system operates in optimal mode, resulting in clear and accurate presentation of medical images.
[0149] Throughout the entire operation, the light source control channel switching module plays a role in mode switching and signal transmission path selection, ensuring smooth operation of both manual control and adaptive control modes without interference.
[0150] Before a medical examination or surgery begins, the operator selects the appropriate control mode via the light source control channel switching module, based on the actual situation. For simple brightness adjustments or preliminary verification of the algorithm's effectiveness, the manual control mode can be selected, allowing for manual adjustment of the light source brightness via the manual adjustment module; alternatively, the mode can be switched to the host adaptive control mode.
[0151] In adaptive control mode, the host continuously acquires image information and calculates the optimal brightness value, dynamically adjusting the brightness of the light source output module in real time. Throughout the medical procedure, operators no longer need to manually adjust the light source brightness, allowing them to focus more on the medical operation itself.
[0152] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.
Claims
1. A method for adaptively adjusting the output brightness of a medical light source, characterized in that, include: Real-time acquisition of the current frame image; Perform brightness feature analysis on the current frame image to calculate the effective brightness value of the current scene; A brightness control signal is generated based on the difference between the effective brightness value and the preset target brightness value; The brightness control signal is sent to the light source device, which then drives the light source device to adjust the output brightness.
2. The method according to claim 1, characterized in that, Perform brightness feature analysis on the current frame image, specifically including: Get the pixel values of the red, green, and blue channels of the current frame image; The pixel values of the red, green, and blue channels are weighted and summed using a preset brightness conversion coefficient to obtain a single-channel brightness image with the same resolution as the current frame image, which is used as the brightness component.
3. The method according to claim 2, characterized in that, Calculate the effective brightness value of the current scene, specifically including: A spatial weight matrix with the same size as the luminance component is used, wherein the weight values of the central region of the spatial weight matrix are higher than the weight values of the edge regions; A weight adjustment mask is generated based on the highlight region in the luminance component. The spatial weight matrix is then corrected point by point using the weight adjustment mask to obtain the corrected weight matrix. The sum of the products of the pixel values of the luminance component and the corresponding weights in the corrected weight matrix is used as the luminance-weighted sum. Calculate the sum of all weight elements in the modified weight matrix, and use it as the weight normalization factor; The effective brightness value is obtained by dividing the weighted sum of brightness by the weight normalization factor.
4. The method according to claim 3, characterized in that, A weighted adjustment mask is generated based on the highlight region in the luminance component, specifically including: Obtain the preset highlight detection threshold; Traverse all pixels of the luminance component, mark pixels with pixel values greater than the highlight determination threshold as highlight pixels, and mark pixels with pixel values less than or equal to the highlight determination threshold as non-highlight pixels; A binarized weight adjustment mask is generated based on the distribution of highlight pixels and non-highlight pixels.
5. The method according to claim 4, characterized in that, Based on the distribution of highlight and non-highlight pixels, a binarized weight adjustment mask is generated. The spatial weight matrix is then modified point-by-point using this mask, specifically including: The proportion of highlight pixels in the total number of pixels in the current frame is used as the highlight percentage. Adaptive weighting factors are dynamically calculated based on the proportion of highlights. In the weight adjustment mask, the position corresponding to the non-highlight pixel is assigned a value of 1, and the position corresponding to the highlight pixel is assigned an adaptive weight factor. The corrected weight matrix is obtained by multiplying the assigned weight adjustment mask with the spatial weight matrix at corresponding positions.
6. The method according to claim 5, characterized in that, The adaptive weighting factor is dynamically calculated based on the highlight ratio, specifically through the following preset mapping relationship: Set a first threshold and a second threshold, wherein the second threshold is greater than the first threshold; When the highlight ratio is less than the first threshold, the adaptive weight factor is set to the preset minimum weight coefficient; When the proportion of highlights is greater than the second threshold, the adaptive weight factor is set to the preset maximum weight coefficient; When the highlight ratio is between the first threshold and the second threshold, the adaptive weighting factor is set to a value that monotonically increases with the highlight ratio.
7. The method according to claim 3, characterized in that, The spatial weight matrix is pre-constructed based on a two-dimensional Gaussian distribution function. Its center coordinates are located at the center of the image, and the element values in the spatial weight matrix decrease from the center to the edge.
8. The method according to claim 1, characterized in that, Based on the difference between the effective brightness value and the preset target brightness value, a brightness control signal is generated, specifically including: Calculate the difference between the preset target brightness value and the effective brightness value; The difference is calculated using a preset proportional-integral adjustment algorithm to obtain the original brightness control signal.
9. A medical light source host with adaptive output brightness adjustment, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 8.
10. A medical light source system that adaptively adjusts output brightness, characterized in that, include: A light source device used to output illumination light; The host computer as described in claim 9 is used to acquire images and control the light source device; The control line connects the host and the light source device and is used to transmit data and control signals.