Method and apparatus for tone mapping, and computer-usable medium storing software for implementing the method
By calculating and using the first and second brightness in the image processing to set the appropriate brightness and selecting the appropriate tone curve, the problem of unstable camera parameters after starting the camera unit is solved, ensuring that the appropriate image is obtained.
Patent Information
- Application Number
- CN202080106305.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-15
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-10-15
AI Technical Summary
In some environments, a specific time has not elapsed since the camera unit is started, resulting in unstable camera parameters and the appropriate tone curve cannot be selected, resulting in the acquired image being unsuitable for the observer, especially the moving images being affected.
By acquiring an image, acquiring illuminance using a light sensor, calculating the first brightness L1 and the second brightness L2, setting the appropriate brightness L according to the camera parameters, and selecting a suitable tone curve for tone mapping.
Ensure that the appropriate image can be obtained even if a specific time has not elapsed after the camera unit is started, avoiding discomfort or strangeness, especially for moving images.
Smart Images

Figure CN116391361B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of image processing technologies, and more particularly, to a method and apparatus for tone mapping on an image, and a computer-usable medium storing software for implementing the method. Background Art
[0002] In recent years, color imaging devices have been developed and widely used in devices such as mobile phones, digital cameras, etc. With the development of high-speed / large-capacity data communication, requirements for high-speed processors or high color quality have also been put forward.
[0003] One such technique (i.e., tone mapping on an image) is effective in obtaining a proper image that does not cause discomfort or look abnormal to an observer.
[0004] According to the conventional technique, camera parameters (e.g., F_value, ISO sensitivity, and / or exposure time) are used to calculate the luminance for tone mapping.
[0005] However, these camera parameters do not have stable and correct values in some environments, for example, within a specific time of about 1 second after the camera unit is started.
[0006] Therefore, it may be the case that since a suitable tone curve for tone mapping cannot be selected due to the use of these unstable camera parameters, an improper image that causes discomfort or a sense of strangeness to an observer may be obtained. In particular, moving images are severely affected by the above problems. Summary of the Invention
[0007] The present disclosure aims to solve at least one of the above technical problems. Therefore, the present disclosure needs to provide a tone mapping method and apparatus, and a computer-usable medium storing software for enabling a computer to implement the tone mapping method.
[0008] According to one aspect of the present disclosure, a method for tone mapping on an image may include:
[0009] Obtain an image;
[0010] Obtain illuminance using a light sensor;
[0011] Calculate a first luminance L1 based on the detected illuminance;
[0012] Obtain camera parameters;
[0013] Calculate a second luminance L2 based on the obtained camera parameters;
[0014] Use the calculated first luminance L1 and / or the calculated second luminance L2 to set a suitable luminance L;
[0015] Select a tone curve according to the set brightness L; and
[0016] Perform tone mapping on the image using the selected tone curve.
[0017] In some embodiments, when using the calculated first brightness L1 and / or the calculated second brightness L2 to set the appropriate brightness L, the method further includes:
[0018] Determine whether a specific time has elapsed since the camera unit was started; and
[0019] When the specific time has not elapsed, set the appropriate brightness L such that the ratio of the first brightness L1 is greater than the ratio of the second brightness L2 compared to the case when the specific time has elapsed.
[0020] In some embodiments, when the specific time has not elapsed, set the appropriate brightness L to be equal to the first brightness L1, and when the specific time has elapsed, set the appropriate brightness L to be equal to (L1 + L2) / 2.
[0021] In some embodiments, use the following formula including camera parameters (i.e., F - value 2 , exposure time, and ISO sensitivity) to calculate the second brightness L2:
[0022]
[0023] where C is the calibrated contrast.
[0024] According to one aspect of the present disclosure, an apparatus for tone mapping on an image includes:
[0025] A camera unit configured to acquire an image;
[0026] A processor configured to input the acquired image, obtain illuminance using a light sensor, calculate a first brightness L1 based on the obtained illuminance, obtain camera parameters, calculate a second brightness L2 based on the obtained camera parameters, use the calculated first brightness L1 and / or the calculated second brightness L2 to set an appropriate brightness L; select a tone curve according to the set appropriate brightness L, and perform tone mapping on the image using the selected tone curve; and
[0027] A display unit configured to display the tone - mapped image.
[0028] In some embodiments, when the processor sets the appropriate brightness L using the calculated first brightness L1 and / or the calculated second brightness L2, the processor further determines whether a specific time has elapsed since the camera unit was started, and when the specific time has not elapsed, the processor sets the appropriate brightness L such that the ratio of the first brightness L1 is greater than the ratio of the second brightness L2 compared to the case where the specific time has elapsed.
[0029] In some embodiments, when the specific time has not elapsed, the processor sets the appropriate brightness L to be equal to the first brightness L1, and when the specific time has elapsed, the processor sets the appropriate brightness L to be equal to (L1 + L2) / 2.
[0030] In some embodiments, the following formula including camera parameters (i.e., F - value 2 , exposure time, and ISO sensitivity) is used to calculate the second brightness L2:
[0031]
[0032] where C is the calibrated contrast.
[0033] According to one aspect of the present disclosure, a computer - usable medium stores software for causing a computer to implement the method of tone - mapping on an image as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] These and / or other aspects and advantages of the embodiments of the present disclosure will become apparent and be more easily understood from the following description with reference to the accompanying drawings. Among them:
[0035] Figure 1 is a block diagram schematically showing a circuit configuration of a tone - mapping device according to a first embodiment of the present disclosure;
[0036] Figure 2 is a flowchart showing a tone - mapping method according to a second embodiment of the present disclosure;
[0037] Figure 3 is a flowchart showing a method for obtaining brightness by determining whether a specific time has elapsed since the camera unit was started; and
[0038] Figure 4A is an example photograph of an original image when a specific time has not elapsed since the camera unit was started; and
[0039] Figure 4B is an example photograph of an image obtained by the tone - mapping method according to the first and second embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] Embodiments of the present disclosure will be described in detail, and examples of the embodiments will be shown in the drawings. Throughout the specification, the same or similar elements and elements having the same or similar functions are denoted by the same reference numerals. The embodiments described herein with reference to the drawings are illustrative and are intended to explain the present disclosure, but should not be construed as limiting the present disclosure.
[0041] A method and apparatus for performing tone mapping on an image according to a first example of the present disclosure are as follows.
[0042] Referring Figure 1 to FIG.
[0043] 1, an apparatus 10 for performing tone mapping according to a first embodiment of the present disclosure includes a camera unit 11, a processor 12, a display unit 13, and a memory 14.
[0044] The camera unit 11 acquires an image in a still image mode or a moving image mode under various conditions, including a case where a specific time has not elapsed since the camera unit 11 was started.
[0044] The processor 12 inputs an image in the still image mode or the moving image mode, acquires illuminance using a light sensor and calculates a first luminance L1 based on the acquired illuminance, and acquires camera parameters of the camera unit 11 and calculates a second luminance L2 using the camera parameters.
[0045] For example, a smartphone has a built-in light sensor and uses the light sensor to adjust the screen brightness based on the brightness in the environment. It may be difficult to convert the illuminance detected by the light sensor into the brightness of all scenes. Therefore, the following coefficient B can be used based on experience to calculate the first luminance L1 using the following formula:
[0046] Luminance [cd / m 2 ²] = B × Illuminance [lux]
[0047] In addition, the following formula including camera parameters (i.e., F - value 2 , exposure time, and ISO sensitivity) can be used to calculate the second luminance L2:
[0048]
[0049] where C is a calibrated contrast.
[0050] Taking into account the shooting conditions, the processor 12 obtains an appropriate luminance using the first luminance L1 and / or the second luminance L2. For example, the processor 12 determines whether a specific time has elapsed since the camera unit 11 was started.
[0051] More specifically, if a specific time has not elapsed, the processor 12 only uses the first luminance L1 and obtains the luminance L using the formula L = L1. If the specific time has elapsed, the processor uses the first luminance L1 and the second luminance L2 to obtain the luminance L using the formula L = (L1 + L2) / 2.
[0052] That is, when the specific time has not elapsed, the processor 12 sets the luminance L such that the ratio of the first luminance L1 is greater than the ratio of the second luminance L2 compared to the case when the specific time has elapsed.
[0053] The processor 12 selects an appropriate tone curve based on the obtained luminance L and performs tone mapping on the original image using the selected tone curve.
[0054] The display unit 13 receives the tone-mapped image and displays it on its screen.
[0055] As Figure 2 shown, the tone mapping method according to the second embodiment of the present disclosure includes the following steps.
[0056] In step S11, an image is acquired in a still image mode or a moving image mode under various conditions, including the condition that a specific time has not elapsed since the camera unit 11 was started.
[0057] In step S12A, the illuminance is acquired by a light sensor. For example, the light sensor is provided inside the smartphone to detect the illuminance in the environment.
[0058] In step S13A, the first luminance L1 is calculated based on the acquired illuminance.
[0059] Meanwhile, in step S12B, camera parameters (e.g., F-value, ISO sensitivity, and / or exposure time) are acquired.
[0060] In step S13B, the second luminance L2 is calculated using the camera parameters.
[0061] In step S14, an appropriate luminance L is set using the first luminance L1 and / or the second luminance L2.
[0062] In step S15, a tone curve is selected according to the appropriate luminance L.
[0063] In step S16, the image is tone-mapped using the selected tone curve.
[0064] In step S17, the tone-mapped image is displayed.
[0065] A more specific method for setting the appropriate luminance L in step S14 described above is described below.
[0066] In step S21, two luminances L1 and L2 are obtained as described above.
[0067] In step S22, it is determined whether a specific time has elapsed since the camera unit 11 was started.
[0068] If so, that is, if a specific time (e.g., 1 second) has elapsed since the camera unit 11 was started, then in step S23 the luminance L is set to (L1 + L2) / 2. If not, that is, if a specific time has not elapsed since the camera unit 11 was started, then in step S24 the luminance L is set to the first luminance L1 (L = L1).
[0069] However, the above-described manner of setting the luminance is not limited to step S23 and / or step S24. Considering shooting conditions such as night scenes, previews, portrait photos, close-up photos, and the types of lighting fixtures in a room, the first luminance L1 and / or the second luminance L2 can be used to set an appropriate luminance L to avoid a drastic change in luminance that may cause discomfort to an observer. For example, an appropriate luminance L can be set by using only the first luminance L1 without using the second luminance L2, using only the second luminance L2 without using the first luminance L1, or using both the first luminance L1 and the second luminance L2 and arbitrarily setting the ratio of the first luminance L1 and the second luminance L2.
[0070] A computer-usable medium according to a third embodiment of the present disclosure is a medium that stores software for causing a computer to implement a tone mapping method, and a method according to a second embodiment of the present disclosure is described below.
[0071] According to the tone mapping device according to the first embodiment, the tone mapping method according to the second embodiment, and the tone mapping medium according to the third embodiment of the present disclosure, even if a specific time has not elapsed since the camera unit was started, tone mapping can be performed by using an appropriate tone curve selected according to an appropriate luminance to obtain an appropriate image.
[0072] Figure 4A An example photograph of an original image when a specific time has not elapsed since the camera unit was started is shown. This photograph is overall very dark and includes an area that is almost black and difficult to see.
[0073] Figure 4B A photograph obtained by the first, second, and third embodiments of the present disclosure is shown. Compared with Figure 4A , the photograph becomes brighter overall and is easy to see even in dark areas.
[0074] In the description of the embodiments of the present disclosure, it should be understood that terms such as "central", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", and "counterclockwise" should be interpreted as referring to the directions or positions as described or shown in the accompanying drawings under discussion. These related terms are only used to simplify the description of the present disclosure and do not indicate or imply that the device or element mentioned must have a specific direction, or must be constructed or operated in a specific direction. Therefore, these terms should not be construed as limiting the present disclosure.
[0075] In addition, terms such as "first" and "second" used herein are for illustrative purposes and are not intended to indicate or imply relative importance or significance or imply the number of the indicated technical features. Therefore, the features defined as "first" and "second" may include one or more of such features. In the description of the present disclosure, unless otherwise specified, "a plurality of" means "two or more".
[0076] In the description of the embodiments of the present disclosure, unless otherwise specified or limited, terms such as "mounted", "connected", "coupled", etc. are widely used and may be, for example, fixedly connected, detachably connected, or integrally connected; they may also be mechanically or electrically connected; they may also be directly connected or indirectly connected through an intermediate structure; they may also be internal communication between two elements, which can be understood by those skilled in the art according to specific circumstances.
[0077] In the embodiments of the present disclosure, unless otherwise specified or limited, the structure in which the first feature is "above" or "below" the second feature may include embodiments in which the first feature is in direct contact with the second feature, and may also include embodiments in which the first feature and the second feature are not in direct contact with each other, but are in contact through additional features formed therebetween. In addition, the first feature being "above", "upper", or "top" of the second feature may include embodiments in which the first feature is orthogonally or obliquely located "above", "upper", or "top" of the second feature, or only means that the height of the first feature is higher than the height of the second feature; while the first feature being "below", "lower", or "bottom" of the second feature may include embodiments in which the first feature is orthogonally or obliquely located "below", "lower", or "bottom" of the second feature, or only means that the height of the first feature is lower than the height of the second feature.
[0078] In the above description, various embodiments and examples are provided to implement different structures of the present disclosure. To simplify the present disclosure, certain elements and settings are described above. However, these elements and settings are only examples and are not intended to limit the present disclosure. In addition, reference numerals and / or reference letters may appear repeatedly in different examples of the present disclosure. This repetition is for simplicity and clarity and does not refer to the relationship between different embodiments and / or settings. In addition, examples of different processes and materials are provided in the present disclosure. However, those skilled in the art should understand that other processes and / or materials may also be applied.
[0079] References throughout this specification to "an embodiment", "some embodiments", "exemplary embodiments", "exemplary embodiments", "examples", "specific examples", or "some examples" mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. Thus, the appearances of the above phrases throughout this specification are not necessarily referring to the same embodiment or example of the present disclosure. In addition, the particular features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0080] Any process or method described in a flowchart or otherwise herein may be understood to include one or more modules, segments, or portions of code for implementing specific logical functions or steps in the process, and the scope of the preferred embodiments of the present disclosure includes other implementations, where those skilled in the art should understand that the functions may be implemented in an order different from that shown or discussed, including in substantially the same order or the reverse order.
[0081] Logic and / or steps described otherwise herein or shown in a flowchart, e.g., a specific sequence listing of executable instructions for implementing a logical function, can be embodied in any computer-readable medium used by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other systems capable of obtaining instructions from an instruction execution system, apparatus, and device that execute instructions), or used in combination with an instruction execution system, apparatus, and device. For the purposes of this specification, a "computer-readable medium" can be any device that adaptively includes, stores, communicates, propagates, or transports a program to be used by or in combination with an instruction execution system, apparatus, and device. More specific examples of computer-readable media include, but are not limited to: an electrical connection having one or more wires (electronic device), a portable computer accessory (magnetic device), a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read only memory (CDROM). Additionally, a computer-readable medium can even be paper or other suitable media on which a program can be printed, because, for example, when the program needs to be obtained electronically, the paper or other suitable media can be optically scanned and then edited, decrypted, or processed by other suitable means, and then the program can be stored in a computer memory.
[0082] It should be understood that each part of the present disclosure can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by an appropriate instruction execution system. For example, if implemented by hardware, in another embodiment, these steps or methods can be implemented by one or a combination of the following techniques known in the art: discrete logic circuits having logic gate circuits for implementing the logical functions of data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0083] Those skilled in the art should understand that all or part of the steps in the above exemplary methods of the present disclosure can be implemented by using program commands to relevant hardware. These programs can be stored in a computer-readable storage medium, and when they run on a computer, these programs include one or a combination of the steps in the method embodiments of the present disclosure.
[0084] In addition, each functional unit of the embodiments of the present disclosure may be integrated into a processing module, or these units may exist separately physically, or two or more units may be integrated into a processing module. The integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, the integrated module may be stored in a computer-readable storage medium.
[0085] The above storage medium may be a read-only memory, a disk, a CD, etc.
[0086] Although the embodiments of the present disclosure have been shown and described, those skilled in the art should understand that these embodiments are illustrative and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions, and variations may be made to the embodiments without departing from the scope of the present disclosure.
Claims
1. A method for tone mapping on an image, the method comprising: Obtaining an image; Obtaining illuminance using a light sensor; Calculating a first luminance L1 based on the detected illuminance; Obtaining camera parameters; Calculating a second luminance L2 based on the obtained camera parameters; Setting an appropriate luminance L using the calculated first luminance L1 and / or the calculated second luminance L2; Selecting a tone curve according to the set luminance L; And Performing tone mapping on the image using the selected tone curve, wherein when setting the appropriate luminance L using the calculated first luminance L1 and / or the calculated second luminance L2, the method further comprises: Judging whether a specific time has elapsed since the camera unit was started; and When the specific time has not elapsed, setting the appropriate luminance L such that the ratio of the first luminance L1 is greater than the ratio of the second luminance L2 compared to the case where the specific time has elapsed.
2. The method according to claim 1, wherein When the specific time has not elapsed, setting the appropriate luminance L to be equal to the first luminance L1, and when the specific time has elapsed, setting the appropriate luminance L to be equal to (L1 + L2) / 2.
3. The method according to claim 1 or 2, wherein Use the following formula including camera parameters, where the camera parameters are the F - value 2 , exposure time, and ISO sensitivity: wherein C is the calibrated contrast.
4. An apparatus for tone mapping on an image, the apparatus comprising: A camera unit configured to obtain an image; A processor configured to input the obtained image, obtain illuminance using a light sensor, calculate a first luminance L1 based on the obtained illuminance, obtain camera parameters, calculate a second luminance L2 based on the obtained camera parameters, set an appropriate luminance L using the calculated first luminance L1 and / or the calculated second luminance L2, select a tone curve according to the set appropriate luminance L, and perform tone mapping on the image using the selected tone curve; And A display unit configured to display the tone-mapped image, wherein when the processor uses the calculated first luminance L1 and / or the calculated second luminance L2 to set the appropriate luminance L, the processor further judges whether a specific time has elapsed since the camera unit was started, and when the specific time has not elapsed, the processor sets the appropriate luminance L such that the ratio of the first luminance L1 is greater than the ratio of the second luminance L2 compared to the case where the specific time has elapsed.
5. The apparatus according to claim 4, wherein, When the specific time has not elapsed, the processor sets the appropriate luminance L to be equal to the first luminance L1, and when the specific time has elapsed, the processor sets the appropriate luminance L to be equal to (L1 + L2) / 2.
6. The apparatus according to claim 4 or 5, wherein The following formula including camera parameters is used to calculate the second luminance L2, and the camera parameters are F-value 2 , exposure time, and ISO sensitivity: wherein C is the calibrated contrast.
7. A computer-usable medium storing software for causing a computer to implement the method for tone mapping on an image according to any one of claims 1 to 3.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN111294575A
Luminance compensation apparatus and method
CN1992842A