CN113436103A - Tone and contrast mapping method based on optimal human vision - Google Patents

Tone and contrast mapping method based on optimal human vision Download PDF

Info

Publication number
CN113436103A
CN113436103A CN202110723411.3A CN202110723411A CN113436103A CN 113436103 A CN113436103 A CN 113436103A CN 202110723411 A CN202110723411 A CN 202110723411A CN 113436103 A CN113436103 A CN 113436103A
Authority
CN
China
Prior art keywords
image
contrast
tone
equation
expectation
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.)
Withdrawn
Application number
CN202110723411.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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202110723411.3A priority Critical patent/CN113436103A/en
Publication of CN113436103A publication Critical patent/CN113436103A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • 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/10024Color image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention provides an optimal tone and contrast mapping method based on optimal human vision, which is characterized in that a linear programming-based optimal tone and contrast mapping method is provided, a quantized image enhancement process with a more accurate contrast expectation function and tone distortion degree is defined, the histogram equalization and planning problem in the image enhancement algorithm in the prior art is converted into a problem of solving the maximum contrast expectation function value under a specific constraint condition, and the maximum value of a target function is solved based on an improved simplex method.

Description

Tone and contrast mapping method based on optimal human vision
Technical Field
The invention relates to a tone and contrast mapping method for human vision, in particular to a tone and contrast mapping method based on optimal human vision, and belongs to the technical field of tone contrast mapping.
Background
From the perspective of the human eye, contrast is a difference that can distinguish an object from the background and other things. In the field of image perception, i.e. for the human visual system HVS, contrast is defined as the difference in color and brightness from the background and surroundings. The human eye is more sensitive to contrast than to absolute brightness. Therefore, for human beings, the contrast plays an important role in human understanding of an image, generally, the contrast of an original image is far from the contrast of an ideal image, which is caused by many reasons, such as insufficient exposure, low quality imaging equipment, wrong use of the imaging equipment when a user takes a picture, or aging of some materials, etc., which are all reasons for the unsatisfactory contrast of the image, so that image enhancement and contrast enhancement become necessary to enable the human beings to better understand and perceive the image.
The contrast enhancement techniques for images can be divided into two categories, the first being algorithms that are related to pixel location and the second being algorithms that are unrelated to pixel location. In the algorithm related to the pixel position, the definition of the contrast is the brightness change rate of the adjacent pixel, so the method for enhancing the contrast directly changes the correlation between the local pixel and the pixel, for example, the edge enhancement and the high-frequency component filter belong to the algorithms related to the pixel, but the algorithms are easy to generate some artificial noises, such as ringing noises, and amplify the original noise points in some images in the process of processing the images; the second kind of algorithm is an enhancement algorithm irrelevant to the positions of the pixel points, from another point of view, the method does not need to specifically adjust the relation between each pixel point, and some better algorithms absorb the advantages of a plurality of statistical subjects. The most important consideration of the pixel position-independent algorithm is to propose a stricter constraint condition to enhance the image, and sometimes, the two algorithms are considered to be combined together for achieving a better effect.
In the current pixel point-independent algorithm, one of the mainstream algorithms in the prior art is a gray value transfer method, the method firstly knows the histogram characteristics of the graph to be processed, and adopts some transfer equations which are adaptive to the image histogram to process the image, such as piecewise linear mapping, a transfer equation similar to a Log type function and an exponential type transfer equation. The parameter setting and the selection of the transfer equation of the processing methods are selected on the basis of knowing the image, and if the distribution condition of the image histogram is not known in advance, the processing effect of the algorithms is greatly reduced. Therefore, in order to process the graphics without knowing the image in advance, a histogram equalization method is provided, the algorithm is simple and easy to implement, the histogram equalization is mainly to equalize the histogram of the whole image and to expand the histogram of the image to a wider range, the histogram equalization has the advantages that the gray level histogram information of the image does not need to be acquired in advance, and the calculation process is relatively simple. However, if the histogram equalization is used to process the image only by a simple machine without any constraint, the processed image will generate some excessive amplification, and some narrower gray values in the original image will be spread to a wider area, which may cause large-area shadow or large-area brightness increase. Moreover, such mechanical processing can cause loss of original statistical information of the image, and change parameters such as average value, energy, covariance and the like of the image. Histogram equalization is an undesirable approach when processing images, because the average of the histogram makes the overall average gray level closer to the middle of the gray level, resulting in a shift of the original gray level average value, when the image has some brightness requirements. The prior art provides a method for ensuring the original average gray level intensity, which divides an image histogram into two parts according to the gray level average value of an input image, the histograms of the two parts are independent of each other, the gray level average value of the processed image keeps the gray level average value of the original image, although the deviation of the gray level average value of the image can be avoided as much as possible when the image is processed compared with the traditional histogram equalization, the maintenance of the gray level average value of the original image does not ensure the naturalness of the gray level value.
In combination with the deficiencies in prior art tone and contrast mapping, the difficulties and problems solved by the present invention are mainly focused on the following:
first, two key parameters of the image presentation: the contrast expectation and the hue distortion degree are in a pair of contradiction, the too high contrast expectation does not represent high image quality, the too low hue distortion degree does not represent high image quality, the prior art cannot construct a correlation mechanism and cannot balance the contradiction, when the whole image is dark, only the whole image is brightened, some details which are outstanding are not highlighted, namely, the difference between adjacent gray values is not enhanced while the image brightness is improved, the visual effect of the image is poor, the contrast between the adjacent gray values is increased while the average brightness of the whole image is increased, the combination of light and shade is poor, higher detail information in the image cannot be highlighted, the expressive force of the image is poor, the distortion degree of the image cannot be considered, and the enhancement effect of the image is not well matched with a human visual system;
secondly, in the algorithm for enhancing the contrast of the image and correlating the positions of the pixels in the prior art, the definition of the contrast is the brightness change rate of the adjacent pixels, so that the method for enhancing the contrast directly changes the correlation between the local pixels and the pixels, but the algorithm is easy to generate artificial noise, such as ringing noise, and amplify original noise points in some images in the process of processing the image; the enhancement algorithm irrelevant to the positions of the pixels does not need to specifically adjust the relation between each pixel, and achieves the purpose of image enhancement by adjusting the direct distance between the gray value with higher frequency in the histogram of the input image and the adjacent gray value, namely the enhancement algorithm irrelevant to the positions of the pixels mainly aims at increasing the distance between the gray values to be changed to achieve the enhancement effect, but needs stricter constraint conditions to enhance the image, the method has poor universality, needs a large amount of manual participation, and the enhancement effect of the image does not accord with the human visual system;
thirdly, the prior art compares the mainstream gray value transfer methods, the parameter setting of these processing methods and the selection of the transfer equation are all selected on the basis of knowing the image, if the distribution of the image histogram is not known in advance, the processing effect of these algorithms will be greatly reduced, in order to be able to process the image under the condition of not knowing the image in advance, the histogram equalization method is proposed, the histogram equalization does not need to acquire the gray histogram information of the image in advance, and the calculation process is relatively simple, but if the histogram equalization is used only in a simple machine without any constraint, the processed image will generate some excessive amplification, some narrower gray values in the original image will be expanded to a wider area, which may cause large-area shadows, or cause large-area brightness improvement, moreover, the mechanical processing can cause the loss of original statistical information of the image, change parameters such as the average value, energy, covariance and the like of the image, and the average gray value of the whole is closer to the middle value of the gray due to the averaging of the histogram, thereby causing the movement of the average value of the original gray;
fourthly, the prior art provides a method for ensuring the original average gray level intensity, the whole image is divided into two parts according to the gray level average value of the input image, the histograms of the two parts are mutually independent, the gray level average value of the processed image keeps the gray level average value of the original image, although the method can avoid the deviation of the image gray level average value as much as possible when the image is processed compared with the traditional histogram equalization, the gray level average value of the original image is not ensured to be the naturalness of the gray level value, the image is not naturally processed, the method is difficult to be applied to the actual working environment, the algorithm debugging time is long, the parameter control is tedious, the real-time image accurate analysis cannot be carried out, and the algorithm portability is poor.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a tone and contrast mapping method based on the optimal human vision, which is based on two key parameters presented by an image: the contrast expectation and the tone distortion degree are a pair of contradiction, the over-high contrast expectation does not represent high image quality, and the over-low tone distortion degree does not represent high image quality.
In order to achieve the technical effects, the technical scheme adopted by the invention is as follows:
the tone and contrast mapping method based on the optimal human vision comprises the steps of constructing a relation between contrast expectation and transfer equation and tone distortion and optimal tone and contrast mapping based on linear programming, defining a contrast expectation solving function through the transfer equation, describing the relation between a histogram and image enhancement by using a mathematical equation, defining the tone distortion to constrain the contrast expectation solving function based on high contrast and not representing good visual effect, and providing the optimal tone and contrast mapping method, so that the image details appearing at high frequency are accurately and effectively highlighted, and the enhanced image is more in line with a human vision system;
constructing a relationship between contrast expectation, transfer equation and hue distortion includes: contrast expectation setting, transfer equation design, contrast expectation solving function and image enhancement relation, tone distortion degree setting, and two key parameters presented by an image: the contrast expectation and the hue distortion are a pair of contradictions for two factors of human eyes, and the contradiction between the two factors is solved by constructing a correlation mechanism and balancing the contradiction by a transfer equation of an image, and simultaneously, the required higher image quality is achieved;
the optimal hue and contrast mapping based on linear programming comprises: describing an optimal tone and contrast mapping method, improving a simplex method, optimizing optimal tone and contrast mapping, providing an algorithm to solve a relatively optimal solution between tone and contrast parameters, describing the optimal tone and contrast mapping method based on linear programming, and providing a solving method of a problem to realize optimal contrast and tone mapping of the whole image;
the optimal tone and contrast mapping method based on linear programming converts the histogram equalization and planning problem in the image enhancement algorithm of the prior art into the problem of solving the maximum contrast expectation to obtain a function value under a specific constraint condition by defining a quantized image enhancement process with a more accurate contrast expectation to obtain a function and a more accurate tone distortion degree, solves the maximum value of a target function based on an improved simplex method, gives consideration to the distortion degree of an image in the enhancement process, ensures that the enhancement effect of the image is more matched with a human eye visual system, controls the tone distortion degree and has a better visual effect.
Based on the tone and contrast mapping method of the optimal human vision, further, the contrast expectation setting is as follows: assuming that a gray-scale value image J with a pixel depth of e has a gray-scale histogram distribution of L and the number of non-zero gray-scale levels in the gray-scale histogram is W, a mathematical expression xwRepresenting gray values, x, with gray values other than 00<x1<…<xW-1 0<W≤H=2eLet p stand forwIs a gray value of xwAnd 0 ≦ W < W, then the contrast of the defined image J is expected to be:
Figure BDA0003137189990000041
by analyzing the contrast expectation formula, the maximum contrast expectation is SmaxH-1, i.e. the image is a black and white binary image, and x0=0,x1When the image is a constant value image, the minimum contrast is desirably S-1minIf the dynamic range of the histogram occupies the whole histogram space, i.e. in the whole histogram distribution space, each gray value will have corresponding pixel point, i.e. when W is H, x is Hw-xw-1The contrast expectation can ignore the distribution of the probability of gray values, and the contrast expectation S is 1 if xW-xW-1Where a > 1.0 ≦ W < H, then the contrast is desirably S ═ a.
The tone and contrast mapping method based on the optimal human vision, further,designing a transfer equation: for an image, the contrast of the image is enhanced, namely the distance between two adjacent nonzero gray values in a histogram of the image is increased, the histogram distribution of the image is readjusted through a corresponding mapping relation, the input before mapping is assumed to be H, namely the histogram distribution of the image to be processed, and the output after mapping through a transfer equation is H*Obtaining a histogram distribution of the processed image, such a conversion from H to H by some calculation*Is a transfer equation, which is expressed by equation 2:
R:{0,1,…H-1}→{0,1...H*-1} formula 2
In this transfer equation, in order to make the image conform to the psychology and physiology vision of human eyes, the transfer equation obtained after processing the image must be monotonously non-decreasing, in the global processing of the image, the relationship holds, in the local processing of the image, the relationship holds, namely the transfer equation can not reverse the histogram arrangement of the original image, when i > j, R (i) ≧ R (j) is expressed by the mathematical formula, and the transfer equation is expressed by formula 3:
Figure BDA0003137189990000051
in equation 3, the last inequality ensures that the dynamic range of the output does not exceed R (j), equation 2 is a generalized transfer equation definition, ciThe histogram distribution of the output image only needs to consider the histogram distribution of the image, but does not need to carefully calculate the gray value of each pixel point, and a transfer equation is completely formed by c ═ { c ═ c0,c1,...cH-1, namely the contrast vector is completely established in the gray level of the input image, and in the establishing process, the invention does not need to consider the relation between each pixel point in the whole image, and only needs to map the gray level value of each pixel point into the corresponding image gray level distribution histogram, so that the solution of the transfer equation has strong performanceAdaptability, the histogram distribution of the image is only needed to be obtained, and the solution of the transfer equation becomes simpler.
Further, the contrast expectation finds the relationship between the function and the image enhancement: obtaining a new histogram of the image through a histogram transfer equation of the image, inputting the image into the transfer equation to obtain the image with the characteristics of the transfer equation, and based on the contrast expectation of the image, if the contrast expectation value of the output image is larger, the contrast presented by the final image is larger;
combining a transfer equation with a contrast expectation, guiding the construction of the transfer equation through the contrast expectation, acting on the whole image through the transfer equation to obtain an image different from the contrast expectation of the original image, and defining a formula of a contrast expectation solving function through a transfer equation R through an equation 3, namely:
Figure BDA0003137189990000052
piis the probability of the occurrence of a gray value i in the image, c0Not added to the calculation, i.e. when the contrast expectation is obtained, c0Without participation, will c0Defined as 0, when the gray level is 0, the past gray level mapped by the transfer equation is also 0, so that if there is no other special description, the vector of the contrast expectation is defined as { c }0,c1,...cH-1The process of solving the contrast expectation solving function by analyzing equation 4 is an image enhancement process, ciRepresenting the distance between the current gray value and the forward gray value, and then multiplied by the probability of the current gray value as a weight.
Further, to prove that the solving process is an image enhancement process, the following embodiment is adopted to prove that the mapping method of hue and contrast based on the optimal human vision:
example one, the desired acquisition of maximum contrast is let cw=H*-1, then taking cwHas a maximum probability value of pw=max{pjI0 < j < H, then let c i0, i ≠ w, in which case the contrast expectation is greatest, as evidenced by the reversal of the assumption that a larger gray-scale value is expected when c i0, i ≠ w, because of the constraint conditions
Figure BDA0003137189990000061
cwIs equal to H*1-s, but due to pid+pw(H*-1)≤pw(H*-1) so that the previous assumption can be overruled;
example-to demonstrate the assumption of the present invention that to achieve maximum contrast expectation, the transfer equation is a simple step function, i.e., converting the gray-scale image into a binary image by a threshold value, and assuming that the threshold value is equal to w, then pw=max{p j0 < i < H }, the binary image having a maximum contrast expectation;
since there is a maximum contrast expectation, and conversely there is a minimum contrast expectation, which is relatively simple to obtain with respect to the maximum contrast expectation, it is only necessary to let the transfer equation r (j) be c in 0j0, all values are 0 when all 0 < i < H, so that the expected minimum contrast can be obtained, and the image is a monochrome image in visual perspective, the image does not express any meaning, namely the gray value of the whole image is a constant, the whole image has only one value, the difference of the gray value of the image is 0, and the expected contrast is also 0;
the minimum contrast is expected to be obtained by the transfer equation r (j) ═ v, let c0=v, c i0, 0 < i < H, wherein v is any one of gray values in the original image in the description, and after the description, the image processed by the transfer equation is an image with a single gray value, and the gray value of each pixel is v;
through the analysis of the above embodiments, all embodiments can be obtained by equation 4, and all embodiments are within the preset of the present invention, and the process of obtaining the contrast expectation is the original image enhancement.
Further, the maximum contrast expectation is obtained by continuously analyzing the hue and contrast mapping method based on the optimal human vision through a transfer equation: if the dynamic range of the input image histogram is the same as that of the output image histogram in one image, the mathematical formula expresses that H is H*Then the transfer equation can be derived as t (j) j, which is expressed as c0=0,c j1,0 < i < H, and deriving a contrast expectation f (c) of the image by using the transfer equation, wherein the contrast expectation f (c) of the obtained output image is always 1 no matter how the gray values of the input image are distributed as long as the input and output dynamic ranges of the original image are the same, so that the transfer equation is a neutral transfer equation, and no processing is performed on the input image, and what image is input, what image is obtained by the transfer equation or what image is output by the transfer equation;
transferring the concept of equal input and output dynamic ranges to the concept of unequal input and output, i.e.
Figure BDA0003137189990000062
To express the relationship between the input dynamic range and the output dynamic range, a hue range is defined and expressed by the following mathematical expression t ═ H*-1)/(H-1), defining this hue range, deriving the expression of the transfer equation, i.e.:
Figure BDA0003137189990000063
obtaining a desired function of contrast ratio, F (t1) ═ t, where 1 is a vector of dimensions 1 × (H-1), and each element in the vector is 1;
the method has the advantages that the maximum contrast expectation can be obtained through the contrast expectation function, no constraint exists in the enhancement process, when the maximum contrast expectation is obtained, the gray level image is directly converted into the binary image, the obtained contrast expectation is maximum, but many details of the original image can be lost, and in order to ensure that the image can be correspondingly enhanced after being processed by the transfer equation and also can ensure some characteristics of the original image, other constraint conditions are added to limit the over-enhancement of the transfer equation.
Based on the tone and contrast mapping method of the optimal human vision, further, the tone distortion degree is set as follows: in order to enhance the image and make the tone continuous and fit the features of human eyes, the invention processes the image by balancing the contrast enhancement and tone smoothing, firstly, based on the second embodiment, when F (t.1) ═ t or cjT, 0 < j < H, that is, the interpolation between each adjacent gray-scale values is equal, the mapping relationship is linear mapping, and max min { c is obtained1,c2,…,cH-1It is the minimum value in the vector c that is to be maximized, for which all values in the vector must be equal, to get the optimal solution to this max min problem, as demonstrated below:
because max min c1,c2,…,cH-1All c are necessaryi0 < i < H, all are equal, assuming a counter example, there is cwB and ciG < b, i ≠ w, for max min { c1,c2,…,cH-1Get an optimal solution g, but if c is assumediG + (b-g)/(H-1) to give max min { c +1,c2,…,cH-1The optimal solution max min c1,c2,…,cH-1G + (b-g)/(H-1) > g, yielding a larger value than the optimization, overriding the previous assumptions of the present invention;
example two describes a simple linear transfer equation, but has no effect on the overall contrast enhancement, maximizes the minimum value in c, and can obtain the contrast expectation F (t · 1) ═ t of the linear mapping when the dynamic range of j varies from 0 to H;
in the process of enhancing the image, based on the influence of the visual effect of human eyes, the optimal tone reconstruction requires that the transfer equation meets the max min criterion in the second embodiment, the reason for meeting the criterion is the continuity of the tone, and the interval between every two continuous gray values must be equal in size, so as to ensure the continuity of the tone, and the distortion degree of the defined tone is expressed by the following formula through the given transfer equation R (j):
Figure BDA0003137189990000071
mapping the gray values j and i to a gray value w through a transfer equation, wherein j and i are less than or equal to w, solving the largest one of i and j to obtain the definition of the distortion degree;
the transfer equation is not a one-to-one mapping relationship, and as the distortion of the hue is smaller, the hue reconstructed by the transfer equation is smoother and the continuity of the hue is better, and also by definition, the minimum available distortion of the hue is mincA(C)=max(0,[1/t-1]);
However, the definition of the tone distortion degree is abstract, so that a plurality of gray values cannot be mapped to one gray value excessively, the excessive concentration can cause distortion, and in order to better understand the relationship between the expected acquisition and tone distortion, two extreme cases are considered when the relationship is between
Figure BDA0003137189990000081
In the first example, when the maximum desired contrast is obtained, the distortion of the color tone is calculated as a (c) ═ max { w-1, H-1-w }, and when the distortion is the minimum, the distortion is [ (H-1)/2]In case 2, in order to obtain the minimum distortion, the contrast is desired to be f (c) 1, and the image processed by the transfer equation is not changed;
for an input image, the high contrast requirement and the low distortion requirement are balanced by finding an optimal contrast and tone transfer equation, and the processing of the balanced transfer equation enables the details with high frequency to be displayed more clearly in the original image, and meanwhile, the darker parts in the image are smoother.
Based on the tone and contrast mapping method of the optimal human vision, further, the optimal tone and contrast mapping method is described as follows: further adding a concept of tone reconstruction, and obtaining an ideal contrast expectation solving function through balance consideration of two aspects;
the invention converts the problem into that an optimal gray value distribution method is searched under the constraint condition of the tone distortion degree to solve the process of obtaining the optimal solution of the contrast expectation function, and the constraint ranges of the contrast expectation function and the tone distortion degree are the dynamic range H of the output image*In equation 4, a vector c of a set of input functions1,c2,…,cH-1Representing the dynamic range H of an output*The available allocation resources, each element in the vector is generating a larger output range H through competition*Obtaining an optimal solution, such image enhancement necessarily producing a dynamic range H for the output*In the process of finding the optimal solution, the dynamic range is output
Figure BDA0003137189990000083
The excessive distortion can cause the output picture not to express the information of the input image normally, and great distortion is generated;
in order to clarify the contrast, the relation between the function and the distortion factor is expected to be obtained, and the histogram can be processed to provide the optimal tone and contrast mapping, which is expressed by the formula:
Figure BDA0003137189990000082
the main purpose of the equation of the optimal tone and contrast mapping is to enable some details appearing at high frequency to be clearer, and simultaneously take account of tone smoothness, introduce Lagrangian lambda > 0 to balance the two parameters for enabling tone distortion degree to play a constraint role, and better understand the optimal tone and contrast mapping by checking the relation between the equation of the tone and contrast mapping and the histogram, wherein the checked equation is used for better understanding the mapping of the optimal tone and contrastProvided that the input dynamic range and the output dynamic range are assumed to be equal, i.e. H ═ H*When the histogram of the input image is uniform, i.e. H is equal to the image gray scale range, the solution to get the best tone and contrast mapping is c-1, while it can also be shown that when p is0=p1=…=pH-1The value of the contrast expectation function is f (c) 1, and the transfer equation obtained in this optimal tone-to-contrast mapping process cannot exist such that both the transfer equation r (j) j and the minimum tone distortion min are obtainedcA(c)=0;
In the optimal tone and contrast mapping equation, a (c) is a nonlinear equation for the independent variable c, and it is very difficult to directly solve equation 7, and equation 7 needs to be transformed, and this problem is transformed into a linear programming solution problem, i.e. this problem is transformed into solving the maximum contrast expectation function value under the constraint of the tone distortion condition, and equation 7 is transformed into the following linear programming problem:
Figure BDA0003137189990000091
in the formula 8, (a) (e) (c) (d) is a constraint condition, the constraint condition (a) limits the output dynamic range to fall in the effective area of the image, the constraint condition (b) ensures a monotone non-decreasing characteristic of the transfer equation, the constraint condition (c) specifies an approximate range allowed by the hue distortion degree, and the constraint condition (d) is an upper limit a (c) less than or equal to a of the minimum distortion degree, so when a maximum contrast expectation solving function is solved, the maximum distortion degree of the hue is constrained, the image can be effectively enhanced and can be constrained in a certain range in the enhancing process, and excessive enhancement is prevented;
rewriting equation 8 to a representation of a matrix yields equation 9:
Figure BDA0003137189990000092
in the formula 9, P isA set of vectors consisting of pi cVector of compositions, wherein 0 < i < H, and jthIs a set of elements j, j +1, …, j + a-1, c with a value of 1 in the matrix D, the subscript in equation 9 shows the dimension of the matrix, the relationship between the objective function and the constraint and the variable c is linear, equation 9 does not show the integer constraint of c, the linear programming problem is an integer-based linear programming problem, the transfer equation r (j) is an integer → integer mapping relationship, all the constituent elements exist as integers, but the integer linear programming is an NP problem, in order to make the linear programming problem more favorable for solving, the constraint (D) c in equation 8 is an integer, which is appropriately relaxed, so as to convert equation 8 from an integer linear programming problem into a common linear programming problem, and all the methods that can be used to solve the linear problem after adjustment can be used to solve the problem in equation 8, after solving, the vector c ═ c is obtained1,c2,,cH-1) After the solution of (c), it is easy to convert the non-integer solution into an integer solution, and an integer → integer transfer equation is obtained by the vector c, as shown below:
Figure BDA0003137189990000093
by relaxing the constraint conditions, the objective function cannot be solved maximally in the process of solving the problem, the constraint conditions are not particularly strict, it may happen that the solved solution is not the optimal solution, in order to optimize the linear programming problem maximally, the constraint condition (c) in equation 8 is replaced by the stricter constraint condition (e) in equation 11 below, so that the problem has more powerful constraint, thereby guiding the solving process more accurately, and the linear programming problem is represented again as follows:
Figure BDA0003137189990000101
optimal tone and contrast mapping is achieved based on linear programming.
Based on the tone and contrast mapping method of the optimal human vision, further, the simplex method is improved: solving the optimal contrast expectation tone mapping problem by using an improved simplex method, wherein the problems processed by the simplex method are all converted into a standard problem in the form of MaxZ (SX), wherein S is a group of vectors matched with X, the constraint condition of the standard form is AX (e), and X is more than or equal to 0, and the formula 11 is converted into a standard form required by solving;
first some positive relaxation variables k are addedjJ ═ 1,2, …, (H-1), and the constraint (b) of such inequality changes to the following form:
Figure BDA0003137189990000102
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,kH-1)TWriting converted to standard form is:
Figure BDA0003137189990000103
in equation 13, the coefficient in the objective function is S ═ p (p)1,p2,…,PH-1,0,0,…,0)2H-2D in the constraint is decomposed into two parts D ═ D (D)1,D2) Obtaining:
A1=IL-1
A2=IL-1formula 14
The value of the vector on the right is e ═ (1/a,1/a, …,1/a)H-1After the standard form is obtained, the following steps are used for solving:
the method comprises the following steps: firstly, solve
Figure BDA0003137189990000104
Let xHCalculating g as Sx as 0;
step two: solving for multiplier k, kD S, k SD-1For non-basis vectors, the discriminant z is calculatedi-si=kpi-siLet the discriminant be zw-sw=min{zi-siIf found non-basis vector zw-swIs less than or equal to 0, for zw-swIf the discriminant of the corresponding base variable is less than or equal to 0, stopping calculation, and the currently solved solution is the best solution; if not, jumping to the third step to solve;
step three: dy decompositionw=pwGet yw=A-1pwIf y iswLess than or equal to 0, i.e. ywIs negative or 0, the calculation process is stopped, since the current linear programming problem has been proven not to be a convex one, there is no optimal solution, if y iswIf the value is more than 0, the next calculation is carried out;
the fourth step: the following reference symbol t is determined so that
Figure BDA0003137189990000111
Let xtIs a radical variable, xwFor radical variables, with pwBy changing ptObtaining a new matrix D, then returning to the step one, and continuing to calculate until the best solution is obtained or the solution is determined to be absent in the process, and stopping calculating;
by the above four-step calculation, if the linear programming problem is a convex problem, an optimal solution is found as
Figure BDA0003137189990000112
The problem required by the present invention is solved by
Figure BDA0003137189990000113
Further, the optimal tone and contrast mapping is optimized based on the optimal human vision: converting equation 11 into the standard form required by the modified simplex method, and further obtaining the optimal solution
Figure BDA0003137189990000114
Applying the algorithm to the actual image processing, the invention introduces a new constraint condition to control the maximum value of the step, and the mathematical expression of the constraint condition is as follows:
civ is less than or equal to v, i is more than 0 and less than H is 15
The present invention redefines the function of the optimal tone and contrast mapping as follows:
Figure BDA0003137189990000115
based on the change of the optimal mapping function, when the equation is solved, the used variables are also transformed, but the method is not changed, and the standard form of the function is converted into the following result: first some positive relaxation variables k are addedjJ ═ 1,2, …, (2H-2), the constraint (b) of the inequality varies in the form:
Figure BDA0003137189990000116
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,k2H-2)TThe notation converted to the standard form is the same as equation 13, but the coefficient in the objective function is S ═ p (p)1,p2,…,pH-1,0,0,…,0)3H-3In the constraint, D is also decomposed into two parts, D ═ D (D)1,D2) The method specifically comprises the following steps:
Figure BDA0003137189990000121
the right vector has the value e ═ m (m, m, …, m, n · n, …, n)2H-2After conversion to the standard form, the solution continues using the modified simplex method.
Compared with the prior art, the invention has the following contributions and innovation points:
firstly, the invention provides an optimal tone and contrast mapping method based on linear programming, which converts the histogram equalization and planning problem in the image enhancement algorithm of the prior art into the problem of solving the maximum contrast expectation to obtain a function value under a specific constraint condition by defining a quantized image enhancement process with a more accurate contrast expectation to obtain a function and tone distortion, and solves the maximum value of a target function based on an improved simplex method;
second, two key parameters of the image presentation: contrast expectation and tone distortion are a pair of contradiction, too high contrast expectation does not represent high image quality, too low tone distortion does not represent high image quality, the invention balances contradiction by constructing a correlation mechanism and a transfer equation of an image, simultaneously achieves higher image quality required, realizes the optimal contrast and tone mapping of the whole image, provides a method which is more reliable, convenient, efficient and good in visual effect for image enhancement, is simple and rapid, and more accurate in image enhancement process, and is an image enhancement method which is high in efficiency and quantifiable;
thirdly, when the whole image is darker, the visual effect of the processed image is better, although the histogram equalization improves the whole brightness of the image, the image is only wholly brightened without highlighting some details, namely, the difference value between adjacent gray values is not enhanced while the brightness of the image is improved, so the visual effect of the image is not very good, the image is more fit with the histogram of the original image, the contrast between the adjacent gray values is improved while the average brightness of the whole image is increased, the bright-dark combination is better, and the detail information with higher frequency in the image is highlighted, the transfer equation of the invention is more effective than the transfer equation of the histogram equalization, the mapping relation of different gray values is adjusted by the probability balance of each gray value, so the gray value with higher gray value probability is more widely distributed in the whole gray space, the details of high-frequency occurrence components are enhanced, and the image has better expressive force;
fourthly, through histogram equalization and comparison of the image after mapping processing of the optimal tone and the contrast, in the process of enhancing the image, the invention ensures detail information of the image and has good visual effect, and the image processed by the mapping method of the optimal tone and the contrast is good in visual effect through analysis of all experimental results, thereby enhancing the whole image, having good enhancement effect on the details with higher frequency, increasing the difference value between the gray values of the image, giving consideration to the distortion degree of the image in the enhancement process, and the enhancement effect of the image is more matched with a human visual system, thereby having wide application prospect in the field of image enhancement.
Drawings
Fig. 1 is a schematic diagram illustrating a first embodiment of the present invention.
FIG. 2 is a schematic illustration of equation 6 of the present invention.
Fig. 3 is a schematic diagram of the result obtained by the image enhancement using formula 11 of the present invention.
FIG. 4 is a graph showing the comparison between the histogram equalization method and the method of the present invention.
Fig. 5 is a gray level histogram of the image corresponding to the experimental result of fig. 4.
Fig. 6 is a comparison graph of the results of the histogram equalization and optimal contrast tone mapping process for medical images.
Fig. 7 is a schematic diagram of a histogram and transfer equations of an image corresponding to fig. 6.
Fig. 8 is a comparison graph of the results of the histogram equalization and optimal contrast tone mapping process for a darker image.
Fig. 9 is a grayscale histogram of an image corresponding to fig. 8.
Detailed Description
The following describes the technical solution of the tone and contrast mapping method based on the optimal human vision, which is provided by the present invention, with reference to the accompanying drawings, so that those skilled in the art can better understand the present invention and can implement the present invention.
The invention provides an optimal tone and contrast mapping method based on linear programming, which converts the histogram equalization and programming problems in the image enhancement algorithm in the prior art into the problem of solving the maximum contrast expectation to obtain a function value under a specific constraint condition by defining a quantitative image enhancement process with more accurate contrast expectation to obtain a function and tone distortion, and solves the maximum value of a target function based on an improved simplex method. Compared with histogram equalization, the method has better universality, gives consideration to the distortion degree of the image in the enhancing process, has better visual effect by better matching the enhancing effect of the image with the visual system of human eyes and controlling the tone distortion degree.
The tone and contrast mapping method based on the optimal human vision mainly describes the optimal tone and contrast mapping method based on linear programming, respectively explains key nouns in the method and describes the flow of the whole method, and provides a solving method of the final problem, thereby realizing the optimal contrast and tone mapping of the whole image.
Firstly, constructing the relation between contrast expectation, transfer equation and tone distortion
For the human eye, two key parameters of the image presentation are: the two factors are a pair of contradiction, the expectation of overhigh contrast ratio does not represent high image quality, the distortion of overlow hue does not represent high image quality, and the contradiction between the two factors is solved by constructing a correlation mechanism and balancing the contradiction by a transfer equation of an image, and simultaneously achieving the required high image quality.
(one) contrast desired setting
Assuming that a gray-scale value image J with a pixel depth of e has a gray-scale histogram distribution of L and the number of non-zero gray-scale levels in the gray-scale histogram is W, a mathematical expression xwRepresenting gray values, x, with gray values other than 00<x1<…<xW-10<W≤H=2eLet p stand forwIs a gray value of xwAnd W is more than or equal to 0 and less than W, the contrast of the image J is definedThe degree expectation is:
Figure BDA0003137189990000141
in the above formula, pwIs a gray value of xwThe probability of occurrence. By analyzing the contrast expectation formula, the maximum contrast expectation is SmaxH-1, i.e. the image is a black and white binary image, and x0=0,x1When the image is a constant value image, the minimum contrast is desirably S-1minIf the dynamic range of the histogram occupies the whole histogram space, i.e. in the whole histogram distribution space, each gray value will have corresponding pixel point, i.e. when W is H, x is Hw-xw-1The contrast expectation can ignore the distribution of the probability of gray values, and the contrast expectation S is 1 if xw-xw-1Where a > 1.0 ≦ W < H, then the contrast is desirably S ═ a.
(II) transfer equation design
For an image, the contrast of the image is enhanced, namely the distance between two adjacent nonzero gray values in a histogram of the image is increased, the histogram distribution of the image is readjusted through a corresponding mapping relation, the input before mapping is assumed to be H, namely the histogram distribution of the image to be processed, and the output after mapping through a transfer equation is H*Obtaining a histogram distribution of the processed image, such a conversion from H to H by some calculation*Is a transfer equation, which is expressed by equation 2:
R:{0,1,...H-1}→{0,1...H*-1} formula 2
In this transfer equation, in order to make the image conform to the psychology and physiology vision of human eyes, the transfer equation obtained after processing the image must be monotonously non-decreasing, in the global processing of the image, the relationship holds, in the local processing of the image, the relationship holds, namely the transfer equation can not reverse the histogram arrangement of the original image, when i > j, R (i) ≧ R (j) is expressed by the mathematical formula, and the transfer equation is expressed by formula 3:
Figure BDA0003137189990000142
in equation 3, the last inequality ensures that the dynamic range of the output does not exceed R (j), equation 2 is a generalized transfer equation definition, ciThe histogram distribution of the output image only needs to consider the histogram distribution of the image, but does not need to carefully calculate the gray value of each pixel point, and a transfer equation is completely formed by c ═ { c ═ c0,c1,...cH-1The set of vectors is determined, namely the set of contrast vectors are completely established in the gray level of the input image, and in the establishing process, the invention does not need to consider the relation between each pixel point in the whole image, and only needs to map the gray level value of each pixel point into the corresponding image gray level distribution histogram, so that the solution of the transfer equation has strong adaptability, and only needs to obtain the histogram distribution of the image, and the solution of the transfer equation becomes simpler.
(III) contrast expectation function and image enhancement relation
The new histogram of the image is obtained through the histogram transfer equation of the image, then the image is input into the transfer equation to obtain the image with the characteristics of the transfer equation, and in the process of obtaining the transfer equation, although the transfer equation is only a simple mapping relation, how to map and how to map, what kind of image the invention wants to obtain through the mapping needs to be considered. Based on the contrast expectation of the image of the present invention, if the contrast expectation of the output image is larger, the contrast presented by the final image is also larger, which is also expected by the present invention.
Combining a transfer equation with a contrast expectation, guiding the construction of the transfer equation through the contrast expectation, acting on the whole image through the transfer equation to obtain an image different from the contrast expectation of the original image, and defining a formula of a contrast expectation solving function through a transfer equation R through an equation 3, namely:
Figure BDA0003137189990000151
piis the probability of the occurrence of a gray value i in the image, c0Not added to the calculation, i.e. when the contrast expectation is obtained, c0Does not participate in c0The reason for not participating in the calculation is that: without gray values having a negative value, c0There is no difference from the forward gray value, so c0There is no contribution to the overall contrast expectation function, although c0Not involved in the calculation of the contrast expectation function, but c0There is some influence on the brightness of the whole image, c0Defined as 0, when the gray level is 0, the past gray level mapped by the transfer equation is also 0, so that if there is no other special description, the vector of the contrast expectation is defined as { c }0,c1,...cH-1The process of solving the contrast expectation solving function by analyzing equation 4 is an image enhancement process, ciRepresenting the distance between the current gray value and the forward gray value, and then multiplied by the probability of the current gray value as a weight.
To demonstrate that the solution process is an image enhancement process, the following example is used to demonstrate that:
example one, the desired acquisition of maximum contrast is let cw=H*-1, then taking cwHas a maximum probability value of pw=max{pjI0 < j < H, then let c i0, i ≠ w, in which case the contrast expectation is greatest, as evidenced by the reversal of the assumption that a larger gray-scale value is expected when c i0, i ≠ w, because of the constraint conditions
Figure BDA0003137189990000152
cwIs equal to H*1-s, but due to pid+pw(H*-1)≤pw(H*-1), which can override the previous assumption.
Description of the first embodiment the image is shown in fig. 1, which demonstrates the previous assumption of the present invention that to achieve maximum contrast expectation, the transfer equation is a simple step function, i.e. the gray-scale image is converted to a binary image by a critical value, and if the critical value is equal to w, then p isw=max{pjI0 < i < H }, the binary image having the greatest contrast expectation.
Since there is a maximum contrast expectation, and conversely there is a minimum contrast expectation, which is relatively simple to obtain with respect to the maximum contrast expectation, it is only necessary to let the transfer equation r (j) be c in 0j0, all values are 0 for all 0 < i < H, so that the minimum contrast expectation can be obtained, which is a monochrome image from the visual point of view, and the image does not express any meaning, that is, the gray value of the whole image is a constant, as shown in fig. 1(c), the whole image has only one value, the difference of the gray value of the image is 0, and the contrast expectation is also 0.
The minimum contrast is expected to be obtained by the transfer equation r (j) ═ v, let c0=v,ciWhere 0 < i < H, v in this description may be any one of the gray values in the original image, and it is understood that the image processed by this transfer equation is a single gray value image, and the gray value of each pixel is v.
Through the analysis of the above embodiments, all embodiments can be obtained by equation 4, and all embodiments are within the preset of the present invention, and the process of obtaining the contrast expectation is the original image enhancement. The present invention continues to analyze the maximum contrast expectation obtained by the transfer equation.
If the dynamic range of the input image histogram is the same as that of the output image histogram in one image, the mathematical formula expresses that H is H*Then the transfer equation can be derived as t (j) j, which is expressed as c0=0,c j1,0 < i < H, by whichThe transfer equation deduces that the contrast of the image is expected to be F (C), which is 1, as long as the input and output dynamic ranges of the original image are the same, and the contrast of the obtained output image is expected to be 1 all the time no matter how the gray values of the input image are distributed, so that the transfer equation is a neutral transfer equation, no processing is performed on the input image, and what image is input, and what image is obtained or what image is obtained through the transfer equation.
Transferring the concept of equal input and output dynamic ranges to the concept of unequal input and output, i.e.
Figure BDA0003137189990000161
To express the relationship between the input dynamic range and the output dynamic range, a hue range is defined and expressed by the following mathematical expression t ═ H*-1)/(H-1), defining this hue range, deriving the expression of the transfer equation, i.e.:
Figure BDA0003137189990000162
the desired function of contrast is obtained as F (t1) ═ t, where 1 is a vector of dimensions 1 × (H-1), and each element in the vector is 1.
Although the fact that the maximum contrast expectation can be obtained through a contrast expectation function is proved, in the enhancing process, no constraint exists, when the maximum contrast expectation is obtained, the image directly converts the gray level image into a binary image, although the obtained contrast expectation is maximum, many details of the original image can be lost, and in order to ensure that after the image is processed through a transfer equation, corresponding enhancement can be obtained, and some characteristics of the original image can be ensured, other constraint conditions are added to limit the over-enhancement of the transfer equation.
(IV) tone distortion factor setting
High contrast desire does not mean high image quality, and another key is continuity of hue, maximizing the contrast desired image, excessive enhancement from a hue perspective,and the result after the treatment is not consistent with the vision of human eyes. In the first embodiment, the transfer equation r (j) converts an image with better color continuity into a black-and-white image, which is a simple and violent enhancement mode, and does not consider accurate color reconstruction at all. In order to enhance the image and make the tone continuous and fit the features of human eyes, the invention processes the image by balancing the contrast enhancement and tone smoothing, firstly, based on the second embodiment, when F (t.1) ═ t or cjT, 0 < j < H, that is, the interpolation between each adjacent gray-scale values is equal, the mapping relationship is linear mapping, and max min { c is obtained1,c2,…,cH-1It is the minimum value in the vector c that is to be maximized, for which all values in the vector must be equal, to get the optimal solution to this max min problem, as demonstrated below:
because max min c1,c2,…,cH-1All c are necessaryi0 < i < H, all are equal, assuming a counter example, there is cwB and ciG < b, i ≠ w, for max min { c1,c2,…,cH-1Get an optimal solution g, but if c is assumediG + (b-g)/(H-1) to give max min { c +1,c2,…,cH-1The optimal solution max min c1,c2,…,cH-1G + (b-g)/(H-1) > g, yielding a larger value than the optimization, overriding the assumptions made before the present invention.
Example two describes a simple linear transfer equation, but has no effect on the overall contrast enhancement, in fact maximizing the minimum in c, and when the dynamic range of j varies from 0 to H, the linearly mapped contrast expectation F (t · 1) ═ t can be obtained.
In the process of enhancing the image, based on the influence of the visual effect of human eyes, the optimal tone reconstruction requires that the transfer equation meets the max min criterion in the second embodiment, and the reason for meeting the criterion is the continuity of the tone, and the interval between every two continuous gray values must be equal in size, so that the continuity of the tone can be ensured. The distortion factor defining the hue is expressed by the following formula through a given transfer equation R (j):
Figure BDA0003137189990000171
the graphical representation of equation 6 is shown in FIG. 2, where the gray values j and i are all mapped to the gray value w by the transfer equation, where j, i ≦ w, and the largest of i-j is found, thus resulting in the definition of the distortion factor.
The transfer equation is not a one-to-one mapping relationship, and as the distortion of the hue is smaller, the hue reconstructed by the transfer equation is smoother and the continuity of the hue is better, and also by definition, the minimum available distortion of the hue is mincA(C)=max(0,[1/t-1])。
However, the definition of the tone distortion degree is abstract, and multiple gray-scale values cannot be mapped to one gray-scale value excessively, so that the excessive concentration causes distortion. For a better understanding of the relationship between contrast desired acquisition and hue distortion, consider the two extreme cases when
Figure BDA0003137189990000172
In the first example, when the maximum desired contrast is obtained, the distortion of the color tone is calculated as a (c) ═ max { w-1, H-1-w }, and when the distortion is the minimum, the distortion is [ (H-1)/2]In case 2, in order to obtain the minimum distortion, the contrast is desirably f (c) 1, and the image processed by the transfer equation is not changed.
Since the dynamic range H of the output is a finite value, two key factors, high contrast and hue distortion, are contradictory to the human eye, and therefore, when designing the corresponding algorithm based on contrast expectation and hue distortion degree, how to deal with the adjustment of the relationship between the two is a key problem, this problem is neglected in prior art image algorithms, which consider only a part of them without relating the relationship between them, therefore, for an input image, the invention balances the high contrast requirement and the low distortion requirement by finding an optimal contrast and tone transfer equation, through the processing of the comparatively balanced transfer equation, the details with comparatively high frequency in the original image are displayed more clearly, and meanwhile, the darker parts in the image are smoother. The present invention next discusses how to better balance the relationship between the two.
Second, optimal tone and contrast mapping based on linear programming
The invention provides an algorithm to solve the relative optimal solution between the two parameters, introduces the basic flow of the algorithm and key steps for solving the problem.
Description of optimal tone and contrast mapping method
The invention has defined a contrast expectation function correlated to transfer equation, and prove that this contrast expectation function correlated to transfer equation is an image enhancement process while processing the picture, through the function of the contrast expectation function as the objective function, the transfer equation makes the function of the contrast expectation obtain the maximum value through looking for an optimal solution, but this single optimization mode will produce a more exaggerated enhancement mode, and the picture produced does not accord with the observation characteristic of the human eye, just like the embodiment, turn a picture of the gray value into a binary image, so the invention further adds the concept of tone reconstruction, obtain the desired function of the contrast expectation through the balanced consideration of two aspects.
In order to find a correct method to improve the visual quality of the image, the invention converts the problem into a process of finding an optimal gray value distribution method under the constraint condition of tone distortion degree to obtain the optimal solution of a contrast expectation function, wherein the constraint ranges of the contrast expectation function and the tone distortion degree are the dynamic range H of the output image*In equation 4, a vector c of a set of input functions1,c2,…,cH-1Represents oneDynamic range of output H*The available allocation resources, each element in the vector is generating a larger output range H through competition*Obtaining an optimal solution, such image enhancement necessarily producing a dynamic range H for the output*One competition of (dynamic range H)*Is a limited resource, the gray value of the image cannot be infinitely expanded, the range is adjusted according to the actual display requirement, the display limit cannot be ignored for better processing effect), and in the process of searching the optimal solution, the dynamic range is output
Figure BDA0003137189990000182
The excessive distortion of the image may cause the output image not to express the information of the input image normally, generate a large distortion, generate unexpected sideband interference, generate a large-area shadow, and shift the average value.
In order to clarify the contrast, the relation between the function and the distortion factor is expected to be obtained, and the histogram can be processed to provide the optimal tone and contrast mapping, which is expressed by the formula:
Figure BDA0003137189990000181
the equation of the optimal tone and contrast mapping mainly aims to enable some details appearing at high frequency to be clearer and simultaneously give consideration to tone smoothness, lagrange operators lambda > 0 are introduced to balance the two parameters so as to enable tone distortion degree to play a constraint role, the optimal tone and contrast mapping is better understood by checking the relation between the tone and contrast mapping equation and a histogram, and the premise of the checking is that the input dynamic range is equal to the value of the output dynamic range, namely H is H*When the histogram of the input image is uniform, i.e. H is equal to the image gray scale range, the solution to get the best tone and contrast mapping is c-1, while it can also be shown that when p is0=p1=…=pH-11/H, the value of the contrast expectation function is f (c) 1, where the optimum hue is compared withThe transfer equation obtained in the contrast mapping process cannot exist in a transfer equation which can enable the transfer equation R (j) to be j and can enable the minimum hue distortion min to be obtainedcA(c)=0。
In the optimal tone and contrast mapping equation, a (c) is a nonlinear equation for the independent variable c, and it is very difficult to directly solve equation 7, and equation 7 needs to be transformed, and this problem is transformed into a linear programming solution problem, i.e. this problem is transformed into solving the maximum contrast expectation function value under the constraint of the tone distortion condition, and equation 7 is transformed into the following linear programming problem:
Figure BDA0003137189990000191
in equation 8, (a) (e) (c) (d) is a constraint condition, the constraint condition (a) limits the dynamic range of the output to fall in the effective area of the image, the constraint condition (b) ensures a monotone non-decreasing characteristic of the transfer equation, the constraint condition (c) specifies an approximate range of the hue distortion degree, and the constraint condition (d) is an upper bound of the minimum distortion degree, a (c) is less than or equal to a, so when the maximum contrast expectation calculation function is calculated, the maximum distortion degree of the hue is constrained, and the image can be effectively enhanced and constrained within a certain range in the enhancement process, and excessive enhancement is prevented.
Rewriting equation 8 to a representation of a matrix yields equation 9:
Figure BDA0003137189990000192
in formula 9, P is a set of vectors consisting of Pi cVector of compositions, wherein 0 < i < H, and jthIs a set of elements j, j +1, …, j + a-1 with a value of 1 in the matrix D, c is a set of vectors with H-1 elements, the subscript in equation 9 shows the dimension of the matrix, the relationship between the objective function and the constraint and the variable c is linear, equation 9 does not show the integer constraint relationship of c, and this linear programming question does not indicate the integer constraint relationship of cThe problem is that an integer-based linear programming problem is solved, the transfer equation r (j) is an integer → integer mapping relation, all the constituent elements exist in integers, but integer linear programming is an NP problem, in order to make the linear programming problem more favorable for solving, the constraint condition (d) c in the formula 8 is an integer, the constraint condition (d) c is properly relaxed, the formula 8 is converted from an integer linear programming problem into a common linear programming problem, all the methods which can be used for solving the linear programming problem after adjustment can be used for solving the problem in the formula 8, and a vector c is obtained after solving (c is equal to c)1,c2,,cH-1) After the solution of (c), it is easy to convert the non-integer solution into an integer solution, and an integer → integer transfer equation is obtained by the vector c, as shown below:
Figure BDA0003137189990000201
by relaxing the constraint conditions, the objective function cannot be solved maximally in the process of solving the problem, because the constraint conditions are not particularly strict, it may happen that the solved solution is not the optimal solution, and in order to optimize the linear programming problem maximally, the constraint condition (c) in equation 8 is replaced by the stricter constraint condition (e) in equation 11 below, so that the problem has more powerful constraint, thereby guiding the solving process more accurately, and the linear programming problem is represented again as follows:
Figure BDA0003137189990000202
optimal tone and contrast mapping is achieved based on linear programming.
(II) improved simplex method
The mapping problem of the optimal contrast expected tone is converted into a linear programming problem, constraint conditions are relaxed, an integer linear programming problem is converted into a linear programming problem, through the relaxed conditions, any method for solving the linear programming problem can be used for solving the equation 11, the linear programming problem is solved by utilizing a simplex method based on operational research, the optimal contrast expected tone mapping problem is solved by utilizing an improved simplex method, the problems processed by the simplex method are converted into a standard problem, the form of the standard problem is MaxZ SX, S is a group of vectors matched with X, the constraint conditions of the standard form are AX-e, X is more than or equal to 0, and the equation 11 is converted into the standard form required for solving.
First some positive relaxation variables k are addedjJ ═ 1,2, …, (H-1), and the constraint (b) of such inequality changes to the following form:
Figure BDA0003137189990000203
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,kH-1)TWriting converted to standard form is:
Figure BDA0003137189990000211
in equation 13, the coefficient in the objective function is S ═ p (p)1,p2,…,PH-1,0,0,…,0)2H-2D in the constraint is decomposed into two parts D ═ D (D)1,D2) Obtaining:
A1=IL-1
A2=IL-1formula 14
The value of the vector on the right is e ═ (1/a,1/a, …,1/a)H-1After the standard form is obtained, the following steps are used for solving:
the method comprises the following steps: first, solve Dx ═ e
Figure BDA0003137189990000216
Let xHCalculating g as Sx as 0;
step two: solving for multiplier k, kD S, k SD-1For non-basis vectors, the discriminant z is calculatedi-si=kpi-siLet the discriminant be zw-sw=min{zi-siIf found non-basis vector zw-swIs less than or equal to 0, for zw-swIf the discriminant of the corresponding base variable is less than or equal to 0, stopping calculation, and the currently solved solution is the best solution; if not, jumping to the third step to solve;
step three: dy decompositionw=pwGet yw=A-1pwIf y iswLess than or equal to 0, i.e. ywIs negative or 0, the calculation process is stopped, since the current linear programming problem has been proven not to be a convex one, there is no optimal solution, if y iswIf the value is more than 0, the next calculation is carried out;
the fourth step: the following reference symbol t is determined so that
Figure BDA0003137189990000212
Let xtIs a radical variable, xwFor radical variables, with pwBy changing ptObtaining a new matrix D, then returning to the step one, and continuing to calculate until the best solution is obtained or the solution is determined to be absent in the process, and stopping calculating;
by the above four-step calculation, if the linear programming problem is a convex problem, an optimal solution is found as
Figure BDA0003137189990000213
The problem required by the present invention is solved by
Figure BDA0003137189990000214
(III) optimal tone and contrast mapping optimization
Converting equation 11 into the standard form required by the modified simplex method, and further obtaining the optimal solution
Figure BDA0003137189990000215
The algorithm is applied to the actual image processing. As shown in fig. 3, although the contrast of the processed image is expected to be the maximum under the constraint of the hue distortion, the visual effect of the whole image obtained finally is compared with the original image, but the processed image is not as good as the original image, which causes the problem because, as shown in fig. 3(c), the gray values at the transfer equations 150 to 190 have a large step, and the probability at the gray value is the maximum in the histogram. Because a huge step exists in the transfer equation, a large area of blank space exists in the middle of the processed histogram, so that although the maximum contrast expectation can be obtained, the result is that the gray level histogram is not smooth in the histogram of the original image, and some characteristics of the histogram of the original image are lost, in order to solve the problem, the invention introduces a new constraint condition to control the maximum value of the step, and the mathematical expression of the constraint condition is as follows:
civ is less than or equal to v, i is more than 0 and less than H is 15
The present invention redefines the function of the optimal tone and contrast mapping as follows:
Figure BDA0003137189990000221
based on the change of the optimal mapping function, when the equation is solved, the used variables are also transformed, but the method is not changed, and the standard form of the function is converted into the following result: first some positive relaxation variables k are addedjJ ═ 1,2, …, (2H-2), the constraint (b) of the inequality varies in the form:
Figure BDA0003137189990000222
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,k2H-2)TThe standard form of writing is the same as formula 13, but in the objective functionThe coefficient in the number is S ═ (p)1,p2,…,pH-1,0,0,…,0)3H-3In the constraint, D is also decomposed into two parts, D ═ D (D)1,D2) The method specifically comprises the following steps:
Figure BDA0003137189990000223
the right vector has the value e ═ m (m, m, …, m, n, n, …, n)2H-2After conversion to the standard form, the solution continues using the modified simplex method.
Third, experimental results
Equation 16 is the final optimal tone and contrast mapping function, and there are two key variables m, n in equation 16, where m is the degree of separation of gray values in the histogram, i.e., related to the degree of tone distortion, and n is the size of the control step, such that ciNot exceeding a certain value makes the histogram smoother. The method of the optimal tone and contrast mapping function is used for processing the image, and histogram equalization is used as a contrast method in order to show the superiority of the algorithm. Fig. 4 is a graph showing the comparison between the results of the method of the present invention and the histogram equalization method, and fig. 5 is a histogram of the image corresponding to the experimental result of fig. 4.
In the mapping processing of the optimal tone and the contrast, the values of m and n are respectively taken as (0.5 and 2), the value is a default value, the group of values has obvious enhancement effect, and the tone distortion problem is also considered. The histograms of the three images are compared respectively to obtain that the histogram after the mapping processing of the optimal tone and the contrast is similar to the original histogram, the style of the histogram is kept consistent with that of the original histogram to a great extent, the similarity of the image histogram after the histogram equalization processing and the original image is low, and basically no rule exists, the histogram equalization processing and the original image are simply superposed, the consistency is reflected on the processed image, the image subjected to the histogram equalization is dark on the whole, the difference between the visual effect of the whole image and the visual effect of the original image is large, and the visual effect of the original image is not good. However, the visual effect of the image after the mapping processing of the optimal tone and contrast is slightly better than that of the original image.
The evaluation of the visual effect of the invention is as follows: the original image, the image after histogram equalization processing and the image after optimal tone and contrast mapping processing are put together, five testers are found in a laboratory, the corresponding sequence of the testers is not told in advance, the testers rank each image, the first image is ranked by adding 3 points, the second image is ranked by adding 2 points, the third image is ranked by adding 1 point, the height of the score of the image is finally ranked, and the visual effect of which image is good can be known from the score.
When the whole image is darker, the visual effect of the image after the mapping processing of the optimal tone and the contrast is better, although the histogram equalization improves the whole brightness of the image greatly, the image is only wholly brightened, some details of the highlighting are not highlighted, that is, the difference value between adjacent gray values is not enhanced while the brightness of the image is improved, so the visual effect of the image is not good. The optimal tone and contrast mapping algorithm is also more fit with the histogram of the original image, the contrast between the optimal tone and contrast mapping algorithm and the contrast mapping algorithm are increased while the average brightness of the whole image is increased, the bright and dark combination is better, and higher detailed information of the frequency in the image is highlighted.
The histogram can be clearly seen through comparison, the optimal tone and contrast mapping transfer equation is more effective than the histogram balanced transfer equation, the mapping relation of different gray values is adjusted through the probability balance of each gray value, the gray values with higher gray value probability are more widely distributed in the whole gray space, the details of high-frequency occurrence components are enhanced, and the image has better expressive force.
The image processed by histogram equalization in fig. 6 is completely distorted, and the whole image gives a poor visual sense to a person, but the image mapped by the optimal tone and contrast ratio is enhanced in the brainstem part, and by contrast, as shown in fig. 7, the histogram equalization directly maps the whole gray scale space to the gray scale value above 120, so that the whole image is brighter, the optimal tone and contrast ratio mapping transfer equation highlights the details of the brainstem part, and two flat areas are generated, so that two more concentrated areas are generated at two ends of the histogram, and partial distortion is caused, but the brainstem part is well enhanced due to distortion, because the brainstem part is interested, the detailed representation of the brainstem part is increased, and the diagnosis of a doctor is facilitated.
As shown in fig. 8, the details of the image after the optimal hue and contrast mapping process are better, the histogram equalization has obvious distortion, the effect of restoring the dark rocks to be expressed in the original image is not good, only the brightness of the image is mechanically enhanced without other constraints, and the optimal hue and contrast mapping not only enhances the overall brightness of the image but also well represents the characteristics that the rocks should have in the process of enhancing the image. As shown in fig. 9, consistent with the image analysis processed above, the optimal tone and contrast mapping extends the high frequency of gray values in the image over a wider space to achieve the optimal contrast expectation, ensuring both consistent tone with the original image and enhanced image,
by the histogram equalization and the contrast of the image after the mapping processing of the optimal tone and the contrast, the optimal tone and the contrast are mapped in the process of enhancing the image, the detail information of the image is ensured, and the image has good visual effect.

Claims (10)

1. The tone and contrast mapping method based on the optimal human vision is characterized by comprising the steps of constructing a relation between contrast expectation and transfer equation and tone distortion and optimal tone and contrast mapping based on linear programming, defining a contrast expectation function through the transfer equation, describing the relation between a histogram and image enhancement by using a mathematical equation, defining the tone distortion degree to restrict the contrast expectation function based on high contrast and not representing good visual effect, and providing the optimal tone and contrast mapping method, so that the image details appearing at high frequency are accurately and effectively highlighted, and the enhanced image is more in line with a human visual system;
constructing a relationship between contrast expectation, transfer equation and hue distortion includes: contrast expectation setting, transfer equation design, contrast expectation solving function and image enhancement relation, tone distortion degree setting, and two key parameters presented by an image: the contrast expectation and the hue distortion are a pair of contradictions for two factors of human eyes, and the contradiction between the two factors is solved by constructing a correlation mechanism and balancing the contradiction by a transfer equation of an image, and simultaneously, the required higher image quality is achieved;
the optimal hue and contrast mapping based on linear programming comprises: describing an optimal tone and contrast mapping method, improving a simplex method, optimizing optimal tone and contrast mapping, providing an algorithm to solve a relatively optimal solution between tone and contrast parameters, describing the optimal tone and contrast mapping method based on linear programming, and providing a solving method of a problem to realize optimal contrast and tone mapping of the whole image;
the optimal tone and contrast mapping method based on linear programming converts the histogram equalization and planning problem in the image enhancement algorithm of the prior art into the problem of solving the maximum contrast expectation to obtain a function value under a specific constraint condition by defining a quantized image enhancement process with a more accurate contrast expectation to obtain a function and a more accurate tone distortion degree, solves the maximum value of a target function based on an improved simplex method, gives consideration to the distortion degree of an image in the enhancement process, ensures that the enhancement effect of the image is more matched with a human eye visual system, controls the tone distortion degree and has a better visual effect.
2. The best human vision based tone-and-contrast mapping method as claimed in claim 1, wherein the contrast desired setting is: assuming that a gray-scale value image J with a pixel depth of e has a gray-scale histogram distribution of L and the number of non-zero gray-scale levels in the gray-scale histogram is W, a mathematical expression xwRepresenting gray values, x, with gray values other than 00<x1<…<xW-1,0<W≤H=2eLet p stand forwIs a gray value of xwAnd 0 ≦ W < W, then the contrast of the defined image J is expected to be:
Figure FDA0003137189980000011
by analyzing the contrast expectation formula, the maximum contrast expectation is SmaxH-1, i.e. the image is a black and white binary image, and x0=0,x1When the image is a constant value image, the minimum contrast is desirably S-1minIf the dynamic range of the histogram occupies the whole histogram space, i.e. in the whole histogram distribution space, each gray value will have corresponding pixel point, i.e. when W is H, x is Hw-xw-1The contrast expectation can ignore the distribution of the probability of gray values, and the contrast expectation S is 1 if xW-xW-1Where a > 1,0 ≦ W < H, then the contrast is desirably S ═ a.
3. The optimal human vision based tone and contrast mapping method as claimed in claim 1, wherein the transfer equation design: for an image, the contrast of the image is enhanced, namely the distance between two adjacent nonzero gray values in a histogram of the image is increased, the histogram distribution of the image is readjusted through a corresponding mapping relation, the input before mapping is assumed to be H, namely the histogram distribution of the image to be processed, and the output after mapping through a transfer equation is H*Obtaining a histogram distribution of the processed image, such a conversion from H to H by some calculation*Is a transfer equation, which is expressed by equation 2:
R:{0,1,…H-1}→{0,1…H*-1} formula 2
In this transfer equation, in order to make the image conform to the psychology and physiology vision of human eyes, the transfer equation obtained after processing the image must be monotonously non-decreasing, in the global processing of the image, the relationship holds, in the local processing of the image, the relationship holds, namely the transfer equation can not reverse the histogram arrangement of the original image, when i > j, R (i) ≧ R (j) is expressed by the mathematical formula, and the transfer equation is expressed by formula 3:
Figure FDA0003137189980000021
ci∈{0,1,…H*-1}
Figure FDA0003137189980000022
in equation 3, the last inequality ensures that the dynamic range of the output does not exceed R (j), equation 2 is a generalized transfer equation definition, ciThe histogram distribution of the output image only needs to consider the histogram distribution of the image, but does not need to carefully calculate the gray value of each pixel point, and a transfer equation is completely formed by c ═ { c ═ c0,c1,...cH-1The set of vectors is determined, namely the set of contrast vectors are completely established in the gray level of the input image, and in the establishing process, the invention does not need to consider the relation between each pixel point in the whole image, and only needs to map the gray level value of each pixel point into the corresponding image gray level distribution histogram, so that the solution of the transfer equation has strong adaptability, and only needs to obtain the histogram distribution of the image, and the solution of the transfer equation becomes simpler.
4. The optimal human vision based tone-contrast mapping method of claim 3, wherein the contrast expectation function relates to image enhancement by: obtaining a new histogram of the image through a histogram transfer equation of the image, inputting the image into the transfer equation to obtain the image with the characteristics of the transfer equation, and based on the contrast expectation of the image, if the contrast expectation value of the output image is larger, the contrast presented by the final image is larger;
combining a transfer equation with a contrast expectation, guiding the construction of the transfer equation through the contrast expectation, acting on the whole image through the transfer equation to obtain an image different from the contrast expectation of the original image, and defining a formula of a contrast expectation solving function through a transfer equation R through an equation 3, namely:
Figure FDA0003137189980000023
piis the probability of the occurrence of a gray value i in the image, c0Not added to the calculation, i.e. when the contrast expectation is obtained, c0Without participation, will c0Defined as 0, when the gray level is 0, the past gray level mapped by the transfer equation is also 0, so that if there is no other special description, the vector of the contrast expectation is defined as { c }0,c1,...cH-1The process of solving the contrast expectation solving function by analyzing equation 4 is an image enhancement process, ciRepresenting the distance between the current gray value and the forward gray value, and then multiplied by the probability of the current gray value as a weight.
5. The optimal human vision based tone-contrast mapping method as claimed in claim 4, wherein the following examples are used to demonstrate that the solving process is an image enhancement process:
example one, the desired acquisition of maximum contrast is let cw=H*-1, then taking cwHas a maximum probability value of pw=max{pjI0 < j < H, then let ci0, i ≠ w, in which case the contrast expectation is greatest, as evidenced by the reversal of the assumption that a larger gray-scale value is expected when ci0, i ≠ w, because of the constraint conditions
Figure FDA0003137189980000031
cwIs equal to H*1-s, but due to pid+pw(H*-1)≤pw(H*-1) so that the previous assumption can be overruled;
example-to demonstrate the assumption of the present invention that to achieve maximum contrast expectation, the transfer equation is a simple step function, i.e., converting the gray-scale image into a binary image by a threshold value, and assuming that the threshold value is equal to w, then pw=max{pjI0 < i < H }, the binary image having a maximum contrast expectation;
since there is a maximum contrast expectation, and conversely there is a minimum contrast expectation, which is relatively simple to obtain with respect to the maximum contrast expectation, it is only necessary to let the transfer equation r (j) be c in 0j0, all values are 0 when all 0 < i < H, so that the expected minimum contrast can be obtained, and the image is a monochrome image in visual perspective, the image does not express any meaning, namely the gray value of the whole image is a constant, the whole image has only one value, the difference of the gray value of the image is 0, and the expected contrast is also 0;
the minimum contrast is expected to be obtained by the transfer equation r (j) ═ v, let c0=v,ci0, 0 < i < H, wherein v is any one of gray values in the original image in the description, and after the description, the image processed by the transfer equation is an image with a single gray value, and the gray value of each pixel is v;
through the analysis of the above embodiments, all embodiments can be obtained by equation 4, and all embodiments are within the preset of the present invention, and the process of obtaining the contrast expectation is the original image enhancement.
6. The optimal human vision based tone-contrast mapping method of claim 5, wherein the continued analysis obtains the maximum contrast expectation by a transfer equation: if in an imageThe dynamic range of the input image histogram is the same as that of the output image histogram, and the mathematical formula expresses that H is H*Then the transfer equation can be derived as t (j) j, which is expressed as c0=0,cj1,0 < i < H, and deriving a contrast expectation f (c) of the image by using the transfer equation, wherein the contrast expectation f (c) of the obtained output image is always 1 no matter how the gray values of the input image are distributed as long as the input and output dynamic ranges of the original image are the same, so that the transfer equation is a neutral transfer equation, and no processing is performed on the input image, and what image is input, what image is obtained by the transfer equation or what image is output by the transfer equation;
transferring the concept of equal input and output dynamic ranges to the concept of unequal input and output, i.e.
Figure FDA0003137189980000041
To express the relationship between the input dynamic range and the output dynamic range, a hue range is defined and expressed by the following mathematical expression t ═ H*-1)/(H-1), defining this hue range, deriving the expression of the transfer equation, i.e.:
Figure FDA0003137189980000042
obtaining a desired function of contrast ratio, F (t1) ═ t, where 1 is a vector of dimensions 1 × (H-1), and each element in the vector is 1;
the method has the advantages that the maximum contrast expectation can be obtained through the contrast expectation function, no constraint exists in the enhancement process, when the maximum contrast expectation is obtained, the gray level image is directly converted into the binary image, the obtained contrast expectation is maximum, but many details of the original image can be lost, and in order to ensure that the image can be correspondingly enhanced after being processed by the transfer equation and also can ensure some characteristics of the original image, other constraint conditions are added to limit the over-enhancement of the transfer equation.
7. The optimal human vision based hue and contrast mapping method according to claim 4, wherein the hue distortion factor is set as: in order to enhance the image and make the tone continuous and fit the features of human eyes, the invention processes the image by balancing the contrast enhancement and tone smoothing, firstly, based on the second embodiment, when F (t.1) ═ t or cjT, 0 < j < H, that is, the interpolation between each adjacent gray-scale values is equal, the mapping relationship is linear mapping, and max min { c is obtained1,c2,…,cH-1It is the minimum value in the vector c that is to be maximized, for which all values in the vector must be equal, to get the optimal solution to this max min problem, as demonstrated below:
because max min c1,c2,…,cH-1All c are necessaryi0 < i < H, all are equal, assuming a counter example, there is cwB and ciG < b, i ≠ w, for max min { c1,c2,…,cH-1Get an optimal solution g, but if c is assumediG + (b-g)/(H-1) to give max min { c +1,c2,…,cH-1The optimal solution max min c1,c2,…,cH-1G + (b-g)/(H-1) > g, yielding a larger value than the optimization, overriding the previous assumptions of the present invention;
example two describes a simple linear transfer equation, but has no effect on the overall contrast enhancement, maximizes the minimum value in c, and can obtain the contrast expectation F (t · 1) ═ t of the linear mapping when the dynamic range of j varies from 0 to H;
in the process of enhancing the image, based on the influence of the visual effect of human eyes, the optimal tone reconstruction requires that the transfer equation meets the max min criterion in the second embodiment, the reason for meeting the criterion is the continuity of the tone, and the interval between every two continuous gray values must be equal in size, so as to ensure the continuity of the tone, and the distortion degree of the defined tone is expressed by the following formula through the given transfer equation R (j):
Figure FDA0003137189980000043
mapping the gray values j and i to a gray value w through a transfer equation, wherein j and i are less than or equal to w, solving the largest one of i and j to obtain the definition of the distortion degree;
the transfer equation is not a one-to-one mapping relationship, and as the distortion of the hue is smaller, the hue reconstructed by the transfer equation is smoother and the continuity of the hue is better, and also by definition, the minimum available distortion of the hue is mincA(C)=max(0,[1/t-1]);
However, the definition of the tone distortion degree is abstract, so that a plurality of gray values cannot be mapped to one gray value excessively, the excessive concentration can cause distortion, and in order to better understand the relationship between the expected acquisition and tone distortion, two extreme cases are considered when the relationship is between
Figure FDA0003137189980000051
In the first example, when the maximum desired contrast is obtained, the distortion of the color tone is calculated as a (c) ═ max { w-1, H-1-w }, and when the distortion is the minimum, the distortion is [ (H-1)/2]In case 2, in order to obtain the minimum distortion, the contrast is desired to be f (c) 1, and the image processed by the transfer equation is not changed;
for an input image, the high contrast requirement and the low distortion requirement are balanced by finding an optimal contrast and tone transfer equation, and the processing of the balanced transfer equation enables the details with high frequency to be displayed more clearly in the original image, and meanwhile, the darker parts in the image are smoother.
8. The best human vision based tone and contrast mapping method of claim 4, wherein the best tone and contrast mapping method describes: further adding a concept of tone reconstruction, and obtaining an ideal contrast expectation solving function through balance consideration of two aspects;
the invention converts the problem into that an optimal gray value distribution method is searched under the constraint condition of the tone distortion degree to solve the process of obtaining the optimal solution of the contrast expectation function, and the constraint ranges of the contrast expectation function and the tone distortion degree are the dynamic range H of the output image*In equation 4, a vector c of a set of input functions1,c2,…,cH-1Representing the dynamic range H of an output*The available allocation resources, each element in the vector is generating a larger output range H through competition*Obtaining an optimal solution, such image enhancement necessarily producing a dynamic range H for the output*In the process of finding the optimal solution, the dynamic range is output
Figure FDA0003137189980000053
The excessive distortion can cause the output picture not to express the information of the input image normally, and great distortion is generated;
in order to clarify the contrast, the relation between the function and the distortion factor is expected to be obtained, and the histogram can be processed to provide the optimal tone and contrast mapping, which is expressed by the formula:
Figure FDA0003137189980000052
the equation of the optimal tone and contrast mapping mainly aims to enable some details appearing at high frequency to be clearer and simultaneously give consideration to tone smoothness, lagrange operators lambda > 0 are introduced to balance the two parameters so as to enable tone distortion degree to play a constraint role, the optimal tone and contrast mapping is better understood by checking the relation between the tone and contrast mapping equation and a histogram, and the premise of the checking is that the input dynamic range is equal to the value of the output dynamic range, namely H is H*When inputtingThe histogram of the image is uniform, i.e. H is equal to the image gray scale range, and the solution to get the best tone and contrast mapping is c-1, and it can also be shown that when p is0=p1=…=pH-1The value of the contrast expectation function is f (c) 1, and the transfer equation obtained in this optimal tone-to-contrast mapping process cannot exist such that both the transfer equation r (j) j and the minimum tone distortion min are obtainedcA(c)=0;
In the optimal tone and contrast mapping equation, a (c) is a nonlinear equation for the independent variable c, and it is very difficult to directly solve equation 7, and equation 7 needs to be transformed, and this problem is transformed into a linear programming solution problem, i.e. this problem is transformed into solving the maximum contrast expectation function value under the constraint of the tone distortion condition, and equation 7 is transformed into the following linear programming problem:
Figure FDA0003137189980000061
(a)
Figure FDA0003137189980000062
(b)ci≥0,0<i<H;
(c)
Figure FDA0003137189980000063
(d)ciis an integer, 0 < i < H; formula 8
In the formula 8, (a) (e) (c) (d) is a constraint condition, the constraint condition (a) limits the output dynamic range to fall in the effective area of the image, the constraint condition (b) ensures a monotone non-decreasing characteristic of the transfer equation, the constraint condition (c) specifies an approximate range allowed by the hue distortion degree, and the constraint condition (d) is an upper limit a (c) less than or equal to a of the minimum distortion degree, so when a maximum contrast expectation solving function is solved, the maximum distortion degree of the hue is constrained, the image can be effectively enhanced and can be constrained in a certain range in the enhancing process, and excessive enhancement is prevented;
rewriting equation 8 to a representation of a matrix yields equation 9:
Figure FDA0003137189980000064
(1)
Figure FDA0003137189980000065
(2)
Figure FDA0003137189980000066
(3)
Figure FDA0003137189980000067
in formula 9, P is a set of vectors consisting of Pi cVector of compositions, wherein 0 < i < H, and jthIs a set of elements j, j +1, …, j + a-1, c with a value of 1 in the matrix D, the subscript in equation 9 shows the dimension of the matrix, the relationship between the objective function and the constraint and the variable c is linear, equation 9 does not show the integer constraint of c, the linear programming problem is an integer-based linear programming problem, the transfer equation r (j) is an integer → integer mapping relationship, all the constituent elements exist as integers, but the integer linear programming is an NP problem, in order to make the linear programming problem more favorable for solving, the constraint (D) c in equation 8 is an integer, which is appropriately relaxed, so as to convert equation 8 from an integer linear programming problem into a common linear programming problem, and all the methods that can be used to solve the linear problem after adjustment can be used to solve the problem in equation 8, after solving, the vector c ═ c is obtained1,c2,,cH-1) After the solution of (2), the non-integer solution is easily converted into an integer solution, and an integer → integer transfer equation is obtained through the vector cAs follows:
Figure FDA0003137189980000071
by relaxing the constraint conditions, the objective function cannot be solved maximally in the process of solving the problem, the constraint conditions are not particularly strict, it may happen that the solved solution is not the optimal solution, in order to optimize the linear programming problem maximally, the constraint condition (c) in equation 8 is replaced by the stricter constraint condition (e) in equation 11 below, so that the problem has more powerful constraint, thereby guiding the solving process more accurately, and the linear programming problem is represented again as follows:
Figure FDA0003137189980000072
(a)
Figure FDA0003137189980000073
(b)cimore than or equal to 1/a, i is more than 0 and less than H; formula 11
Optimal tone and contrast mapping is achieved based on linear programming.
9. The optimal human vision based hue and contrast mapping method according to claim 8, wherein the modified simplex method: solving the optimal contrast expectation tone mapping problem by using an improved simplex method, wherein the problems processed by the simplex method are all converted into a standard problem in the form of MaxZ (SX), wherein S is a group of vectors matched with X, the constraint condition of the standard form is AX (e), and X is more than or equal to 0, and the formula 11 is converted into a standard form required by solving;
first some positive relaxation variables k are addedjJ ═ 1,2, …, (H-1), and the constraint (b) of such inequality changes to the following form:
Figure FDA0003137189980000074
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,kH-1)TWriting converted to standard form is:
Figure FDA0003137189980000075
(a)Dx=e;
(b) x is more than or equal to 0; formula 13
In equation 13, the coefficient in the objective function is S ═ p (p)1,p2,…,pH-1,0,0,…,0)2H-2D in the constraint is decomposed into two parts D ═ D (D)1,D2) Obtaining:
A1=IL-1
A2=IL-1formula 14
The value of the vector on the right is e ═ (1/a,1/a, …,1/a)H-1After the standard form is obtained, the following steps are used for solving:
the method comprises the following steps: first, solve Dx as e and then,
Figure FDA0003137189980000087
let xHCalculating g as Sx as 0;
step two: solving for multiplier k, kD S, k SD-1For non-basis vectors, the discriminant z is calculatedi-si=kpi-siLet the discriminant be zw-sw=min{zi-siIf found non-basis vector zw-swIs less than or equal to 0, for zw-swIf the discriminant of the corresponding base variable is less than or equal to 0, stopping calculation, and the currently solved solution is the best solution; if not, jumping to the third step to solve;
step three: dy decompositionw=pwGet yw=A-1pwIf y iswLess than or equal to 0, i.e. ywIs negative or 0, the calculation process is stopped, since the current linear programming problem has been proven not to be a convex one, there is no optimal solution, if y iswIf the value is more than 0, the next calculation is carried out;
the fourth step: the following reference symbol t is determined so that
Figure FDA0003137189980000081
Let xtIs a radical variable, xwFor radical variables, with pwBy changing ptObtaining a new matrix D, then returning to the step one, and continuing to calculate until the best solution is obtained or the solution is determined to be absent in the process, and stopping calculating;
by the above four-step calculation, if the linear programming problem is a convex problem, an optimal solution is found as
Figure FDA0003137189980000082
The problem required by the present invention is solved by
Figure FDA0003137189980000083
10. The best human vision based tone and contrast mapping method of claim 9, wherein the best tone and contrast mapping is optimized by: converting equation 11 into the standard form required by the modified simplex method, and further obtaining the optimal solution
Figure FDA0003137189980000084
Applying the algorithm to the actual image processing, the invention introduces a new constraint condition to control the maximum value of the step, and the mathematical expression of the constraint condition is as follows:
civ is less than or equal to v, i is more than 0 and less than H is 15
The present invention redefines the function of the optimal tone and contrast mapping as follows:
Figure FDA0003137189980000085
(a)
Figure FDA0003137189980000086
(b)ci≥m,0<i<H;
(c)cin is more than or equal to n, i is more than 0 and less than H; formula 16
Based on the change of the optimal mapping function, when the equation is solved, the used variables are also transformed, but the method is not changed, and the standard form of the function is converted into the following result: first some positive relaxation variables k are addedjJ ═ 1,2, …, (2H-2), the constraint (b) of the inequality varies in the form:
Figure FDA0003137189980000091
corresponding to the standard form where x ═ c1,c2,…,cH-1,k0,k1,…,kH-1)TThe notation converted to the standard form is the same as equation 13, but the coefficient in the objective function is S ═ p (p)1,p2,…,pH-1,0,0,…,0)3H-3In the constraint, D is also decomposed into two parts, D ═ D (D)1,D2) The method specifically comprises the following steps:
Figure FDA0003137189980000092
Figure FDA0003137189980000093
the right vector has the value e ═ m (m, m, …, m, n, n, …, n)2H-2After conversion to the standard form, the solution continues using the modified simplex method.
CN202110723411.3A 2021-06-28 2021-06-28 Tone and contrast mapping method based on optimal human vision Withdrawn CN113436103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110723411.3A CN113436103A (en) 2021-06-28 2021-06-28 Tone and contrast mapping method based on optimal human vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110723411.3A CN113436103A (en) 2021-06-28 2021-06-28 Tone and contrast mapping method based on optimal human vision

Publications (1)

Publication Number Publication Date
CN113436103A true CN113436103A (en) 2021-09-24

Family

ID=77757473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110723411.3A Withdrawn CN113436103A (en) 2021-06-28 2021-06-28 Tone and contrast mapping method based on optimal human vision

Country Status (1)

Country Link
CN (1) CN113436103A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914811A (en) * 2014-03-13 2014-07-09 中国科学院长春光学精密机械与物理研究所 Image enhancement algorithm based on gauss hybrid model
US20150104188A1 (en) * 2013-10-11 2015-04-16 The Johns Hopkins University Active beam shaping system and method using sequential deformable mirrors

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150104188A1 (en) * 2013-10-11 2015-04-16 The Johns Hopkins University Active beam shaping system and method using sequential deformable mirrors
CN103914811A (en) * 2014-03-13 2014-07-09 中国科学院长春光学精密机械与物理研究所 Image enhancement algorithm based on gauss hybrid model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAOLIN WU ET AL.: "A Linear Programming Approach for Optimal Contrast-Tone Mapping", 《IEEE TRANSACTIONS ON IMAGE PROCESSING》, pages 1262 - 1272 *
高明 等: "基于非线性直方图变换的对比度畸变图像校正", 《北京航空航天大学学报》 *

Similar Documents

Publication Publication Date Title
KR100456017B1 (en) Contrast enhancement apparatus using histogram matching and method thereof
KR20070050249A (en) Method and apparatus for contrast enhancement
CN109272470B (en) Image enhancement method and device
KR100694153B1 (en) Method and Apparatus for Image Processing based on a Mapping Function
US20080279467A1 (en) Learning image enhancement
CN115797225B (en) Unmanned ship acquired image enhancement method for underwater topography measurement
Arriaga-Garcia et al. Adaptive sigmoid function bihistogram equalization for image contrast enhancement
KR101113483B1 (en) Apparatus for enhancing visibility of color image
CN109478316B (en) Real-time adaptive shadow and highlight enhancement
CN113962898A (en) Low-illumination image enhancement method based on illumination map optimization and adaptive gamma correction
CN112419195A (en) Image enhancement method based on nonlinear transformation
Dixit et al. A review on image contrast enhancement in colored images
Singh et al. Image enhancement by adaptive power-law transformations
Meylan Tone mapping for high dynamic range images
CN113436103A (en) Tone and contrast mapping method based on optimal human vision
Wang et al. Adaptive enhancement for nonuniform illumination images via nonlinear mapping
CN113643651B (en) Image enhancement method and device, computer equipment and storage medium
JP4719559B2 (en) Image quality improving apparatus and program
Veluchamy et al. Fuzzy dissimilarity contextual intensity transformation with gamma correction for color image enhancement
JP2007243987A (en) Image processing method, image processing system, and image processing program
CN114494471A (en) Image contrast enhancement method and system
Makandar et al. Color image analysis and contrast stretching using histogram equalization
CN114429426A (en) Low-illumination image quality improvement method based on Retinex model
Zini et al. Shallow camera pipeline for night photography rendering
Ghous et al. Efficient image enhancement using improved RIQMC based ROHIM model

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210924

WW01 Invention patent application withdrawn after publication