Tone mapping method and apparatus
Abstract
This disclosure provides a tone mapping method and apparatus. In the method, after global tone mapping is performed on a to-be-displayed image, local mapping information is adjusted to obtain the adjusted local mapping information; and based on the adjusted local mapping information, local tone mapping is performed on at least some pixels in the to-be-displayed image on which global tone mapping is performed. In embodiments of this disclosure, a global and local joint tone mapping solution is used, and local mapping is performed based on the adjusted local mapping information, to balance an uncoordinated contrast between different regions in local tone mapping, and effectively improve tone mapping effect and display effect of an image.
Claims
exact text as granted — not AI-modified1 . A tone mapping method, comprising:
obtaining a to-be-displayed image; obtaining a first tone-mapped image by performing global tone mapping on the to-be-displayed image; obtaining local mapping information of the first tone-mapped image; obtaining adjusted local mapping information by adjusting the local mapping information; and obtaining a second tone-mapped image by performing local tone mapping on at least some pixels in the first tone-mapped image based on the adjusted local mapping information.
2 . The method according to claim 1 , wherein obtaining the local mapping information of the first tone-mapped image comprises:
obtaining at least one initial local tone mapping curve and at least one feature value of the first tone-mapped image, wherein the at least one initial local tone mapping curve corresponds to one or more feature values.
3 . The method according to claim 2 , wherein obtaining the adjusted local mapping information comprises:
obtaining at least one adjusted local tone mapping curve by adjusting the at least one initial local tone mapping curve based on the at least one feature value, so that the at least one adjusted local tone mapping curve and a global tone mapping curve used for global tone mapping satisfy a first condition.
4 . The method according to claim 3 , wherein the first condition comprises:
a mapping value, obtained through mapping a first feature value by using the global tone mapping curve, is a second feature value, or a value, obtained through performing function transformation on a mapping value obtained through mapping a first feature value by using the global tone mapping curve, is a second feature value, wherein the first feature value is any one of the one or more feature values; a mapping value, obtained through mapping the second feature value by using the adjusted local tone mapping curve corresponding to the first feature value, is a third feature value; and a difference between the second feature value and the third feature value falls within a first range.
5 . The method according to claim 3 , wherein before adjusting the at least one initial local tone mapping curve based on the at least one feature value, the method further comprises:
obtaining terminal display device information; and adjusting the at least one initial local tone mapping curve based on the obtained terminal display device information.
6 . The method according to claim 2 , wherein obtaining the at least one feature value comprises:
determining at least one block region of the to-be-displayed image; collecting statistics on luminance information of each of the at least one block region; dividing the luminance information of each block region into one or more luminance segments; and using a center, or a center of gravity, of each of the one or more luminance segments as one of the one or more feature values.
7 . The method according to claim 1 , wherein obtaining the local mapping information of the first tone-mapped image comprises:
obtaining metadata of the to-be-displayed image; and obtaining the local mapping information from the metadata.
8 . The method according to claim 1 , wherein obtaining the local mapping information of the first tone-mapped image comprises:
obtaining local mapping indication information; and in association with the local mapping indication information indicating that local mapping is to be applied, determining preset local mapping information or calculating the local mapping information.
9 . The method according to claim 2 , wherein the at least one adjusted local tone mapping curve is in a one-to-one correspondence with at least one block region of the first tone-mapped image, and performing local tone mapping on the at least some pixels in the first tone-mapped image comprises:
separately performing, based on the at least one adjusted local tone mapping curve, local tone mapping on block regions respectively corresponding to the at least one adjusted local tone mapping curve, to obtain the second tone-mapped image.
10 . The method according to claim 1 , wherein performing local tone mapping on the at least some pixels in the first tone-mapped image comprises:
determining a to-be-processed pixel of the first tone-mapped image; determining an extraction region based on the to-be-processed pixel, wherein the extraction region covers at least some of the at least one block region; obtaining the at least one adjusted local tone mapping curve corresponding to the at least some of the block regions; and obtaining the second tone-mapped image by performing local tone mapping on the to-be-processed pixel based on the at least one adjusted local tone mapping curve.
11 . The method according to claim 10 , wherein performing local tone mapping on the to-be-processed pixel comprises:
obtaining a plurality of mapping values by performing local tone mapping on the to-be-processed pixel based on a plurality of adjusted local tone mapping curves; and obtaining a mapping value of the to-be-processed pixel by performing weighted averaging on the plurality of mapping values.
12 . The method according to claim 1 , wherein the local tone mapping comprises:
layer-based local tone mapping, block-based local tone mapping, or a combination of layer-based local tone mapping and block-based local tone mapping.
13 . An image encoding method, comprising:
writing a to-be-displayed image into a bitstream; and writing local mapping information of the to-be-displayed image into the bitstream, wherein adjusted local mapping information is used to perform local tone mapping on at least some pixels in the to-be-displayed image on which global tone mapping is performed.
14 . The method according to claim 13 , wherein writing the local mapping information of the to-be-displayed image into the bitstream comprises:
writing at least one initial local tone mapping curve and at least one feature value of the to-be-displayed image into the bitstream, wherein the at least one initial local tone mapping curve corresponds to one or more feature values.
15 . The method according to claim 14 , wherein
at least one adjusted local tone mapping curve is in a one-to-one correspondence with at least one block region of the to-be-displayed image.
16 . The method according to claim 14 , wherein
the at least one feature value is used to adjust the at least one initial local tone mapping curve to obtain at least one adjusted local tone mapping curve, and the at least one adjusted local tone mapping curve and a global tone mapping curve used for global tone mapping satisfy a first condition.
17 . The method according to claim 16 , wherein the first condition comprises:
a mapping value, obtained through mapping a first feature value by using the global tone mapping curve, is a second feature value, or a value, obtained through performing function transformation on a mapping value obtained through mapping a first feature value by using the global tone mapping curve, is a second feature value, wherein the first feature value is any one of the one or more feature values; a mapping value, obtained through mapping the second feature value by using the adjusted local tone mapping curve corresponding to the first feature value, is a third feature value; and a difference between the second feature value and the third feature value falls within a first range.
18 . The method according to claim 13 , further comprising:
determining at least one block region of the to-be-displayed image; collecting statistics on luminance information of each of the at least one block region; dividing the luminance information of each block region into one or more luminance segments; and using a center, or a center of gravity, of each of the one or more luminance segments as one of the one or more feature values.
19 . The method according to claim 18 , further comprising:
writing division information into the bitstream, wherein the division information is used to determine the at least one block region of the to-be-displayed image.
20 . An electronic device, comprising:
a processor; and a memory configured to store computer readable instructions that, when executed by the processor, cause the electronic device to: obtain a to-be-displayed image; obtain a first tone-mapped image by performing global tone mapping on the to-be-displayed image; obtain local mapping information of the first tone-mapped image; obtain the adjusted local mapping information by adjusting the local mapping information; and obtain a second tone-mapped image by performing local tone mapping on at least some pixels in the first tone-mapped image based on the adjusted local mapping information.Join the waitlist — get patent alerts
Track US2025371688A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.