Image contrast editing method and device, and computer readable storage medium
Patent Information
- Application Number
- CN201911372091.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-27
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2039-12-27
AI Technical Summary
The prior art has problems such as out-of-bounds of curve values, non-monotonicity and insufficient scalability in image contrast editing, resulting in a decline in image quality and it is difficult for users to flexibly adjust parameters to meet specific constraints.
A generalized exponential gamma model is used to generate contrast mapping curves to ensure the continuity and boundary of the curves, and a curve that meets user needs is generated through monotonic constraints and composite algorithms. The cascading parameter mode is supported to adjust the curve parameters.
The continuity, boundary and monotonicity of the contrast mapping curve is achieved, avoiding the situation of pixel values being discontinuous or out of boundaries, providing more flexible parameter adjustment methods, and improving image quality and user experience.
Smart Images

Figure CN113052926B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to an image contrast editing method and device, and a computer-readable storage medium. Background Art
[0002] Application scenarios of image contrast editing include:
[0003] 1. Image editing: Users need to adjust the contrast of the image, such as using the curve tool in Photoshop or GIMP (GNU Image Manipulation Program) image editing software.
[0004] 2. Imaging equipment parameter control: Monitoring equipment installers need to adjust the image contrast according to the lighting conditions of the surveillance camera installation location to ensure that the image quality meets user needs.
[0005] 3. HDR (High-Dynamic Range) image display or enhancement: When HDR images need to be displayed on traditional devices, the image dynamic contrast needs to be compressed. This operation can include contrast mapping curve information during encoding, or the image can be displayed adaptively based on the image content on the decoding side. Summary of the invention
[0006] The inventors have found through research that the image editing software of the related art adjusts the image contrast by adjusting the contrast mapping curve, and the commonly used methods of the related art include: piecewise linear, spline curve, polynomial curve, etc. However, these curves of the related art may fail to meet specific constraints during the adjustment process due to improper operation by the user, thereby damaging the image quality.
[0007] In view of at least one of the above technical problems, the present disclosure provides an image contrast editing method and device, and a computer-readable storage medium, which adopt a generalized exponential gamma model to ensure the continuity and boundedness of the contrast mapping curve.
[0008] According to one aspect of the present disclosure, there is provided an image contrast editing method, comprising:
[0009] receiving an image to be edited, a control point and a control condition from a user input module;
[0010] According to the control points and control conditions input by the user, a generalized exponential gamma model is used to generate a contrast mapping curve;
[0011] The image pixel values of the image to be edited are mapped according to the generated contrast mapping curve function to obtain an enhanced image.
[0012] In some embodiments of the present disclosure, generating a contrast mapping curve using a generalized exponential gamma model according to a control point and a control condition input by a user includes:
[0013] Determine whether the contrast mapping curve is required to pass through the control point;
[0014] When the contrast mapping curve is required to pass through the control point, a generalized exponential gamma spline curve model is used to generate the contrast mapping curve.
[0015] In some embodiments of the present disclosure, generating a contrast mapping curve using a generalized exponential gamma model according to a control point and a control condition input by a user further includes:
[0016] In the case where the contrast mapping curve is not required to pass through the control point, determining whether the contrast mapping curve is required to be monotonic;
[0017] When the contrast mapping curve is required to be monotonic, a generalized exponential gamma model fitting algorithm with monotonicity constraint is used to generate the contrast mapping curve.
[0018] In some embodiments of the present disclosure, generating a contrast mapping curve using a generalized exponential gamma model according to a control point and a control condition input by a user further includes:
[0019] When the contrast mapping curve is not required to be monotonic, a generalized exponential gamma model fitting algorithm is used to generate the contrast mapping curve.
[0020] In some embodiments of the present disclosure, the kernel function of the contrast mapping curve function is a polynomial function or a spline curve function.
[0021] In some embodiments of the present disclosure, the contrast mapping curve function F(x) is linearly related to the generalized exponential gamma model function f(x), F(x) = α + βf(x), where α and β are model parameters.
[0022] In some embodiments of the present disclosure, the generalized exponential gamma model function f(x) is:
[0023] f(x)=x exp(Φ(x)) , where Φ(x) is the kernel function of the generalized exponential gamma model function.
[0024] In some embodiments of the present disclosure, when the kernel function Φ(x) of the generalized exponential gamma model function is a polynomial function, Among them, a i is the model parameter, n is the order of the model, and i is a natural number greater than or equal to 0 and less than or equal to n.
[0025] In some embodiments of the present disclosure, the contrast mapping curve function has at least one of the following properties: passing through a fixed point, being bounded, and being continuous in any order of derivative.
[0026] In some embodiments of the present disclosure, the contrast mapping curve function is linearly related to the generalized exponential gamma model function.
[0027] In some embodiments of the present disclosure, the monotonicity constraint is that the derivative of the generalized exponential gamma model function is greater than 0.
[0028] In some embodiments of the present disclosure, the generalized exponential gamma model fitting algorithm is: performing at least one of additive compounding, multiplicative compounding and functional compounding on multiple low-order contrast generalized exponential gamma models to generate a contrast mapping curve function.
[0029] In some embodiments of the present disclosure, generating a contrast mapping curve using a generalized exponential gamma model according to a control point and a control condition input by a user includes:
[0030] In the cascade parameter adjustment mode, multiple mapping curves are cascaded in a waterfall manner to form a contrast mapping curve function, and the curve parameters are adjusted section by section.
[0031] According to another aspect of the present disclosure, there is provided an image contrast editing device, comprising:
[0032] A user input receiving module, used for receiving the image to be edited, the control point and the control condition input by the user;
[0033] A contrast curve generation module, used to generate a contrast mapping curve using a generalized exponential gamma model according to control points and control conditions input by a user;
[0034] The image enhancement module is used to map the image pixel values of the image to be edited according to the generated contrast mapping curve function to obtain an enhanced image.
[0035] In some embodiments of the present disclosure, the image contrast editing device is used to perform operations to implement the image contrast editing method described in any of the above embodiments.
[0036] According to another aspect of the present disclosure, there is provided an image contrast editing device, comprising:
[0037] A memory for storing instructions;
[0038] The processor is used to execute the instructions so that the device performs operations to implement the image contrast editing method as described in any of the above embodiments.
[0039] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the image contrast editing method as described in any of the above embodiments is implemented.
[0040] The present disclosure adopts a generalized exponential gamma model to ensure the continuity and boundedness of the contrast mapping curve, and will not cause discontinuity or out-of-bounds pixel values. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A schematic diagram of the shortcomings of out-of-bounds values of the relevant technology curve.
[0043] Figure 2 Schematic diagram of the non-monotonic disadvantage of the relevant technology curve.
[0044] Figure 3 Schematic diagram of some embodiments of the image contrast editing method disclosed in the present invention.
[0045] Figure 4 Schematic diagrams of other embodiments of the image contrast editing method disclosed in the present invention.
[0046] Figure 5 This is a schematic diagram of an image contrast editing device according to some embodiments of the present disclosure operating in a spline curve mode.
[0047] Figure 6 It is a schematic diagram of applying nonlinear constraints to EGGCM in some embodiments of the present disclosure.
[0048] Figure 7 It is a schematic diagram of an image contrast editing device operating in a curve fitting mode in some embodiments of the present disclosure.
[0049] Figure 8 It is a schematic diagram of using the additive composite (AddMix) method to generate a composite EGGCM curve to fit the image cumulative histogram in some embodiments of the present disclosure.
[0050] Fig. 9 Schematic diagram of using the function composite (CmpMix) method to generate a composite EGGCM curve to fit the image cumulative histogram in some embodiments of the present disclosure.
[0051] Fig.10A schematic diagram of a mapping curve generated by the image contrast editing method disclosed herein when operating in a cascade parameter adjustment mode.
[0052] Fig.11 It is a schematic diagram of applying the image contrast editing method disclosed in the present invention to adaptive image contrast enhancement.
[0053] Fig.12 Schematic diagram of some embodiments of the image contrast editing device disclosed in the present invention.
[0054] Fig.13 Schematic diagrams of other embodiments of the image contrast editing device disclosed in the present invention. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0056] Unless specifically stated otherwise, the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0057] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0058] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0059] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0060] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0061] The inventors have found through research that the related art has also proposed many methods for generating image contrast mapping curves, such as a dynamic contrast enhancement method based on function curve transformation and a method for obtaining an image gamma curve and enhancing image contrast.
[0062] However, the related art methods still have the following technical problems:
[0063] 1. Figure 1 The following is a schematic diagram of the shortcomings of the relevant technical curve value out of bounds. Figure 1 As shown in the figure, when the curve value is out of bounds (less than 0, or greater than 255), the software usually cuts off the value, causing a sudden change in the image transition. When the curve is cut off, the image will appear "dead black" or "overexposed".
[0064] 2. Figure 2 It is a schematic diagram of the non-monotonicity disadvantage of the relevant technology curve. Figure 2 As shown, the curve is non-monotonic, which will cause the relationship between the light and dark pixels of the image to be changed, resulting in distortion.
[0065] 3. The types of curves represented by related technologies are very limited and have low scalability. In image editing or HDR image display scenarios, these curves will vary greatly depending on the image scene, so users hope to have a general method to arbitrarily construct a curve that meets the above constraints.
[0066] 4. Monotonicity constraints of related technologies are usually optional, and users hope to be able to flexibly choose whether to impose monotonicity constraints.
[0067] 5. In the related art, users lack effective means to adjust parameters. For example, in the histogram-based mapping curve generation scheme, the mapping curve is usually directly generated in some way according to the image histogram, such as histogram equalization. At this time, the user cannot control its characteristics. In some application scenarios, such as HDR video display, the transition between one image and another frame in the video may not be continuous enough, affecting the user experience.
[0068] In view of at least one of the above technical problems, the present disclosure provides an image contrast editing method and device, and a computer-readable storage medium, which are described below through specific embodiments.
[0069] Figure 3 Schematic diagram of some embodiments of the image contrast editing method disclosed in the present invention. Preferably, this embodiment can be performed by the image contrast editing device disclosed in the present invention. The method comprises the following steps:
[0070] Step 31, receiving the image to be edited, control points and control conditions inputted by the user into the module.
[0071] Step 32: Generate a contrast mapping curve using a generalized exponential gamma model according to the control points and control conditions input by the user.
[0072] In some embodiments of the present disclosure, the generalized exponential gamma model may be an Exponential Generalized Gamma Curve Model (EGGCM).
[0073] Step 33: Map the image pixel values of the image to be edited according to the generated contrast mapping curve function to obtain an enhanced image.
[0074] Based on the image contrast editing method provided by the above embodiment of the present disclosure, the generalized exponential gamma model is adopted to ensure the continuity and boundedness of the contrast mapping curve, and will not cause discontinuity or out-of-bounds of pixel values.
[0075] The above-mentioned embodiment of the present disclosure generates a function curve F(x) based on the parameters input by the user and an exponential generalized gamma model. The function curve is applied to perform function mapping on the image data, so as to achieve the purpose of modifying the visual effect of the image data.
[0076] Figure 4 Schematic diagram of other embodiments of the image contrast editing method of the present disclosure. Preferably, this embodiment can be executed by the image contrast editing device of the present disclosure. Figure 4 The embodiment also provides a comparison between the image contrast editing method disclosed in the present invention and the conventional method of the related art. Figure 4 As shown, the conventional method of the related art only includes: the user inputs the control point; and the curve is generated by spline interpolation. However, the image contrast editing method disclosed in the present invention may include the following steps 41 to 46, specifically:
[0077] In step 41, the image to be edited, the control points and the control conditions are received from the user input module.
[0078] In step 42, it is determined whether the contrast mapping curve is required to pass through the control point according to the control point and control condition input by the user. If the contrast mapping curve is required to pass through the control point, step 43 is executed; otherwise, if the contrast mapping curve is not required to pass through the control point, step 44 is executed.
[0079] In step 43, a contrast mapping curve is generated using a generalized exponential gamma spline curve model.
[0080] In some embodiments of the present disclosure, the definition of the generalized exponential gamma model F(x) is as shown in formula (1).
[0081] F(x)=α+βf(x)
[0082] f(x)=x exp(Φ(x)) (1)
[0083] In formula (1), the contrast mapping curve function F(x) is linearly related to the generalized exponential gamma model function f(x), and α and β are model parameters. Therefore, the present disclosure will study the contrast mapping curve function F(x) by studying the generalized exponential gamma model function f(x). In formula (1), Φ(x) is defined as the kernel function of the generalized exponential gamma model function f(x).
[0084] In some embodiments of the present disclosure, the kernel function of the generalized exponential gamma model function is a polynomial function or a spline curve function.
[0085] In some embodiments of the present disclosure, the kernel function of the generalized exponential gamma model function may be a polynomial function, as shown in formula (2).
[0086]
[0087] In formula (2), a i is the model parameter, n is the order of the model, and i is a natural number greater than or equal to 0 and less than or equal to n.
[0088] In some embodiments of the present disclosure, the kernel function of the generalized exponential gamma model function may be a spline curve function, such as a cubic spline function or a B-spline function, as shown in formula (3).
[0089]
[0090] In formula (3), Y i (x) is a series of control points [x1,x2,...,x n ],[y1,y2,...,y n ] is the spline function defined by .
[0091] In some embodiments of the present disclosure, the generalized exponential gamma model function f(x) may have at least one of the following properties: passing through a fixed point, being bounded (having upper and lower boundaries), and being continuous in derivatives of any order.
[0092] In some embodiments of the present disclosure, the domain of the generalized exponential gamma model function f(x) may be [0, 1], which can ensure that the generated F(x) maps the input x to [α, α+β].
[0093] In some embodiments of the present disclosure, it can be proved that the generalized exponential gamma model function f(x) has the following properties:
[0094] Passing a fixed point: f(0) = 0, f(1) = 1;
[0095] Boundedness: 0≤f(x)≤1;
[0096] Smoothness: The derivatives of any order of f(x) are continuous.
[0097] In the above embodiments of the present disclosure, no matter how the user sets the parameters, this form always ensures that the generated F(x) correctly maps the input x to [α, α+β], unlike other methods that may cause out-of-bounds.
[0098] Since the parameters of the above embodiments of the present disclosure only represent legal curves, their representation is more compact than a general polynomial parameterization method, that is, the same curve has fewer parameters.
[0099] Figure 5 Schematic diagram of the image contrast editing device in some embodiments of the present disclosure working in the spline curve mode. In this mode, the user inputs a number of control points (x i ,y i ), this system generates the required mapping curve by spline curve interpolation. This method can ensure that the curve passes through each control point, but does not support the imposition of monotonicity constraints. Figure 5 As shown, the user inputs x=[0.1 0.2 0.6 0.75 0.8 0.99], y=[0.0 0.1 0.8 0.9 1 0.91]. Figure 5 The contrast mapping curves generated by using the 2nd-order EGGCM and the contrast mapping curves generated by using the 8th-order EGGCM are respectively given. Figure 5 The embodiment adopts cubic spline curve difference generation.
[0100] exist Figure 4 In step 44 of the embodiment, it is determined whether the contrast mapping curve is required to be monotonic; if the contrast mapping curve is required to be monotonic, step 45 is executed; otherwise, if the contrast mapping curve is not required to be monotonic, step 46 is executed.
[0101] The above-mentioned embodiment of the present disclosure can further impose constraints on the exponential generalized gamma model to perform monotonicity, thereby ensuring that the size relationship of the image pixels before and after mapping will not be changed.
[0102] exist Figure 4 In step 45 of the embodiment, a generalized exponential gamma model fitting algorithm with monotonicity constraint is used to generate a contrast mapping curve.
[0103] In some embodiments of the present disclosure, the monotonicity constraint condition is that the derivative f'(x) of the generalized exponential gamma model function f(x) is greater than or equal to 0.
[0104] In some embodiments of the present disclosure, monotonicity requires f'(x)≥0. When a polynomial kernel function is used, constraint condition formula (4) can be derived.
[0105]
[0106] By discretizing x, x=[x0,x1,x2,...,x N-1 ] T ,
[0107]
[0108] Formula (4) can be expressed as a linear inequality constraint, as shown in formula (5).
[0109] Ca≤d (5)
[0110] In formula (5), d j =-1 / x j logx j ,a=[a0,a1,...,a n ] T .
[0111] Figure 6 Schematic diagram of applying nonlinear constraints to EGGCM in some embodiments of the present disclosure. Figure 6 As shown, the line connecting the discrete points Δ is the curve obtained by fitting the EGGCM, and the light-colored curve is the contrast mapping curve after applying the above-mentioned monotonicity constraint condition to the nonlinear fitting of EGGCM.
[0112] Therefore, the above-mentioned embodiment of the present disclosure can use a linear programming method to solve the system, which has the advantage of less calculation amount.
[0113] exist Figure 4 In step 46 of the embodiment, the image contrast editing device generates a contrast mapping curve using a generalized exponential gamma model fitting algorithm.
[0114] Figure 7 FIG. 1 is a schematic diagram of an image contrast editing device in some embodiments of the present disclosure working in a curve fitting mode. Figure 7 As shown, according to the user's five control points, a third-order EGGCM is used, and then a generalized exponential gamma model fitting algorithm is used to generate a contrast mapping curve.
[0115] The above embodiments of the present disclosure can generate multiple mapping curves by compounding functions to obtain more complex mapping curves. This mode is conducive to representing a high-order complex model in the form of multiple low-order simple EGGCM models.
[0116] In some embodiments of the present disclosure, the generalized exponential gamma model fitting algorithm is: performing at least one of additive compounding, multiplicative compounding and functional compounding on multiple low-order generalized exponential gamma models to generate a more complex generalized exponential gamma model function.
[0117] In some embodiments of the present disclosure, specific compounding methods include:
[0118] Additive compounding is shown in formula (6):
[0119]
[0120] In formula (6), λ i Any non-negative number.
[0121] The multiplicative compound is shown in formula (7):
[0122]
[0123] In formula (7), λ i is any non-negative number (normalization is not required).
[0124] The function composition is shown in formula (8):
[0125] f mix (x) = f n (...f2(f1(x))) (8)
[0126] In formula (6-8), f i (x) can be a function curve represented by EGGCM of any order. It is easy to prove that these composites will still retain the original smoothness, boundedness, and monotonicity of EGGCM (if all f i (x) is monotonic). Users can choose the compounding method and quantity according to the specific usage scenario.
[0127] Figure 8 It is a schematic diagram of using the additive composite (AddMix) method to generate a composite EGGCM curve to fit the image cumulative histogram in some embodiments of the present disclosure. Figure 8 A comparison between the mapping curves and the image accumulation histogram obtained by using the 2nd order additive composite EGGCM curve fitting algorithm, the 4th order additive composite EGGCM curve fitting algorithm and the 8th order additive composite EGGCM curve fitting algorithm is given. Fig. 9 Schematic diagram of using function combination (CmpMix) to generate composite EGGCM curves for image cumulative histogram fitting in some embodiments of the present disclosure. Fig. 9 A comparison between the mapping curves and the image accumulation histogram obtained by using the 2nd-order function composite EGGCM curve fitting algorithm, the 4th-order function composite EGGCM curve fitting algorithm and the 8th-order function composite EGGCM curve fitting algorithm is given. Figure 8 and Fig. 9 The higher the order used in the embodiment, the better the approximation effect.
[0128] When the method and device of the above embodiments of the present disclosure work in the curve fitting mode, the user inputs a number of control points (x i ,y i ), the above embodiment of the present disclosure generates the required mapping curve by curve fitting. The user can choose whether to impose a monotonicity constraint to generate a monotonic curve.
[0129] In the above embodiment of the present disclosure, when the number of control points is less than or equal to the model order, the curve can be guaranteed to pass through each control point. When the number of control points is greater than the model order, the fitting cannot be guaranteed to pass through each control point, and the overall distance metric is minimized according to the distance metric specified by the user.
[0130] In the above embodiments of the present disclosure, the user can use different curve fitting algorithms or distance metric functions for fitting. The user can specify different weights for different control points, thereby relaxing or narrowing the local fitting error.
[0131] In some embodiments of the present disclosure, the image contrast editing method of the present disclosure may further include: Unlike high-order EGGCM functions (n≥3) which can only be monotonized using numerical methods, low-order EGGCM functions (order n<3) can be directly monotonized by rewriting the formula. A normal 2nd-order EGGCM is expressed as shown in formula (9).
[0132]
[0133] The inventors have deduced that after applying the monotonicity constraint, formula (9) is re-expressed as formula (10):
[0134]
[0135] In formula (10), e represents a natural constant. At this time, a, It can take any value, and formula (10) can guarantee its monotonicity. Therefore, users can adjust it at will, which is very convenient for fine-tuning with a slider in the software interface. Therefore, the low-order monotonic EGGCM function is particularly suitable as the basic module in the composite model.
[0136] In some embodiments of the present disclosure, the parameters a, Continuously adjustable.
[0137] In some embodiments of the present disclosure, the image contrast editing method of the present disclosure may also include: in the cascade parameter adjustment mode, multiple generalized exponential gamma model function curves are combined to form a contrast mapping curve function through the above-mentioned compounding method (additive, multiplicative, function compounding). In the control interface, each generalized exponential gamma model function curve is displayed one by one in a waterfall manner in the order of being compounded, for example, the parameters of the curve are displayed. The user can control the number of compound curves by adding or deleting the number of waterfalls as needed to control the complexity of the final contrast mapping curve, and can also adjust the curve parameters of each level separately to control the curve shape.
[0138] Fig.10 The figure is a schematic diagram of the image contrast editing method disclosed in the present invention working in the cascade parameter adjustment mode to generate a mapping curve. Fig.10 As shown, when the image contrast editing method disclosed in the present invention works in the cascade parameter adjustment mode, the user can cascade multiple generalized exponential gamma model function curves in a waterfall manner to represent a complex mapping curve, and adjust the curve parameters step by step. For example: in the first level generalized exponential gamma model function, the parameters a=0.12, b=0.34, c=0.67 are set; in the second level generalized exponential gamma model function, the parameters a=-3.2, b=0.25, c=4.32 are set.
[0139] Since the composition of monotonic functions is still monotonic, this mode supports monotonicity control.
[0140] In some embodiments of the present disclosure, a low-order EGGCM (n<3) can be used as the minimum unit of the cascade. Since the parameters of each level are continuously adjustable at this time, they can be adjusted by simple means such as sliding bars. Therefore, it can be used to adjust the mapping curve of devices that do not support mouse, such as televisions, projectors, printers, etc.
[0141] Fig.11 Schematic diagram of the image contrast editing method disclosed in the present invention applied to adaptive image contrast enhancement. Fig.11 As shown, the above-mentioned embodiment of the present disclosure can discretize the cumulative histogram of the image into control points, which are input as the target of curve fitting, so as to obtain a mapping curve. The user controls the complexity of the mapping curve by controlling the model order. When the order is low, the obtained curve is simpler and continuous, and the obtained image transition is smoother. When the order is high, the obtained mapping curve can approximate the cumulative histogram of the image with high precision. At this time, the obtained function mapping curve is similar to the traditional histogram equalization of the related art, but avoids the defect that the traditional histogram equalization is prone to abrupt changes.
[0142] The above embodiment of the present disclosure proposes a new method for editing and controlling the contrast mapping curve based on the exponential generalized gamma curve model, which can ensure that no matter how the user operates, the mapping curve always meets the following property requirements: continuity, smoothness, boundedness, monotonicity (optional), etc. The method of the above embodiment of the present disclosure not only has better properties than the traditional method, but also can be fully compatible with the traditional method, and has good practicality.
[0143] The exponential generalized gamma model adopted in the above embodiments of the present disclosure ensures the continuity and boundedness of the tone mapping curve, and does not cause discontinuity or out-of-bounds pixel values.
[0144] The method of the above embodiment of the present disclosure can ensure that the order relationship of the brightness of image pixels does not change by applying a monotonicity constraint.
[0145] The method of the above embodiment of the present disclosure has a more compact representation form, so the storage space can be saved in the process of curve parameter storage and encoding transmission.
[0146] The parameters of the low-order exponential generalized gamma model in the above-mentioned embodiment of the present disclosure can take any values and are continuously adjustable, so the user can conveniently adjust these parameters in a device that does not support a mouse.
[0147] Fig.12 Schematic diagram of some embodiments of the image contrast editing device disclosed in the present invention. Fig.12 As shown, the image contrast editing device of the present disclosure may include a user input receiving module 121, a contrast curve generating module 122 and an image enhancing module 123, wherein:
[0148] The user input receiving module 121 is used to receive the image to be edited, the control point and the control condition input by the user.
[0149] The contrast curve generating module 122 is used to generate a contrast mapping curve using a generalized exponential gamma model according to the control points and control conditions input by the user.
[0150] In some embodiments of the present disclosure, the kernel function of the contrast mapping curve function may be a polynomial function or a spline curve function.
[0151] In some embodiments of the present disclosure, the contrast mapping curve function has at least one of the following properties: passing through a fixed point, being bounded (for example, having upper and lower boundaries), and being continuous in any order of derivative.
[0152] In some embodiments of the present disclosure, the contrast mapping curve function is linearly related to the generalized exponential gamma model function.
[0153] In some embodiments of the present disclosure, the contrast curve generating module 122 may be used to determine whether the contrast mapping curve is required to pass through a control point; if the contrast mapping curve is required to pass through a control point, a generalized exponential gamma spline curve model is used to generate the contrast mapping curve.
[0154] In some embodiments of the present disclosure, the contrast curve generating module 122 may also be used to determine whether the contrast mapping curve is required to be monotonic when the contrast mapping curve is not required to pass through a control point; when the contrast mapping curve is required to be monotonic, a generalized exponential gamma model fitting algorithm with a monotonicity constraint is used to generate the contrast mapping curve; when the contrast mapping curve is not required to be monotonic, a generalized exponential gamma model fitting algorithm is used to generate the contrast mapping curve.
[0155] In some embodiments of the present disclosure, the monotonicity constraint is that the derivative of the generalized exponential gamma model function is greater than 0.
[0156] In some embodiments of the present disclosure, the generalized exponential gamma model fitting algorithm may be: performing at least one of additive compounding, multiplicative compounding and functional compounding on a plurality of low-order contrast generalized exponential gamma models to generate a contrast mapping curve function.
[0157] The image enhancement module 123 is used to map the image pixel values of the image to be edited according to the generated contrast mapping curve function to obtain an enhanced image.
[0158] In some embodiments of the present disclosure, the image contrast editing device of the present disclosure can also be used to cascade multiple mapping curves in a waterfall manner to form a contrast mapping curve function in a cascade parameter adjustment mode, and adjust the curve parameters step by step.
[0159] In some embodiments of the present disclosure, the image contrast editing device is used to implement any of the above embodiments (for example Figure 3-Figure 11 The operation of the image contrast editing method described in any embodiment).
[0160] Based on the image contrast editing device provided by the above-mentioned embodiment of the present disclosure, a series of control points and control conditions inputted through a control interface are received through a user input receiving module; a contrast curve generating module uses a generalized exponential gamma model to call a corresponding algorithm based on the control points and control conditions inputted by the user to generate a continuous, smooth, bounded, monotonic (optional) contrast mapping curve F(x); and an image enhancement module is used: according to the generated contrast mapping curve function F(x), the image pixel value I(m,n) of the image to be edited is mapped to obtain an enhanced image.
[0161] Fig.13Schematic diagrams of other embodiments of the image contrast editing device disclosed in the present invention. Fig.13 As shown, the image contrast editing device disclosed in the present invention may include a memory 131 and a processor 132, wherein:
[0162] The memory 131 is used to store instructions.
[0163] The processor 132 is configured to execute the instructions so that the device performs any of the above embodiments (for example Figure 3-Figure 11 The operation of the image contrast editing method described in any embodiment).
[0164] The above embodiment of the present disclosure proposes a new device for editing and controlling contrast mapping curves based on an exponential generalized gamma curve model, which can ensure that no matter how the user operates, the mapping curve always meets the following property requirements: continuity, smoothness, boundedness, monotonicity (optional), etc. The device of the above embodiment of the present disclosure not only has better properties than the traditional method, but also can be fully compatible with the traditional method, and has good practicality.
[0165] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, any of the above embodiments (for example Figure 3-Figure 11 The image contrast editing method described in any embodiment).
[0166] The exponential generalized gamma model adopted in the above embodiments of the present disclosure ensures the continuity and boundedness of the tone mapping curve, and does not cause discontinuity or out-of-bounds pixel values.
[0167] The above embodiments of the present disclosure can ensure that the order relationship of image pixel brightness does not change by applying monotonicity constraints.
[0168] The above embodiments of the present disclosure have a more compact representation form, so storage space can be saved during curve parameter storage and encoding transmission.
[0169] The parameters of the low-order EGGCM in the above-mentioned embodiments of the present disclosure can take any values and are continuously adjustable, so the user can conveniently adjust these parameters in a device that does not support a mouse.
[0170] The image contrast editing device described above can be implemented as a general-purpose processor, a programmable logic controller (PLC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components or any appropriate combination thereof for performing the functions described in the present application.
[0171] So far, the present disclosure has been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
[0172] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0173] The description of the present disclosure is given for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure, and to enable those of ordinary skill in the art to understand the present disclosure and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. An image contrast editing method, characterized in that: include: receiving an image to be edited, a control point and a control condition from a user input module; According to the control points and control conditions input by the user, the contrast mapping curve is generated using the generalized exponential gamma model, where the contrast mapping curve function is linearly related to the generalized exponential gamma model function. The generalized exponential gamma model function f(x) is: , is the kernel function of the generalized exponential gamma model function; The image pixel values of the image to be edited are mapped according to the generated contrast mapping curve function to obtain an enhanced image.
2. The image contrast editing method according to claim 1, characterized in that: The step of generating a contrast mapping curve using a generalized exponential gamma model according to the control point and control condition input by the user includes: Determine whether the contrast mapping curve is required to pass through the control point; When the contrast mapping curve is required to pass through the control point, a generalized exponential gamma spline curve model is used to generate the contrast mapping curve.
3. The image contrast editing method according to claim 2, characterized in that: The step of generating a contrast mapping curve using a generalized exponential gamma model according to the control point and control condition input by the user further includes: In the case where the contrast mapping curve is not required to pass through the control point, determining whether the contrast mapping curve is required to be monotonic; When the contrast mapping curve is required to be monotonic, a generalized exponential gamma model fitting algorithm with monotonicity constraint is used to generate the contrast mapping curve.
4. The image contrast editing method according to claim 3, characterized in that: The step of generating a contrast mapping curve using a generalized exponential gamma model according to the control point and control condition input by the user further includes: When the contrast mapping curve is not required to be monotonic, a generalized exponential gamma model fitting algorithm is used to generate the contrast mapping curve.
5. The image contrast editing method according to any one of claims 1 to 4, characterized in that: The contrast mapping curve function F(x) is linearly related to the generalized exponential gamma model function f(x). , where α and β are model parameters.
6. The image contrast editing method according to any one of claims 1 to 4, characterized in that: The kernel function of the generalized exponential gamma model function is a polynomial function or a spline curve function.
7. The image contrast editing method according to claim 6, characterized in that: Kernel function of the generalized exponential gamma model function For a polynomial function, , where a i is the model parameter, n is the order of the model, and i is a natural number greater than or equal to 0 and less than or equal to n.
8. The method according to any one of claims 1 to 4, characterized in that The generalized exponential gamma model function has at least one of the following properties: passing through a fixed point, being bounded, and being continuous at any order of derivative.
9. The method according to claim 3 or 4, characterized in that: The monotonicity constraint is that the derivative of the generalized exponential gamma model function is greater than 0.
10. The image contrast editing method according to claim 3 or 4, characterized in that: The generalized exponential gamma model fitting algorithm is: performing at least one of additive compounding, multiplicative compounding and functional compounding on a plurality of low-order contrast generalized exponential gamma models to generate a contrast mapping curve function.
11. An image contrast editing device, characterized in that: include: A user input receiving module, used for receiving the image to be edited, the control point and the control condition input by the user; The contrast curve generation module is used to generate a contrast mapping curve using a generalized exponential gamma model according to the control points and control conditions input by the user, wherein the contrast mapping curve function is linearly related to the generalized exponential gamma model function, and the generalized exponential gamma model function f(x) is: , is the kernel function of the generalized exponential gamma model function; The image enhancement module is used to map the image pixel values of the image to be edited according to the generated contrast mapping curve function to obtain an enhanced image.
12. The image contrast editing device according to claim 11, characterized in that: The image contrast editing device is used to perform operations to implement the image contrast editing method as described in any one of claims 2-10.
13. An image contrast editing device, characterized in that: include: A memory for storing instructions; A processor is used to execute the instructions so that the device performs operations to implement the image contrast editing method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the image contrast editing method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Method and device for regulating image tone and graphical user interface used in it
CN1495675A
Image Processing Device and Method, Recording Medium, and Program
US20080199074A1
