Contrast enhancement method and device, electronic equipment and storage medium

By generating the target enhancement curve of the basic curve and correction terms, the problems of large calculation amount and non-smooth brightness in the prior art are solved, and efficient and smooth contrast enhancement is achieved.

CN120378562APending Publication Date: 2025-07-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410094873.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-23
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the mapping curve determines the contrast enhancement based on the curve interpolation method, with large calculation amount and unsmooth brightness transition, which reduces the calculation efficiency and enhancement effect.

Method used

By obtaining target configuration information, a basic curve is generated and the correction term is determined based on the slope of the target point, a target enhancement curve is formed, curve interpolation is avoided, calculation efficiency is improved, and curve smoothness is enhanced.

Benefits of technology

Improves calculation efficiency, avoids the situation of unsmooth brightness transition, and improves the contrast enhancement effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378562A_ABST
    Figure CN120378562A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a contrast enhancement method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring target configuration information and original media data; a target enhancement curve is determined according to the target configuration information, the target enhancement curve comprises a basic curve and a correction term, the basic curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the basic curve; and performing contrast enhancement on the original media data based on the target enhancement curve. According to the embodiment of the invention, the target enhancement curve comprises the basic curve and the correction term, the basic curve is generated based on the target configuration information, curve interpolation does not need to be executed, and the calculation efficiency can be improved; the target point is corrected based on the slope of the target point on the basic curve through the correction item, so that the whole target enhancement curve is relatively smooth, the condition of unsmooth brightness transition of partial pixel points of the target media data is avoided, and the contrast enhancement effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to computer technologies, and particularly to a contrast enhancement method, apparatus, electronic device, and storage medium. Background Art

[0002] Contrast enhancement refers to a technology that maps the brightness of the original media data to a new brightness using a mapping curve to enhance the contrast.

[0003] Currently, contrast enhancement is achieved by increasing the slope of the mapping curve in the target area, where the target area is determined based on the distribution state of the brightness of the original media data. For example, the target area can be a curve segment corresponding to the brightness within a preset brightness interval. However, the current mapping curve is determined based on curve interpolation, with a relatively large amount of calculation, reducing the calculation efficiency. In addition, the mapping curve is not smooth enough at some points, resulting in uneven brightness transitions in the target media data after contrast enhancement at these points. Summary of the Invention

[0004] The present disclosure provides a contrast enhancement method, apparatus, electronic device, and storage medium, which can improve the calculation efficiency and the overall smoothness of the curve.

[0005] In a first aspect, embodiments of the present disclosure provide a contrast enhancement method, including:

[0006] Obtaining target configuration information and original media data;

[0007] Determining a target enhancement curve according to the target configuration information, where the target enhancement curve includes a base curve and a correction term, the base curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the base curve;

[0008] Performing contrast enhancement on the original media data based on the target enhancement curve.

[0009] In a second aspect, embodiments of the present disclosure further provide a contrast enhancement apparatus, including:

[0010] An information acquisition module, configured to obtain target configuration information and original media data;

[0011] A curve determination module, configured to determine a target enhancement curve according to the target configuration information, where the target enhancement curve includes a base curve and a correction term, the base curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the base curve;

[0012] An enhancement module, configured to perform contrast enhancement on the original media data based on the target enhancement curve.

[0013] In a third aspect, embodiments of the present disclosure further provide an electronic device, the electronic device comprising:

[0014] One or more processors;

[0015] A storage device for storing one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the contrast enhancement method as described in any embodiment of the present disclosure.

[0017] In a fourth aspect, embodiments of the present disclosure further provide a storage medium containing computer-executable instructions, the computer-executable instructions being used to execute the contrast enhancement method as described in any embodiment of the present disclosure when executed by a computer processor.

[0018] Embodiments of the present disclosure provide a contrast enhancement method, apparatus, electronic device, and storage medium. By determining a target enhancement curve based on the acquired target configuration information and performing contrast enhancement on the original media data based on the target enhancement curve. Since the target enhancement curve includes a base curve and a correction term, and the base curve is generated based on the target configuration information, curve interpolation does not need to be performed, which can improve the calculation efficiency; in addition, by correcting the target point based on the slope of the target point on the base curve by the correction term, the overall target enhancement curve can be made relatively smooth, avoiding the situation where the brightness transition of some pixel points of the target media data is not smooth, and improving the contrast enhancement effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the accompanying drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the original elements and elements are not necessarily drawn to scale.

[0020] Figure 1 It is a schematic flowchart of a contrast enhancement method provided by an embodiment of the present disclosure;

[0021] Figure 2 It is a schematic diagram of a target enhancement curve provided by an embodiment of the present disclosure;

[0022] Figure 3 It is a schematic diagram of a base curve provided by an embodiment of the present disclosure;

[0023] Figure 4 It is a schematic flowchart of another contrast enhancement method provided by an embodiment of the present disclosure;

[0024] Figure 5Schematic structural diagram of a contrast enhancement device provided by an embodiment of the present disclosure;

[0025] Figure 6 Schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0027] It should be understood that the various steps recorded in the method embodiments of the present disclosure can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0028] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.

[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0032] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to users and the authorization of users should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0033] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application, a server, or a storage medium that performs the operations of the present disclosure's technical solution based on the prompt message.

[0034] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0035] It can be understood that the above process of notifying and obtaining user authorization is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0036] It can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0037] Figure 1 FIG. is a schematic flowchart of a contrast enhancement method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of enhancing the contrast of multimedia data. This method can be executed by a contrast enhancement device, and the device can be implemented in the form of software and / or hardware. Optionally, it is implemented by an electronic device, and the electronic device can be a mobile terminal, a PC terminal or a server, etc.

[0038] As Figure 1 shown, the method includes:

[0039] S110. Obtain target configuration information and original media data.

[0040] Among them, the configuration information is used to determine the shape of the enhancement curve. The target configuration information refers to the configuration information input by the user through the interaction interface. The target configuration information includes target enhancement parameters and a target fulcrum. Among them, the target enhancement parameters are used to determine the shape of the target enhancement curve. The target fulcrum represents the intersection point of target enhancement curves of different shapes, that is, the point that all the obtained target enhancement curves pass through regardless of how the parameters of the target enhancement curve are adjusted, and is used as the target fulcrum. Then, the target enhancement curve can be generated in real time according to the target enhancement parameters and the target fulcrum input by the user.

[0041] Optionally, a set of candidate configuration information can be preset for the user to select. The candidate configuration information includes candidate enhancement parameters and candidate fulcrums. Then, some candidate enhancement curves are pre-generated according to the candidate enhancement parameters and candidate fulcrums, forming a candidate enhancement curve set. Each candidate enhancement curve in the candidate enhancement curve set is associated with the candidate configuration information. A selection function for the candidate configuration information is provided on the interaction interface. For example, the selection function for the candidate configuration information can be provided in the form of a slider control. The selection function for the candidate configuration information can also be provided in the form of a drop-down box control. It can be understood that other ways can also be adopted to provide the selection function for the candidate configuration information on the interaction interface, and the embodiments of the present disclosure do not make specific limitations thereto.

[0042] The original media data may include an image or video to be subjected to contrast enhancement, etc. For example, the original media data may be a photo or video stored locally, etc. Alternatively, the original media data may also be a photo or video currently being taken, etc. Alternatively, the original media data may also include an image or video whose contrast enhancement effect does not meet the expectation, etc. Alternatively, the original media data may also include an image or video after effect adjustment in the form of saturation adjustment and / or sharpening adjustment, etc. The embodiments of the present disclosure do not specifically limit the type of the original media data.

[0043] Exemplarily, in response to a data loading event in the interaction interface, the original media data uploaded by the user is acquired and the original media data is displayed in the interaction interface. In response to a configuration information setting event in the interaction interface, the target enhancement parameters and the target fulcrum are acquired as the target configuration information, where the target enhancement parameters are used to determine the shape of the target enhancement curve, and the target fulcrum represents the intersection point of target enhancement curves of different shapes.

[0044] S120. Determine a target enhancement curve according to the target configuration information, where the target enhancement curve includes a basic curve and a correction term, the basic curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the basic curve.

[0045] In the embodiments of the present disclosure, the target enhancement curve represents an S-shaped curve with preset coordinate points as endpoints and passing through the target fulcrum. Since the S-shaped curve has good smoothness near (0, 0) and (1, 1), it avoids the unevenness at some points in the form of a broken line, and can also avoid information loss caused by curve truncation. Figure 2 It is a schematic diagram of a target enhancement curve provided by the embodiments of the present disclosure. As Figure 2 shown, the target enhancement curve can be an S-shaped curve with (0, 0) and (1, 1) as endpoints and passing through the target fulcrum (x p , y p ) specified by the user.

[0046] In some embodiments, the generation method of the base curve includes: performing processing such as translation and scale transformation on a preset curve based on a target enhancement parameter and a target fulcrum. Through the translation processing, the abscissa of the curve endpoint is moved to 0, and through the scale transformation, the shape of the curve is changed. Specifically, a preset curve is obtained, where the preset curve is an S-shaped curve. For example, a curve corresponding to a sigmoid function, a logistic function, or a Richards function, etc., is used as the preset curve. A scale transformation parameter is determined based on the target enhancement parameter, and then the preset curve is translated and scaled according to the target fulcrum and the scale transformation parameter to obtain the base curve. The abscissa of the base curve represents the input brightness, and the ordinate represents the output brightness.

[0047] Figure 3 FIG. is a schematic diagram of a base curve provided by an embodiment of the present disclosure. As Figure 3 shown, the base curve is S-shaped, however, the endpoints of the base curve are (0, a) and (1, b). Wherein, a > 0, b > 1; or, a > 0, b < 1; or, a < 0, b > 1; or, a > 0, b > 1. Therefore, a correction term needs to be used to correct the offset of the base curve at the endpoints. To ensure the overall smoothness of the curve, not only the endpoints need to be corrected, but also the points inside the curve need to be adaptively corrected.

[0048] In some embodiments, the generation method of the correction term includes: dividing the base curve into two curve segments according to the target fulcrum (x p , y p ). For the curve segment corresponding to the interval [0, x p , determine the first deviation between the slope of the base curve at the endpoint (0, a) and the slope at (x p , y p ), and determine the second deviation between the output brightness of the endpoint (0, a) of the base curve and the output brightness at (0, 0). Combining the deviation between the slope of the base curve at the target point and the slope at (x p , y p ) and the first deviation, determine the adjustment ratio, and determine the correction term according to the adjustment ratio and the second deviation.

[0049] Exemplarily, determining the target enhancement curve according to the target configuration information includes: determining a target scale transformation parameter according to the target enhancement parameter; adjusting the preset curve according to the target scale transformation parameter and the target fulcrum to obtain a base curve; determining a correction term for a target point on the base curve, and superimposing the correction term on the target point to obtain the target enhancement curve.

[0050] Wherein, the base curve can be a preset curve that has been translated and scaled.

[0051] For example, according to the mapping relationship formula between the enhancement parameter and the scale transformation parameter, the target enhancement parameter is mapped to the target scale transformation parameter. Among them, in combination with the preset candidate enhancement parameters and the expected curve form, the scale transformation parameter is determined. An exponential and polynomial combined formula is used to fit the enhancement parameter scale and the transformation parameter to obtain the fitting coefficient, and the mapping relationship formula is determined according to the fitting coefficient.

[0052] Calculate the target scale transformation parameter according to the target enhancement parameter and the mapping relationship formula. The scale transformation processing of the preset curve can be realized according to the target scale transformation parameter, and the points on the preset curve are translated according to the target fulcrum to obtain the basic curve.

[0053] In some embodiments, determining the correction term of the target point on the basic curve includes: determining the first difference information according to the slope of the endpoint of the basic curve and the slope of the target fulcrum; determining the second difference information according to the endpoint of the basic curve and the target fulcrum; determining the correction term of the target point on the basic curve according to the slope of the target point on the basic curve, the slope of the target fulcrum, the first difference information and the second difference information.

[0054] Specifically, according to the target fulcrum (x p , y p ), the basic curve is divided into two curve segments. For the curve segment corresponding to the interval [0, x p , the slope of the target point on the curve segment is the first derivative at the target point. Denote the slope at the target fulcrum as kp, and the slope at the endpoint (0, a) as k0. Calculate the first difference information according to kp and k0. Determine the second difference information according to the difference in the ordinate between the endpoint (0, a) and the target fulcrum. For the target point on the curve segment corresponding to the interval [0, x p , denote the slope at the target point as k, calculate the slope difference according to kp and k, and determine the adjustment ratio according to the slope difference and the first difference information. Determine the correction term corresponding to the target point according to the adjustment ratio and the second difference information.

[0055] For the curve segment corresponding to the interval [x p , 1], the slope of the target point on the curve segment is the first derivative at the target point. Denote the slope at the target fulcrum as kp, and the slope at the endpoint (1, b) as k1. Calculate the first difference information according to kp and k1. Determine the second difference information according to the difference in the ordinate between the endpoint (1, b) and the target fulcrum. For the target point on the curve segment corresponding to the interval [x p , 1], denote the slope at the target point as k, calculate the slope difference according to kp and k, and determine the adjustment ratio according to the slope difference and the first difference information. Determine the correction term corresponding to the target point according to the adjustment ratio and the second difference information.

[0056] For a target point on the base curve, the correction term of the target point is superimposed on the function value of the target point to obtain the output value corresponding to the target point on the target enhancement curve. Determine the coordinates of the corrected target point according to the input value and output value of the target point, and determine the target enhancement curve according to the coordinates of each corrected target point.

[0057] S130. Perform contrast enhancement on the original media data based on the target enhancement curve.

[0058] Exemplarily, based on the original brightness of the original media data, the target brightness is determined by using the target enhancement curve; the original media data is updated according to the target brightness to obtain the target media data.

[0059] Since the target enhancement curve represents the mapping relationship between the input brightness and the output brightness. Taking the brightness of the original media data as the original brightness, with the original brightness as the independent variable, the function value corresponding to the independent variable is calculated through the target enhancement curve, that is, the target brightness is obtained. Replacing the brightness of the corresponding point in the original media data with the target brightness, the target media data is obtained.

[0060] The technical solution of the embodiments of the present disclosure determines the target enhancement curve through the obtained target configuration information, and performs contrast enhancement on the original media data based on the target enhancement curve. Since the target enhancement curve includes a base curve and a correction term, and the base curve is generated based on the target configuration information, curve interpolation does not need to be performed, which can improve the calculation efficiency; in addition, by correcting the target point based on the slope of the target point on the base curve by the correction term, the overall target enhancement curve can be relatively smooth, avoiding the situation that the brightness transition of some pixel points of the target media data is not smooth, and improving the contrast enhancement effect.

[0061] Figure 4 It is a schematic flowchart of another contrast enhancement method provided by the embodiments of the present disclosure. On the basis of the above embodiments, the embodiments of the present disclosure define the step of determining the target enhancement curve according to the target configuration information.

[0062] As Figure 4 shown, the method includes:

[0063] S410. Obtain target configuration information and original media data.

[0064] S420. Match the target configuration information with the candidate configuration information corresponding to the candidate enhancement curve set to obtain the target enhancement curve, where the candidate configuration information includes candidate enhancement parameters and candidate fulcrums.

[0065] Pre-configure multiple pieces of candidate configuration information composed of candidate enhancement parameters and candidate pivot points. According to the mapping relation between the enhancement parameter and the scale transformation parameter, map the candidate enhancement parameter to a candidate scale transformation parameter. Calculate the candidate scale transformation parameter according to the candidate enhancement parameter and the mapping relation. For each piece of candidate configuration information, adjust the preset curve according to the corresponding scale transformation parameter and candidate pivot point to obtain a basic curve. Calculate a correction term based on the slope of the target point on the basic curve, and correct the target point according to the correction term to obtain a candidate enhanced curve. Determine a set of candidate enhanced curves according to the candidate enhanced curves corresponding to each piece of candidate configuration information.

[0066] Specifically, for the candidate configuration information, scale transformation processing of the preset curve can be realized according to the candidate scale transformation parameter, and translation processing of the points on the preset curve can be carried out according to the candidate pivot point to obtain a basic curve.

[0067] According to the candidate pivot point (x′ p , y′ p ), divide the basic curve into two curve segments. For the curve segment corresponding to the interval [0, x′ p , the slope of the target point on the curve segment is the first derivative at the target point. Denote the slope at the candidate pivot point as k′ p , and denote the slope at the endpoint (0, a) as k′0. Calculate the first difference information according to k′ p and k′0. Determine the second difference information according to the difference in the ordinates of the endpoint (0, a) and the candidate pivot point. For the target point on the curve segment corresponding to the interval [0, x′ p , denote the slope at the target point as k′, calculate the slope difference according to k′ p and k′, and determine the adjustment ratio according to the slope difference and the first difference information. Determine the correction term corresponding to the target point according to the adjustment ratio and the second difference information.

[0068] For the curve segment corresponding to the interval [x′ p , 1], the slope of the target point on the curve segment is the first derivative at the target point. Denote the slope at the candidate pivot point as k′ p , and denote the slope at the endpoint (1, b) as k′1. Calculate the first difference information according to k′ p and k′1. Determine the second difference information according to the difference in the ordinates of the endpoint (1, b) and the candidate pivot point. For the target point on the curve segment corresponding to the interval [x′ p , 1], denote the slope at the target point as k′, calculate the slope difference according to k′ p and k′, and determine the adjustment ratio according to the slope difference and the first difference information. Determine the correction term corresponding to the target point according to the adjustment ratio and the second difference information.

[0069] For a target point on the base curve, the correction term of the target point is superimposed on the function value of the target point to obtain the output value corresponding to the target point on the candidate enhancement curve. Determine the coordinates of the corrected target point according to the input value and output value of the target point, and determine the candidate enhancement curve according to the coordinates of each corrected target point.

[0070] Provide candidate configuration information through an interactive interface for the user to select. In response to the target configuration information input by the user, the target configuration information is matched with the candidate configuration information, and then the candidate configuration information with successful matching is obtained. For example, the candidate configuration information with successful matching is the configuration information identical to the target configuration information. Or, the candidate configuration information with successful matching is the configuration information whose deviation from the target configuration information is less than a set threshold. Select the candidate enhancement curve corresponding to the candidate configuration information with successful matching from the candidate enhancement curve set as the target enhancement curve.

[0071] S430. Perform contrast enhancement on the original media data based on the target enhancement curve.

[0072] The technical solution of the embodiments of the present disclosure matches the obtained target configuration information with the candidate configuration information corresponding to the candidate enhancement curve set to select the target enhancement curve from the candidate enhancement curve set. Since the target enhancement curve can be directly obtained through information matching, the curve determination efficiency is improved.

[0073] Figure 5 The figure is a schematic structural diagram of a contrast enhancement device provided by the embodiments of the present disclosure. The device can be implemented in the form of software and / or hardware. Optionally, it is implemented through an electronic device, which can be a mobile terminal, a PC or a server, etc.

[0074] As Figure 5 shown, the device includes: an information acquisition module 510, a curve determination module 520, and an enhancement module 530.

[0075] The information acquisition module 510 is configured to acquire target configuration information and original media data;

[0076] The curve determination module 520 is configured to determine a target enhancement curve according to the target configuration information, where the target enhancement curve includes a base curve and a correction term, the base curve is generated based on the target configuration information, and the correction term is determined based on the slope of the target point on the base curve;

[0077] The enhancement module 530 is configured to perform contrast enhancement on the original media data based on the target enhancement curve.

[0078] Optionally, the information acquisition module 510 is specifically configured to:

[0079] Obtain a target enhancement parameter and a target fulcrum as target configuration information, where the target enhancement parameter is used to determine the shape of a target enhancement curve, and the target fulcrum represents the intersection point of target enhancement curves of different shapes.

[0080] Optionally, the curve determination module 520 includes:

[0081] A parameter determination unit, configured to determine a target scale transformation parameter according to the target enhancement parameter;

[0082] A curve adjustment unit, configured to adjust a preset curve according to the target scale transformation parameter and the target fulcrum to obtain a base curve;

[0083] A correction unit, configured to determine a correction term for a target point on the base curve, and superimpose the correction term on the target point to obtain a target enhancement curve.

[0084] Optionally, the correction unit is specifically configured to:

[0085] Determine first difference information according to the slope of the endpoint of the base curve and the slope of the target fulcrum;

[0086] Determine second difference information according to the endpoint of the base curve and the target fulcrum;

[0087] Determine a correction term for a target point on the base curve according to the slope of the target point on the base curve, the slope of the target fulcrum, the first difference information, and the second difference information.

[0088] Optionally, the curve determination module 520 is specifically configured to:

[0089] Match the target configuration information with candidate configuration information corresponding to a candidate enhancement curve set to obtain a target enhancement curve, where the candidate configuration information includes a candidate enhancement parameter and a candidate fulcrum.

[0090] Optionally, the enhancement module 530 is specifically configured to:

[0091] Determine a target brightness based on the original brightness of the original media data by using the target enhancement curve;

[0092] Update the original media data according to the target brightness to obtain target media data.

[0093] Optionally, the target enhancement curve represents an S-shaped curve with a preset coordinate point as an endpoint and passing through the target fulcrum.

[0094] The contrast enhancement device provided by the embodiments of the present disclosure can execute the contrast enhancement method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0095] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present disclosure.

[0096] Figure 6 The following is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Referring below to Figure 6 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure (such as Figure 6 the terminal device or server in Figure 6 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0097] As Figure 6 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The editing / output (I / O) interface 605 is also connected to the bus 604.

[0098] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 shows the electronic device 600 having various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0099] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0100] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are for illustrative purposes only and are not used to limit the scope of these messages or information.

[0101] The electronic device provided in the embodiment of the present disclosure and the contrast enhancement method provided in the above embodiment belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0102] The embodiment of the present disclosure provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the contrast enhancement method provided in the above embodiment is implemented.

[0103] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0104] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0105] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.

[0106] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:

[0107] Obtain target configuration information and original media data;

[0108] Determine a target enhancement curve according to the target configuration information, where the target enhancement curve includes a base curve and a correction term, the base curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the base curve;

[0109] Perform contrast enhancement on the original media data based on the target enhancement curve.

[0110] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The foregoing programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions denoted by the blocks may occur in a different order than that denoted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0112] The units described in the embodiments of the present disclosure may be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.

[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM or Flash memory), an optical fiber, a portable Compact Disc Read Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0115] The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.

[0116] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0117] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A contrast enhancement method, characterized in that, Including: Obtain target configuration information and original media data; Determine a target enhancement curve according to the target configuration information, where the target enhancement curve includes a basic curve and a correction term, the basic curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the basic curve; Perform contrast enhancement on the original media data based on the target enhancement curve.

2. The method according to claim 1, characterized in that, The obtaining of the target configuration information includes: Obtain a target enhancement parameter and a target fulcrum as the target configuration information, where the target enhancement parameter is used to determine the shape of the target enhancement curve, and the target fulcrum represents the intersection point of target enhancement curves of different shapes.

3. The method according to claim 2, characterized in that The determining of the target enhancement curve according to the target configuration information includes: Determine a target scale transformation parameter according to the target enhancement parameter; Adjust a preset curve according to the target scale transformation parameter and the target fulcrum to obtain a basic curve; Determine the correction term of the target point on the basic curve, and superimpose the correction term on the target point to obtain the target enhancement curve.

4. The method according to claim 3, wherein The determining of the correction term of the target point on the basic curve includes: Determine first difference information according to the slope of the end point of the basic curve and the slope of the target fulcrum; Determine second difference information according to the end point of the basic curve and the target fulcrum; Determine the correction term of the target point on the basic curve according to the slope of the target point on the basic curve, the slope of the target fulcrum, the first difference information, and the second difference information.

5. The method according to claim 1, wherein The determining of the target enhancement curve according to the target configuration information includes: Match the target configuration information with the candidate configuration information corresponding to a candidate enhancement curve set to obtain the target enhancement curve, where the candidate configuration information includes a candidate enhancement parameter and a candidate fulcrum.

6. The method according to claim 1, wherein The performing of contrast enhancement on the original media data based on the target enhancement curve includes: Use the target enhancement curve to determine a target brightness based on the original brightness of the original media data; Update the original media data according to the target brightness to obtain target media data.

7. The method according to claim 1, wherein The target enhancement curve represents an S-shaped curve with a preset coordinate point as an end point and passing through the target fulcrum.

8. A contrast enhancement device, characterized in that, Including: An information acquisition module for obtaining target configuration information and original media data; A curve determination module for determining a target enhancement curve according to the target configuration information, where the target enhancement curve includes a basic curve and a correction term, the basic curve is generated based on the target configuration information, and the correction term is determined based on the slope of a target point on the basic curve; An enhancement module for performing contrast enhancement on the original media data based on the target enhancement curve.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the contrast enhancement method as described in any one of claims 1-7.

10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the contrast enhancement method as described in any one of claims 1-7 when executed by a computer processor.

Citation Information

Cited By

  • Image adjusting method and system, medium and electronic equipment

    CN121194077A