CN116342504A - Image processing method and device, electronic equipment and readable storage medium - Google Patents

Image processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116342504A
CN116342504A CN202310215879.0A CN202310215879A CN116342504A CN 116342504 A CN116342504 A CN 116342504A CN 202310215879 A CN202310215879 A CN 202310215879A CN 116342504 A CN116342504 A CN 116342504A
Authority
CN
China
Prior art keywords
image
target
processed
processing
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
CN202310215879.0A
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.)
Beijing Tiantan Hospital
Original Assignee
Beijing Tiantan Hospital
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 Beijing Tiantan Hospital filed Critical Beijing Tiantan Hospital
Priority to CN202310215879.0A priority Critical patent/CN116342504A/en
Publication of CN116342504A publication Critical patent/CN116342504A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10068Endoscopic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10132Ultrasound image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, and discloses an image processing method, an image processing device, electronic equipment and a readable storage medium. Wherein the method comprises the following steps: acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels; determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels; determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the target pixel value in the target pixel matrix; performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image; and carrying out weighting processing on the enhanced image and the image to be processed to generate a target image. By implementing the invention, the smoke feeling of the image can be reduced to improve the uniformity of the image, the contrast of the image can be improved, the uniformity of the image and the contrast of the image are both considered, and the image enhancement effect is ensured.

Description

Image processing method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method, an image processing device, an electronic device, and a readable storage medium.
Background
The medical endoscope enters the human body through a natural duct of the human body or through a small incision made by operation so as to guide the endoscope into a pre-checked organ and directly peep the change of the related part. Therefore, the image quality of the endoscope viewing window is critical.
In the related art, image enhancement processing is generally performed based on methods such as image defogging of dark channel prior, contrast-limited histogram equalization and the like, so as to improve the quality of an endoscopic image. Although the image processing method in the related art can achieve the image enhancement effect, it is difficult to simultaneously consider both the image uniformity and the image contrast.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide an image processing method, an image processing apparatus, an electronic device, and a readable storage medium, so as to solve the problem that image uniformity and image contrast are difficult to be simultaneously compatible.
According to a first aspect, an embodiment of the present invention provides an image processing method, including: acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels; determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels; determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and target pixel values in the target pixel matrix; performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image; and carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
According to the image processing method provided by the embodiment of the invention, the target pixel matrix of the image to be processed is extracted to determine the target transmission coefficient according to the maximum target pixel value, and then the image processing is carried out on the image to be processed according to the target transmission coefficient, so that the smoke feeling of the image can be reduced to improve the uniformity of the image, and meanwhile, the contrast of the image can be improved, so that the uniformity of the image and the contrast of the image are both considered, and the enhancement effect of the image is ensured.
With reference to the first aspect, in a first implementation manner of the first aspect, the determining, based on the target pixel matrix and target pixel values in the target pixel matrix, a target transmission coefficient corresponding to the image to be processed includes: determining a weight matrix based on a ratio of the target pixel matrix to the target pixel value; determining an initial transmission coefficient based on a product of a preset parameter and the weight matrix; and carrying out constraint processing on the initial transmission coefficient according to a preset constraint condition to obtain a target transmission coefficient.
According to the image processing method provided by the embodiment of the invention, the initial transmission coefficient is determined through the target pixel value and the target pixel matrix, and the constraint condition is set for the initial transmission coefficient, so that the finally determined target transmission coefficient is matched with the image to be processed, and defogging processing can be performed in a targeted manner, thereby being beneficial to improving the image processing speed, facilitating the realization of real-time image defogging processing, and improving the uniformity of the image.
With reference to the first aspect, in a second implementation manner of the first aspect, the performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image includes: in response to a setting operation on the atmospheric light vector, determining a target atmospheric light vector corresponding to each color channel based on the setting operation; defogging the image to be processed based on the target atmospheric light vector and the target transmission coefficient to generate a defogged image; and carrying out balanced enhancement processing on the defogging image to generate an enhanced image.
With reference to the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the defogging processing is performed on the image to be processed based on the target atmospheric light vector and the target transmission coefficient, and a defogging image is generated, including:
Figure BDA0004114896270000021
wherein f (x) is a defogging image; f is an image to be processed formed by a plurality of color channels; a is a target atmospheric light vector; t is a target transmission coefficient; k is a proportionality coefficient, 0< k <1; abs represents the absolute value.
With reference to the second implementation manner of the first aspect, in a fourth implementation manner of the first aspect, performing an equalization enhancement process on the defogging image to generate an enhanced image, including: and carrying out enhancement processing on the contrast of the defogging image based on a local histogram equalization method to obtain an enhanced image.
According to the image processing method provided by the embodiment of the invention, the atmospheric light vector matched with the image to be processed is set, so that the defogging effect of the image is ensured to be higher, and the uniformity of the image is improved to the greatest extent. Meanwhile, the defogging image is subjected to balanced enhancement treatment, so that the contrast of the image is improved on the basis of guaranteeing the uniformity of the image, the details of the image are enhanced conveniently, and the details of the image are clearer.
With reference to the first aspect, in a fifth implementation manner of the first aspect, the weighting processing is performed on the enhanced image and the image to be processed to generate a target image, including: setting N weight coefficients; performing an image transform process on the enhanced image i times based on δ (Ni); overlapping the images subjected to the i-time image transformation processing to obtain the target image; wherein the sum of the i-degree weight coefficients is 1, and delta (Ni) represents the i weight coefficients.
According to the image processing method provided by the embodiment of the invention, the generation accuracy of the target image is ensured by determining that the image is subjected to multiple image transformations for the enhanced image and overlapping the multiple images obtained by the multiple image transformations.
With reference to the first aspect, in a sixth implementation manner of the first aspect, the determining, based on pixel values corresponding to the plurality of color channels, a target pixel matrix corresponding to the image to be processed includes: normalizing the pixel value of the image to be processed to obtain normalized pixel value data; determining a pixel value matrix corresponding to each color channel based on the normalized pixel value data; and comparing the pixel values in each pixel value matrix to determine the target pixel matrix.
With reference to the sixth implementation manner of the first aspect, in a seventh implementation manner of the first aspect, the method further includes: and carrying out de-normalization processing on the pixel value of the target image, and determining the actual pixel value of the target image.
According to the image processing method provided by the embodiment of the invention, the influence of the singular pixel value is eliminated by carrying out normalization processing on the pixels of the image to be processed, so that the subsequent image processing is facilitated. Through carrying out the de-normalization processing to the pixel value of the target image, the actual pixel value of the image is conveniently determined, so that more accurate image information is obtained.
According to a second aspect, an embodiment of the present invention provides an image processing apparatus including: the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an image to be processed, and the image to be processed comprises a plurality of color channels; the first determining module is used for determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels; the second determining module is used for determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and target pixel values in the target pixel matrix; the processing module is used for carrying out smoke removal processing and enhancement processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image; and the weighting module is used for carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
According to a third aspect, an embodiment of the present invention provides an electronic device, including: the image processing device comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so that the image processing method according to the first aspect or any implementation mode of the first aspect is executed.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the image processing method according to the first aspect or any implementation manner of the first aspect.
It should be noted that, the description of the corresponding contents in the image interpolation processing method is omitted herein for brevity, and the corresponding beneficial effects of the image interpolation processing apparatus, the electronic device and the computer readable storage medium provided in the embodiments of the present invention are described herein.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention;
fig. 2 is another flowchart of an image processing method according to an embodiment of the present invention;
FIG. 3 is a further flowchart of an image processing method according to an embodiment of the present invention;
FIG. 4 shows a schematic representation of an image of the abdominal cavity prior to processing;
FIG. 5 shows a schematic representation of a processed abdominal cavity image;
fig. 6 is a block diagram of the structure of an image processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The medical endoscope enters the human body through a natural duct of the human body or through a small incision made by operation so as to guide the endoscope into a pre-checked organ and directly peep the change of the related part. Therefore, the image quality of the endoscope viewing window is critical.
In the related art, image enhancement processing is generally performed based on methods such as image defogging of dark channel prior, contrast-limited histogram equalization and the like, so as to improve the quality of an endoscopic image. For example, limiting the contrast histogram equalization method can improve the image contrast, but it cannot remove smoke of the endoscopic image well, reducing the uniformity of the image; although the image defogging method based on dark channel priori can better remove the smog of the endoscope image, the image contrast is poor and the real-time processing of the image is not facilitated.
Based on this, this application technical scheme can carry out defogging processing and enhancement processing simultaneously to the image, not only can reduce the smog sense of image in order to promote the image homogeneity, can also promote the contrast of image.
According to an embodiment of the present invention, there is provided an embodiment of an image processing method, it being noted that the steps shown in the flowcharts of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.
In this embodiment, an image processing method is provided, which may be used in an electronic device, such as an endoscope, a computer, a medical device host, etc., fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
s11, acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels.
The image to be processed is a color image acquired by an electronic device, such as an image of the abdominal cavity acquired by an endoscope. Specifically, the image to be processed generally includes a plurality of color channels, and the bit width of the color channels may be 8 bits, or may be other bits, which is not limited herein.
In particular, the color in the image to be processed may be the variation of the three color channels red, green and blue and the superposition of them with each other, i.e. the image to be processed comprises the three color channels red, green and blue.
S12, determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the color channels.
Each pixel point position of the image to be processed has a pixel value corresponding to each color channel, and a pixel value matrix aiming at each color channel of the image to be processed can be constructed according to the pixel value corresponding to each color channel. And comparing the pixel values of the color channels corresponding to the pixel point positions according to the pixel value matrix of each color channel, and selecting the minimum pixel value from the pixel value matrix. And traversing the minimum pixel value of each pixel point in sequence to generate a target pixel matrix. Taking three color channels of red, green and blue as an example, the minimum pixel matrix is to screen out the minimum pixel value corresponding to each pixel point from the pixel value matrixes of the three color channels, and generate a target pixel matrix according to the minimum pixel value and the pixel point coordinates.
S13, determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the maximum target pixel value in the target pixel matrix.
The target transmission coefficient is used to characterize the defogging coefficient for the image to be processed, and the maximum target pixel value is a pixel maximum selected from the target pixel matrix, which is not limited to the color channel. The electronic device may perform data processing in combination with the maximum target pixel value and each pixel value in the target pixel matrix to obtain a target transmission coefficient that matches the target pixel matrix of the current image to be processed.
S14, performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image.
And carrying out image processing on the image to be processed by combining the target transmission coefficient and the atmospheric light vector so as to extract the true color value of the image to be processed, improve the contrast of the image and generate a corresponding enhanced image.
Specifically, defogging treatment is carried out on the image to be treated, and the true color value of the image to be treated is extracted to obtain a defogged image. Then, image histogram equalization is employed for the defogging image, and local enhancement processing is performed on the defogging image to increase the contrast of the image, thereby generating an enhanced image subjected to the defogging processing and the enhancement processing.
And S15, carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
The electronic equipment sets corresponding weighting coefficients for the enhanced image and the image to be processed according to a preset rule, and products of the enhanced image and the image to be processed and the weighting coefficients thereof are calculated respectively to obtain a product result of the enhanced image and a result of the image to be processed. And then, overlapping the two images to obtain the target image. The preset rule is a preset distribution rule of the weighting coefficient, and the specific weighting coefficient is not limited herein, and can be determined by a person skilled in the art according to actual requirements.
According to the image processing method, the target pixel matrix of the image to be processed is extracted to determine the target transmission coefficient according to the maximum target pixel value, and then corresponding image processing is carried out on the image to be processed according to the target transmission coefficient, so that the smoke feeling of the image is reduced, the uniformity of the image is improved, the contrast of the image is improved, the uniformity of the image and the contrast of the image can be considered, and the enhancement effect of the image is guaranteed.
In this embodiment, an image processing method is provided, which may be used in an electronic device, such as an endoscope, a computer, a medical device host, etc., and fig. 2 is a flowchart of the image processing method according to an embodiment of the present invention, and as shown in fig. 2, the flowchart includes the following steps:
s21, acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S22, determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the color channels. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S23, determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the maximum target pixel value in the target pixel matrix.
Specifically, the step S23 may include:
s231, determining a weight matrix based on the ratio of the target pixel matrix to the maximum target pixel value in the target pixel matrix.
The ratio of the target pixel matrix to the maximum target pixel value in the target pixel matrix is obtained by dividing each pixel value in the target pixel matrix by the maximum target pixel value in the target pixel matrix. Specifically, the weight matrix is determined in the following manner: Y/Max_Y. Wherein Y is a target pixel matrix, and the maximum target pixel value in the target pixel matrix is Max_Y.
S232, determining an initial transmission coefficient based on the product of the preset parameter and the weight matrix.
The preset parameters are preset coefficients aiming at the weight matrix, w represents the preset parameters, and the range of the preset parameters can be: 0< w <1. Specific values of the preset parameters are not limited herein, and can be determined by those skilled in the art according to actual needs.
Multiplying the preset parameters with each weight value in the weight matrix, and then performing difference processing on the product result by a constant 1 to obtain an initial transmission coefficient, wherein the method comprises the following steps of:
t1=1-w*(Y/Max_Y)
wherein t1 is an initial transmission coefficient, w is a preset parameter, Y is a target pixel matrix, and the maximum target pixel value in the target pixel matrix is max_y.
S233, constraint processing is carried out on the initial transmission coefficient according to a preset constraint condition, and a target transmission coefficient is obtained.
The preset constraint condition is used for constraining the initial transmission coefficient to a certain range and determining the transmission coefficient within the constraint range as a target transmission coefficient. The method comprises the following steps:
t=max(min(t1,0.9),0.1)
wherein t1 is an initial transmission coefficient, t is a target transmission coefficient, and max () and min () are preset constraint conditions.
S24, performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image.
Specifically, the step S24 may include:
s241, in response to the setting operation of the atmospheric light vector, the target atmospheric light vector corresponding to each color channel is determined based on the setting operation.
The target atmospheric light vector is used to reduce the smoke perception in the image to be processed. The technician can set a corresponding atmospheric light vector for the image to be processed, and accordingly, the electronic device can respond to the setting operation of the technician for the atmospheric light vector, and generate target atmospheric light vectors of the various color channels of the image to be processed according to the setting operation. Taking the example of three color channels of red, green and blue, the target atmospheric light vector may be set as:
A=[a;a;a],(0.8<a<1)
wherein a is a matrix of the atmospheric light vector for each color channel, the atmospheric light vector for each color channel being the same.
And S242, defogging processing is carried out on the image to be processed based on the target atmospheric light vector and the target transmission coefficient, and a defogging image is generated.
And performing difference processing on the image color channel matrix corresponding to the image to be processed and the atmospheric light vector, and calculating a defogging image corresponding to the image to be processed by combining the target transmission coefficient. Specifically, the determination expression of the defogging image is as follows:
Figure BDA0004114896270000081
wherein f (x) is a defogging image; f is an image to be processed formed by a plurality of color channels; a is a matrix formed by target atmospheric light vector; t is a target transmission coefficient; k is a proportionality coefficient, 0< k <1; abs represents the absolute value.
S243, performing equalization enhancement processing on the defogging image to generate an enhanced image.
In order to further enhance the contrast of the image so as to make the details of the image clearer, after the defogging image is obtained, a histogram equalization method, an adaptive histogram equalization method, a contrast limited adaptive histogram equalization method or a contrast limited global histogram equalization method can be further adopted to perform equalization enhancement processing on the defogging image, so that an enhanced image after the contrast of the image is enhanced is obtained.
In an alternative embodiment, the contrast of the defogging image is enhanced based on a local histogram equalization method, so as to obtain an enhanced image.
The local histogram equalization method is self-adaptive histogram equalization, local contrast of the defogging image is enhanced by adjusting local of the defogging image based on the principle of self-adaptive histogram equalization, and especially when the defogging image has a condition of close contrast, the detail in the defogging image is clearer by enhancing the contrast through self-adaptive histogram equalization, so that the purpose of enhancing the image is achieved.
S25, weighting the enhanced image and the image to be processed to generate a target image. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
According to the image processing method, the initial transmission coefficient is determined through the maximum target pixel value in the target pixel matrix and the target pixel matrix, and the constraint condition is set for the initial transmission coefficient, so that the finally determined target transmission coefficient is matched with the image to be processed, defogging processing can be performed in a targeted manner, the image processing speed is improved, real-time image defogging processing is facilitated, and uniformity of the image is improved. Through setting up the atmospheric light vector that matches in the image of waiting to handle, guarantee that the defogging effect of image is higher, promoted the image homogeneity to the maximum extent. Meanwhile, the defogging image is subjected to balanced enhancement treatment, so that the contrast of the image is improved on the basis of guaranteeing the uniformity of the image, the details of the image are enhanced conveniently, and the details of the image are clearer.
In this embodiment, an image processing method is provided, which may be used in an electronic device, such as an endoscope, a computer, a medical device host, etc., and fig. 3 is a flowchart of the image processing method according to an embodiment of the present invention, and as shown in fig. 3, the flowchart includes the following steps:
s31, acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S32, determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the color channels.
Specifically, the step S32 may include:
s321, carrying out normalization processing on the pixel value of the image to be processed to obtain normalized pixel value data.
And collecting pixel values corresponding to the coordinates of each pixel point of the image to be processed, and carrying out normalization processing on the pixel values corresponding to each pixel point, namely normalizing the pixel values of the image to be processed to be between 0 and 1, so as to obtain normalized pixel value data. The subsequent data processing is facilitated through pixel value normalization, so that the data calculation amount is reduced, and the data processing speed is improved.
S322, determining a pixel value matrix corresponding to each color channel based on the normalized pixel value data.
The image to be processed is a color image formed by a plurality of color channels, and after normalization processing of pixel values is completed, normalized pixel value data is divided according to each color channel to obtain a pixel value matrix corresponding to each color channel.
S323, comparing the pixel values in each pixel value matrix to determine a target pixel matrix.
The target pixel matrix is a matrix formed by minimum pixel values of all color channels of the image to be processed. And sequentially comparing pixel values of the pixel value matrixes corresponding to the color channels to determine the minimum pixel value corresponding to each pixel point position, so as to generate a target pixel matrix according to the minimum pixel value corresponding to each pixel point position. Taking three color channels of red, green and blue as an example, the determination mode of the target pixel matrix is as follows:
Y(x,y)=min(R(x,y),G(x,y),B(x,y))
the min () represents the minimum pixel value, R, G, B is the pixel value matrix corresponding to the three color channels of red, green and blue, and (x, y) is the pixel coordinate in the pixel value matrix, R (x, y), G (x, y), and B (x, y) is the pixel value corresponding to the three color channels of red, green and blue at the pixel coordinate (x, y).
S33, determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the maximum target pixel value in the target pixel matrix. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S34, smoke removal treatment and enhancement treatment are carried out on the image to be treated based on the transmission coefficient, and an enhanced image is obtained. The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
And S35, carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
Specifically, the step S35 may include:
s351, N weight coefficients are set, and i image conversion processes are performed on the enhanced image based on δ (Ni).
Wherein, delta (Ni) represents a transformation mode, and the sum of i times weight coefficients is 1.
The weight coefficient is used for representing the weight of the image to be processed and the enhanced image in the target image. Here, the image to be processed and the enhanced image may be subjected to multiple image transformations by setting a plurality of weight coefficients, by different weight coefficients.
Specifically, δ (Ni) may be multiplied by a weighting coefficient for each pixel value in the image matrix to obtain a transformed image.
And S352, overlapping the images subjected to the i times of image transformation processing to obtain a target image.
And superposing all pixel values of a pixel matrix corresponding to the image subjected to the image transformation processing for each time according to the pixel coordinates to obtain a pixel matrix of the target image, and determining the corresponding target image according to the pixel matrix.
In this embodiment, the above steps are described below by taking n=2 and i=2 as an example:
and multiplying each pixel value in the image matrix to be processed by a weight coefficient N1 based on delta (N1), and generating an image 1 after the first image transformation processing. Specifically, if N1 is a and the pixel matrix of the image to be processed is F, then the image 1 is a×f.
The respective pixel values in the enhanced image matrix are multiplied by the weighting coefficient N2 based on δ (N2), and the image 2 after the first image conversion processing is generated. Specifically, if N2 is b and the pixel matrix of the enhanced image is F1, then the image 2 is b×f1. Wherein a+b=1.
And superposing the pixel values of the pixel matrixes corresponding to the image 1 and the image 2 according to the pixel coordinates to obtain a pixel matrix of the target image, and determining the corresponding target image according to the pixel matrix. Specifically, the pixel matrix F2 of the target image is expressed as: f2 =a×f+b×f1.
S36, performing de-normalization processing on the pixel value of the target image, and determining the actual pixel value of the target image.
In the above process, in order to facilitate data processing, normalization processing is performed on the pixel values, so when image processing is completed to obtain a pixel matrix of the target image, the normalization processing needs to be performed on each pixel value in the pixel matrix of the target image, and each pixel value is restored to an actual pixel value, so as to ensure the authenticity of the target image.
According to the image processing method, the first weighted image and the second weighted image aiming at the image to be processed are determined, and then the first weighted image and the second weighted image are weighted to generate the target image, so that the generation accuracy of the target image is guaranteed. The influence of singular pixel values is eliminated by carrying out normalization processing on pixels of the image to be processed, so that subsequent image processing is facilitated. Through carrying out the de-normalization processing to the pixel value of the target image, the actual pixel value of the image is conveniently determined, so that more accurate image information is obtained.
The enhancement effect of the above image processing method was verified here using the abdominal cavity image disclosed on the network. Specifically, fig. 4 shows a pre-processed abdominal image, which has strong smoke feeling, unclear details, and poor image contrast; fig. 5 shows an image processed by the image processing method, and it can be seen that the image shown in fig. 5 has reduced smoke feeling, enhanced image contrast and clearer details.
The present embodiment also provides an image processing apparatus, which is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides an image processing apparatus, as shown in fig. 6, including:
the acquiring module 41 is configured to acquire an image to be processed, where the image to be processed includes a plurality of color channels.
The first determining module 42 is configured to determine a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels.
A second determining module 43 for determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the maximum target pixel value in the target pixel matrix
The image processing module 44 is configured to perform image processing on the image to be processed based on the target transmission coefficient, so as to obtain an enhanced image.
The weighting module 45 is configured to perform weighting processing on the enhanced image and the image to be processed, and generate a target image.
Alternatively, the second determining module 43 may include:
and the first determination submodule is used for determining a weight matrix based on the ratio of the target pixel matrix to the target pixel value.
And the second determining submodule is used for determining an initial transmission coefficient based on the product of the preset parameter and the weight matrix.
And the constraint sub-module is used for carrying out constraint processing on the initial transmission coefficient according to a preset constraint condition to obtain a target transmission coefficient.
Alternatively, the processing module 44 may include:
and the response sub-module is used for responding to the setting operation of the atmospheric light vector and determining the target atmospheric light vector corresponding to each color channel based on the setting operation.
And the defogging sub-module is used for defogging the image to be processed based on the target atmospheric light vector and the target transmission coefficient to generate a defogged image.
And the enhancer module is used for carrying out balanced enhancement processing on the defogging image to generate an enhanced image.
Alternatively, the first determining module 42 may include:
and the normalization sub-module is used for carrying out normalization processing on the pixel value of the image to be processed to obtain normalized pixel value data.
And the third determining submodule is used for determining a pixel value matrix corresponding to each color channel based on the normalized pixel value data.
And the fourth determination submodule is used for comparing the pixel values in each pixel value matrix and determining a target pixel matrix.
Alternatively, the weighting module 45 may include:
and the image transformation submodule is used for setting N weight coefficients and performing i times of image transformation processing on the enhanced image based on delta (Ni).
And the superposition sub-module is used for superposing the images subjected to the i-time image transformation processing to obtain a target image. Wherein the sum of the i-degree weight coefficients is 1, and delta (Ni) represents the transformation mode.
Optionally, the image processing apparatus described above may further include:
and the denormalization module is used for performing denormalization processing on the pixel value of the target image and determining the actual pixel value of the target image.
The image processing apparatus in this embodiment is presented in the form of functional units, where the units refer to ASIC circuits, processors and memories executing one or more software or fixed programs, and/or other devices that can provide the above described functions.
Further functional descriptions of the above modules and sub-modules are the same as those of the above corresponding embodiments, and are not repeated here.
The embodiment of the invention also provides electronic equipment, which is provided with the image processing device shown in the figure 6.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, and as shown in fig. 7, the electronic device may include: at least one processor 501, such as a central processing unit (Central Processing Unit, CPU), at least one communication interface 503, a memory 504, at least one communication bus 502. Wherein a communication bus 502 is used to enable connected communications between these components. The communication interface 503 may include a Display screen (Display), a Keyboard (Keyboard), and the optional communication interface 503 may further include a standard wired interface, and a wireless interface. The memory 504 may be a high-speed volatile random access memory (Random Access Memory, RAM) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 504 may also optionally be at least one storage device located remotely from the aforementioned processor 501. Wherein the processor 501 may have stored in the memory 504 an application program in the apparatus described in connection with fig. 6 and the processor 501 invokes the program code stored in the memory 504 for performing any of the above-mentioned method steps.
The communication bus 502 may be, among other things, a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, etc. The communication bus 502 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus.
Wherein the memory 504 may include volatile memory (RAM), such as random-access memory (RAM); the memory may also include a nonvolatile memory (non-volatile memory), such as a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); memory 504 may also include a combination of the types of memory described above.
The processor 501 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP) or a combination of CPU and NP, among others.
The processor 501 may further include a hardware chip, among others. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), general-purpose array logic (generic array logic, GAL), or any combination thereof.
Optionally, the memory 504 is also used for storing program instructions. The processor 501 may invoke program instructions to implement the image processing method as shown in the above-described embodiments of the present application.
The embodiment of the invention also provides a non-transitory computer storage medium, which stores computer executable instructions that can execute the image processing method in any of the above method embodiments. The storage medium may be a magnetic Disk, an optical disc, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (10)

1. An image processing method, comprising:
acquiring an image to be processed, wherein the image to be processed comprises a plurality of color channels;
determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels;
determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and a maximum target pixel value in the target pixel matrix;
performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image;
and carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
2. The method according to claim 1, wherein determining the target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and the maximum target pixel value in the target pixel matrix comprises:
determining a weight matrix based on a ratio of the target pixel matrix to a maximum target pixel value in the target pixel matrix;
determining an initial transmission coefficient based on a product of a preset parameter and the weight matrix;
and carrying out constraint processing on the initial transmission coefficient according to a preset constraint condition to obtain a target transmission coefficient.
3. The method according to claim 1, wherein the performing image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image includes:
in response to a setting operation on the atmospheric light vector, determining a target atmospheric light vector corresponding to each color channel based on the setting operation;
defogging the image to be processed based on the target atmospheric light vector and the target transmission coefficient to generate a defogged image;
and carrying out balanced enhancement processing on the defogging image to generate an enhanced image.
4. A method according to claim 3, wherein said defogging the image to be processed based on the target atmospheric light vector and the target transmission coefficient, generating a defogged image, comprises:
Figure FDA0004114896260000021
wherein f (x) is a defogging image; f is an image to be processed formed by a plurality of color channels; a is a target atmospheric light vector; t is a target transmission coefficient; k is a proportionality coefficient, 0< k <1; abs represents the absolute value.
5. The method of claim 1, wherein the weighting the enhanced image and the image to be processed to generate a target image comprises:
setting N weight coefficients, and performing i times of image transformation processing on the enhanced image based on delta (Ni);
overlapping the images subjected to the i-time image transformation processing to obtain the target image;
wherein the sum of the i-degree weight coefficients is 1, and delta (Ni) represents the transformation mode.
6. The method of claim 1, wherein determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels comprises:
normalizing the pixel value of the image to be processed to obtain normalized pixel value data;
determining a pixel value matrix corresponding to each color channel based on the normalized pixel value data;
and comparing the pixel values in each pixel value matrix to determine the target pixel matrix.
7. The method as recited in claim 6, further comprising:
and carrying out de-normalization processing on the pixel value of the target image, and determining the actual pixel value of the target image.
8. An image processing apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an image to be processed, and the image to be processed comprises a plurality of color channels;
the first determining module is used for determining a target pixel matrix corresponding to the image to be processed based on pixel values corresponding to the plurality of color channels;
the second determining module is used for determining a target transmission coefficient corresponding to the image to be processed based on the target pixel matrix and target pixel values in the target pixel matrix;
the image processing module is used for carrying out image processing on the image to be processed based on the target transmission coefficient to obtain an enhanced image;
and the weighting module is used for carrying out weighting processing on the enhanced image and the image to be processed to generate a target image.
9. An electronic device, comprising:
a memory and a processor, said memory and said processor being communicatively coupled to each other, said memory having stored therein computer instructions, said processor executing said computer instructions to perform the image processing method of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute the image processing method according to any one of claims 1 to 7.
CN202310215879.0A 2023-03-01 2023-03-01 Image processing method and device, electronic equipment and readable storage medium Pending CN116342504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310215879.0A CN116342504A (en) 2023-03-01 2023-03-01 Image processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310215879.0A CN116342504A (en) 2023-03-01 2023-03-01 Image processing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116342504A true CN116342504A (en) 2023-06-27

Family

ID=86883253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310215879.0A Pending CN116342504A (en) 2023-03-01 2023-03-01 Image processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116342504A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117333403A (en) * 2023-12-01 2024-01-02 合肥金星智控科技股份有限公司 Image enhancement method, storage medium, and image processing system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117333403A (en) * 2023-12-01 2024-01-02 合肥金星智控科技股份有限公司 Image enhancement method, storage medium, and image processing system
CN117333403B (en) * 2023-12-01 2024-03-29 合肥金星智控科技股份有限公司 Image enhancement method, storage medium, and image processing system

Similar Documents

Publication Publication Date Title
Pu et al. A fractional-order variational framework for retinex: fractional-order partial differential equation-based formulation for multi-scale nonlocal contrast enhancement with texture preserving
CN108604369B (en) Method, device and equipment for removing image noise and convolutional neural network
Huang et al. Underwater image enhancement via adaptive group attention-based multiscale cascade transformer
CN108765264B (en) Image beautifying method, device, equipment and storage medium
CN107798661B (en) Self-adaptive image enhancement method
US9569684B2 (en) Image enhancement using self-examples and external examples
CN110675334A (en) Image enhancement method and device
US11080833B2 (en) Image manipulation using deep learning techniques in a patch matching operation
CN108734127B (en) Age identification value adjusting method, age identification value adjusting device, age identification value adjusting equipment and storage medium
Liu et al. Learning hadamard-product-propagation for image dehazing and beyond
Lin et al. Low-light enhancement using a plug-and-play Retinex model with shrinkage mapping for illumination estimation
CN111145086A (en) Image processing method and device and electronic equipment
CN111968057A (en) Image noise reduction method and device, storage medium and electronic device
CN116342504A (en) Image processing method and device, electronic equipment and readable storage medium
CN111986132A (en) Infrared and visible light image fusion method based on DLatLRR and VGG &amp; Net
Kousha et al. Modeling srgb camera noise with normalizing flows
CN111340913B (en) Picture generation and model training method, device and storage medium
Lei et al. A novel intelligent underwater image enhancement method via color correction and contrast stretching✰
Jeon et al. Low-light image enhancement using inverted image normalized by atmospheric light
Duong et al. Dmt-net: deep multiple networks for low-light image enhancement based on retinex model
CN112991236B (en) Image enhancement method and device based on template
WO2020107308A1 (en) Low-light-level image rapid enhancement method and apparatus based on retinex
Al-Ameen Contrast enhancement for color images using an adjustable contrast stretching technique
CN110378860A (en) Method, apparatus, computer equipment and the storage medium of restored video
Pan et al. ChebyLighter: Optimal Curve Estimation for Low-light Image Enhancement

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