CN117218015A - Image enhancement method, terminal device and storage medium - Google Patents

Image enhancement method, terminal device and storage medium Download PDF

Info

Publication number
CN117218015A
CN117218015A CN202311018858.6A CN202311018858A CN117218015A CN 117218015 A CN117218015 A CN 117218015A CN 202311018858 A CN202311018858 A CN 202311018858A CN 117218015 A CN117218015 A CN 117218015A
Authority
CN
China
Prior art keywords
target
image
pixel
channel
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311018858.6A
Other languages
Chinese (zh)
Inventor
曾武斌
张霄
杨牧
张游龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Reetoo Biotechnology Co Ltd
Original Assignee
Shenzhen Reetoo Biotechnology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Reetoo Biotechnology Co Ltd filed Critical Shenzhen Reetoo Biotechnology Co Ltd
Priority to CN202311018858.6A priority Critical patent/CN117218015A/en
Publication of CN117218015A publication Critical patent/CN117218015A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application provides an image enhancement method, terminal equipment and a storage medium, and belongs to the technical field of image processing. The method comprises the following steps: acquiring a target image, and acquiring 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 of a target image; screening 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 a target image in a corresponding image channel according to the target pixel point set, wherein the parameter information is used for representing pixel value distribution conditions of the target image in the image channel; according to the parameter information and the target pixel, determining a corresponding gain coefficient of the target image in the image channel; and carrying out image enhancement processing on the target image according to the gain coefficient to obtain the target enhanced image. The method solves the problem of non-ideal image enhancement effect in the prior art, and improves the image enhancement effect and efficiency.

Description

Image enhancement method, terminal device and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image enhancement method, a terminal device, and a storage medium.
Background
Microscopes commonly used in medicine include a biological microscope and an electron microscope, and abnormal changes of cells and tissues of a human body can be observed through the microscope to help doctors diagnose diseases, but because images watched by naked eyes under the biological microscope and stored by the electron microscope have deviation (image background is slightly red), clinical use is not facilitated. In order to make the image viewed by the naked eye of the biological microscope and the picture saved under the electron microscope consistent, the saved picture may be subjected to image enhancement processing.
At present, the image enhancement method is more and mainly comprises a space domain method and a frequency domain method. The airspace method mainly comprises gray level transformation, histogram equalization, laplacian sharpening and the like; the frequency domain method mainly comprises homomorphic filtering, wavelet transformation and the like. During the research and practice of the above enhancement method, it was found that: the method has certain limitation, is not robust and cannot adapt to the cell image under a microscope. For example, although the gradation conversion method is simple, information is easily lost; histogram equalization does not work well for partially darkened and brighter images, and noise is easily amplified, etc.
Therefore, there is a need for an image enhancement method that overcomes the limitations of the existing image enhancement methods, such as unsatisfactory image enhancement effects on partially dark and bright images, easy noise amplification, and complex computation.
Disclosure of Invention
The embodiment of the application mainly aims to provide an image enhancement method, terminal equipment and storage medium, and aims to solve the problems that when an image stored under an electron microscope is subjected to enhancement processing, the image enhancement effect on partial dark and bright images is not ideal, noise is easy to amplify, calculation is complex and the like.
In a first aspect, an embodiment of the present application provides an image enhancement method, including:
acquiring a target image, and acquiring 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 of the target image;
screening pixels 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 a corresponding image channel according to the target pixel point set, wherein the parameter information is used for representing pixel value distribution conditions of the target image in the image channel;
determining a corresponding gain coefficient of the target image in the image channel according to the parameter information and the target pixel;
and carrying out image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
In a second aspect, an embodiment of the present application further provides a terminal device, the terminal device comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the steps of any one of the image enhancement methods as provided in the present specification.
In a third aspect, embodiments of the present application further provide a storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement steps of any of the image enhancement methods as provided in the present specification.
The embodiment of the application provides an image enhancement method, terminal equipment and storage medium, wherein after a target image is acquired, the method calculates pixel sums corresponding to each pixel point in the target image, determines target pixel sums according to the sizes of the pixel sums, determines a target threshold corresponding to the target image, and further screens the pixel sums of all the pixel points of the target image by utilizing the target threshold to obtain a target pixel point set corresponding to the target image; analyzing the target pixel point set to determine parameter information of the target image in the corresponding image channel; according to the parameter information and the target pixel, determining a corresponding gain coefficient of the target image in the image channel; and finally, carrying out image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image. Therefore, the problems that the image enhancement effect of the image stored under the electron microscope is not ideal, noise is easy to amplify, calculation is complex and the like when the image stored under the electron microscope is enhanced are solved, the image enhancement effect of the image stored under the electron microscope is improved, the image with partial darkness and brightness is enhanced, the detailed information in the image is highlighted, the effect under the biological microscope is reduced, and the calculation is simple, and the image enhancement method can be used for real-time image enhancement, so that the image enhancement method is more beneficial to clinical use.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an image enhancement method according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a substep S102 of the image enhancement method of FIG. 1;
FIG. 3 is a flow chart illustrating a substep S105 of the image enhancement method of FIG. 1;
fig. 4 is a schematic view of a scene for implementing the image enhancement method according to the present embodiment;
FIG. 5 is a schematic diagram of an image enhancement result of a target image according to an embodiment of the present application;
fig. 6 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The embodiment of the application provides an image enhancement method, terminal equipment and a storage medium. The image enhancement method can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as tablet computers, notebook computers, desktop computers, personal digital assistants, wearable equipment and the like.
Some embodiments of the application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Image enhancement is mainly to enhance the brightness and contrast of an image, highlighting the required information. Image enhancement is an important means for improving image quality and visual effect, and provides good conditions for subsequent processing of images, video tracking and the like. The current image enhancement methods are relatively many, and mainly comprise a space domain method and a frequency domain method. The airspace method mainly comprises gray level transformation, histogram equalization, laplacian sharpening and the like; the frequency domain method mainly comprises homomorphic filtering, wavelet transformation and the like.
The gray scale transformation is to map gray scales r in an original image f (x, y) into gray scales s in an enhanced image g (x, y) so that the dynamic range of the image gray scales is expanded or compressed, thereby enhancing the image contrast. The usual grey scale transformations are: linear transforms, piecewise linear transforms, and nonlinear transforms, with nonlinear transforms commonly used being exponential transforms, logarithmic transforms, and combined exponential and logarithmic transforms. The essence of histogram equalization is to widen the gray level with more pixels in the image, and reduce the gray level with less pixels, so as to achieve the purpose of adjusting the brightness and contrast of the image. The probability density function accumulation of the output image is equal to the probability density function accumulation of the input image, and the probability density functions of the output image remain uniformly distributed. The laplace operator is a differential operator that enhances the image edge information, i.e., the areas where the gray values are abrupt. Laplacian sharpening is the most direct and simplest processing method for image sharpening, and can enhance the edge of an image and make a blurred image clearer. The homomorphic filtering method utilizes the illumination characteristic of the image to reduce the influence of uneven illumination on the image. Homomorphic filtering regards an image as the product of illumination and reflectance according to the illumination-reflectance model theory. The image is transformed to the frequency domain, then processed by using the illuminance-reflectance model, and the visual effect of the image is improved by expanding and compressing the gray scale range. Homomorphism filtering can be classified into gaussian homomorphism filtering, butterworth homomorphism filtering, and exponential homomorphism filtering according to the difference of the high-pass filtering functions. The wavelet transform may decompose a signal into a series of subband signals with different resolution, frequency characteristics, and direction characteristics. The wavelet transformation uses a high-pass filter and a low-pass filter for the two-dimensional image, performs wavelet decomposition on different scales, and synthesizes the decomposed low-frequency components through wavelet to obtain an enhanced image.
However, the image enhancement processing methods have certain limitations, are not robust, and cannot be adapted to the cell image under a microscope. Such as gray scale conversion, although simple, is prone to losing information; histogram equalization has poor enhancement effect on partially darker and lighter images and is easy to amplify noise; laplace sharpening can only enhance the edges of an image and cannot enhance the brightness and contrast of the image; homomorphic filtering can enhance the brightness of an image but has an undesirable effect on the contrast enhancement of the image; the wavelet transform is also not ideal enough and computationally complex for contrast enhancement of images, and is difficult to use in real-time enhancement systems.
Therefore, there is a need for an image enhancement method that overcomes the limitations of the existing image enhancement methods, such as unsatisfactory image enhancement effects on partially dark and bright images, easy noise amplification, and complex computation.
Referring to fig. 1, fig. 1 is a flowchart of an image enhancement method according to an embodiment of the application.
As shown in fig. 1, the image enhancement method includes steps S101 to S106.
Step S101, acquiring a target image, and acquiring a pixel sum corresponding to each pixel point in the target image.
Illustratively, the information observed under the biological microscope and the image stored under the electronic microscope have deviation (for example, the background of the image is slightly red), so that in order to realize that the image stored under the electronic microscope is consistent with the information of the image observed under the biological microscope, the clinical use is convenient, the image stored under the electronic microscope is taken as a target image, and further the image enhancement processing is carried out.
Illustratively, image attributes corresponding to the target image, such as the image size, the pixel value, the pixel channel and the like of the target image, are obtained, so that the pixel value of each pixel point in the target image under the pixel channel is obtained according to the image attributes of the target image and summed, and the corresponding pixel sum is obtained.
For example, if the pixel channel of the target image is an RGB channel, the pixel value Pr of the target image 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) are obtained, so as to obtain the sum of the pixels of the target image under the pixel positions (x, y) as pr+pg+pb.
Optionally, the type of the pixel channel of the target image may be determined according to the actual image attribute of the target image, and the specific pixel channel is not specifically limited herein and may be set according to the requirement.
And step S102, determining a target pixel sum according to the size of the pixel sum, and determining a target threshold value of the target image.
Illustratively, pixel sums of the target image are arranged according to the size, so as to obtain pixel sums under a preset number, and an average value of the pixel sums under the preset number is calculated, so that the average value is used as the target pixel sums. And determining a target threshold value required by the target image according to a control variable method or performing self-adjustment according to requirements.
In one embodiment, the determining the target pixel sum according to the size of the pixel sum and determining the target threshold of the target image, specifically referring to fig. 2, step S102 includes: substep S1021 to substep S1022.
And step S1021, comparing the pixel sum corresponding to each pixel point in the target image, and further determining the maximum value corresponding to the pixel sum as the target pixel sum.
Illustratively, the pixel sums corresponding to each pixel point in the target image are compared, and then arranged in the order from large to small, and then the pixel sum corresponding to the maximum value is taken as the target pixel sum.
For example, if the size of the target image is 10×10, the pixel sums corresponding to each pixel position are calculated, and then the pixel sums corresponding to each pixel position are arranged according to the order from large to small, so as to obtain the target pixel sums.
And step S1022, determining a target proportion, and determining a target threshold corresponding to the target image according to the target proportion and the pixel.
The target proportion is determined, the number of pixels corresponding to the target image is determined according to the image size corresponding to the target image and the target proportion, the sorting result is obtained according to the pixel sums, the pixel sums corresponding to the number of pixels in the sorting result are obtained, and the pixel sums are used as the target threshold.
For example, the target proportion is 10%, the size of the target image is 10×10, the total number of pixels of the target image is 100, and then the total number of pixels 100 is multiplied by the target proportion of 10% to obtain the number of pixels 10, and when the sorting result is obtained according to the pixel sum, the pixel sum corresponding to the 10 th bit in the sorting result is used as the target threshold.
And step 103, screening 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.
Illustratively, when the sum of pixels of each pixel point in the target image is greater than the target threshold, the pixel and the corresponding pixel point are taken as one target in the target pixel point set.
For example, the target threshold is 200, the size of the target image is 3*3, the pixels are represented by x11, x12, x13, x21, x22, x23, x31, x32, x33, and if the sum of pixels corresponding to x11, x23, x32, x33 is greater than the target threshold 200, the set of target pixels includes x11, x23, x32, x33.
Step S104, determining parameter information of the target image in a corresponding image channel according to the target pixel point set, wherein the parameter information is used for representing the pixel value distribution condition of the target image in the image channel.
An image channel corresponding to the target image is obtained, and then a pixel value distribution condition of the pixels contained in the target pixel point set is analyzed in the corresponding image channel.
For example, the target pixel point set includes x11, x23, x32, x33, and the image channel corresponding to the target image is RGB, the pixel value distribution conditions of the pixel points x11, x23, x32, x33 under the R channel are calculated, and the pixel value distribution conditions of the pixel points x11, x23, x32, x33 under the G channel and the pixel value distribution conditions of the pixel points x11, x23, x32, x33 under the B channel are also calculated.
In some embodiments, the determining parameter information of the target image in the corresponding image channel according to the target pixel point set includes: determining the image channel corresponding to the target image; and acquiring a corresponding target pixel value of each pixel point in the target pixel point set in the image channel, and determining parameter information of the target image in the corresponding image channel according to the target pixel value.
The image channel corresponding to the target image is determined according to the image attribute of the target image, and then a target pixel value corresponding to each pixel point in the target pixel point set in the image channel is obtained, so that parameter information of the target image in the corresponding image channel is determined according to the target pixel value, wherein the parameter information is a mode or a median.
For example, the target pixel point set includes x11, x23, x32, and x33, the image channel corresponding to the target image is RGB, the pixel value distribution of the pixel points x11, x23, x32, and x33 under the R channel is calculated, the pixel values of the pixel points x11, x23, x32, and x33 under the R channel are 200, 205, 201, and 201, if the parameter information is mode, the parameter information corresponding to the R channel is 201, if the parameter information is median, the parameter information corresponding to the R channel is also 201, the calculation mode is (201+201)/2, 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 calculated according to the same mode.
In some embodiments, the parameter information is mean value information, and the determining parameter information of the target image in the corresponding image channel according to the target pixel value includes: calculating the sum of corresponding pixels of the target pixel value in the image channel, and determining accumulated sum information of the target image in the corresponding image channel; and determining average value information of the target image in the image channel according to the accumulated sum information.
The method includes the steps of taking average value information as pixel value distribution conditions of a target image in an image channel, further summing pixel values of the target pixel value under the image channel after the image channel corresponding to the target image is determined to obtain accumulation sum information of the target image under the image channel, dividing the accumulation sum information by the number of target pixel point sets according to the accumulation sum information, and further obtaining average value information corresponding to the target image in the image channel.
For example, the target pixel point set includes x11, x23, x32, and x33, and if the image channel corresponding to the target image is RGB, the pixel value distribution condition of the pixel points x11, x23, x32, and x33 under the R channel is calculated, and the pixel values of the pixel points x11, x23, x32, and x33 under the R channel are respectively 200, 205, 201, and if the cumulative sum information under the R channel is 200+205+201+201=807, the mean information under the R channel is 807/4. And similarly, calculating the mean value information of the pixel points x11, x23, x32 and x33 under the G channel and the mean value information of the pixel points x11, x23, x32 and x33 under the B channel respectively.
Step S105, determining a gain coefficient corresponding to the target image in the image channel according to the parameter information and the target pixel.
Illustratively, the corresponding gain coefficients of the target image in the image channel are determined based on the parameter information and the target pixel sums under the image channel.
In an embodiment, the determining, according to the parameter information and the target pixel, a gain coefficient corresponding to the target image in the image channel, specifically referring to fig. 3, step S105 includes: substep S1051 to substep S1052.
Substep S1051, determining a target channel pixel value corresponding to the target image in the image channel based on the target pixel and the target channel pixel value.
Illustratively, a target pixel and a corresponding pixel point in the target image are obtained, and further a target channel pixel value corresponding to the pixel point in the image channel is obtained.
For example, if the image channel is an R channel, the sum of the target pixels is 200, and the target pixel and the corresponding pixel point in the target image are x23, the corresponding target channel pixel value under the R channel is queried when the target image is at the x23 position. Similarly, when the image channel is a B channel or the image channel is a G channel, the corresponding target channel pixel values are obtained respectively.
In the substep S1052, the pixel value of the target channel and the parameter information are divided to obtain a gain coefficient corresponding to the target image in the image channel.
Illustratively, the corresponding target channel pixel value under the image channel is divided by the parameter information under the image channel to obtain the gain coefficient of the target image under the image channel.
For example, if the image channel of the target image is an RGB channel and the parameter information is mean value information, when the pixel value of the target channel under the R channel is maxval_r, the mean value information isThereby obtaining the gain coefficient of R channel as +.>Similarly, when the pixel value of the target channel under the G channel is MaxVal_G, the mean value information is +.>Thereby obtaining the gain coefficient of G channel as +.>When the pixel value of the target channel under the B channel is MaxVal_B, the average value information is +.>Thereby obtaining gain coefficient under B channel as
And 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.
The image enhancement processing is performed on the pixel values of each pixel point in the target image by using the gain coefficient, so as to obtain a target enhanced image corresponding to the target image.
In some embodiments, 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 with a 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 carrying out pixel fusion according to the enhancement processing result to obtain a target enhancement image corresponding to the target image.
Illustratively, 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, so as to determine the target enhanced image corresponding to the target image.
For example, the target image is an RGB image, and the gain factor under the R channel isGain factor under G channel is +.>The gain factor under the B channel is +.>The corresponding pixel values of the target image at the pixel points Pxy are respectively (pix_r, pix_g, pix_b), so that the result of the image enhancement processing at the pixel points Pxy is (gain_r, gain_g, gain_b, pix_b), and then the image enhancement processing result under the RGB image channel is fused to obtain the target enhanced image after the image enhancement.
In some embodiments, the pixel fusion is performed according to the enhancement processing result to obtain a target enhancement image corresponding to the target image, which includes comparing the enhancement processing result with a target pixel range to determine a target enhancement processing result; and carrying out pixel fusion according to the target enhancement processing result to obtain a target enhancement image corresponding to the target image.
For example, when the enhancement processing results are obtained after processing the respective image channels of the target image according to the gain coefficients, the enhancement processing results should be ensured to be within the pixel range [0,255] at the same time, when the enhancement processing results are smaller than 0, they are forcedly set to 0, when the enhancement processing results are larger than 255, they are forcedly set to 255, and when the enhancement processing results are within [0,255], the gain processing results are retained, so as to obtain the target enhancement processing results, and thus, pixel fusion is performed according to the target enhancement processing results, and the target enhancement image corresponding to the target image is obtained.
In some embodiments, after the pixel fusion is performed according to the target enhancement processing result to obtain a target enhanced image corresponding to the target image, the method further includes: determining a corresponding target number when the enhancement processing result exceeds the target pixel range; and when the target number is greater than a preset number, canceling image enhancement processing on the target image, and reserving the target image.
In an exemplary embodiment, when the enhancement result exceeds the target pixel range, the count variable is incremented, and when the total enhancement result is compared, the count variable is determined as the target number, and when the target number is greater than the preset number, it is determined that the difference between the target enhanced image and the target image after the image enhancement is too large, the target enhanced image distortion is determined, and then the image enhancement processing performed on the target image is canceled, and the target image is retained.
For example, the target pixel range is [0,255], and when the enhancement processing result is smaller than 0 or larger than 255, the count variable is incremented by one, so as to obtain the target number.
For example, when the preset number is set to 100, when the target number is greater than 100, the target enhanced image is considered to be distorted, and then the image enhancement processing on the target image is canceled, and the target image is reserved; or, the preset number is set to be a number corresponding to a target percentage of the number of pixels of the target image, for example, the target percentage is 30%, when the size of the target image is 100×100, the number of pixels of the target image is 10000, and the preset number is 10000×30% =3000.
The target pixel range is a difference range between a pixel value before multiplication of the gain coefficient and a pixel value after multiplication of the gain coefficient, and when a difference between an image enhancement result and a pixel value under an original image channel exceeds the difference range, image distortion is determined, image enhancement processing on a target image is canceled, and the target image is reserved.
The target pixel range is a ratio range of a pixel value before multiplication of the gain coefficient to a pixel value after multiplication of the gain coefficient, and when the ratio of the image enhancement result to the pixel value under the original image channel exceeds the ratio range, the image distortion is determined, so that the image enhancement processing on the target image is canceled, and the target image is reserved.
Referring to fig. 4, fig. 4 is a schematic view of a scene for implementing the image enhancement method provided in this embodiment, as shown in fig. 4, a saved wet-film image is obtained as a target image according to an electron microscope, and then each pixel point in the target image is traversed and a pixel sum of each pixel point under all image channels is calculated, and the target pixel sum is obtained according to the size of the pixel sum; obtaining a corresponding target threshold value under a target proportion according to the size of the pixel sum; and traversing each pixel point in the target image again to screen and obtain pixels and pixel points larger than a target threshold value as a target pixel point set, further calculating corresponding mean value information of the pixel points in the target pixel point set in each image channel, according to target pixels and the corresponding target pixel points, dividing the pixel values of the target pixel points under each image channel and the corresponding mean value information in the image channel to obtain gain coefficients corresponding to the image channels, multiplying the pixel values of the image channels corresponding to each pixel point in the target image by the gain coefficients corresponding to the image channels to obtain an image enhancement processing result, comparing the image enhancement processing result with target pixel ranges [0,255], adding one counting variable when the image enhancement processing result exceeds the target pixel ranges [0,255], canceling the target enhancement image obtained by the image enhancement processing result when the counting variable exceeds a preset number, reserving the target image, and obtaining the target enhancement image corresponding to the target image when the preset number is not exceeded, wherein the target image enhancement processing effect is as shown in fig. 5. The method solves the problems that the image enhancement effect of partial darkness and brightness is not ideal, noise is easy to amplify, calculation is complex and the like when the image stored under the electron microscope is enhanced, improves the image enhancement effect of the image stored under the electron microscope, enhances the partial darkness and brightness, highlights the detailed information in the image, reduces the effect under the biological microscope more, has simple calculation, can be used for real-time image enhancement, and is more beneficial to clinical use. And the image enhancement processing can be carried out on the wet sheet image under the electron microscope in a self-adaptive manner, so that the method has an obvious enhancement effect.
Referring to fig. 6, fig. 6 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
As shown in fig. 6, the terminal device 300 includes a processor 301 and a memory 302, the processor 301 and the memory 302 being connected by a bus 303, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 301 is used to provide computing and control capabilities, supporting the operation of the entire terminal device. The processor 301 may be a central processing unit (Central Processing Unit, CPU), the processor 301 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 302 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of a portion of the structure related to the embodiment of the present application, and does not constitute a limitation of the terminal device to which the embodiment of the present application is applied, and that a specific server may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The processor is configured to run a computer program stored in the memory, and implement any one of the image enhancement methods provided by the embodiments of the present application when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in a memory and to implement the following steps when executing the computer program:
acquiring a target image, and acquiring 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 of the target image;
screening pixels 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 a corresponding image channel according to the target pixel point set, wherein the parameter information is used for representing pixel value distribution conditions of the target image in the image channel;
determining a corresponding gain coefficient of the target image in the image channel according to the parameter information and the target pixel;
and carrying out image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
In some embodiments, the processor 301 performs, in the determining the target pixel sum according to the size of the pixel sum and determining the target threshold of the target image:
comparing the pixel sum corresponding to each pixel point in the target image, and further determining the maximum value corresponding to the pixel sum as the target pixel sum;
and determining a target proportion, and determining a target threshold corresponding to the target image according to the target proportion, the pixels and the target image.
In some embodiments, the processor 301 performs, in the determining, according to the set of target pixels, parameter information of the target image in a corresponding image channel:
determining the image channel corresponding to the target image;
and acquiring a corresponding target pixel value of each pixel point in the target pixel point set in the image channel, and determining parameter information of the target image in the corresponding image channel according to the target pixel value.
In some embodiments, the parameter information is mean value information, and the processor 301 performs, in the determining, according to the target pixel value, parameter information of the target image in a corresponding image channel:
calculating the sum of corresponding pixels of the target pixel value in the image channel, and determining accumulated sum information of the target image in the corresponding image channel;
and determining average value information of the target image in the image channel according to the accumulated sum information.
In some embodiments, the processor 301 performs, in the determining of the corresponding gain coefficient of the target image in the image channel according to the parameter information and the target pixel:
determining a corresponding target channel pixel value of the target image in the image channel according to the target pixel;
and dividing the pixel value of the target channel and the parameter information to obtain a gain coefficient corresponding to the target image in the image channel.
In some embodiments, the processor 301 performs, in 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 following steps:
multiplying the gain coefficient with a 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 carrying out pixel fusion according to the enhancement processing result to obtain a target enhancement image corresponding to the target image.
In some embodiments, the processor 301 performs, in the process of performing pixel fusion according to the enhancement processing result to obtain a target enhanced image corresponding to the target image, the following steps:
comparing the enhancement processing result with a target pixel range to determine a target enhancement processing result;
and carrying out pixel fusion according to the target enhancement processing result to obtain a target enhancement image corresponding to the target image.
In some embodiments, the processor 301 further performs, in the process after the pixel fusion according to the target enhancement processing result and obtaining the target enhanced image corresponding to the target image, the following steps:
determining a corresponding target number when the enhancement processing result exceeds the target pixel range;
and when the target number is greater than a preset number, canceling image enhancement processing on the target image, and reserving the target image.
It should be noted that, for convenience and brevity of description, specific working processes of the terminal device described above may refer to corresponding processes in the foregoing image enhancement method embodiments, and are not described herein again.
Embodiments of the present application also provide a storage medium for computer-readable storage, where one or more programs are stored, where the one or more programs are executable by one or more processors to implement steps of any of the image enhancement methods as provided in the embodiments of the present application.
The storage medium may be an internal storage unit of the terminal device according to the foregoing embodiment, for example, a hard disk or a 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 (Flash Card) or the like, which are provided on the terminal device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable 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, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is 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 which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically 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 includes any information delivery media.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions may be made therein without departing from the spirit and scope of the application as defined by the appended claims. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method of image enhancement, the method comprising:
acquiring a target image, and acquiring 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 of the target image;
screening pixels 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 a corresponding image channel according to the target pixel point set, wherein the parameter information is used for representing pixel value distribution conditions of the target image in the image channel;
determining a corresponding gain coefficient of the target image in the image channel according to the parameter information and the target pixel;
and carrying out image enhancement processing on the target image according to the gain coefficient to obtain a target enhanced image corresponding to the target image.
2. The method of claim 1, wherein the determining a target pixel sum from the pixel sum size and determining a target threshold for the target image comprises:
comparing the pixel sum corresponding to each pixel point in the target image, and further determining the maximum value corresponding to the pixel sum as the target pixel sum;
and determining a target proportion, and determining a target threshold corresponding to the target image according to the target proportion, the pixels and the target image.
3. The method of claim 1, wherein determining parameter information of the target image in the corresponding image channel from the set of target pixels comprises:
determining the image channel corresponding to the target image;
and acquiring a corresponding target pixel value of each pixel point in the target pixel point set in the image channel, and determining parameter information of the target image in the corresponding image channel according to the target pixel value.
4. A method according to claim 3, wherein the parameter information is mean information, and the determining parameter information of the target image in the corresponding image channel according to the target pixel value includes:
calculating the sum of corresponding pixels of the target pixel value in the image channel, and determining accumulated sum information of the target image in the corresponding image channel;
and determining average value information of the target image in the image channel according to the accumulated sum information.
5. The method of claim 1, wherein said determining a corresponding gain factor for the target image in the image channel based on the parameter information and the target pixel comprises:
determining a corresponding target channel pixel value of the target image in the image channel according to the target pixel;
and dividing the pixel value of the target channel and the parameter information to obtain a gain coefficient corresponding to the target image in the image channel.
6. 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 with a 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 carrying out pixel fusion according to the enhancement processing result to obtain a target enhancement image corresponding to the target image.
7. The method according to claim 6, wherein the obtaining the target enhanced image corresponding to the target image by performing pixel fusion according to the enhancement processing result includes:
comparing the enhancement processing result with a target pixel range to determine a target enhancement processing result;
and carrying out pixel fusion according to the target enhancement processing result to obtain a target enhancement image corresponding to the target image.
8. The method according to claim 7, wherein 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 comprises:
determining a corresponding target number when the enhancement processing result exceeds the target pixel range;
and when the target number is greater than a preset number, canceling image enhancement processing on the target image, and reserving the target image.
9. A terminal device, characterized in that the terminal device comprises a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and to implement the image enhancement method according to any of claims 1 to 8 when the computer program is executed.
10. A computer-readable storage medium, which when executed by one or more processors causes the one or more processors to perform the steps of the image enhancement method of any of claims 1 to 8.
CN202311018858.6A 2023-08-11 2023-08-11 Image enhancement method, terminal device and storage medium Pending CN117218015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311018858.6A CN117218015A (en) 2023-08-11 2023-08-11 Image enhancement method, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311018858.6A CN117218015A (en) 2023-08-11 2023-08-11 Image enhancement method, terminal device and storage medium

Publications (1)

Publication Number Publication Date
CN117218015A true CN117218015A (en) 2023-12-12

Family

ID=89047058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311018858.6A Pending CN117218015A (en) 2023-08-11 2023-08-11 Image enhancement method, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN117218015A (en)

Similar Documents

Publication Publication Date Title
US11127122B2 (en) Image enhancement method and system
Lin et al. Intensity and edge based adaptive unsharp masking filter for color image enhancement
US10672112B2 (en) Method and system for real-time noise removal and image enhancement of high-dynamic range images
US9076218B2 (en) Method and image processing device for image dynamic range compression with local contrast enhancement
US9842382B2 (en) Method and device for removing haze in single image
Sun et al. Fast single image haze removal via local atmospheric light veil estimation
WO2011011445A1 (en) System and method for random noise estimation in a sequence of images
CN109214996B (en) Image processing method and device
Park et al. Contrast enhancement for low-light image enhancement: A survey
US8594446B2 (en) Method for enhancing a digitized document
CN109255752B (en) Image self-adaptive compression method, device, terminal and storage medium
Deng A generalized logarithmic image processing model based on the gigavision sensor model
US8565549B2 (en) Image contrast enhancement
Wu et al. A novel scheme for infrared image enhancement by using weighted least squares filter and fuzzy plateau histogram equalization
Hassan et al. A cascaded approach for image defogging based on physical and enhancement models
Jindal et al. Bio-medical image enhancement based on spatial domain technique
CN117218015A (en) Image enhancement method, terminal device and storage medium
Bonnier et al. Locally adaptive multiscale contrast optimization
WO2022016326A1 (en) Image processing method, electronic device, and computer-readable medium
Krylov et al. Adaptive image deblurring with ringing control
Reddy et al. Guided image filtering for image enhancement
Wu et al. Contrast enhancement based on discriminative co-occurrence statistics
Mu et al. Color image enhancement method based on weighted image guided filtering
Yin et al. Enhancement of Low-Light Image using Homomorphic Filtering, Unsharp Masking, and Gamma Correction
Loza et al. Joint denoising and contrast enhancement for light microscopy image sequences

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination