CN111127341A - Image processing method and apparatus, and storage medium - Google Patents

Image processing method and apparatus, and storage medium Download PDF

Info

Publication number
CN111127341A
CN111127341A CN201911236238.3A CN201911236238A CN111127341A CN 111127341 A CN111127341 A CN 111127341A CN 201911236238 A CN201911236238 A CN 201911236238A CN 111127341 A CN111127341 A CN 111127341A
Authority
CN
China
Prior art keywords
image
image block
parameter
value
optimized
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
CN201911236238.3A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911236238.3A priority Critical patent/CN111127341A/en
Publication of CN111127341A publication Critical patent/CN111127341A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T5/92
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • G06T2207/20008Globally adaptive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application discloses an image processing method, an image processing device and a storage medium, wherein the method comprises the following steps: acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; wherein, the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other one of the clipping amplitude limiting parameter and the image block size parameter; based on the initial value and each reference value of the at least two reference values, performing image processing and quality evaluation on a preset image to obtain an image quality evaluation value corresponding to each reference value; performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value; and enhancing the preset image by using a target value of the parameter to be optimized and a contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.

Description

Image processing method and apparatus, and storage medium
Technical Field
The present disclosure relates to image processing technologies, and in particular, to an image processing method and apparatus, and a storage medium.
Background
Histogram equalization is a commonly used image enhancement method, but as a global gray-scale mapping algorithm, there are often problems of excessive enhancement or insufficient enhancement of regional targets. For this reason, many improved methods decompose an image into a plurality of image blocks for processing. However, due to lack of control parameters and boundary conditions, these methods may bring about an enhancement process in the image block region, which may cause problems such as unstable enhancement effect. The Contrast-limited adaptive Histogram Equalization (CLAHE) algorithm achieves the purpose of limiting the Contrast by cutting the Histogram in the image block region and uniformly distributing the cut region in the whole gray scale range, so that the Histogram Equalization in each image block region is constrained.
However, the enhancement effect of the CLAHE algorithm depends heavily on two parameters, namely, the image BLOCK SIZE (BLOCK _ SIZE) and the clipping LIMIT value (CLIMP _ LIMIT), at present, the fixed image BLOCK SIZE and the fixed clipping LIMIT value are set according to experience, and then the fixed image BLOCK SIZE and the fixed clipping LIMIT value are subjected to parameter adjustment.
Disclosure of Invention
The application provides an image processing method and device and a storage medium, which can improve the processing speed and the processing effect of an image.
The technical scheme of the application is realized as follows:
the embodiment of the application provides an image processing method, which comprises the following steps:
acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other of the clipping amplitude limiting parameter and the image block size parameter;
based on the initial value and each reference value of the at least two reference values, performing image processing and quality evaluation on a preset image to obtain an image quality evaluation value corresponding to each reference value;
performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the maximum image quality evaluation value;
and enhancing the preset image by using the target value of the parameter to be optimized and a contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
In the foregoing solution, after performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value, the method further includes:
interchanging the fixed parameters and the parameters to be optimized to obtain interchanged fixed parameters and interchanged parameters to be optimized;
continuing to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized to obtain a target value of the interchanged parameters to be optimized with the maximum image quality evaluation value;
and enhancing the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after interchange and a contrast limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
In the foregoing solution, the performing image processing and quality evaluation on a preset image based on the initial value and each of the at least two reference values to obtain an image quality evaluation value corresponding to each reference value includes:
dividing the preset image into at least one non-overlapping image block according to each of the at least two reference values;
performing histogram clipping and integration on each image block in the at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block;
and stretching the at least one image block by using the contrast stretching curve to obtain the image quality evaluation value.
In the foregoing solution, the performing histogram clipping and integration on each image block in the at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block includes:
performing histogram statistics and normalization on each image block to obtain a normalized histogram;
and according to the initial value, cutting and integrating the normalized histogram to obtain the contrast stretching curve.
In the foregoing solution, the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value includes:
performing gray scale stretching on a corresponding image block in the at least one image block by using the contrast stretching curve to obtain a stretched image block;
carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block, and further obtain the information entropy of at least one image block;
and averaging the information entropy of the at least one image block to obtain the image quality evaluation value.
In the foregoing solution, the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value includes:
performing gray scale stretching on the at least one image block in the preset image by using the contrast stretching curve to obtain a stretched first image;
and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain the image quality evaluation value.
In the foregoing solution, the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value includes:
obtaining an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curves;
weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block;
performing gray scale stretching on the at least one image block in the preset image by using the weighted contrast stretching curve to obtain a stretched second image;
and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain the image quality evaluation value.
In the foregoing solution, the performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value includes:
fitting a gamma curve by taking the at least two reference values as abscissa and the image quality evaluation value as ordinate to obtain a curve equation;
performing second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero;
and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
In the above scheme, when the fixed parameter is a clipping amplitude limiting parameter and the parameter to be optimized is an image block size parameter, the exchanged fixed parameter is an image block size parameter, and the exchanged parameter to be optimized is a clipping amplitude limiting parameter;
and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are image block size parameters.
An embodiment of the present application provides an image processing apparatus, the apparatus including:
the acquisition module is used for acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other of the clipping amplitude limiting parameter and the image block size parameter;
the target determining module is used for carrying out image processing and quality evaluation on a preset image based on the initial value and each reference value of the at least two reference values to obtain an image quality evaluation value corresponding to each reference value; performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the maximum image quality evaluation value;
and the image processing module is used for enhancing the preset image by utilizing the target value of the parameter to be optimized and the contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
In the foregoing solution, the obtaining module is further configured to perform curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with a maximum image quality evaluation value, and then interchange the fixed parameter and the parameter to be optimized to obtain an interchanged fixed parameter and an interchanged parameter to be optimized;
the target determining module is further configured to continue to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized to obtain a target value of the interchanged parameters to be optimized, where the image quality evaluation value is the largest;
the image processing module is further configured to perform enhancement processing on the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after the interchange, and a contrast-limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
In the foregoing solution, the target determining module is further configured to divide the preset image into at least one non-overlapping image block according to each of the at least two reference values; performing histogram clipping and integration on each image block in the at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block; and stretching the at least one image block by using the contrast stretching curve to obtain the image quality evaluation value.
In the above scheme, the target determining module is further configured to perform histogram statistics and normalization on each image block to obtain a normalized histogram; and according to the initial value, cutting and integrating the normalized histogram to obtain the contrast stretching curve.
In the above scheme, the target determining module is further configured to perform gray scale stretching on a corresponding image block in the at least one image block by using the contrast stretching curve to obtain a stretched image block; carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block, and further obtaining the information entropy of at least one image block; and averaging the information entropy of the at least one image block to obtain the image quality evaluation value.
In the above scheme, the target determining module is further configured to perform gray scale stretching on the at least one image block in the preset image by using the contrast stretching curve to obtain a stretched first image; and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain the image quality evaluation value.
In the above scheme, the target determining module is further configured to obtain an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curve; weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block; performing gray scale stretching on the at least one image block in the preset image by using the weighted contrast stretching curve to obtain a stretched second image; and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain the image quality evaluation value.
In the above scheme, the target determining module is further configured to fit a gamma curve with the at least two reference values as abscissa and the image quality evaluation value as ordinate to obtain a curve equation; performing second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero; and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
In the above scheme, when the fixed parameter is a clipping amplitude limiting parameter and the parameter to be optimized is an image block size parameter, the exchanged fixed parameter is an image block size parameter, and the exchanged parameter to be optimized is a clipping amplitude limiting parameter;
and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are image block size parameters.
An embodiment of the present application provides an image processing apparatus, the apparatus including: a processor, a memory and a communication bus, the memory communicating with the processor through the communication bus, the memory storing one or more programs executable by the processor, the processor performing any of the image processing methods as described above when the one or more programs are executed.
Embodiments of the present application provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement any one of the image processing methods described above.
The embodiment of the application provides an image processing method and device and a storage medium, and the technical implementation scheme is adopted, based on an initial value of one of a clipping amplitude limiting parameter and an image block size parameter, image quality evaluation values corresponding to a plurality of reference values of the other of the clipping amplitude limiting parameter and the image block size parameter are respectively obtained, and curve fitting is performed on the plurality of reference values and the image quality evaluation values corresponding to the reference values to determine a target value with the largest image quality evaluation value; the target value is determined by fitting a curve through a plurality of reference values, the numerical value does not need to be adjusted step by step, the acquisition speed of the target value is increased, namely the processing speed of the image is increased, secondly, the target value corresponds to the maximum image quality evaluation value, namely the target value is the numerical value which enables the image quality evaluation value of the image to be maximum, and then the target value of one parameter in the CLAHE algorithm and the CLAHE algorithm is used for enhancing the preset image, so that the image quality of the obtained first enhanced image is good, and the processing effect of the image is improved.
Drawings
Fig. 1 is a first flowchart of an image processing method according to an embodiment of the present disclosure;
fig. 2 is a second flowchart of an image processing method according to an embodiment of the present application;
fig. 3 is a flowchart of a third image processing method according to an embodiment of the present application;
fig. 4 is a fourth flowchart of an image processing method according to an embodiment of the present application;
fig. 5 is a first schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
Example one
An embodiment of the present application provides an image processing method, as shown in fig. 1, the image processing method includes the following steps:
s101, acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; wherein, the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other one of the clipping amplitude limiting parameter and the image block size parameter;
aiming at a clipping amplitude limiting parameter and/or an image block size parameter in a CLAHE algorithm, the image processing device acquires respective target values of the two parameters or acquires a target value of any one parameter; when a target value of one parameter is obtained, the one parameter is used as a parameter to be optimized, and the other parameter is used as a fixed parameter; an initial value of the fixed parameter is obtained, and at least two reference values of the parameter to be optimized are obtained.
Further, when the image processing device acquires a target value of another parameter, acquiring at least two reference values of the interchanged parameter to be optimized, and acquiring an initial value of the interchanged fixed parameter; and the parameters to be optimized and the fixed parameters after being interchanged are parameters after the parameters to be optimized and the fixed parameters are interchanged.
In some embodiments, when the fixed parameter is a clipping amplitude limiting parameter and the parameter to be optimized is an image block size parameter, the exchanged fixed parameter is an image block size parameter, and the exchanged parameter to be optimized is a clipping amplitude limiting parameter; and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are the image block size parameters.
In some embodiments, the initial values include clipping threshold values and image block size values; the at least two parameter values include at least two clipping limit values and at least two image block size values.
In some embodiments, when the fixed parameter is a clipping limiting parameter and the parameter to be optimized is an image block size parameter, the image processing apparatus obtains an initial clipping limiting value and at least two image block size values.
The image processing device takes a fixed initial clipping amplitude limiting value according to the clipping amplitude limiting parameter, and then takes out at least two image block size values in the image block size range according to the image block size parameter; the clipping slice value refers to a value of the histogram to be clipped.
In some embodiments, the initial clip limit value is set based on empirical values, for example, the initial clip limit value is equal to 2/256 or 1.5/256.
In some embodiments, the image block size range is set according to an empirical value or a pixel size of a preset image to be processed.
In some embodiments, according to a preset value rule, at least two image block size values are sequentially taken out from an image block size range, wherein each image block size value in the at least two image block size values is n, which represents that an image block is n × n; the preset value-taking rules comprise equal-interval value taking, equal-proportion value taking and the like.
Illustratively, the at least two image block size values taken in equal proportion are: 8. 16, 32, …, 256, 512; where 8 denotes the size of the image block as 8 × 8.
Illustratively, the at least two image block size values taken at equal intervals are: 8. 12, 16, …, 36.
In some embodiments, when the fixed parameter is an image block size parameter and the parameter to be optimized is a clipping slice parameter, the image processing apparatus obtains an initial image block size value and at least two clipping slice values.
The image processing device takes a fixed initial image block size value according to the image block size parameter, and then takes out at least two clipping amplitude limiting values respectively within the clipping amplitude limiting range according to the clipping amplitude limiting parameter.
In some embodiments, the initial image block size value is set according to an empirical value, or after obtaining the target image block size parameter, the target image block size parameter is taken as the initial image block size value.
In some embodiments, the clipping range is set according to empirical values, e.g., 0-4/256.
In some embodiments, at least two clipping amplitude limits are sequentially taken out within the clipping amplitude limit range according to a preset value rule.
Illustratively, the at least two clipping limit values taken at equal intervals are: 0.4/256, 0.8/256, 1.2/256, 1.6/256, 2.0/256, 2.4/256, 2.8/256, 3.2/256, 3.6/256, 4.0/256.
S102, based on the initial value and each reference value of the at least two reference values, carrying out image processing and quality evaluation on a preset image to obtain an image quality evaluation value corresponding to each reference value;
the image processing device sequentially performs image processing and quality evaluation on the preset image by using the initial value and each reference value to obtain an image quality evaluation value corresponding to each reference value, and further obtains image quality evaluation values corresponding to at least two reference values.
In some embodiments, the image quality evaluation value is information capable of characterizing image quality, and the image quality evaluation value includes: information entropy, sharpness, spatial frequency of the image, relative edge response, standard deviation or roughness, etc.; the image quality evaluation value may also be a weighted value of a plurality of the above parameters.
In some embodiments, the image processing apparatus divides the preset image into at least one image block that does not overlap according to each of the at least two reference values; performing histogram clipping and integration on each image block in at least one image block by using an initial value to obtain a contrast stretching curve corresponding to each image block; and stretching at least one image block by using a contrast stretching curve to obtain an image quality evaluation value.
When the fixed parameter is an image block size parameter and the parameter to be optimized is a clipping amplitude limiting parameter, the image processing device determines that an initial value is an initial clipping amplitude limiting value, at least two reference values are at least two image block size values, and each reference value is each image block size value; according to an image block size value, continuously dividing a preset image in a non-overlapping way to obtain at least one image block; performing histogram clipping, integration and stretching processing on at least one image block by using the initial clipping amplitude limit value to obtain an image quality evaluation value corresponding to the size value of the image block; and continuously dividing the preset image in a non-overlapping way according to the size value of the next image block until the image quality evaluation value corresponding to each size value of all the image blocks is obtained.
In some embodiments, the image processing apparatus continuously divides the preset image without overlapping according to an image block size value to obtain at least one image block with a size value greater than or equal to the image block size value; when the size value of the last image block on each line of the preset image is smaller than the size value of the image block, when the penultimate image block of each line is divided, the last image block of each line is also divided into the penultimate image block, and the penultimate image block is the image block of which the size value is larger than the size value of the image block; similarly, when the size value of the last image block on each column of the predetermined image is smaller than the image block size value, when the penultimate image block of each column is divided, the last image block of each column is also divided into the penultimate image block, and the penultimate image block is the image block with the size value larger than the image block size value.
Illustratively, the size of the preset image is 35 × 33, and taking an image block size value as an example of 8, starting from the first column of the first row, the preset image is continuously divided without overlapping to obtain 16 image blocks, where the 16 image blocks include: the first image block of 8 × 8, the second image block of 8 × 8, the third image block of 8 × 8 and the fourth image block of 11 × 8 belonging to the first row, the first image block of 8 × 8, the second image block of 8 × 8, the third image block of 8 × 8, the fourth image block of 11 × 8 belonging to the second row, the first image block of 8 × 8, the second image block of 8 × 8, the third image block of 8 × 8, the fourth image block of 11 × 8 belonging to the third row, the first image block of 8 × 9, the second image block of 8 × 9, the third image block of 8 × 9 belonging to the fourth row, and the fourth image block of 11 × 9.
In some embodiments, histogram statistics and normalization are performed on each image block to obtain a normalized histogram; and according to the initial value, cutting and integrating the normalized histogram to obtain a contrast stretching curve.
The image processing device determines an initial value as an initial clipping amplitude limit value; calculating and normalizing the gray level histogram of each image block to obtain a normalized gray level histogram; cutting the normalized gray level histogram of each image block by using the initial cutting amplitude limiting value to obtain a cut histogram and a cut (cut) histogram; redistributing the cut histogram to the gray level of the cut histogram to obtain a redistributed histogram; and integrating the distributed histograms to obtain a contrast stretching curve corresponding to each image block.
In some embodiments, for the normalized grayscale histogram of each image block, the histogram having grayscale values greater than or equal to the initial clipping limit value is clipped.
In some embodiments, the image processing apparatus performs gray scale stretching on a corresponding image block of the at least one image block by using a contrast stretching curve to obtain a stretched image block; carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block so as to obtain the information entropy of at least one image block; and averaging the information entropy of at least one image block to obtain an image quality evaluation value.
The image processing device performs gray scale stretching on the image processing device by using a contrast stretching curve corresponding to each image block to obtain stretched image blocks; calculating the distribution probability of each gray level in the stretched image block, and further calculating the distribution probability of all gray levels in the stretched image block to obtain the information entropy of each image block; and adding the information entropies of all the image blocks, and then averaging to obtain a first information entropy, wherein the first information entropy is used as a first image quality evaluation value.
In some embodiments, the image processing apparatus calculates the information entropy of each image block using the correspondence between the grayscale probability and the information entropy; the corresponding relation between the gray level probability and the information entropy is shown as the following formula (1):
Figure BDA0002304947150000111
wherein E (x) is information entropy, P (x)i) The gray level ranges from 1 to N, which is the distribution probability of the gray level i.
In some embodiments, the image processing apparatus performs gray scale stretching on at least one image block in a preset image by using a contrast stretching curve to obtain a stretched first image; and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain an image quality evaluation value.
The image processing device performs gray scale stretching on image blocks corresponding to the contrast stretching curves in the preset image by using the contrast stretching curves of all the image blocks until at least one image block (all the image blocks) in the preset image is subjected to gray scale stretching to obtain a stretched first image; calculating distribution probability of each gray level in the stretched first image, and calculating the distribution probability of all gray levels in the stretched first image according to the corresponding relation (for example, formula (1)) of the gray level probability and the information entropy to obtain the information entropy of a preset image; and taking the information entropy of the preset image as an image quality evaluation value.
In some embodiments, the image processing apparatus obtains an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curves; weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block; performing gray scale stretching on at least one image block in a preset image by using the weighted contrast stretching curve to obtain a stretched second image; and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain an image quality evaluation value.
The image processing device acquires contrast stretching curves of all adjacent image blocks of each image block in a preset image, and the contrast stretching curves are used as the adjacent contrast stretching curves; weighting and summing all adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block; carrying out gray scale stretching on the corresponding image blocks in the preset image by using the weighted contrast stretching curve corresponding to each image block until all the image blocks in the preset image are subjected to gray scale stretching to obtain a stretched second image; and obtaining a first image quality evaluation value based on the stretched second image.
It should be noted that the implementation process of the image processing apparatus performing the gray scale probability statistics and the information entropy calculation on the stretched first image to obtain the image quality evaluation value is the same as the implementation process of performing the gray scale probability statistics and the information entropy calculation on the stretched second image to obtain the image quality evaluation value, and details are not repeated here.
Illustratively, taking at least two image block size values including 8, 16, 32, 64, 128, 256, and 512 as an example, the information entropy corresponding to each image block size value is calculated, and the information entropy corresponding to each of the at least two image block size values is: e _8, E _16, E _32, E _64, E _128, E _258, E _ 512.
In some embodiments, when the fixed parameter is a clipping amplitude limiting parameter and the parameter to be optimized is an image block size parameter, dividing the preset image into at least one non-overlapping image block according to an initial value; performing histogram clipping and integration on each image block in at least one image block by using each reference value to obtain a contrast tension curve corresponding to each image block; and processing at least one image block by using the contrast stretching curve to obtain an image quality evaluation value.
When the fixed parameter is a cutting amplitude limiting parameter and the parameter to be optimized is an image block size parameter, the image processing device determines that the initial value is an initial image block size value, the at least two reference values are at least two cutting amplitude limiting values, and each reference value is each cutting amplitude limiting value; continuously dividing a preset image in a non-overlapping way according to the size value of the initial image block to obtain at least one image block; performing histogram clipping, integration and stretching processing on at least one image block by using a clipping amplitude limit value to obtain an image quality evaluation value corresponding to the clipping amplitude limit value; and continuously utilizing the next clipping amplitude limiting value to perform histogram clipping, integration and stretching processing on at least one image block until image quality evaluation values corresponding to all the clipping amplitude limiting values are obtained.
It should be noted that, the implementation process of the image processing apparatus dividing the preset image into at least one non-overlapping image block according to the initial image block size value is the same as the implementation process of dividing the preset image into at least one non-overlapping image block according to each image block size value, and details are not repeated here.
In addition, the image processing apparatus performs histogram clipping and integration on each image block in the at least one image block by using each clipping margin value to obtain the implementation process of the contrast stretching curve corresponding to each image block, and the implementation process of performing histogram clipping and integration on each image block in the at least one image block by using the initial clipping margin value to obtain the contrast stretching curve corresponding to each image block is the same as that of the implementation process of obtaining the contrast stretching curve corresponding to each image block, which is not repeated here.
Illustratively, taking the at least two clipping slice values including 0.4/256, 0.8/256, 1.2/256, 1.6/256, 2.0/256, 2.4/256, 2.8/256, 3.2/256, 3.6/256, and 4.0/256 as an example, the information entropy corresponding to each clipping slice value is calculated, and the information entropy corresponding to each clipping slice value is respectively: e _0.4, E _0.8, E _1.2, E _1.6, E _2.0, E _2.4, E _2.8, E _3.2, E _3.6, E _ 4.0.
S103, performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value;
the image processing device performs curve fitting by using the at least two reference values and the image quality evaluation values corresponding to the at least two reference values to obtain a curve equation; and determining the target value of the parameter to be optimized with the maximum image quality evaluation value according to the curve equation.
In some embodiments, the target values for the parameters to be optimized include a target image block size value for the image block size parameter and a target clipping limit value for the clipping limit parameter.
Exemplarily, when the at least two reference values are at least two image block size values and the parameter to be optimized is an image block size parameter, the image processing apparatus performs curve fitting by using image quality evaluation values corresponding to the at least two image block size values and the at least two image block size values to obtain a curve equation; and determining the image block size value with the maximum image quality evaluation value according to a curve equation, and taking the image block size value as the target image block size value.
In some embodiments, the image processing apparatus fits a Gamma curve (Gamma curve) with at least two reference values as abscissa and an image quality evaluation value as ordinate to obtain a curve equation; carrying out second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero; and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
The image processing device takes the parameter value as an abscissa, takes the image quality evaluation value as an ordinate, and fits the gamma curve by using all the reference values and the image quality evaluation values corresponding to all the reference values to obtain a curve equation corresponding to the gamma curve; and determining an inflection point coordinate corresponding to the curve equation, and taking an abscissa in the inflection point coordinate as a target value.
Exemplarily, the reference value is an image block size value as an abscissa, and the image quality evaluation value is an information entropy; the image processing device fits a gamma curve by using the information entropies corresponding to all the image block size values and all the image block size values respectively to obtain a first curve equation representing the corresponding relation between the image block size values and the information entropies; performing second-order derivation on the first curve equation and taking zero from the second-order derivative to obtain an inflection point with the maximum characteristic information entropy; the abscissa of the inflection point is the size value of the target image block; wherein the first curve equation belongs to the curve equation.
Illustratively, the reference value is a clipping margin value, and the image quality evaluation value is information entropy; the image processing device fits a gamma curve by using the information entropies corresponding to all the cutting amplitude limiting values and all the cutting amplitude limiting values respectively to obtain a second curve equation representing the corresponding relation between the cutting amplitude limiting values and the information entropies; performing second-order derivation on the second curve equation and taking zero from the second-order derivative to obtain an inflection point with the maximum characteristic information entropy; the abscissa of the inflection point is the target cutting amplitude limiting value; wherein the second curve equation belongs to the curve equation.
And S104, enhancing the preset image by using the target value of the parameter to be optimized and the contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
After obtaining the target value of the parameter to be optimized, the image processing device substitutes the target value of the parameter to be optimized into a CLAHE algorithm, and then carries out enhancement processing on a preset image by using the CLAHE algorithm to obtain a first enhanced image; compared with the image obtained by enhancing with the CLAHE algorithm which does not adopt the target value, the first enhanced image has better enhancing effect.
In some embodiments, as shown in fig. 2, after step S103, the image processing method further includes:
s105, interchanging the fixed parameters and the parameters to be optimized to obtain interchanged fixed parameters and interchanged parameters to be optimized;
the image processing device exchanges the fixed parameters and the parameters to be optimized in order to obtain the target values of the fixed parameters; acquiring at least two reference values of the interchanged parameter to be optimized, and acquiring an initial value of the interchanged fixed parameter; the exchanged fixed parameters are parameters to be optimized, and the exchanged parameters to be optimized are fixed parameters.
In some embodiments, the image processing apparatus may use the target value of the parameter to be optimized as the initial value of the fixed parameter after the interchange.
S106, continuing to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized to obtain the target value of the interchanged parameters to be optimized with the maximum image quality evaluation value;
the image processing device carries out image processing and quality evaluation on a preset image based on the initial value of the interchanged fixed parameter and each reference value of the at least two reference values of the interchanged parameter to be optimized to obtain an image quality evaluation value corresponding to each reference value of the interchanged parameter to be optimized; and performing curve fitting on the at least two interchanged reference values of the parameter to be optimized and the image quality evaluation value corresponding to each interchanged reference value of the parameter to be optimized to obtain the interchanged target value of the parameter to be optimized with the largest image quality evaluation value.
S107, enhancing the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after interchange and a contrast limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
The image processing device substitutes the target value of the parameter to be optimized and the interchanged target value of the parameter to be optimized into a CLAHE algorithm, and then the CLAHE algorithm is used for carrying out enhancement processing on the preset image to obtain a second enhanced image; the second enhanced image has a better enhancement effect than the first enhanced image.
It should be noted that fig. 2 does not limit the execution sequence of steps S101 to S103 and steps S105 to S106, and steps S101 to S103 and steps S105 to S106 may be executed simultaneously, or steps S105 to S106 may be executed first and then steps S101 to S103 may be executed.
In some embodiments, as shown in fig. 3, an image processing method includes:
s201, acquiring an initial clipping amplitude limit value and at least two image block size values;
and when the fixed parameters are cutting amplitude limiting parameters, the image processing device acquires an initial cutting amplitude limiting value and at least two image block size values.
S202, based on the initial clipping amplitude limit value and each image block size value in at least two image block size values, performing image processing and quality evaluation on a preset image to obtain a first image quality evaluation value corresponding to each image block size value;
the image processing device sequentially performs image processing and quality evaluation on a preset image by using the initial clipping amplitude limit value and each image block size value to obtain a first image quality evaluation value corresponding to each image block size value, and further obtain first image quality evaluation values corresponding to at least two image block size values; the first of the first image quality evaluation values is only used to indicate that the image quality evaluation value is calculated using each image block size value with the clipping slice parameter fixed.
S203, performing curve fitting on the at least two image block size values and the first image quality evaluation value to obtain a first curve equation, and determining a target image block size value with the largest image quality evaluation value according to the first curve equation;
the image processing device uses the image block size value as an abscissa and the first image instruction evaluation value as an ordinate, fits a curve by using all the image block size values and all the first image quality evaluation values to obtain a first curve equation, and then determines a target image block size value according to the first curve equation.
S204, acquiring an initial image block size value and at least two cutting amplitude limiting values;
and when the interchanged fixed parameters of the image processing device are image block size parameters, acquiring an initial image block size value and at least two cutting amplitude limiting values.
In some embodiments, the image processing apparatus may take the target image block size value as the initial image block size value after obtaining the target image block size value first.
S205, based on the initial image block size value and each clipping amplitude limit value in the at least two clipping amplitude limit values, carrying out image processing and quality evaluation on the preset image to obtain a second image quality evaluation value corresponding to each clipping amplitude limit value;
the image processing device sequentially performs image processing and quality evaluation on the preset image by using the initial image block size value and each clipping amplitude limiting value to obtain a second image quality evaluation value corresponding to each clipping amplitude limiting value, and further obtain second image quality evaluation values corresponding to at least two clipping amplitude limiting values; the second image quality evaluation value is only used for representing the image quality evaluation value calculated by using each clipping limiting value under the condition that the image block size parameter is fixed and unchanged.
S206, performing curve fitting on the at least two clipping amplitude limiting values and the second image quality evaluation value to obtain a second curve equation, and determining a target clipping amplitude limiting value with the largest image quality evaluation value according to the second curve equation;
the image processing device takes the clipping amplitude limiting value as an abscissa and the first image instruction evaluation value as an ordinate, fits a curve by using all the clipping amplitude limiting values and all the second image quality evaluation values to obtain a second curve equation, and then determines a target clipping amplitude limiting value according to the second curve equation.
It should be noted that fig. 3 does not limit the execution sequence of steps S101 to S103 and steps S104 to S106, and steps S101 to S103 and steps S104 to S106 may be executed simultaneously, or steps S104 to S106 may be executed first, and then steps S101 to S103 are executed; and after the target clipping amplitude limiting value is obtained, the target clipping amplitude limiting value can be used as an initial clipping amplitude limiting value.
And S207, enhancing the preset image by using the target image block size value, the target cutting amplitude limiting value and the contrast limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
And after obtaining the target image block size value and the target cutting amplitude limit value, the image processing device substitutes the target image block size value and the target cutting amplitude limit value into the CLAHE algorithm, and then uses the CLAHE algorithm to perform enhancement processing on the preset image to obtain a second enhanced image.
In some embodiments, the image processing apparatus divides the preset image into at least one target image block that does not overlap according to the target image block size value; performing histogram statistics and normalization on each target image block in at least one target image block to obtain a normalized target histogram; according to the target cutting amplitude limiting value, cutting the normalized target histogram to obtain a cut target histogram and a cut target histogram; redistributing the cut histogram to the gray level of the cut target histogram to obtain a balanced target histogram; and performing gray level bilinear difference on the preset image by using the equalized target histogram to obtain an enhanced image.
The image processing device obtains a normalized target histogram of each target image block; according to the target cutting amplitude limiting value, sequentially cutting and redistributing the normalized target histogram to obtain a balanced target histogram; and carrying out gray level bilinear difference on the preset image by utilizing the equalized target histograms corresponding to all the target image blocks to obtain an enhanced image.
It should be noted that the implementation process of the image processing apparatus dividing the preset image into at least one non-overlapping target image block according to the size value of the target image block is the same as the implementation process of dividing the preset image into at least one non-overlapping image block according to each size value of the image block, and details are not repeated here.
In some embodiments, an image processing method as shown in fig. 4, the image processing method comprising:
s301, acquiring an initial clipping amplitude limit value of 2/256, and size values of at least two image blocks of 8, 16, 32, 64, 128, 256 and 512;
s302, dividing a preset image into at least one non-overlapping first image block according to each image block size value in at least two image block sizes; sequentially performing histogram statistics, normalization, clipping and integration on each first image block in at least one first image block by using the initial clipping amplitude limit value to obtain a first contrast stretching curve corresponding to each first image block; processing at least one first image block by using a first contrast stretching curve to obtain an information entropy corresponding to each image block size value, and further obtaining information entropies corresponding to at least two image block size values, wherein the information entropies are respectively as follows: e _8, E _16, E _32, E _64, E _128, E _258, E _ 512;
s303, fitting the gamma curve by using a plurality of coordinates (8, E _8), (16, E _16), (32, E _32), (64, E _64), (128, E _128), (256, E _258), (512, E _512) to obtain a first curve equation corresponding to the gamma curve; calculating the inflection point coordinate of the first curve equation; an abscissa in the inflection point coordinates of the first curve equation is taken as a target image BLOCK SIZE value (target BLOCK _ SIZE);
s304, acquiring an initial image block size value of 32, wherein at least two clipping limiting values are 0.4/256, 0.8/256, 1.2/256, 1.6/256, 2.0/256, 2.4/256, 2.8/256, 3.2/256, 3.6/256 and 4.0/256;
s305, dividing the preset image into at least one non-overlapping second image block according to the size value of the initial image block; sequentially performing histogram statistics, normalization, clipping and integration on each second image block in the at least one second image block by using each clipping amplitude limit value in the at least two clipping amplitude limit values to obtain a second contrast stretching curve corresponding to each second image block; processing at least one second image block by using a second contrast stretching curve to obtain information entropy corresponding to each cutting amplitude limit value; and then the information entropies corresponding to the at least two clipping amplitude limiting values are respectively obtained as follows: e _0.4, E _0.8, E _1.2, E _1.6, E _2.0, E _2.4, E _2.8, E _3.2, E _3.6, E _ 4.0;
it should be noted that the second of the first and second image blocks in the first image block is only used to indicate that the image block is obtained by dividing according to different image block size values; the second of the first and second contrast stretch curves in the first contrast stretch curve is only used to indicate that the contrast stretch curve corresponds to a different image block.
S306, fitting the gamma curve by using a plurality of coordinates (0.4/256, E _0.4), (0.8/256, E _0.8), (1.2/256, E _1.2), (1.6/256, E _1.6), (2.0/256, E _2.0), (2.4/256, E _2.4), (2.8/256, E _2.8), (3.2/256, E _3.2), (3.6/256, E _3.6) and (4.0/256, E _4.0) to obtain a second curve equation corresponding to the gamma curve; calculating the inflection point coordinate of the second curve equation; taking an abscissa in the inflection point coordinates of the second curve equation as a target clipping LIMIT value (target CLIMP _ LIMIT);
s307, enhancing the preset image according to the target BLOCK _ SIZE, the target CLIMP _ LIMIT and the CLAHE algorithm to obtain a second enhanced image.
It should be noted that fig. 4 does not limit the execution sequence of steps S301 to S303 and steps S304 to S306, and steps S301 to S303 and steps S304 to S306 may be executed simultaneously, or steps S304 to S306 may be executed first, and then steps S301 to S303 are executed.
It can be understood that, the image processing apparatus obtains, based on an initial value of one of the clipping limiting parameter and the image block size parameter, an image quality evaluation value corresponding to each of a plurality of reference values of the other of the clipping limiting parameter and the image block size parameter, and performs curve fitting on the plurality of reference values and the image quality evaluation values corresponding to each of the reference values to determine a target value of the maximum image quality evaluation value; the target value is determined by fitting a curve through a plurality of reference values, the numerical value does not need to be adjusted step by step, the acquisition speed of the target value is increased, namely the processing speed of the image is increased, secondly, the target value corresponds to the maximum image quality evaluation value, namely the target value is the numerical value which enables the image quality evaluation value of the image to be maximum, and then the target value of one parameter in the CLAHE algorithm and the CLAHE algorithm is used for enhancing the preset image, so that the image quality of the obtained first enhanced image is good, and the processing effect of the image is improved.
Example two
The further description will be made based on the same inventive concept of the first embodiment.
An embodiment of the present application provides an image processing apparatus, and as shown in fig. 5, an image processing apparatus 3 includes:
an obtaining module 31, configured to obtain an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; wherein, the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other one of the clipping amplitude limiting parameter and the image block size parameter;
the target determining module 32 is configured to perform image processing and quality evaluation on a preset image based on the initial value and each of the at least two reference values to obtain an image quality evaluation value corresponding to each reference value; performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value;
and the image processing module 33 is configured to perform enhancement processing on the preset image by using a target value of the parameter to be optimized and a contrast-limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
In some embodiments, the obtaining module 31 is further configured to perform curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the largest image quality evaluation value, and then interchange the fixed parameter and the parameter to be optimized to obtain an interchanged fixed parameter and an interchanged parameter to be optimized;
the target determining module 32 is further configured to continue to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized, so as to obtain a target value of the interchanged parameters to be optimized, where the image quality evaluation value is the largest;
the image processing module 33 is further configured to perform enhancement processing on the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after the interchange, and the contrast-limiting adaptive histogram equalization algorithm, so as to obtain a second enhanced image.
In some embodiments, the target determining module 32 is further configured to divide the preset image into at least one image block that does not overlap according to each of the at least two reference values; performing histogram clipping and integration on each image block in at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block; and stretching at least one image block by using the contrast stretching curve to obtain an image quality evaluation value.
In some embodiments, the target determining module 32 is further configured to perform histogram statistics and normalization on each image block to obtain a normalized histogram; and according to the initial value, cutting and integrating the normalized histogram to obtain a contrast stretching curve.
In some embodiments, the target determining module 32 is further configured to perform gray scale stretching on a corresponding image block in the at least one image block by using a contrast stretching curve, so as to obtain a stretched image block; carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block so as to obtain the information entropy of at least one image block; and averaging the information entropy of at least one image block to obtain an image quality evaluation value.
In some embodiments, the target determining module 32 is further configured to perform gray scale stretching on at least one image block in the preset image by using a contrast stretching curve, so as to obtain a stretched first image; and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain an image quality evaluation value.
In some embodiments, the target determining module 32 is further configured to obtain an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curves; weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block; performing gray scale stretching on at least one image block in the preset image by using the weighted contrast stretching curve to obtain a stretched second image; and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain an image quality evaluation value.
In some embodiments, the target determining module 32 is further configured to fit a gamma curve with the at least two reference values as an abscissa and the image quality evaluation value as an ordinate to obtain a curve equation; performing second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero; and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
In some embodiments, when the fixed parameter is a clipping amplitude limiting parameter and the parameter to be optimized is an image block size parameter, the exchanged fixed parameter is an image block size parameter, and the exchanged parameter to be optimized is a clipping amplitude limiting parameter;
and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are the image block size parameters.
In practical applications, the obtaining module 31, the target determining module 32 and the image Processing module 33 can be implemented by a processor 34 located on the image Processing apparatus 3, specifically, implemented by a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal Processing) or a Field Programmable Gate Array (FPGA).
An embodiment of the present application further provides an image processing apparatus, as shown in fig. 6, where the image processing apparatus 3 includes: a processor 34, a memory 35 and a communication bus 36, the memory 35 communicating with the processor 34 via the communication bus 36, the memory 35 storing one or more programs executable by the processor 34, the one or more programs, when executed, causing the processor 34 to perform any one of the image processing methods according to the first embodiment.
The present embodiment provides a computer-readable storage medium, which stores one or more programs, where the one or more programs are executable by one or more processors 34, and when the program is executed by the processor 34, the program implements any one of the image processing methods according to the first embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.

Claims (20)

1. An image processing method, characterized in that the method comprises:
acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other of the clipping amplitude limiting parameter and the image block size parameter;
based on the initial value and each reference value of the at least two reference values, performing image processing and quality evaluation on a preset image to obtain an image quality evaluation value corresponding to each reference value;
performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the maximum image quality evaluation value;
and enhancing the preset image by using the target value of the parameter to be optimized and a contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
2. The method according to claim 1, wherein after the curve fitting of the at least two reference values and the image quality evaluation value to obtain the target value of the parameter to be optimized with the largest image quality evaluation value, the method further comprises:
interchanging the fixed parameters and the parameters to be optimized to obtain interchanged fixed parameters and interchanged parameters to be optimized;
continuing to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized to obtain a target value of the interchanged parameters to be optimized with the maximum image quality evaluation value;
and enhancing the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after interchange and a contrast limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
3. The method according to claim 1 or 2, wherein the performing image processing and quality evaluation on the preset image based on the initial value and each of the at least two reference values to obtain an image quality evaluation value corresponding to each reference value comprises:
dividing the preset image into at least one non-overlapping image block according to each of the at least two reference values;
performing histogram clipping and integration on each image block in the at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block;
and stretching the at least one image block by using the contrast stretching curve to obtain the image quality evaluation value.
4. The method according to claim 3, wherein the histogram clipping and integrating each image block of the at least one image block using the initial value to obtain a contrast stretching curve corresponding to each image block comprises:
performing histogram statistics and normalization on each image block to obtain a normalized histogram;
and according to the initial value, cutting and integrating the normalized histogram to obtain the contrast stretching curve.
5. The method according to claim 3, wherein the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value comprises:
performing gray scale stretching on a corresponding image block in the at least one image block by using the contrast stretching curve to obtain a stretched image block;
carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block, and further obtain the information entropy of at least one image block;
and averaging the information entropy of the at least one image block to obtain the image quality evaluation value.
6. The method according to claim 3, wherein the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value comprises:
performing gray scale stretching on the at least one image block in the preset image by using the contrast stretching curve to obtain a stretched first image;
and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain the image quality evaluation value.
7. The method according to claim 3, wherein the stretching the at least one image block using the contrast stretching curve to obtain the image quality evaluation value comprises:
obtaining an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curves;
weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block;
performing gray scale stretching on the at least one image block in the preset image by using the weighted contrast stretching curve to obtain a stretched second image;
and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain the image quality evaluation value.
8. The method according to any one of claims 1 to 7, wherein the curve fitting the at least two reference values and the image quality evaluation value to obtain the target value of the parameter to be optimized with the largest image quality evaluation value comprises:
fitting a gamma curve by taking the at least two reference values as abscissa and the image quality evaluation value as ordinate to obtain a curve equation;
performing second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero;
and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
9. The method of claim 2,
when the fixed parameters are clipping amplitude limiting parameters and the parameters to be optimized are image block size parameters, the exchanged fixed parameters are image block size parameters, and the exchanged parameters to be optimized are clipping amplitude limiting parameters;
and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are image block size parameters.
10. An image processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring an initial value of a fixed parameter and at least two reference values of a parameter to be optimized; the fixed parameter is one of a clipping amplitude limiting parameter and an image block size parameter, and the parameter to be optimized is the other of the clipping amplitude limiting parameter and the image block size parameter;
the target determining module is used for carrying out image processing and quality evaluation on a preset image based on the initial value and each reference value of the at least two reference values to obtain an image quality evaluation value corresponding to each reference value; performing curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with the maximum image quality evaluation value;
and the image processing module is used for enhancing the preset image by utilizing the target value of the parameter to be optimized and the contrast limiting adaptive histogram equalization algorithm to obtain a first enhanced image.
11. The apparatus of claim 10,
the obtaining module is further configured to perform curve fitting on the at least two reference values and the image quality evaluation value to obtain a target value of the parameter to be optimized with a maximum image quality evaluation value, and then interchange the fixed parameter and the parameter to be optimized to obtain an interchanged fixed parameter and an interchanged parameter to be optimized;
the target determining module is further configured to continue to perform image processing, quality evaluation and curve fitting on the interchanged fixed parameters and the interchanged parameters to be optimized to obtain a target value of the interchanged parameters to be optimized, where the image quality evaluation value is the largest;
the image processing module is further configured to perform enhancement processing on the preset image by using the target value of the parameter to be optimized, the target value of the parameter to be optimized after the interchange, and a contrast-limiting adaptive histogram equalization algorithm to obtain a second enhanced image.
12. The apparatus of claim 10 or 11,
the target determination module is further configured to divide the preset image into at least one non-overlapping image block according to each of the at least two reference values; performing histogram clipping and integration on each image block in the at least one image block by using the initial value to obtain a contrast stretching curve corresponding to each image block; and stretching the at least one image block by using the contrast stretching curve to obtain the image quality evaluation value.
13. The apparatus of claim 12,
the target determination module is further configured to perform histogram statistics and normalization on each image block to obtain a normalized histogram; and according to the initial value, cutting and integrating the normalized histogram to obtain the contrast stretching curve.
14. The apparatus of claim 12,
the target determination module is further configured to perform gray scale stretching on a corresponding image block in the at least one image block by using the contrast stretching curve to obtain a stretched image block; carrying out gray scale probability statistics and information entropy calculation on the stretched image blocks to obtain the information entropy of each image block, and further obtaining the information entropy of at least one image block; and averaging the information entropy of the at least one image block to obtain the image quality evaluation value.
15. The apparatus of claim 12,
the target determination module is further configured to perform gray scale stretching on the at least one image block in the preset image by using the contrast stretching curve to obtain a stretched first image; and carrying out gray level probability statistics and information entropy calculation on the stretched first image to obtain the image quality evaluation value.
16. The apparatus of claim 12,
the target determination module is further configured to obtain an adjacent contrast stretching curve corresponding to each image block based on the contrast stretching curves; weighting and summing the adjacent contrast stretching curves to obtain a weighted contrast stretching curve corresponding to each image block; performing gray scale stretching on the at least one image block in the preset image by using the weighted contrast stretching curve to obtain a stretched second image; and carrying out gray level probability statistics and information entropy calculation on the stretched second image to obtain the image quality evaluation value.
17. The apparatus according to any one of claims 10 to 16,
the target determination module is further configured to fit a gamma curve with the at least two reference values as abscissa and the image quality evaluation value as ordinate to obtain a curve equation; performing second-order derivation on the curve equation, and determining an inflection point coordinate with a second-order derivative of zero; and taking the reference value corresponding to the inflection point coordinate as the target value of the parameter to be optimized.
18. The apparatus of claim 11,
when the fixed parameters are clipping amplitude limiting parameters and the parameters to be optimized are image block size parameters, the exchanged fixed parameters are image block size parameters, and the exchanged parameters to be optimized are clipping amplitude limiting parameters;
and when the fixed parameters are image block size parameters and the parameters to be optimized are clipping amplitude limiting parameters, the interchanged fixed parameters are the clipping amplitude limiting parameters, and the interchanged parameters to be optimized are image block size parameters.
19. An image processing apparatus characterized by comprising: a processor, a memory, and a communication bus, the memory in communication with the processor through the communication bus, the memory storing one or more programs executable by the processor, the processor performing the method of any of claims 1-9 when the one or more programs are executed.
20. A computer-readable storage medium, having one or more programs stored thereon, the one or more programs being executable by one or more processors to perform the method of any of claims 1-9.
CN201911236238.3A 2019-12-05 2019-12-05 Image processing method and apparatus, and storage medium Pending CN111127341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911236238.3A CN111127341A (en) 2019-12-05 2019-12-05 Image processing method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911236238.3A CN111127341A (en) 2019-12-05 2019-12-05 Image processing method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
CN111127341A true CN111127341A (en) 2020-05-08

Family

ID=70496170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911236238.3A Pending CN111127341A (en) 2019-12-05 2019-12-05 Image processing method and apparatus, and storage medium

Country Status (1)

Country Link
CN (1) CN111127341A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709560A (en) * 2021-03-31 2021-11-26 腾讯科技(深圳)有限公司 Video editing method, device, equipment and storage medium
CN113763281A (en) * 2021-09-17 2021-12-07 无锡睿勤科技有限公司 Gamma curve adjusting method and device
CN113992850A (en) * 2021-10-20 2022-01-28 上海闻泰电子科技有限公司 ISP-based image processing method and device, storage medium and camera equipment
CN116363148A (en) * 2022-06-21 2023-06-30 上海玄戒技术有限公司 Image processing method, device, chip and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463816A (en) * 2014-12-02 2015-03-25 苏州大学 Image processing method and device
CN105654438A (en) * 2015-12-27 2016-06-08 西南技术物理研究所 Gray scale image fitting enhancement method based on local histogram equalization
CN105825485A (en) * 2016-03-30 2016-08-03 努比亚技术有限公司 Image processing system and method
US20160335750A1 (en) * 2013-12-07 2016-11-17 Razzor Technologies Inc. Adaptive contrast in image processing and display
CN106997583A (en) * 2017-03-10 2017-08-01 江苏帝集团有限公司 A kind of underwater robot adaptive image enhancement and feature extracting method
US20180204305A1 (en) * 2015-12-11 2018-07-19 Shanghai United Imaging Healthcare Co., Ltd. System and method for image reconstruction
CN109472759A (en) * 2018-11-23 2019-03-15 中国科学院长春光学精密机械与物理研究所 A kind of method, apparatus of adaptive image enhancement, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160335750A1 (en) * 2013-12-07 2016-11-17 Razzor Technologies Inc. Adaptive contrast in image processing and display
CN104463816A (en) * 2014-12-02 2015-03-25 苏州大学 Image processing method and device
US20180204305A1 (en) * 2015-12-11 2018-07-19 Shanghai United Imaging Healthcare Co., Ltd. System and method for image reconstruction
CN105654438A (en) * 2015-12-27 2016-06-08 西南技术物理研究所 Gray scale image fitting enhancement method based on local histogram equalization
CN105825485A (en) * 2016-03-30 2016-08-03 努比亚技术有限公司 Image processing system and method
CN106997583A (en) * 2017-03-10 2017-08-01 江苏帝集团有限公司 A kind of underwater robot adaptive image enhancement and feature extracting method
CN109472759A (en) * 2018-11-23 2019-03-15 中国科学院长春光学精密机械与物理研究所 A kind of method, apparatus of adaptive image enhancement, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
付青青;杨立华;付建栋;吴爱平;: "基于限定对比度直方图均衡的超声测井图像增强方法", no. 03, pages 47 - 51 *
兰太吉: "数字域TDI CMOS遥感相机高动态高灵敏成像技术研究", vol. 2018, no. 10, pages 140 - 34 *
杨卫中;徐银丽;乔曦;饶伟;李道亮;李振波;: "基于对比度受限直方图均衡化的水下海参图像增强方法", no. 06, pages 205 - 211 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709560A (en) * 2021-03-31 2021-11-26 腾讯科技(深圳)有限公司 Video editing method, device, equipment and storage medium
CN113709560B (en) * 2021-03-31 2024-01-02 腾讯科技(深圳)有限公司 Video editing method, device, equipment and storage medium
CN113763281A (en) * 2021-09-17 2021-12-07 无锡睿勤科技有限公司 Gamma curve adjusting method and device
CN113763281B (en) * 2021-09-17 2023-12-12 无锡睿勤科技有限公司 Gamma curve adjustment method and device
CN113992850A (en) * 2021-10-20 2022-01-28 上海闻泰电子科技有限公司 ISP-based image processing method and device, storage medium and camera equipment
WO2023065523A1 (en) * 2021-10-20 2023-04-27 上海闻泰电子科技有限公司 Isp-based image processing method and apparatus, storage medium, and camera device
CN116363148A (en) * 2022-06-21 2023-06-30 上海玄戒技术有限公司 Image processing method, device, chip and storage medium
CN116363148B (en) * 2022-06-21 2024-04-02 上海玄戒技术有限公司 Image processing method, device, chip and storage medium

Similar Documents

Publication Publication Date Title
CN111127341A (en) Image processing method and apparatus, and storage medium
CN109191395B (en) Image contrast enhancement method, device, equipment and storage medium
CN109272016B (en) Target detection method, device, terminal equipment and computer readable storage medium
CN110969046B (en) Face recognition method, face recognition device and computer-readable storage medium
CN108133463B (en) Noise reduction method and system for histogram equalization image
US9418410B2 (en) Image processing apparatus and method thereof
CN109743473A (en) Video image 3 D noise-reduction method, computer installation and computer readable storage medium
CN111062884B (en) Image enhancement method and device, storage medium and terminal equipment
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
CN108564541B (en) Image processing method and device
CN109309826B (en) Image color balancing method and device, terminal equipment and readable storage medium
CN108961260B (en) Image binarization method and device and computer storage medium
CN111127343B (en) Histogram double-control infrared image contrast enhancement method
US20240005468A1 (en) Image distortion evaluation method and apparatus, and computer device
CN111062897B (en) Image equalization method, terminal and storage medium
JP2017098677A5 (en) Image processing apparatus, image processing method, and program
CN110866043A (en) Data preprocessing method and device, storage medium and terminal
CN114219774B (en) Image quality evaluation method, device, terminal and computer readable storage medium
CN114066783A (en) Tone mapping method, tone mapping device, electronic equipment and storage medium
CN110505485B (en) Motion compensation method, motion compensation device, computer equipment and storage medium
CN113808045A (en) Image brightness adjusting method and device
CN113688937A (en) Image processing method and device and storage medium
KR101617551B1 (en) Image processing method and system for improving face detection
CN110895789B (en) Face beautifying method and device
CN108447037B (en) Method and device for enhancing dynamic range of image

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