Adaptive image enhancement method and device, endoscope, medium and program product

By segmenting and luminance calculation of the images collected by the endoscopy, combining the enhancement level set by the user and the pixel size of the image block, the brightness value of the image block is adaptively adjusted, which solves the problem of noise increase in the endoscopy image during the enhancement process and improves the image's visual and quality.

CN120088176APending Publication Date: 2025-06-03SHENZHEN COMEN MEDICAL INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411991100.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

While adjusting image gain and enhancing image effects, the endoscope will enhance image noise, especially when the brightness is low, which seriously affects the appearance and quality of the picture.

Method used

By acquiring the images collected by the endoscope, segmenting them into multiple image blocks, calculating the brightness value of each image block, and determining the target brightness factor based on the mapping relationship between the preset brightness value and the brightness factor. Combining the enhancement level set by the user and the pixel size of the image block, the brightness value of each image block is adjusted to achieve adaptive adjustment of the image brightness.

Benefits of technology

It realizes fine adjustment of image brightness, reduces the enhancement of noise, improves the appearance and quality of the image, and meets the needs of different usage scenarios for image effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088176A_ABST
    Figure CN120088176A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of endoscopes, and discloses a self-adaptive image enhancement method and device, an endoscope, a medium and a program product. The method comprises the following steps: acquiring at least one frame of image acquired by an endoscope; segmenting the at least one frame of image to obtain a plurality of first image blocks; calculating a first brightness value of each first image block; determining a target brightness factor corresponding to the first brightness value according to a mapping relation between a preset image block brightness value and a brightness factor; acquiring the enhancement level of at least one frame of image; wherein the enhancement level is a level set by a user according to a current use scene; and adjusting each first brightness value according to the target brightness factor, the enhancement level and the pixel size of the first image block to obtain a target brightness value of each first image block. By implementing the technical scheme of the invention, adaptive enhancement of the image is realized, so that the brightness, contrast and definition of the image are improved, and the overall image quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of endoscopes, and in particular to an adaptive image enhancement method, device, endoscope, medium and program product. Background Art

[0002] Due to the complexity of the abdominal cavity environment where the internal camera of the electronic endoscope is located during video acquisition and the influence of factors such as electronic noise interference, problems such as insufficient saturation will occur in the acquired endoscope images, resulting in image degradation.

[0003] Therefore, in order to solve the problem of image degradation, the current internal endoscopes will activate the structure enhancement algorithm in different environments to highlight the texture details and boundary contours in the image. However, while adjusting the image gain and enhancing the image effect, the image noise will be enhanced, especially when the image brightness is low, which seriously affects the visual perception and quality of the image. Summary of the Invention

[0004] In view of this, the present invention provides an adaptive image enhancement method, device, endoscope, medium and program product to solve the problem that the endoscope enhances image noise while adjusting the image gain and enhancing the image effect.

[0005] In a first aspect, the present invention provides an adaptive image enhancement method, including: acquiring at least one frame of image collected by an endoscope; segmenting the at least one frame of image to obtain a plurality of first image blocks; calculating a first brightness value of each first image block; determining a target brightness factor corresponding to the first brightness value according to a mapping relationship between a preset image block brightness value and a brightness factor; acquiring an enhancement level of the at least one frame of image; wherein, the enhancement level is a level set by the user according to the current usage scenario; adjusting each first brightness value according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain a target brightness value of each first image block.

[0006] The adaptive image enhancement method provided by the embodiments of the present invention can finely adjust the brightness of the image block according to the mapping relationship between the preset image block brightness value and the brightness factor, making the image processing more accurate and natural. According to the enhancement level set by the user based on the current usage scenario, personalized enhancement of the image can be realized, meeting the requirements of different usage scenarios for the image effect. By calculating the brightness value of each image block and determining the target brightness factor according to the set rules, the adaptive adjustment of the image brightness is realized, improving the processing efficiency. Adjusting the first brightness value according to the target brightness factor, the enhancement level, and the pixel size helps to maintain image details and avoid over-enhancing or damaging the image quality.

[0007] In an alternative embodiment, calculating the first luminance value of each first image block includes: segmenting the first image block to obtain a plurality of second image blocks of the same size; calculating the second luminance value of each second image block; performing column histogram statistics on all the second luminance values, and determining the first luminance value of each first image block according to a preset condition.

[0008] The adaptive image enhancement method provided by the embodiments of the present invention can achieve more delicate adjustment of the image luminance by further segmenting the first image block into a plurality of second image blocks of the same size and calculating the luminance value of each second image block. Performing column histogram statistics on all the second luminance values helps to comprehensively understand the luminance distribution within the first image block, providing an objective basis for determining the first luminance value of the first image block. Determining the first luminance value of each first image block according to a preset condition can adaptively adjust the luminance of the image block according to specific situations, making the processing result more in line with actual requirements.

[0009] In an alternative embodiment, calculating the second luminance value of each second image block includes: for any pixel in the second image block, selecting the maximum value from the three color channels corresponding to the pixel; determining the maximum value as the third luminance value of the pixel; calculating the average value of the third luminance values of all the pixels in the second image block; and determining the average value as the second luminance value of the second image block.

[0010] The adaptive image enhancement method provided by the embodiments of the present invention can ensure the preservation of the color information of the original pixel during the luminance adjustment process and avoid color distortion by selecting the maximum value from the three color channels corresponding to each pixel as the third luminance value. By calculating the average value of the third luminance values of all the pixels in the second image block and determining it as the second luminance value of the second image block, the luminance distribution of the entire image block can be more comprehensively considered, making the luminance adjustment more balanced and accurate.

[0011] In an alternative embodiment, performing column histogram statistics on all the second luminance values and determining the first luminance value of the first image block according to a preset condition includes: sorting the histogram in descending order according to the magnitudes of the second luminance values and determining the number of second image blocks corresponding to each second luminance value; starting from the highest luminance value among the second luminance values, cumulatively summing the numbers; determining the target second luminance value when the cumulative sum is greater than or equal to a preset value for the first time as the first luminance value of the first image block; where the preset value is calculated according to the number of first pixels corresponding to the first image block and the number of second pixels corresponding to the second image block.

[0012] The adaptive image enhancement method provided by the embodiment of the present invention can comprehensively understand the distribution of different brightness values in the second image block by counting the number of second image blocks corresponding to each second brightness value, providing an objective basis for determining the first brightness value. According to the preset value and the process of cumulative summation, the first brightness value can be adaptively determined, making the adjustment process more flexible and meeting the actual needs. By means of cumulative summation, the first brightness value can be quickly and effectively determined, avoiding complex calculation processes and the subjectivity of manual adjustment, and improving the processing efficiency and accuracy. By calculating the preset value according to the number of pixels corresponding to the first image block and the second image block, the actual situation and structure of the image can be better reflected, enhancing the correlation between the algorithm and the data. Dynamically calculating the preset value according to the number of pixels makes the algorithm have a certain self-adaptability, can be applied to image blocks with different pixel numbers, and improves the universality and application range of the algorithm. The preset value calculated based on the number of pixels can more accurately reflect the characteristics and structure of the image, thereby improving the accuracy and stability of the algorithm.

[0013] In an alternative embodiment, each first brightness value is adjusted according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain the target brightness value of each first image block, including: obtaining the enhancement parameter corresponding to the enhancement level and the brightness parameter corresponding to the target brightness factor; calculating the target brightness value of each first image block according to the preset brightness value enhancement formula, the enhancement parameter, the brightness parameter, and the pixel size of the first image block.

[0014] The adaptive image enhancement method provided by the embodiment of the present invention can flexibly adjust the effect of image enhancement by setting the enhancement parameter corresponding to the enhancement level and the brightness parameter corresponding to the target brightness factor, meeting the brightness adjustment requirements under different needs. According to the preset brightness value enhancement formula, a brightness adjustment algorithm that meets the requirements can be designed according to specific needs, making the brightness adjustment more personalized and customized. Combining the enhancement parameter, the brightness parameter, and the pixel size of the first image block can accurately calculate the target brightness value of each first image block, ensuring the accuracy and controllability of the brightness adjustment.

[0015] In an alternative embodiment, the brightness value enhancement formula is:

[0016]

[0017] where EnhY is the target brightness value, Y is the first brightness value, Ybp is the component after convolving Y, w is the enhancement parameter, t is the size of the first image block, S is the brightness parameter, and a is the constant component.

[0018] In a second aspect, the present invention provides an adaptive image enhancement device, including: a first acquisition module configured to acquire at least one frame of image collected by an endoscope; a segmentation module configured to segment the at least one frame of image to obtain a plurality of first image blocks; a calculation module configured to calculate a first brightness value of each first image block; a determination module configured to determine a target brightness factor corresponding to the first brightness value according to a mapping relationship between a preset image block brightness value and a brightness factor; a second acquisition module configured to acquire an enhancement level of the at least one frame of image, where the enhancement level is a level set by a user according to a current usage scenario; and an adjustment module configured to adjust each first brightness value according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain a target brightness value of each first image block.

[0019] In a third aspect, the present invention provides an endoscope, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the adaptive image enhancement method according to the first aspect or any corresponding embodiment thereof.

[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, and the computer instructions are used to cause a computer to perform the adaptive image enhancement method according to the first aspect or any corresponding embodiment thereof.

[0021] In a fifth aspect, the present invention provides a computer program product including computer instructions, and the computer instructions are used to cause a computer to perform the adaptive image enhancement method according to the first aspect or any corresponding embodiment thereof. Description of the Drawings

[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 is a flowchart of an adaptive image enhancement method according to an embodiment of the present invention;

[0024] Figure 2 is a flowchart of another adaptive image enhancement method according to an embodiment of the present invention;

[0025] Figure 3 is a structural block diagram of an adaptive image enhancement device according to an embodiment of the present invention;

[0026] Figure 4 It is a schematic diagram of the hardware structure of the endoscope according to an embodiment of the present invention. Specific Embodiments

[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0028] With the continuous progress of technology, high-definition electronic medical endoscopes have become essential medical devices for diagnosing and treating human diseases. However, when the endoscope camera captures video in a complex abdominal cavity environment, affected by factors such as environmental complexity and electronic noise, the obtained endoscope images have problems such as insufficient saturation and image degradation. Therefore, to solve the degradation problem and improve the image effect, a structure enhancement algorithm is currently introduced into the endoscope image processing system. This algorithm aims to process the brightness of the image, highlight texture details and boundary contours, thereby improving the image quality.

[0029] However, when the structure enhancement algorithm is applied, while highlighting the texture details and boundary contours in the image, it also enhances the noise in the image. The appearance of this noise will seriously affect the visual perception and quality of the image. Especially in areas with low brightness, the signal-to-noise ratio is low. When the structure enhancement algorithm is applied, while enhancing the image in low-brightness areas, it will also greatly enhance the noise, making the noise and the image signal not significantly distinguishable in low-brightness areas.

[0030] In view of this, the technical solution of the present invention adds functions of noise suppression and scene recognition to the image processing system of the endoscope to adaptively complete the display enhancement of endoscope images.

[0031] According to an embodiment of the present invention, an embodiment of an adaptive image enhancement 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 a different order than here.

[0032] In this embodiment, an adaptive image enhancement method is provided, which can be used for endoscopes. Figure 1 It is a flowchart of the adaptive image enhancement method according to an embodiment of the present invention, as Figure 1 shown, and this process includes the following steps:

[0033] Step S101: Obtain at least one frame of image collected by the endoscope.

[0034] Select and extract at least one still image from the video stream or continuous image sequence captured by the endoscope. Specifically, during endoscopy or surgery, the endoscope will transmit a continuous image stream to the display screen or storage device in real time. These images are usually continuous and dynamic. Select and extract at least one frame of image from the continuous video stream or image sequence.

[0035] Step S102: Segment the at least one frame of image to obtain multiple first image blocks.

[0036] The first image block is an image block obtained by segmenting the at least one frame of image, with a specific size and shape. Each first image block represents a part of the content in the at least one frame of image. Specifically, segmentation can be performed in different ways, such as pixel-based segmentation, edge detection, region growing, threshold segmentation, etc.

[0037] Step S103: Calculate the first brightness value of each first image block.

[0038] The first brightness value is used to characterize the brightness of the first image block. Specifically, the first brightness value of each first image block can be calculated according to methods such as average brightness value, maximum / minimum brightness value, or brightness histogram statistics, which are not limited here.

[0039] For example, by the average brightness value method, add up the brightness values of all pixels in the first image block and divide by the number of pixels to obtain the average brightness value, and determine the average brightness value as the first brightness value.

[0040] For another example, by the brightness histogram statistics method, count the number of pixels at each brightness level in the first image block, and a brightness histogram can be drawn to understand the overall brightness distribution.

[0041] Step S104: Determine the target brightness factor corresponding to the first brightness value according to the mapping relationship between the preset image block brightness value and the brightness factor.

[0042] The mapping relationship between the image block brightness value and the brightness factor can be obtained through experience, mathematical models, or experimental data. For example, through investigation and research or experimental analysis, the mapping rules of the target brightness factor corresponding to different brightness values can be established. Specifically, when the mapping relationship between the brightness value and the brightness factor is established, determine the target brightness factor corresponding to the first brightness value according to the mapping relationship.

[0043] For example, the value of the brightness factor is 0 - 1, and the brightness value is 0 - 255. Map the brightness factor and the brightness value. 0 - 20 corresponds to a brightness factor of 0.1, 20 - 40 corresponds to a brightness factor of 0.2, 40 - 45 corresponds to a brightness factor of 0.3, and so on. Traverse and test according to the brightness value and the factor to obtain the best corresponding relationship.

[0044] Step S105, obtain the enhancement level of at least one frame of image; wherein, the enhancement level is the level set by the user according to the current usage scenario.

[0045] The enhancement level refers to the level that can be set according to specific requirements and scenario requirements for enhancing the color of mucous membranes in an image or video. The enhancement level can involve adjustments in aspects such as the brightness, contrast, color saturation, and sharpness of the image, and is used to improve the visual effect of the image. Specifically, according to the enhancement level set by the user, perform corresponding enhancement processing on the obtained image.

[0046] Step S106, adjust each first brightness value according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain the target brightness value of each first image block.

[0047] The pixel size of the first image block represents the spatial size occupied by the first image block in the image. The target brightness value is the brightness value of the first image block obtained after adjusting the first brightness value of each first image block. Specifically, according to the set target brightness factor, enhancement level, and pixel size of the first image block, adjust the brightness value of each first image block to obtain the target brightness value of each first image block, so as to achieve precise control of the brightness of the first image block and obtain the final image brightness effect that meets the requirements.

[0048] The adaptive image enhancement method provided by the embodiment of the present invention can finely adjust the brightness of the image block according to the mapping relationship between the preset image block brightness value and the brightness factor, making the image processing more accurate and natural. According to the enhancement level set by the user based on the current usage scenario, personalized enhancement of the image can be realized to meet the requirements of different usage scenarios for the image effect. By calculating the brightness values of each image block and determining the target brightness factor according to the set rules, adaptive adjustment of the image brightness is achieved, improving the processing efficiency. Adjusting the first brightness value according to the target brightness factor, the enhancement level, and the pixel size helps to maintain image details and avoid over - enhancement or damage to the image quality.

[0049] In this embodiment, an adaptive image enhancement method is provided, which can be used for endoscopes. Figure 2 It is a flowchart of the adaptive image enhancement method according to the embodiment of the present invention, as Figure 2 shown, and this process includes the following steps:

[0050] Step S201: Obtain at least one frame of image collected by the endoscope. For details, please refer to Figure 1 step S101 of the embodiment shown, which will not be elaborated here.

[0051] Step S202: Segment the at least one frame of image to obtain a plurality of first image blocks. For details, please refer to Figure 1 step S102 of the embodiment shown, which will not be elaborated here.

[0052] Step S203: Calculate the first brightness value of each first image block.

[0053] Specifically, the above step S203 includes:

[0054] Step S2031: Segment the first image block to obtain a plurality of second image blocks of the same size.

[0055] The second image block is an image block obtained by segmenting the first image block. Specifically, the first image block is divided according to a certain rule or algorithm to obtain several second image blocks of the same size. For example, it can be divided according to features such as pixel position, color, and brightness to obtain second image blocks of the same size.

[0056] Step S2032: Calculate the second brightness value of each second image block.

[0057] The second brightness value is a comprehensive representation of the brightness values of the pixels in each second image block. Specifically, operations such as averaging, weighted averaging, maximum value, and minimum value of all pixel brightness values in the second image block are performed to obtain a value representing the overall brightness feature of the second image block.

[0058] In some alternative embodiments, the above step S2032 includes:

[0059] Step a1: For any pixel in the second image block, select the maximum value from the three color channels corresponding to the pixel.

[0060] For any pixel in the second image block, each pixel point contains information of three color channels of RGB (red, green, and blue). Specifically, for any pixel in the second image block, the one with the largest value among the RGB three channels of the pixel is selected as the final color value of the pixel.

[0061] Step a2: Determine the maximum value as the third brightness value of the pixel.

[0062] The third brightness value is the maximum value selected from the RGB color channels of the pixel. Specifically, the maximum value is determined as the third brightness value of the pixel to enhance the brightness contrast of the image and make the image look more plump and vivid.

[0063] Step a3, calculate the average value of the third luminance values of all the pixels in the second image block.

[0064] After summing up the third luminance values of each pixel in the second image block, divide the sum by the total number of pixels in the second image block to obtain the average value. Specifically, after adding up the third luminance values of each pixel in the second image block, divide the result of the summation by the total number of pixels to obtain the average value of the third luminance values of all the pixels in the second image block.

[0065] Step a4, determine the average value as the second luminance value of the second image block.

[0066] When the average value of the third luminance values of all the pixels in the second image block is calculated, determine the average value as the second luminance value of the second image block to simplify and extract the luminance feature of the entire second image block, providing a reference for subsequent image processing.

[0067] In the above embodiment, by selecting the maximum value in the three-color channels corresponding to each pixel as the third luminance value, it is possible to ensure that the color information of the original pixel is maintained during the luminance adjustment process, avoiding color distortion. By calculating the average value of the third luminance values of all the pixels in the second image block and determining it as the second luminance value of the second image block, it is possible to more comprehensively consider the luminance distribution of the entire image block, making the luminance adjustment more balanced and accurate.

[0068] Step S2033, perform column histogram statistics on all the second luminance values, and determine the first luminance value of each first image block according to a preset condition.

[0069] A histogram is a statistical chart used to represent the data distribution. Specifically, perform column histogram statistics on all the second luminance values of the first image block to obtain the distribution of the second luminance values of all the second image blocks in the first image block, that is, obtain the occurrence frequency or quantity of different luminance values of the second luminance value.

[0070] The preset condition refers to some rules or conditions set in advance for determining the first luminance value of the first image block. Specifically, determine the first luminance value of each first image block according to the histogram statistics result and the preset condition.

[0071] In some alternative embodiments, the above step S2033 includes:

[0072] Step b1, sort the histogram in descending order according to the magnitudes of the second luminance values, and determine the number of second image blocks corresponding to each second luminance value.

[0073] A histogram is a chart used to represent the image block brightness distribution of the first image block. The horizontal axis represents the specific magnitude values of the second brightness value, and the vertical axis represents the number of pixels or frequency corresponding to the second brightness value. Specifically, the second brightness values in the histogram are sorted from high to low according to the brightness value. The number of second image blocks corresponding to each second brightness value is determined by reading the vertical axis of the histogram.

[0074] Step b2: Start accumulating and summing the number from the highest brightness value among the second brightness values.

[0075] The highest brightness value refers to the brightness value with the largest brightness value among the second brightness values. Specifically, starting from the highest brightness value, the number of image blocks corresponding to each second brightness value is successively added up one by one to form an accumulated summation sequence.

[0076] Step b3: Determine the target second brightness value when the accumulated sum is greater than or equal to the preset value for the first time as the first brightness value of the first image block.

[0077] The preset value is calculated based on the number of first pixels corresponding to the first image block and the number of second pixels corresponding to the second image block, that is For example, the number of first pixels corresponding to the first image block is 128×128, and the number of second pixels corresponding to the second image block is 16×16.

[0078] Specifically, during the process of accumulated summation, the target second brightness value when the accumulated sum is greater than or equal to the preset value for the first time is determined as the first brightness value of the first image block. For example, the second brightness value A when the accumulated sum is greater than or equal to 64 for the first time is determined as the first brightness value of the first image block.

[0079] In the above embodiment, by counting the number of second image blocks corresponding to each second brightness value, the distribution of different brightness values in the second image block can be comprehensively understood, providing an objective basis for determining the first brightness value. According to the preset value and the process of accumulated summation, the first brightness value can be adaptively determined, making the adjustment process more flexible and in line with actual requirements. Through the method of accumulated summation, the first brightness value can be quickly and effectively determined, avoiding complex calculation processes and the subjectivity of manual adjustment, and improving the processing efficiency and accuracy.

[0080] Step S204: Determine the target brightness factor corresponding to the first brightness value according to the mapping relationship between the preset image block brightness value and the brightness factor. For details, please refer to Figure 1 Step S104 of the illustrated embodiment, which will not be elaborated here.

[0081] Step S205: Obtain the enhancement level of at least one frame of image; wherein, the enhancement level is the level set by the user according to the current usage scenario.

[0082] Specifically, the above-mentioned step S205 includes: In response to the user's operation instruction, determine the enhancement level of at least one frame of image.

[0083] It can be understood that different endoscopes have their specific usage scenarios in fields such as medicine and industry, such as gastrointestinal endoscopes, industrial inspection endoscopes, etc. When observing the mucosa, the color performance of the endoscope may be affected by factors such as light and environment, and enhancement processing is required to improve the visual effect. According to the specific usage scenario of the endoscope and the characteristics of the mucosa color, different enhancement levels can be set to obtain clearer and more accurate images or videos.

[0084] Specifically, according to the enhancement level selection instruction of the user on the operation device corresponding to the endoscope, determine the enhancement level of at least one frame of image. For example, the user can set the enhancement level to five levels from 1 to 5 according to the specific usage requirements of the endoscope and the characteristics of the mucosa color.

[0085] Step S206: Adjust each first brightness value according to the target brightness factor, enhancement level, and pixel size of the first image block to obtain the target brightness value of each first image block.

[0086] Specifically, the above-mentioned step S206 includes:

[0087] Step S2061: Obtain the enhancement parameter corresponding to the enhancement level and the brightness parameter corresponding to the target brightness factor.

[0088] The enhancement parameter is the specific parameter corresponding to the set enhancement level, and the brightness parameter is the parameter set according to the target brightness factor. Specifically, parse the user's enhancement level selection instruction to obtain the enhancement parameter corresponding to the enhancement level, and parse the determined target brightness factor to obtain the brightness parameter corresponding to the target brightness factor.

[0089] Step S2062: Calculate the target brightness value of each first image block according to the preset brightness value enhancement formula, enhancement parameter, brightness parameter, and pixel size of the first image block.

[0090] Specifically, the brightness value enhancement formula is:

[0091]

[0092] where EnhY is the target brightness value, Y is the first brightness value, Ybp is the component after convolving Y, w is the enhancement parameter, t is the pixel size of the first image block, S is the brightness parameter, and a is the constant component.

[0093] The brightness value enhancement formula is a pre-set mathematical formula or algorithm for adjusting the brightness of an image, including the calculation method of brightness enhancement, parameter settings, and other contents. Specifically, the enhancement parameter, brightness parameter, pixel size of the first image block, and the first brightness value are substituted into the brightness value enhancement formula to calculate the target brightness value of each first image block.

[0094] In the adaptive image enhancement method provided by the embodiments of the present invention, by setting the enhancement parameter corresponding to the enhancement level and the brightness parameter corresponding to the target brightness factor, the effect of image enhancement can be flexibly adjusted to meet the brightness adjustment requirements under different needs. According to the pre-set brightness value enhancement formula, a brightness adjustment algorithm that meets the requirements can be designed according to specific needs, making the brightness adjustment more personalized and customized. Combining the enhancement parameter, brightness parameter, and the pixel size of the first image block, the target brightness value of each first image block can be accurately calculated to ensure the accuracy and controllability of brightness adjustment.

[0095] In this embodiment, an adaptive image enhancement device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0096] This embodiment provides an adaptive image enhancement device, as Figure 3 shown, including:

[0097] A first acquisition module 301, configured to acquire at least one frame of image collected by an endoscope;

[0098] A segmentation module 302, configured to segment at least one frame of image to obtain a plurality of first image blocks;

[0099] A calculation module 303, configured to calculate the first brightness value of each first image block;

[0100] A determination module 304, configured to determine the target brightness factor corresponding to the first brightness value according to the mapping relationship between the preset image block brightness value and the brightness factor;

[0101] A second acquisition module 305, configured to acquire the enhancement level of at least one frame of image. The enhancement level is the level set by the user according to the current usage scenario;

[0102] An adjustment module 306, configured to adjust each first brightness value according to the target brightness factor, enhancement level, and pixel size of the first image block to obtain the target brightness value of each first image block.

[0103] In some alternative embodiments, the computing module 303 includes:

[0104] A splitting sub-module, configured to split the first image block to obtain a plurality of second image blocks of the same size;

[0105] A first computing sub-module, configured to calculate the second brightness value of each second image block;

[0106] A first determining sub-module, configured to perform column histogram statistics on all the second brightness values, and determine the first brightness value of each first image block according to a preset condition.

[0107] In some alternative embodiments, the first computing sub-module includes:

[0108] A selection unit, configured to select the maximum value from the three color channels corresponding to a pixel in the second image block;

[0109] A first determination unit, configured to determine the maximum value as the third brightness value of the pixel;

[0110] A calculation unit, configured to calculate the average value of the third brightness values of all the pixels in the second image block;

[0111] A second determination unit, configured to determine the average value as the second brightness value of the second image block.

[0112] In some alternative embodiments, the first determining sub-module includes:

[0113] A third determination unit, configured to sort the histogram in descending order according to the magnitudes of the second brightness values, and determine the number of second image blocks corresponding to each second brightness value;

[0114] A summing unit, configured to cumulatively sum the numbers starting from the highest brightness value among the second brightness values;

[0115] A fourth determination unit, configured to determine the target second brightness value when the cumulative sum is greater than or equal to a preset value for the first time as the first brightness value of the first image block; wherein, the preset value is calculated according to the number of first pixels corresponding to the first image block and the number of second pixels corresponding to the second image block.

[0116] In some alternative embodiments, the adjustment module 306 includes:

[0117] An acquisition sub-module, configured to acquire the enhancement parameter corresponding to the enhancement level and the brightness parameter corresponding to the target brightness factor;

[0118] A second computing sub-module, configured to calculate the target brightness value of each first image block according to a preset brightness value enhancement formula, the enhancement parameter, the brightness parameter, and the pixel size of the first image block.

[0119] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding embodiments above, and will not be repeated here.

[0120] The adaptive image enhancement device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0121] The adaptive image enhancement device provided by the embodiment of the present invention can finely adjust the brightness of an image block according to the mapping relationship between the preset brightness value of the image block and the brightness factor, making the image processing more accurate and natural. According to the enhancement level set by the user based on the current usage scenario, personalized enhancement of the image can be achieved, meeting the requirements for image effects in different usage scenarios. By calculating the brightness values of each image block and determining the target brightness factor according to the set rules, the adaptive adjustment of the image brightness is realized, improving the processing efficiency. Adjusting the first brightness value according to the target brightness factor, the enhancement level, and the pixel size helps to maintain image details and avoid over-enhancing or damaging the image quality.

[0122] The embodiment of the present invention also provides an endoscope having the above-mentioned Figure 3 adaptive image enhancement device.

[0123] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an endoscope provided by an alternative embodiment of the present invention. As shown in Figure 4 , the endoscope includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component communicates with each other using different buses and can be installed on a common main board or installed in other ways as needed. The processor can process instructions executed within the endoscope, including instructions stored in the memory 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 alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple endoscopes can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 4 In

[0124] The processor 10 may be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.

[0125] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.

[0126] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the endoscope, etc. In addition, the memory 20 may include a high-speed random access memory, and may further include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the endoscope through 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.

[0127] The memory 20 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 20 may further include a combination of the above types of memories.

[0128] The endoscope further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means. Figure 4 Taking connection through a bus as an example.

[0129] The input device 30 may receive input digital or character information, and generate key signal inputs related to the user settings and function control of the endoscope, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (such as an LED), and a tactile feedback device (such as a vibration motor), etc. The above-mentioned display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.

[0130] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, 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 disc, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, 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, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0131] A part of the present invention can be applied as a computer program product, for example, computer program instructions, which when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0132] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. An adaptive image enhancement method, characterized in that: The method comprises: Acquire at least one frame of image collected by an endoscope; Segmenting the at least one frame of image to obtain a plurality of first image blocks; Calculating a first brightness value of each of the first image blocks; Determining a target brightness factor corresponding to the first brightness value according to a preset mapping relationship between the brightness value of the image block and the brightness factor; Acquire the enhancement level of the at least one frame of image; wherein the enhancement level is a level set by the user according to the current usage scenario; Each of the first brightness values ​​is adjusted according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain a target brightness value of each of the first image blocks.

2. The adaptive image enhancement method according to claim 1, characterized in that: The calculating the first brightness value of each of the first image blocks includes: Segmenting the first image block to obtain a plurality of second image blocks of the same size; Calculating a second brightness value of each of the second image blocks; Column histogram statistics are performed on all second brightness values, and the first brightness value of each of the first image blocks is determined according to a preset condition.

3. The adaptive image enhancement method according to claim 2, characterized in that: The calculating the second brightness value of each of the second image blocks comprises: For any pixel in the second image block, selecting a maximum value from the three color channels corresponding to the pixel; Determine the maximum value as a third brightness value of the pixel; Calculating an average value of third brightness values ​​of all pixels in the second image block; The average value is determined as a second brightness value of the second image block.

4. The adaptive image enhancement method according to claim 2, characterized in that: The performing column histogram statistics on all the second brightness values ​​and determining the first brightness value of the first image block according to a preset condition includes: sorting the histogram from high to low according to the magnitude of each of the second brightness values, and determining the number of second image blocks corresponding to each of the second brightness values; Cumulatively summing the number starting from the highest brightness value among the second brightness values; Determine the target second brightness value when the cumulative sum is greater than or equal to a preset value for the first time as the first brightness value of the first image block; The preset value is calculated based on the first number of pixels corresponding to the first image block and the second number of pixels corresponding to the second image block.

5. The adaptive image enhancement method according to claim 1, characterized in that: The adjusting each of the first brightness values ​​according to the target brightness factor, the enhancement level, and the pixel size of the first image block to obtain the target brightness value of each of the first image blocks includes: Acquire an enhancement parameter corresponding to the enhancement level and a brightness parameter corresponding to the target brightness factor; The target brightness value of each of the first image blocks is calculated according to a preset brightness value enhancement formula, the enhancement parameter, the brightness parameter, and the pixel size of the first image block.

6. The adaptive image enhancement method according to claim 5, characterized in that: The brightness enhancement formula is: Among them, EnhY is the target brightness value, Y is the first brightness value, Ybp is the component after convolution of Y, w is the enhancement parameter, t is the size of the first image block, S is the brightness parameter, and a is a constant component.

7. An adaptive image enhancement device, characterized in that: The device comprises: A first acquisition module, used to acquire at least one frame of image collected by the endoscope; A segmentation module, used for segmenting the at least one frame of image to obtain a plurality of first image blocks; A calculation module, used for calculating a first brightness value of each of the first image blocks; A determination module, configured to determine a target brightness factor corresponding to the first brightness value according to a preset mapping relationship between the brightness value of the image block and the brightness factor; A second acquisition module, used to acquire the enhancement level of the at least one frame of image; wherein the enhancement level is a level set by the user according to the current usage scenario; An adjustment module is used to adjust each of the first brightness values ​​according to the target brightness factor, the enhancement level and the pixel size of the first image block to obtain a target brightness value of each of the first image blocks.

8. An endoscope, 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 adaptive image enhancement method according to any one of claims 1 to 6 by executing the computer instructions.

9. 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 adaptive image enhancement method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the adaptive image enhancement method according to any one of claims 1 to 6.