Image enhancement method, terminal device and storage medium
By acquiring the pixel sum of the microscope image, filtering the target pixel points, and calculating the gain coefficient for image enhancement, the problem of unsatisfactory image enhancement effect and complex calculations under the microscope is solved, and effective enhancement and outstanding details for dark and bright images are achieved.
Patent Information
- Application Number
- CN202311018858.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-11
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-08-11
AI Technical Summary
The existing image enhancement method has poor effect on partially dark and bright images under a microscope, which is easy to amplify noise and is complex in calculations, so it cannot adapt to the lack of robustness of cell images.
By acquiring the pixel sum of the target image, determining the target threshold, filtering the target pixel point set, analyzing the parameter information of the image channel, calculating the gain coefficient and performing image enhancement processing, the target enhancement image is obtained.
It improves the image enhancement effect of pictures saved under the microscope, highlights the detail information, is simple to calculate, can be used for real-time image enhancement, and is suitable for the enhancement processing of wet-mount images under electron microscope.
Smart Images

Figure CN117218015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image enhancement method, terminal equipment, and storage medium. Background Art
[0002] Commonly used microscopes in medicine include biological microscopes and electron microscopes. These microscopes can observe abnormal changes in human cells and tissues, helping doctors diagnose diseases. However, because images viewed with the naked eye under biological microscopes differ from those stored under electron microscopes (the image background appears slightly reddish), this is not conducive to clinical use. To ensure that images viewed with the naked eye under biological microscopes and stored under electron microscopes are consistent, image enhancement processing can be performed on the stored images.
[0003] Currently, there are numerous image enhancement methods, primarily spatial and frequency domain methods. Spatial domain methods primarily include grayscale transformation, histogram equalization, and Laplace sharpening, while frequency domain methods primarily include homomorphic filtering and wavelet transforms. Research and application of these enhancement methods have revealed limitations, lack of robustness, and inability to adapt to microscopic cell imaging. For example, grayscale transformation, while simple, is prone to information loss; histogram equalization is ineffective for enhancing dark and bright images and tends to amplify noise.
[0004] Therefore, there is an urgent need for an image enhancement method that can overcome the limitations of existing image enhancement methods, such as unsatisfactory enhancement effects on partially dark and bright images, easy amplification of noise, and complex calculations. Summary of the Invention
[0005] The main purpose of the embodiments of the present invention is to provide an image enhancement method, terminal device and storage medium, which are intended to solve the problems of unsatisfactory enhancement effect for partially dark and bright images, easy amplification of noise, and complex calculation when performing enhancement processing on images stored under an electron microscope.
[0006] In a first aspect, an embodiment of the present invention provides an image enhancement method, comprising:
[0007] Acquire a target image, and obtain a pixel sum corresponding to each pixel point in the target image;
[0008] Determining a target pixel sum according to the size of the pixel sum, and determining a target threshold value of the target image;
[0009] Filtering the pixel sum of each pixel point of the target image according to the target threshold value to obtain a target pixel point set corresponding to the target image;
[0010] Determining parameter information of the target image in the corresponding image channel according to the target pixel point set, wherein the parameter information is used to characterize the pixel value distribution of the target image in the image channel;
[0011] Determine a gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel;
[0012] Performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
[0013] In a second aspect, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the image enhancement methods provided in the specification of the present invention are implemented.
[0014] In a third aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any image enhancement method provided in the specification of the present invention.
[0015] An embodiment of the present invention provides an image enhancement method, a terminal device, and a storage medium. After acquiring a target image, the method calculates the pixel sum corresponding to each pixel in the target image, determines the target pixel sum based on the size of the pixel sum, and determines a target threshold corresponding to the target image. The target threshold is then used to filter the pixel sums of each pixel in the target image to obtain a target pixel set corresponding to the target image. The target pixel set is then analyzed to determine parameter information of the target image in the corresponding image channel. A gain coefficient corresponding to the target image in the image channel is determined based on the parameter information and the target pixel sum. Finally, image enhancement processing is performed on the target image based on the gain coefficient to obtain a target enhanced image corresponding to the target image. This method solves the problems of unsatisfactory enhancement effects, easy amplification of noise, and computational complexity in enhancing images stored under an electron microscope. The method improves the image enhancement effects of images stored under an electron microscope, enhances partially dark and bright images, highlights detailed information in the image, and more accurately restores the effects of biological microscopes. The method is computationally simple and can be used for real-time image enhancement, thus being more conducive to clinical use. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] Figure 1 A schematic diagram of a flow chart of an image enhancement method provided by an embodiment of the present invention;
[0018] Figure 2 for Figure 1 Schematic diagram of the process of sub-step S102 of the image enhancement method;
[0019] Figure 3 for Figure 1 Schematic diagram of the process of sub-step S105 of the image enhancement method;
[0020] Figure 4 A schematic diagram of a scenario for implementing the image enhancement method provided in this embodiment;
[0021] Figure 5 A schematic diagram of a target image enhanced by an image enhancement method according to an embodiment of the present invention;
[0022] Figure 6 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0024] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0025] It should be understood that the terms used in this specification are only for the purpose of describing particular embodiments and are not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0026] The present invention provides an image enhancement method, a terminal device, and a storage medium. The image enhancement method can be applied to a terminal device, which can be an electronic device such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, or a wearable device.
[0027] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0028] Image enhancement primarily enhances image brightness and contrast, highlighting desired information. Image enhancement is an important means of improving image quality and visual quality, facilitating subsequent image processing and video tracking. Currently, there are numerous image enhancement methods, primarily spatial domain and frequency domain. Spatial domain methods primarily include grayscale transformation, histogram equalization, and Laplace sharpening, while frequency domain methods primarily include homomorphic filtering and wavelet transforms.
[0029] Grayscale transformation maps the grayscale r in the original image f(x,y) to the grayscale s in the enhanced image g(x,y), expanding or compressing the dynamic range of the image's grayscale, thereby enhancing image contrast. Common grayscale transformations include linear transformation, piecewise linear transformation, and nonlinear transformation. Common nonlinear transformations include exponential transformation, logarithmic transformation, and combinations of exponential and logarithmic transformations. Histogram equalization essentially widens the grayscale range in areas with a large number of pixels and reduces the grayscale range in areas with a small number of pixels, thereby adjusting image brightness and contrast. The cumulative probability density function of the output image is equal to the cumulative probability density function of the input image, and the output probability density function maintains a uniform distribution. The Laplace operator is a differential operator that enhances image edge information, i.e., areas with abrupt changes in grayscale values. Laplace sharpening is the most direct and simplest method for image sharpening, enhancing image edges and making blurred images clearer. Homomorphic filtering utilizes the illumination characteristics of an image to reduce the effects of uneven illumination on the image. Based on the illuminance-reflectance model theory, homomorphic filtering considers an image as the product of illuminance and reflectance. The image is first transformed into the frequency domain, then processed using the illuminance-reflectance model. The image's visual quality is improved by expanding and compressing the grayscale range. Homomorphic filtering can be categorized into Gaussian, Butterworth, and exponential homomorphic filtering, depending on the high-pass filter function. The wavelet transform decomposes a signal into a series of subband signals with varying resolution, frequency, and directional characteristics. The wavelet transform applies a high-pass filter and a low-pass filter to a two-dimensional image, performing wavelet decomposition at different scales. The low-frequency components of the decomposed components are synthesized through wavelets to produce an enhanced image.
[0030] However, all of the aforementioned image enhancement methods have limitations, lack robustness, and are unsuitable for microscopic cell images. For example, grayscale transformation, while simple, is prone to information loss; histogram equalization is ineffective for enhancing dark or bright images and tends to amplify noise; Laplace sharpening can only enhance image edges but not brightness or contrast; homomorphic filtering can enhance image brightness but is less effective for contrast; and wavelet transforms are also less effective for contrast enhancement and computationally complex, making them difficult to use in real-time enhancement systems.
[0031] Therefore, there is an urgent need for an image enhancement method that can overcome the limitations of existing image enhancement methods, such as unsatisfactory enhancement effects on partially dark and bright images, easy amplification of noise, and complex calculations.
[0032] Please refer to Figure 1 , Figure 1 A flowchart of an image enhancement method provided by an embodiment of the present invention.
[0033] like Figure 1 As shown, the image enhancement method includes steps S101 to S106.
[0034] Step S101: Acquire a target image and obtain the pixel sum corresponding to each pixel point in the target image.
[0035] For example, there is a deviation between the information observed under a biological microscope and the image saved under an electron microscope (for example, the image background is slightly reddish). Therefore, in order to ensure that the image saved under the electron microscope is consistent with the image information observed under the biological microscope and facilitate clinical use, the image saved under the electron microscope is used as the target image and then image enhancement processing is performed.
[0036] Exemplarily, image attributes corresponding to the target image are obtained, such as the image size, pixel value, pixel channel, etc. of the target image, so as to obtain the pixel value of each pixel point in the target image under the pixel channel according to the image attributes of the target image and sum them to obtain the corresponding pixel sum.
[0037] For example, if the pixel channels of the target image are RGB channels, the pixel value Pr under the R channel, the pixel value Pg under the G channel, and the pixel value Pb under the B channel corresponding to each pixel position (x, y) of the target image are obtained, and then the pixel sum of the target image at the pixel position (x, y) is obtained as Pr+Pg+Pb.
[0038] Optionally, the pixel channel type of the target image may be determined according to actual image properties of the target image. The specific pixel channel is not particularly limited here and may be set as required.
[0039] Step S102: determining a target pixel sum according to the size of the pixel sum, and determining a target threshold of the target image.
[0040] For example, the target image's pixel sums are arranged by size to obtain a predetermined number of pixel sums. The average of these predetermined number of pixel sums is calculated and used as the target pixel sum. The target threshold for the target image is determined using the controlled variable method or adjusted as needed.
[0041] In one embodiment, the target pixel sum is determined according to the size of the pixel sum, and the target threshold of the target image is determined. Specifically, referring to Figure 2 , step S102 includes: sub-step S1021 to sub-step S1022.
[0042] Sub-step S1021: comparing the pixel sums corresponding to each pixel point in the target image, and then determining the maximum value corresponding to the pixel sums as the target pixel sum.
[0043] Exemplarily, the pixel sums corresponding to each pixel point in the target image are compared, and then arranged in order from large to small, and the maximum value corresponding to the pixel sum is taken as the target pixel sum.
[0044] For example, if the size of the target image is 10*10, after calculating the pixel sum corresponding to each pixel position, the pixel sum corresponding to each pixel position is arranged in descending order to obtain the target pixel sum.
[0045] Sub-step S1022: determining a target ratio, and determining a target threshold corresponding to the target image according to the target ratio and the pixel sum.
[0046] Exemplarily, the target ratio is determined, the number of pixels corresponding to the target image is determined according to the image size and target ratio corresponding to the target image, and then sorting is performed according to the pixel sum to obtain a sorting result, and the pixel sum corresponding to the number of pixels in the sorting result is obtained, and then the pixel sum is used as the target threshold.
[0047] For example, if the target ratio is 10% and the size of the target image is 10*10, the total number of pixels in the target image is 100. Then, the total number of pixels 100 is multiplied by the target ratio 10% to obtain the number of pixels 10. After obtaining the sorting result by sorting the pixels, the pixel sum corresponding to the 10th place in the sorting result is used as the target threshold.
[0048] Step S103 : Filter the pixel sums of the pixels of the target image according to the target threshold value to obtain a target pixel set corresponding to the target image.
[0049] Exemplarily, when the pixel sum of each pixel point in the target image is greater than the target threshold, the pixel and the corresponding pixel point are regarded as a target in the target pixel point set.
[0050] For example, the target threshold is 200, the size of the target image is 3*3, and the pixels are represented by x11, x12, x13, x21, x22, x23, x31, x32, and x33 respectively. If the sum of the pixels corresponding to x11, x23, x32, and x33 is greater than the target threshold 200, then the target pixel point set includes x11, x23, x32, and x33.
[0051] Step S104: determining parameter information of the target image in the corresponding image channel according to the target pixel point set, wherein the parameter information is used to characterize the pixel value distribution of the target image in the image channel.
[0052] Exemplarily, an image channel corresponding to the target image is obtained, and then the pixel value distribution of the pixel points included in the target pixel point set is analyzed in the corresponding image channel.
[0053] For example, the target pixel point set includes x11, x23, x32, and x33, and the image channel corresponding to the target image is RGB. Then, the pixel value distribution of the pixel points x11, x23, x32, and x33 under the R channel is calculated, and the pixel value distribution of the pixel points x11, x23, x32, and x33 under the G channel and the pixel value distribution of the pixel points x11, x23, x32, and x33 under the B channel are also calculated.
[0054] In some embodiments, determining the parameter information of the target image in the corresponding image channel based on the target pixel point set includes: determining the image channel corresponding to the target image; obtaining the target pixel value corresponding to each pixel point in the target pixel point set in the image channel, and determining the parameter information of the target image in the corresponding image channel based on the target pixel value.
[0055] Exemplarily, the image channel corresponding to the target image is determined based on the image attributes of the target image, and then the target pixel value corresponding to each pixel point in the target pixel point set in the image channel is obtained, so as to determine the parameter information of the target image in the corresponding image channel based on the target pixel value, wherein the parameter information is the mode or median value.
[0056] For example, the target pixel point set includes x11, x23, x32, and x33, and the image channel corresponding to the target image is RGB. The pixel value distribution of pixel points x11, x23, x32, and x33 under the R channel is calculated. The pixel values of x11, x23, x32, and x33 under the R channel are 200, 205, 201, and 201 respectively. If the parameter information is the mode, the corresponding parameter information value under the R channel is 201. If the parameter information is the median, the corresponding parameter information under the R channel is also 201. The calculation method is (201+201) / 2. The pixel value distribution of pixel points x11, x23, x32, and x33 under the G channel and the pixel value distribution of pixel points x11, x23, x32, and x33 under the B channel are calculated in the same way.
[0057] In some embodiments, the parameter information is mean information, and determining the parameter information of the target image in the corresponding image channel based on the target pixel value includes: calculating the sum of the pixels corresponding to the target pixel value in the image channel to determine the cumulative sum information of the target image in the corresponding image channel; and determining the mean information of the target image in the image channel based on the cumulative sum information.
[0058] Exemplarily, the mean information is used to represent the pixel value distribution of the target image in the image channel. After determining the image channel corresponding to the target image, the pixel values of the target pixel values in the image channel are summed to obtain the cumulative sum information of the target image in the image channel, and the cumulative sum information is divided by the number of target pixel point sets to obtain the mean information corresponding to the target image in the image channel.
[0059] For example, if the target pixel set includes x11, x23, x32, and x33, and the image channel corresponding to the target image is RGB, then the pixel value distribution of pixels x11, x23, x32, and x33 in the R channel is calculated. The pixel values of x11, x23, x32, and x33 in the R channel are 200, 205, 201, and 201, respectively. The cumulative sum information in the R channel is 200+205+201+201=807, and the mean information in the R channel is 807 / 4. Similarly, the mean information of pixels x11, x23, x32, and x33 in the G channel and the mean information of pixels x11, x23, x32, and x33 in the B channel are calculated.
[0060] Step S105: Determine a gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel.
[0061] Exemplarily, a calculation is performed based on the parameter information of the image channel and the target pixel sum to determine the gain coefficient corresponding to the target image in the image channel.
[0062] In one embodiment, the gain coefficient corresponding to the target image in the image channel is determined based on the parameter information and the target pixel, specifically, referring to Figure 3 , step S105 includes: sub-step S1051 to sub-step S1052.
[0063] Sub-step S1051: determining a target channel pixel value corresponding to the target image in the image channel according to the target pixel.
[0064] Exemplarily, a target pixel and a corresponding pixel point in a target image are obtained, and then a target channel pixel value corresponding to the pixel point in the image channel is obtained.
[0065] For example, if the image channel is R, the target pixel sum is 200, and the corresponding pixel point in the target image is x23, then the corresponding target channel pixel value under the R channel at position x23 of the target image is queried. Similarly, when the image channel is B or G, the corresponding target channel pixel value is obtained respectively.
[0066] Sub-step S1052: Divide the target channel pixel value by the parameter information to obtain a gain coefficient corresponding to the target image in the image channel.
[0067] Exemplarily, the pixel value of the target channel corresponding to the image channel is divided by the parameter information of the image channel to obtain the gain coefficient of the target image in the image channel.
[0068] For example, if the image channel of the target image is RGB channel and the parameter information is mean information, then when the target channel pixel value under the R channel is MaxVal_R, the mean information is Then the gain coefficient under the R channel is obtained as Similarly, when the target channel pixel value under the G channel is MaxVal_G, the mean information is Then the gain coefficient under the G channel is obtained as When the target channel pixel value under the B channel is MaxVal_B, the mean information is Then the gain coefficient under channel B is obtained as
[0069]
[0070] Step S106: performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
[0071] Exemplarily, the gain coefficient is used to perform image enhancement processing on the pixel value of each pixel point in the target image, thereby obtaining a target enhanced image corresponding to the target image.
[0072] In some embodiments, performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image includes: multiplying the gain coefficient by the pixel value in the image channel corresponding to the target image, thereby obtaining an enhancement processing result of the target image in the image channel; and performing pixel fusion according to the enhancement processing result to obtain a target enhanced image corresponding to the target image.
[0073] Exemplarily, the gain coefficient under the image channel is multiplied by the pixel value of the target image under the image channel to obtain the image enhancement processing result of the pixel point under the image channel, and then the image enhancement processing results under each image channel are added to determine the target enhanced image corresponding to the target image.
[0074] For example, if the target image is an RGB image, the gain coefficient under the R channel is The gain coefficient under the G channel is The gain coefficient under channel B is The pixel values corresponding to the target image at the pixel point Pxy are (Pix_R, Pix_G, Pix_B), and the result of image enhancement processing at the pixel point Pxy is (gain_R*Pix_R, gain_G*Pix_G, gain_B*Pix_B). Then, the image enhancement processing results under the RGB image channels are fused to obtain the target enhanced image after image enhancement.
[0075] In some embodiments, performing pixel fusion according to the enhancement processing result to obtain a target enhanced image corresponding to the target image includes: comparing the enhancement processing result with the target pixel range to determine the target enhancement processing result; performing pixel fusion according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image.
[0076] For example, when the image channels of the target image are processed according to the gain coefficient to obtain the enhanced processing result, it should be ensured that the enhanced processing result is within the pixel range of [0, 255]. When the enhanced processing result is less than 0, it is forced to be set to 0. When the enhanced processing result is greater than 255, it is forced to be set to 255. If it is in [0, 255], the gain processing result is retained to obtain the target enhanced processing result. Pixel fusion is then performed according to the target enhanced processing result to obtain the target enhanced image corresponding to the target image.
[0077] In some embodiments, after performing pixel fusion based on the target enhancement processing result to obtain a target enhanced image corresponding to the target image, the method further includes: determining the number of targets corresponding to when the enhancement processing result exceeds the target pixel range; when the number of targets is greater than a preset number, canceling the image enhancement processing on the target image and retaining the target image.
[0078] Exemplarily, a counting variable is determined. When the enhancement processing result exceeds the target pixel range, the counting variable is increased by one. After all the enhancement processing results are compared, the counting variable is determined as the target number. When the target number is greater than the preset number, it is determined that the target enhanced image after the image enhancement processing is too different from the target image, and the target enhanced image is determined to be distorted, and then the image enhancement processing on the target image is canceled and the target image is retained.
[0079] For example, if the target pixel range is [0, 255], when the enhancement processing result is less than 0 or greater than 255, the counting variable is increased by one to obtain the target number.
[0080] For example, if the preset number is set to 100, then when the target number is greater than 100, the target enhanced image is deemed to be distorted, and the image enhancement processing on the target image is canceled, and the target image is retained; alternatively, the preset number is set to the number corresponding to the target percentage of the number of pixels in the target image. For example, if the target percentage is 30%, then when the target image size is 100*100, the number of pixels in the target image is 10,000, and the preset number is 10,000*30%=3,000.
[0081] Exemplarily, the target pixel range is the difference range between the pixel value before multiplication by the gain coefficient and the pixel value after multiplication by the gain coefficient. When the difference between the pixel value under the image enhancement result and the original image channel exceeds the difference range, the image is deemed to be distorted, and the image enhancement processing on the target image is canceled, and the target image is retained.
[0082] Exemplarily, the target pixel range is the ratio range of the pixel value before multiplication by the gain coefficient to the pixel value after multiplication by the gain coefficient. When the ratio of the image enhancement result to the pixel value under the original image channel exceeds this ratio range, the image is deemed to be distorted, and the image enhancement processing on the target image is canceled, and the target image is retained.
[0083] Please refer to Figure 4 , Figure 4 A schematic diagram of a scenario for implementing the image enhancement method provided in this embodiment, as shown in FIG. Figure 4As shown, a wet mount image saved by an electron microscope is obtained as a target image, and then each pixel point in the target image is traversed and the pixel sum of each pixel point in all image channels is calculated, and the target pixel sum is obtained according to the size of the pixel sum; the target threshold corresponding to the target ratio is obtained according to the size of the pixel sum; each pixel point in the target image is traversed again to screen and obtain pixel points whose pixel sum is greater than the target threshold as a target pixel point set, and then the corresponding mean information of the pixel points in the target pixel point set in each image channel is calculated, and the corresponding target pixel point is obtained according to the target pixel sum, and the pixel value of the target pixel point in each image channel and the corresponding value in the image channel are calculated. The mean information is divided to obtain the gain coefficient corresponding to the image channel, and then the pixel value of the image channel corresponding to each pixel point in the target image is multiplied by the gain coefficient corresponding to the image channel to obtain the image enhancement processing result, and the image enhancement processing result is compared with the target pixel range [0,255]. When the image enhancement processing result exceeds the target pixel range [0,255], the counting variable is increased by one. When the counting variable exceeds the preset number, the target enhanced image obtained by the image enhancement processing result is cancelled and the target image is retained. If it does not exceed the preset number, the target enhanced image corresponding to the target image is obtained. The target image enhancement processing effect comparison is as follows: Figure 5 This method addresses issues such as poor enhancement of partially dark and bright images, noise amplification, and computational complexity during electron microscope image enhancement. It improves the image enhancement of electron microscope images, enhancing partially dark and bright images, highlighting image details, and more accurately recreating the effects of biological microscopy. The method is computationally simple and can be used for real-time image enhancement, making it more beneficial for clinical use. Furthermore, it can adaptively enhance wet mount images from electron microscopes, achieving significant enhancement results.
[0084] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention.
[0085] like Figure 6 As shown, the terminal device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected via a bus 303, such as an I2C (Inter-integrated Circuit) bus.
[0086] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0087] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0088] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0089] The processor is configured to run a computer program stored in a memory, and implement any one of the image enhancement methods provided by the embodiments of the present invention when executing the computer program.
[0090] In one embodiment, the processor is configured to run a computer program stored in the memory, and implement the following steps when executing the computer program:
[0091] Acquire a target image, and obtain a pixel sum corresponding to each pixel point in the target image;
[0092] Determining a target pixel sum according to the size of the pixel sum, and determining a target threshold value of the target image;
[0093] Filtering the pixel sum of each pixel point of the target image according to the target threshold value to obtain a target pixel point set corresponding to the target image;
[0094] Determining parameter information of the target image in the corresponding image channel according to the target pixel point set, wherein the parameter information is used to characterize the pixel value distribution of the target image in the image channel;
[0095] Determine a gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel;
[0096] Performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
[0097] In some implementations, during the process of determining the target pixel sum according to the size of the pixel sum and determining the target threshold of the target image, the processor 301 executes:
[0098] Comparing the pixel sums corresponding to each pixel point in the target image, and then determining the maximum value corresponding to the pixel sums as the target pixel sum;
[0099] A target ratio is determined, and a target threshold corresponding to the target image is determined according to the target ratio and the pixel sum.
[0100] In some implementations, during the process of determining parameter information of the target image in the corresponding image channel according to the target pixel point set, the processor 301 executes:
[0101] Determining the image channel corresponding to the target image;
[0102] A target pixel value corresponding to each pixel point in the target pixel point set in the image channel is obtained, and parameter information of the target image in the corresponding image channel is determined according to the target pixel value.
[0103] In some implementations, the parameter information is mean information, and the processor 301, in the process of determining the parameter information of the target image in the corresponding image channel according to the target pixel value, executes:
[0104] Calculating the sum of pixels corresponding to the target pixel value in the image channel to determine cumulative sum information of the target image in the corresponding image channel;
[0105] Determine mean value information of the target image in the image channel according to the cumulative sum information.
[0106] In some implementations, during the process of determining the gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel, the processor 301 performs:
[0107] Determining a target channel pixel value corresponding to the target image in the image channel according to the target pixel;
[0108] The target channel pixel value is divided by the parameter information to obtain a gain coefficient corresponding to the target image in the image channel.
[0109] In some implementations, during the process of performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image, the processor 301 executes:
[0110] Multiplying the gain coefficient by the pixel value in the image channel corresponding to the target image, thereby obtaining an enhancement processing result of the target image in the image channel;
[0111] Pixel fusion is performed according to the enhancement processing result to obtain a target enhanced image corresponding to the target image.
[0112] In some embodiments, during the process of performing pixel fusion according to the enhancement processing result to obtain the target enhanced image corresponding to the target image, the processor 301 executes:
[0113] Comparing the enhancement processing result with the target pixel range to determine the target enhancement processing result;
[0114] Pixel fusion is performed according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image.
[0115] In some implementations, after performing pixel fusion according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image, the processor 301 further executes:
[0116] Determining the number of targets corresponding to when the enhancement processing result exceeds the target pixel range;
[0117] When the number of targets is greater than a preset number, the image enhancement processing performed on the target images is canceled and the target images are retained.
[0118] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned image enhancement method embodiment, and will not be repeated here.
[0119] An embodiment of the present invention also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any image enhancement method provided in the description of the embodiment of the present invention.
[0120] The storage medium may be an internal storage unit of the terminal device described in the aforementioned embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the terminal device.
[0121] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0122] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system that includes a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system that includes the element.
[0123] The serial numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope of protection of the claims.
Claims
1. An image enhancement method, characterized in that: The method comprises: Acquire a target image, and obtain a pixel sum corresponding to each pixel point in the target image; Determining a target pixel sum according to the size of the pixel sum, and determining a target threshold value of the target image; Filtering the pixel sum of each pixel point of the target image according to the target threshold value to obtain a target pixel point set corresponding to the target image; Determining parameter information of the target image in the corresponding image channel according to the target pixel point set, wherein the parameter information is used to characterize the pixel value distribution of the target image in the image channel; Determine a gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel; Performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image; The determining, according to the parameter information and the target pixel, a gain coefficient corresponding to the target image in the image channel includes: Determining a target channel pixel value corresponding to the target image in the image channel according to the target pixel; The target channel pixel value is divided by the parameter information to obtain a gain coefficient corresponding to the target image in the image channel.
2. The method according to claim 1, characterized in that Determining a target pixel sum according to the size of the pixel sum and determining a target threshold of the target image includes: Comparing the pixel sums corresponding to each pixel point in the target image, and then determining the maximum value corresponding to the pixel sums as the target pixel sum; A target ratio is determined, and a target threshold corresponding to the target image is determined according to the target ratio and the pixel sum.
3. The method according to claim 1, characterized in that The determining, according to the target pixel point set, parameter information of the target image in the corresponding image channel includes: Determining the image channel corresponding to the target image; A target pixel value corresponding to each pixel point in the target pixel point set in the image channel is obtained, and parameter information of the target image in the corresponding image channel is determined according to the target pixel value.
4. The method according to claim 3, characterized in that The parameter information is mean information, and determining the parameter information of the target image in the corresponding image channel according to the target pixel value includes: Calculating the sum of pixels corresponding to the target pixel value in the image channel to determine cumulative sum information of the target image in the corresponding image channel; Determine mean value information of the target image in the image channel according to the cumulative sum information.
5. The method according to claim 1, wherein The performing image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image includes: Multiplying the gain coefficient by the pixel value in the image channel corresponding to the target image, thereby obtaining an enhancement processing result of the target image in the image channel; Pixel fusion is performed according to the enhancement processing result to obtain a target enhanced image corresponding to the target image.
6. The method according to claim 5, characterized in that The performing pixel fusion according to the enhancement processing result to obtain a target enhanced image corresponding to the target image includes: Comparing the enhancement processing result with the target pixel range to determine the target enhancement processing result; Pixel fusion is performed according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image.
7. The method according to claim 6, characterized in that After performing pixel fusion according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image, the method further includes: Determining the number of targets corresponding to when the enhancement processing result exceeds the target pixel range; When the number of targets is greater than a preset number, the image enhancement processing performed on the target images is canceled and the target images are retained.
8. A terminal device, characterized in that: The terminal device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the image enhancement method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that When the computer-readable storage medium is executed by one or more processors, the one or more processors are caused to perform the steps of the image enhancement method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image enhancement method and device, equipment and storage medium
CN114298944A
Low-illumination image enhancement method and device and image processing equipment
CN115619667A