Automatic brightness adjustment for HDR video coding
Through the neural network processing circuit and brightness mapping function, the brightness range of the HDR image is dynamically adjusted, which solves the problem of unreasonable display of the main HDR image on different displays and achieves high-quality display on displays with different peak brightness.
Patent Information
- Application Number
- CN202380019047.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-27
- Filing Date
- 2023-01-13
- Publication Date
- 2024-09-10
AI Technical Summary
When the existing technology processes high dynamic range video, it is difficult to effectively map the main HDR image to displays with different peak brightness, resulting in unreasonable or less beautiful image display, especially when the peak brightness of the display does not match.
It uses a neural network processing circuit and a brightness mapping function to dynamically adjust the brightness range of the image by learning the image characteristics and the amount of ambient light to adapt to the peak brightness of different displays and generate an appropriate secondary dynamic range image.
It achieves the quality consistency and beauty of HDR images displayed on displays with different peak brightness, improves the visibility and visual effects of the image, and is suitable for various viewing environments.
Smart Images

Figure CN118633102A
Abstract
Description
Technical Field
[0001] The present invention relates to an apparatus and a method for creating a secondary dynamic range image for a primary (or master) dynamic range image, which can be used in particular for high dynamic range (HDR) video encoding of the type in which at least two different dynamic range images are transmitted to a receiver (usually one as an actual pixelated image and the other as data for a calculation method to derive it from the actual received image).
[0002] The invention also relates to a device and a method for calculating a secondary dynamic range image according to various technical requirements in a device comprising a receiver of a high dynamic range image.
[0003] Such an apparatus or method may be included in consumer devices such as TV displays, mobile phones, but also in professional systems such as video communications in commercial applications such as in shops, etc. On the HDR video creation and communication side, it may be applied for example in an end station of a deployer of a TV communication network that transmits the HDR video images to the end customer (distribution), such as in a satellite or cable headend or a mobile phone communication network, etc., but it may also be used in contributions where the video is relayed from a first professional (enterprise) such as producing the video to a second enterprise such as distributing the video on a certain medium, zone or customer.
[0004] The apparatus and methods specifically exploit advances in machine learning that can learn specific properties of an image, in this case the desired brightness remapping function to create a good quality secondary dynamic range image given the details of any image or class of images, e.g., a useful scenario is creating a low dynamic range image for an HDR image. Background Art
[0005] High dynamic range video processing (encoding or display adaptation, which is the remapping of images of a first dynamic range to the specific displayable dynamic range capabilities of any display, etc.) is a fairly recent field of technology (in the TV world, its initial versions originate from after 2010), which still has several unresolved problems and questions. Although HDR TVs have been sold for a few years (usually with a maximum displayable brightness, also called peak brightness, of around 1000 nits or Cd / m^2, i.e. slightly below e.g. 600 nits, or slightly above e.g. 2000 nits, and possibly up to 5000 nits or more in the future), the technology that came before the display on improved displays (which is a matter of physics and electronics drive) (i.e. content production, encoding or color processing) still has multiple solutions to invent / improve and deploy. There are already multiple movies that have been created and delivered, as well as some early broadcasts, and although the results are generally great, there is still the possibility of further improving some aspects, so the technology is not currently at a stage where it is largely solved.
[0006] High dynamic range images are defined as images compared to the status quo of traditional low dynamic range (LDR) images (also called standard dynamic range (SDR) images) that were generated and displayed in the second half of the 20th century and are still the mainstream of most video technologies (e.g., TV or movie distribution by any technology) from terrestrial broadcasting to youtube videos supplied via the Internet, etc. The properties of SDR images and how to process them (e.g., to make movie images that look good) are well understood. Its brightness code - usually an 8-bit code ranging from 0 to 255 - is very suitable for defining various gray levels of objects in a relatively uniformly illuminated environment. In the case of a relative maximum value of 255 representing "white" (which has no associated actual brightness in LDR because it will be rendered differently depending on the peak brightness of any purchased display, but is associated with a maximum brightness ML_LDR=100 nits in the HDR era), lower levels gradually darken in a quadratic manner, that is, a percentage (e.g., 5%) of white looks black.
[0007] An HDR image is one that can represent (encode) multiple additional luminances (and typically additional colors if a wider span of primaries is also involved), in particular multiple additional gray levels above (100 nits) white. There is no absolute requirement that these additional steps be accompanied by a larger number of luminances represented by the additional bits (but it is generally desirable to use 10 bits for HDR color components), as this is ultimately determined by which electro-optical transfer function (EOTF) defines which pixel luminances are the amount of available luminance codes, and some 8-bit HDR decoders have been demonstrated.
[0008] Formally, the luminance dynamic range can be defined as the span of all luminances from minimum black (MB) to peak white or peak brightness (PB) (also called maximum brightness (ML)), so it is possible to have an HDR movie with very deep blacks, or just normal (LDR) blacks, but brighter pixels (often called highlights) in one. So in practice, an HDR image can be defined and processed (e.g., color processed) primarily based on a unique value (i.e., being higher peak brightness) (usually this is what the user is most interested in, whether it's a bright explosion or just more realistic specular spots on metals and jewellery etc., and the minimum black can actually be stated to be the same for SDR and HDR images).
[0009] In practice, a 1000:1 luminance dynamic range of an SDR image will drop below 100 nits (and 0.1 nits above) from traditional times, and an HDR image will typically have a PB that is at least 5 times brighter, so 500 nits or higher (this is where the difference starts to become impressive, making the user see really beautiful e.g. glowing parts of the image; obviously using a higher maximum might be better and more desirable, so one can start to define really good HDR when it has an ML of 1000 nits or higher, i.e. typically in a video at least some pixels will be given that brightness to make them look most impressive compared to the rest of the scene).
[0010] Note that without going into a lot of detail that may not be necessary here, it is possible to indicate which HDR is present by associating a peak brightness number as metadata with the HDR image. This can be thought of as the brightness of the brightest pixel present in the image, and is often formally defined by associating a reference display with the image (i.e. a virtual display is associated with the image, where its peak brightness corresponds to the brightest pixel present in the image or video, i.e. the brightest pixel that needs to be displayed and then encoding that PB_C-C represents the "encoding" of that virtual display as metadata outside of the image pixel color matrix).
[0011] In this way, there is no need to "inelegantly" encode HDR images with an excessive amount of bits, and one can simply reuse existing technology with 10-bit word length for color components (at least for the near future, 12 bits or more are already considered quite heavy by several technology vendors in the entire video processing chain for various reasons; and the PB_C metadata allows easy upgrading of the HDR framework for future scenarios).
[0012] One aspect reused from classic video engineering is that pixel colors are usually always transmitted as YCbCr colors, where Y is the so-called luma component (which is a technical encoding of brightness), and Cb and Cr are the blue and red chroma components, completing the three-color additive color definition.
[0013] Luminance is defined in terms of non-linear R'G'B' color components (the prime ' indicates the non-linear nature, i.e. the difference from the linear RGB components of the color, so to speak, the amount of red, green and blue photons coming out of a display pixel of any particular color) and via the following equation:
[0014] Y = a1*R'+a2*G'+a3*B' [Equation 1]
[0015] The question is how the non-linear R'G'B' is related to (and in fact defined for) the linear RGB components.
[0016] The definition of the coding system is done by specifying the so-called electro-optical transfer function (EOTF) or its inverse electro-optical transfer function which calculates the non-linear component from the corresponding linear component, for example:
[0017] R' = OETF_PQ(R) [Equation 2]
[0018] For example, while in the LDR era, there was only the standard Rec. 709 OETF, the OETF (simplifying some irrelevant details of this patent application) is the inverse of the EOTF, and this is a fairly good approximation to a simple square root.
[0019] Then, when the technical problem of encoding a large range of HDR brightness (e.g. 1 / 10000 nit – 10000 nit) in only 10 bits (which is impossible with a square root function) arose, a new EOTF was invented, the so-called perceptual quantizer EOTF (US9077994). This is sufficient to "specify" any desired HDR pixel color (or its brightness), but is not necessarily sufficient for practical video communication systems, since more information about (multiple) HDR scenes or images is usually wanted (which can be defined by the video creator, for example).
[0020] Therefore, this different EOTF definition, and any input YCbCr color defined by it, will clearly have different numerical normalized components, depending on whether it is YCbCr_Rec709 or YCbCr_PQ (in fact, one can see this by turning the R'G'B' cube on its black tip, where the Y axes of achromatic grays of different brightness now form a vertical: the various image pixel colors will then have different extensions along this vertical). The various components to be normalized between 0 and 1 (1 meaning peak brightness, i.e. different luminances of the various encoded scenes) can be assumed in a technically elegantly simple formula, and the calculation of the secondary image can then be viewed as offsetting the pixel brightness or luminance along its normalized axis.
[0021] Figure 1 Some of the issues involved in using HDR images are shown in terms of absolute brightness for enhanced clarity.
[0022] Compared to LDR imaging, in which all scenes look more or less the same (e.g. one cannot really darken a night scene, because again a full extension between luminance 0 and almost 255 is needed to make all image objects sufficiently visible, so one needs to simulate a night scene by tinting it blue; and there is also only one white color, not e.g. super white), a full HDR video system will allow many kinds of HDR images to be produced and eventually displayed, giving many kinds of different visual impressions (also called looks). For example, in addition to "normal lighting" images, e.g. of a dim day or an evenly lit room, one can also produce a desert image (ImSCN1), in which strongly sunlit objects are slightly brighter (e.g. 500 nits on average instead of 100 nits or less), but which also contains super bright pixels, like a 5000 nit quite bright sun. But one can also define night images (which can still contain a few very bright pixels like street lamps), like a city night scene ImSCN2 or a cave ImSCN3. Thus, the pixels may all fall on a luminance axis spanning between, for example, 1 / 5000 nit and 5000 nit.
[0023] Therefore, at least some video content producers may want to define their original (also called master) images to be as beautiful as possible, i.e. over a brightness range of e.g. PB_C = 5000 nits for a 5000 nit quality master HDR image. This is to make a "universal" HDR image. Thus, a future display that can show e.g. up to 10000 nit pixel brightness will indeed show a bright 5000 nit sun (as intended by the creators of the movie).
[0024] The problem is, of course, that even in the very distant future at least some viewers may have displays that do not always display up to 5000 nits, but for example only display up to 800 nits.
[0025] The question is then what to do with the main 5000 nit HDR image pixel luminances, i.e. how to display them (which would involve a conversion to 800 nit maximum even without any luminance mapping algorithm applied). For example if the tv simply displays at the exact luminance as specified in the received image pixel luminances, it will clip and therefore merge the shape of the sun disk with the clouds around it, which have pixel luminances in the main 5000 nit HDR image of e.g. 900 or 1200 nits. This may be reasonable in some scenes, but less reasonable in others. The tv can try to use smarter algorithms as internal automatic luminance mapping, but there is still no way to say to which final luminance any luminance accurately artistically crafted by the creator will be mapped and on which images on which displays this will look reasonable or not.
[0026] Thus, more advanced HDR video codecs allow the creator to make and transmit not only the master HDR image itself (i.e. as a matrix of YCbCr pixel colors as defined by, for example, SMPTE 2084EOTF), but also to specify at least one secondary reference gradation. That is, the video creator can define exactly how he thinks the brightness of any image should be mapped to, for example, a 100 nit PB_C_LDR secondary reference brightness range. He can typically do this by defining (e.g., one per temporally consecutive video image) a function F_L for mapping any possible input HDR brightness (Y_HDR_in ranges on 0-1023) to a corresponding LDR brightness (Y_LDR_out ranges on the same span of values 0-1023, but with different values or positions along the brightness axis).
[0027] Once the two reference images (also called gradations) have been transmitted, or the corresponding data is one of the two images and the function F_L, there is an algorithm for determining any intermediate gradation, such as an 800 nit gradation.
[0028] The scenarios so far assume that there is a secondary (e.g. LDR reference) staging (a ground truth) corresponding to the primary HDR image as input image. This should not be confused with a different technical scenario with different possible styles of associated secondary images, which will be discussed below with our embodiments!
[0029] Figure 2 An exemplary HDR video encoding and communication chain is illustrated, which is one embodiment in which the current new technologies discussed below may be used.
[0030] Details of possible encodings may be found in the ETSI standard "High Performance Single Layer High Dynamic Range [SLHDR], Parts 1 & 2" (incorporated herein by reference).
[0031] On the video encoding side, a master HDR image (MAST_HDR) is obtained, e.g., a high quality 5000 nit image. Without limitation, we describe two useful variants. In the first variant, a human color grader starts with an initial image (e.g., captured directly from a camera) and performs an accurate grading (i.e., determination) of the brightness of various objects in the image so that the image acquires a certain look. As a second example, an automaton determines the master HDR image from the initial camera-captured image, e.g., some rough grading may be used on the relative brightness image from the camera to make a 5000 nit master HDR image of good enough quality, or an existing LDR image may be converted to a pseudo HDR image by inverse tone mapping.
[0032] Without restrictions, Figure 2 The illustrated embodiment assumes that the master HDR image is actually transmitted as a corresponding LDR image (Im_SDR). Therefore, a suitable brightness or luminance mapping function (F_L) must be determined to calculate the LDR image from the master HDR image. If the normalized input luminance Yi (i.e., the luminance code divided by a power (2; number of bits)) is processed into a normalized output luminance using a luminance mapping function consisting of, for example, two linear segments, and if the input coordinates of the connection point (yp) are fixed to, for example, half, then the function can be specified by one parameter P1, which determines the slope of the first linear segment.
[0033] The color transformer 202 in the video encoder 221 applies a F_L brightness mapping of the brightness of the pixels of the master HDR image (Master HDR) (in practice it typically applies a 3D color transform F_ct).
[0034] The LDR image is then compressed, typically in a compressor 203, using any known video compression technique (e.g. VVC), thereby producing an encoded version of the LDR video image Im_COD. The luminance mapping function F_L (or indeed the data of the color mapping F_ct, which typically additionally contains a function for changing the saturation of a pixel, since hue typically remains constant between the input and output functions) is treated as metadata by the compressor, and Supplemental Enhancement Information (SEI) is a good way to convey any data about the desired processing function.
[0035] After the actions of the content video encoder 221, the rest of the communication chain, from the point of view of the image communication technology, pretends that it gets a "normal SDR" image as input. Thus, for example, the transport formatter 204 may apply all necessary transformations to format the data to pass through some transmission medium 205 (e.g. channel encoding to be stored on a BD disc or frequency encoding for cable transmission, cutting the video into appropriate data packets, etc.).
[0036] The image data then travels via a transmission medium 205 (e.g., satellite or cable or Internet transmission, such as according to ATSC 3.0, or DVB, or any video signal communication principle) to one or more receiving sides, which may be consumer video devices (such as televisions, or set-top boxes), or professional systems (such as cinema receiving units), etc.
[0037] At any consumer or professional receiving side, a receiver deformatter 206, which may be included in various physical devices such as a set-top box, a television or a computer, removes the channel coding (if any) by applying deformatting and channel decoding. A video decompressor 207 within a video re-determination device 220 (e.g., a video decoder) then applies, for example, HEVC decoding to produce a decoded SDR image IM_RLDR and unpacks the color transformation function metadata F_ct. A color transformer 208 is then arranged to transform the SDR image brightness to obtain an output image brightness of a certain output image.
[0038] Depending on the type of video re-determination device 220, two scenarios are of interest. If the device is a pure decoder, it can apply the inverse of the (brightness or) luminance mapping function F_L to obtain a close reconstruction of the master HDR image (i.e. the same peak brightness dynamic range grading, and approximately the same pixel brightness except for some video compression errors of the transmitted LDR image) as a reconstructed HDR image Im_RHDR. The device can also determine an image of different peak brightness (i.e. different from the peak brightness master HDR image, and the peak brightness of the second reference grading copied as the communication image in this embodiment, i.e., for example 100 nits). For example, the display adaptation algorithm of the display adaptation unit (e.g., electronic circuit) 209 can determine a function for calculating a 900 nit display adaptation image Im_DA_MDR, which is optimized for a connected 900 nit capability display. Such an algorithm, several variations of which we describe in WO2017108906, typically applies a weaker version of the inverse of the function F_L.
[0039] The technical components (according to the innovative components of the present teachings and / or the existing technical components with which they can be connected, cooperate, integrate, etc.) can be embodied or implemented as various technical systems typical in image or video technology (i.e., for example in various hardware devices). For example, the video re-determination device 220 can have any technical video supply output, for example, an HDMI cable that can be connected to a TV display, etc. (also, for example, a storage device, etc.; or even a network cable or wireless output that transmits the output image Im_RHDR or Im_DA_MDR to another potential remote device or system, etc.). Depending on the physical variant selected, there can be an image or video output signal formatter that converts the image appropriately for any technical situation (for example, the pixel color can have an R, G, B representation defined by the second OETF, such as HLG formatted and uncompressed, etc.).
[0040] There are two embodiments for determining the luma mapping function F_L. On the one hand, it can be defined by a human color expert (i.e., a color grader) who optimizes the created video. However, on the other hand, in several scenarios, automata (potentially partially preconfigured by humans to make them tend to a certain chromaticity behavior) will be relied upon to determine the appropriate curve shape of the luma mapping function F_L for each different type of HDR scene (e.g., potentially a different function for each video moment image).
[0041] The desired shape of the curve will depend on various factors. Ideally, the optimal curve depends on the semantic information that humans attach to various image objects. One might want to make the flames of a hearth or the light of a bulb glow brightly compared to the rest of the image, and so define the shape of the curve so that the function increases the brightness of pixels that fall within the range of brightness that various pixels in, for example, a flame have.
[0042] In practice, sufficient functions can already be defined based on factors such as the total dynamic range (i.e. the peak brightness PB_C of the image, e.g. 5000 nits), and in which areas of various brightness values are there in the image (and in more advanced approaches not only how many (e.g. 95% percentile) brightest pixels there are, but also whether they are e.g. central or peripheral in the image, or other geometric aspects).
[0043] The applicant has deployed several versions of the automaton, which currently serve various video communication systems.
[0044] For example, an automaton is designed to determine the best shape, e.g. the best slope for boosting the brightness of the darkest brightness using the first linear system, for the three-part curve of the above-mentioned SLHDR ETSI standard (see also WO2016119979). This curve (called Para[see Figure 3]) is defined by three parameters: the first slope of a linear segment starting from the darkest black (zero luminance) and the second slope of a second linear segment going down from the brightest white (i.e., normalized luminance = 1) define the intersection point, and the third parameter defines the width of a parabolic region around that intersection point, which connects the shortened versions of the two linear segments. The automaton uses a lot of math to analyze the statistics of the input image and derive the 3 best parameter values for the best regrading (i.e., the luminance remapping curve for that image). There are also versions with 5 parameters that also include clipping regions for the darkest black and brightest white, etc., and similar automatons can be made for further differently parameterized curves (e.g., customizable multi-linear segment curves).
[0045] The automation will also prove to be of interest if in the future non-professionals (i.e. consumers) will start producing their own HDR content. It is expected that, contrary to professional graders (who might even spend half a day grading a particular scene (depending on the budget the filmmaker has reserved or still has available for grading)), at least a certain portion of consumers will want as few adjustments as necessary.
[0046] It might be desirable to try to overlay better curves on other image aspects.
[0047] However, if for any reason it is desired to have a variety of styles, the automaton technique will be even more cumbersome. The applicant has recently looked at changing the paradigm so that there is no requirement for a unique "optimal" grading curve, but two reasonable regrading functions can be made, for example, for defining two styles of LDR images, which work well with the input master HDR image. For example, the first brightness mapping curve F_L1 has a slightly more brightness boost in the darkest linear segment, making the darkest pixel slightly brighter in the output LDR image, and the brightness mapping curve F_L2 of the second style keeps the darkest pixel in the scene slightly darker. The video creation artist can set his ideas on a unique optimal function, for example, he wants to keep the darkest pixel very dark, so they retain a mysterious atmosphere. But it is possible that some users may expect a slightly brighter or even more exposed version of the dark areas in some images. The embodiments set forth below enable the construction of a much more powerful device, for example, a mobile phone that automatically shows an image optimally when, for example, walking from indoors to outdoors.
[0048] US2020 / 0211503 teaches a system for brightening HDR images to compensate for brighter viewing environments. Figure 7Summary. An input image (Im_inpr) enters. In the case where this happens to be an SDR image, an SDR to HDR conversion is performed by unit 701 to begin the actual environmental compensation process for the common level HDR image (Imstrt). In order to obtain a better displayed image in a brighter viewing environment, the pixel brightness is increased (e.g., by multiplying all pixel brightnesses by a common factor k), and then some clipping is performed on the brightest pixels to obtain permission (for a fixed maximum brightness end-user display, some dynamic range will be suffered anyway). It should be understood that the quality of this processing depends on the quality of the image (noise, compression artifacts, resolution). For example, if the image contains a lot of analog noise, if a strong grayscale conversion function with a high k value is used, the best image may not be produced for display, because this will enhance the noise and may make it annoyingly visible, especially if the environment is not so bright. Therefore, the best grayscale curve among the alternative grayscale curves to be applied depends on a combination of the image quality value and the measurement sensor 760's measurement of the ambient illumination amount (I_amb). In this teaching, one or more quality aspects of various images are determined by a deep neural network (750). For example, a DNN may look at an image and classify it as a standard resolution image (SD) or a 4K image (UHD). One would tend to think that this is a simple way of counting the amount of horizontal pixels, but the UHD image may have been generated based on a poor quality original SD by spatial upconversion, and the DNN can discover this. This measure of resolution (M_resol) may be useful in the enhancement process. For example, if the enhancement performs a spatial upscaling from 4K to 8K, it may use a different scaling algorithm, depending on the spatial quality of the image, for example, trying to slightly sharpen the blurred edges. Another measure is the simulated noise metric M_noi as determined by the DNN. This value is useful for both denoising (denoiser 702) and determining the best grayscale conversion function for the first converter 703. In practice, a first conversion, for example, slightly stronger, may be performed on the standard definition starting image after appropriate denoising. A complementary grayscale conversion may then be performed by the second converter 705 after the enhancer 704 (i.e., if the resolution has been increased, the spatial quality of the image is therefore higher, or the blocking artifacts of the MPEG compression have been mitigated). Importantly, this DNN has only an external role in parallel to the standard processing pipeline, i.e. it aims to provide a more meaningful quality metric for various (completely different) input images than a classical noise level estimator would do. Thus, a good ambient compensated version of the original image, i.e. ImHDRprout, is obtained.
[0049] Figure 8The principle as can be used according to JP2907057B is clarified. Exposure change is a technique that multiplies an input value (e.g. brightness or luminance) according to a determined exposure value E, e.g. luminance_out A(E)*luminance_in. If we have an indoor scene with some outdoor objects in the sun, e.g. seen through a window (Fig. A), we may (e.g. when calculating an LDR image from an input HDR image) want to focus on the indoor objects, rather than on the outdoor objects which may be cropped to white as in classic LDR images produced in the past. Knowing the limited (e.g. LDR) output range, an optimal exposure can be determined and boosted by a multiplier B(E). If one wants to focus on the outdoors, another optimal exposure can be determined, resulting in a multiplier A(E2), which in this example darkens ( Figure 8 B). Figure 8 C shows an example of how this can be determined statistically without wanting to use a neural network (which can give better results). A simple heuristic is to look for lobes in the image where the main brightness occurs, determine a representative brightness value LinX, and map it to, for example, half the output brightness range (which sets another multiplier value).
[0050] JP2907057B improves on this by determining not only the general (grey) level of ambient lighting, but also red, green and blue measurements, so that also coloured (e.g. bluish) environments can be compensated. The average of the processed image is the fourth input to a neural network that determines control signals for boosting the drive values of the red, green and blue electron guns of the CRT display (thereby brightening the displayed image to compensate for the brighter environment). The fifth parameter is the duration for which the (possibly overly) brightened image is shown to the viewer.
[0051] The paper by T. Bashford-Rogers et al., “Learning preferential perceptual exposure for HDR displays” (IEEE Access, April 2019) teaches a statistical and neural network model for determining optimal exposure for various categories of displays (e.g., 500 nits maximum displayable brightness up to 10,000 nits) and various brightness values (from darkness to typical indoor light (e.g., 400 lux) to 4000 lux outdoors).
[0052] The optimal exposure depends on the details of the image by a constant factor, and depends linearly on the amount of ambient lighting around the display, and logarithmically on the display maximum brightness. As variables to characterize the image, the log10 mean of the brightness in the image, an image key that defines the ratio of the median brightness to the minimum value divided by the total span, and a dynamic range measure seem sufficient to characterize the image. Neural networks can learn these aspects about images internally. They taught a neural network where the first layer performs a summarizing convolution, and then the last fully connected layer determines a single optimal exposure value based on all this summarized information.
[0053] US2016 / 0100183 teaches a reproduction device for sending an image from a recording medium (e.g. a Blu-ray disc) to a TV, wherein the medium contains the image and a brightness mapping function. If the TV transmits certain information, the reproduction device will send the image and the function, and if it does not transmit such information, a conventional SDR image is sent to the TV. Summary of the invention
[0054] The difficulty of obtaining a proper rescaling of any video is addressed by: an apparatus for brightness rescaling (300) an input high dynamic range image (IM_HDR) of a first brightness dynamic range to a second image (IM_DR2) of a second brightness dynamic range, wherein the maximum brightness of the second image can be higher or lower than the maximum brightness of the input high dynamic range image, the apparatus comprising:
[0055] a first neural network processing circuit (301) having as input a set of pixel intensities of the input high dynamic range image (IM_HDR), wherein the first neural network processing circuit has at least two sets of outputs (S1, S2),
[0056] wherein the output set has an output node for supplying parameter values of a parameter rescaling equation, wherein the parameter rescaling equation comprises at least two partial functions, the amounts of the at least two partial functions in the rescaling equation being controlled by at least two corresponding output parameter values (P11, P21);
[0057] wherein a first output set (S1) comprises at least two parameter values (P11, P21) determining a first shape of a reclassification function, and a second output set (S2) comprises at least two corresponding parameter values (P12, P22) determining an alternative second shape of the reclassification function, the alternative second shape being determined by the same parameter definition but using different values for its parameters to obtain a different shape;
[0058] a second neural network processing circuit (302) having as input at least one measurement value (La) from at least one sensor (311) and having as output nodes supplying a set of weights corresponding in number at least to the number of sets of outputs of the first neural network processing circuit;
[0059] a combiner (303) arranged to add first parameter values (P11) of the first set of outputs of the first neural network processing circuit multiplied by corresponding first weights (w11) from the second neural network processing circuit and corresponding parameter values (P12) of the same reclassification function definition parameter of the second set of outputs of the first neural network processing circuit multiplied by corresponding second weights (w12) from the second neural network processing circuit, thereby producing a final parameter value (P1_f); and
[0060] A luma mapping circuit (320) is arranged to map the input luma of the input high dynamic range image (IM_HDR) using a luma mapping function (F_L) to obtain an output luma of the second image (IM_DR2), the luma mapping function being defined by at least two parameters including the final parameter value (P1_f).
[0061] The limits of the two dynamic ranges may be preset, or set in several ways at processing time. For example, when the minimum black of the two ranges is considered equal and fixed (e.g. 0.01 nit), the luminance dynamic range may be defined using only the maximum luminance (preferably of the associated target display of the image). This may be hardwired in the device, or input via a user interface, etc. It may be an additional input parameter to the neural network, or a condition for preloading an alternative set of internal coefficients of the neural network, etc. Note that although the preferred embodiment uses HDR input images that are uniquely defined according to the associated target display with the maximum luminance (a 4000 nit target display image or video should not typically have pixels with luminance greater than 4000 nits, and will typically have at least some image objects containing pixels that well fill the range of the associated target display, i.e., those pixels will have luminances slightly below and / or up to 4000 nits), the images actually displayed do not need to be on that scale (e.g., in very bright sunlight conditions, those images may be displayed on outputs ranging from 0.01 to 8000). The neural network may also work with relative (e.g., normalized to a maximum of 1.0) brightness pixel values.
[0062] Depending on relevant measures of, for example, relevant aspects of the surrounding or encoding side of the display, the second network may determine a mixture of two different rescaling functions for the input image, which represents an alternative style as encoded in the main network. Thus, the second network type controls the first neural network in a specific way, i.e. it regulates parallel aspects that are already fully contained in the first neural network. In some embodiments, the mixing weights may be equal to the amount of sets, so that the grading curves may be mixed as a whole. For example, if there are three sets (to be mixed) and each set defines a rescaling function controlled by two parameters (e.g. A*pixel_luma+B), the final value of the first parameter may result in (w1*A1+w2*A2+w3*A3) / normalized, and the second final parameter value may be determined by those same three weights from the second neural network, i.e. B_final=(w1*B1+w2*B2+w3*B3) / normalized. Typically at least some parameters will be mixed. Other embodiments may output more weights, e.g. each contribution may have its own weight. For example: (w1*A1+w2*A2+w3*A3) / normalization and (w4*B1+w5*B2+w63*B3) / normalization. On the other hand, not all parameters may get a changed final value in the combiner, for example the first parameter may get a weighted value A_final=(w1*A1+w2*A2) / normalization and B_final=B1 (or even a fixed value etc.). Although all parameters defining the regrading function will usually be mixed,
[0063] For parameter definitions (for which the main neural network can be trained to find suitable values), we mean numbers that can be set, which determine the weighting of a partial function over a certain domain (i.e., they define a part of the total definition of a re-grading function). For example, if the function is defined over the entire domain of input values (e.g., when having a lightness code of 0 - power(2; number of bits); or for a luminance ranging between Luminance_min (e.g., 0 nits) and Luminance_max (e.g., 4000 nits)), then an additional re-grading function can be formulated as: F_final(x) = parameter_1 * first-partial-function(x) + parameter_2 * second-partial-function(x), where x is any value in the input domain. When the partial function is a polynomial, one can have F_final(x) = parameter_1 * first-partial-polynomial(x) + parameter_2 * second-partial-polynomial(x). Of course, those skilled in the art will understand that the functions input in the device hardware or software are actually the available functions for re-grading between higher dynamic range images and lower dynamic range images, i.e., they will typically be strictly increasing, that is, strictly monotonically increasing. An example of a multiplicative definition can be, for example, F_final(x) = parameter_1 * first-partial-function(x) * [parameter_2 + second-partial-function(x)]. An example of a differential (also called a partial domain definition function) can be, for example: if x < parameter_1, then apply parameter_2 * partial_function_1; otherwise apply (parameter_3 * partial_function_2 + parameter_4 * partial_function_3) as the result of F_final(x > parameter_1). Those skilled in the art understand how to define additional parameter re-grading functions, and how the main neural network can learn which values of those parameters work well in various situations, e.g., in the main case where a first re-grading function shape is needed and in a secondary case where a second different re-grading function shape is needed, such as a dark cave image with a large number of dark regions.
[0064] Thus, if a first set of nodes produces a first value for parameters A, B, C, the second set will produce alternative values, e.g., for slightly larger values of those same parameters, defining the same re-grading function, e.g., A+B*luminance-in+C*power(luminance-in; 3).
[0065] The system will also know which dynamic range to map from (e.g. which maximum brightness of the associated target display, i.e. which maximum pixel brightness can generally be expected in the image). This can be prefixed, e.g. in a system that always gets 1000 nits input video and needs to downgrade to 200 nits output video or 1500 nits output video (if this is e.g. the capability of the display on which the output image is seen in various situations). Or configurable values for inputs and / or outputs can be set by the user, e.g. at runtime, and then e.g. the neural network can load different weights for different situations, or all situations inside the network can be included and these settings are taken as additional inputs (or even derived internally if the image brightness is a set of pixel brightness values sampled from the input image to be brightness mapped, etc.). These functions can also be preset in the circuitry of the device, or defined by the user before use, etc.
[0066] In the default case, generally useful functions can be used, for example, a function of two outer linear segments connected by a parabolic middle segment of the applicant can be used in a simpler version. Complex versions can use complex models that a neural network can optimize. Many systems will be pre-optimized from the factory, but other systems may involve a training phase by the user of the device (e.g., a mobile phone). The user then draws, for example, a multi-piece function, and the neural network optimizes the segmentation based on preferences indicated by the user regarding the final re-graded appearance of the displayed image. Various neural networks can use various learning / optimization algorithms. In a general purpose device, the measurement can be anything that can affect the re-grading as required and can be measured, such as the environment, display properties, user properties, etc., as illustrated by our illustrative example.
[0067] By parameters that determine the shape of a function, we mean that the values of these parameters uniquely determine the shape of the function, i.e. which output coordinate values are produced by which input coordinate values on the graph. If the neural network decides to lower the value of the output because it trains its internal weights differently, the curve can, for example, be located lower, closer to the diagonal, less strongly curved, etc.
[0068] An example of a single parameter controllable regrading function is a two linear segment function defined on the lightness axis normalized to 1, where the parameter controls the height of the first segment at input 0.5, i.e. P1 = h, and Y_out(0.5) = h*0.5. We have found our three parameter (black slope, white slope, midtone width) Para function to be well suited for regrading images in certain applications (e.g. broadcast), although more advanced regrading functions have been developed and proposed (see, e.g., the SLHDR ETSI standard), and may also be computed by the first neural network embodiment below. In the case where the number of weights is equal to the number of sets, only the function style itself is weighted, i.e., all parameters are weighted by the same value. In the case where the number of output weights of the second neural network is equal to the number of sets multiplied by the number of parameters per set (i.e., the total number of output nodes of the first neural network), then each parameter may be weighted differently (as described, each parameter triplet defines some final Para function curve shape).
[0069] The first neural network processing circuit (301) can be trained to obtain a useful set of regrading functions (styles) for any kind of HDR scene image. Since several parameters need to be learned that characterize the curve shape of one or more mathematically defined curves (we illustrate with single and three parameter curves (Para), but the system can be extended to cover parallel regrading curves, such as choosing between Para or multi-linear segment curves, or learning functions that are applied successively, such as a fine-tuned multi-linear segment curve applied to HDR luminance after an initial Para regrading, etc.), any neural network topology can be used by training it with some cost minimization function to produce output parameters close to the parameters that a human grader would choose for a variety of input images. The input image may have a fixed (e.g., a full 1000 nits if the device is to function, for example, in a fixed broadcast system) or variable encoded peak brightness, and will include a fairly large collection of HDR images of various characteristics (all bright like the cowboys in the desert example, semi-dark with a few bright areas like the sun's rays coming through the ceiling, larger and smaller dark and bright areas, flickering high brightness areas like explosions or fireworks, with faces of human actors appearing in areas of various different lighting like images indoors and outside a window, etc.).
[0070] The second neural network (NN) processing circuit (302) can now learn how these functions should be combined, for example, if the light meter 311 measures a specific ambient lighting level (e.g., when watching evening TV with dimmed lights or watching on a train during the day, etc.), it can learn that a certain amount of function 1 (e.g., Para with a brighter linear slope for the darkest colors in the scene) needs to be mixed with function 2 (the Para with a smaller slope is the average case). Also, the second NN can learn different settings for different peak brightness or particularly minimum coded brightness (MB_C), anticipating that averaging will require more correction to obtain better visibility.
[0071] This allows very low user interaction, and the system will then quickly switch to the appropriate re-graded output image for any of several final viewing situations.
[0072] It is useful when the means for brightness regrading is coupled to a sensor coupled to the display. In this way, details of what is happening with the display can be measured. For example a user may be viewing differently with a lateral movement of the display (this may be further combined with e.g. the type of content data extracted from descriptive metadata, whether the user is viewing e.g. a downloaded movie or a linear broadcast programme), and the orientation sensor may provide input for the second NN to move to a different set of output weights for that situation. Another example is a compass and / or 3D orientation sensor, so that the direction in which the user is viewing the image and the average impact of the sun can be measured, e.g. in combination with the time of day. Another example is using a camera adjacent to the display.
[0073] It is useful when the means for brightness re-grading is coupled to a illuminance meter (311) arranged to provide a measure of the amount of light in the environment. This can enable different weightings of the curves from the first NN, which are still optimized to appear specifically for different kinds of HDR scene input images, and some of them have curve shapes that are better tuned for e.g. darker content in brighter viewing environments, etc.
[0074] It is useful when the apparatus for brightness re-grading is coupled to an image summarizing unit (310) which is arranged to measure brightness aspects of the input high dynamic range image (IM_HDR). There are various algorithms for summarizing images, ranging from simple (e.g. a sub-sampled average regional brightness image) to complex, such as measures of intra-object and inter-object contrast (e.g. various derivatives) and texture measures, etc. All of these can simply form the input to the second NN to train its internal understanding. The neural network can then learn (based on pre-processed knowledge as input or natively based on image brightness) e.g. whether brightness generally corresponds to indoor scenes or indoor+outdoor scenes (e.g. a view through a window). In principle, the second NN can also work at least in part based on geometrically localized aspects of the image, e.g. the relevance of concentrated mid-grey areas being faces, etc., although many embodiments will work with high-level global parameters. If additional brightness-derived parameters are also used, such as estimated motion, the apparatus can take into account motion settings (e.g. central zero motion due to the camera tracking a motorcycle, etc., and fast external areas).
[0075] It is useful when the apparatus for brightness re-grading comprises a user interface unit (330) arranged to determine a set of user specified weights and a selector (331) for selecting at least one user specified weight to enter the combiner (303) in place of the corresponding weight from the second neural network processing circuit (302). In addition to the automatic mode of re-grading, it is useful to have a way in which the user can benefit from all learned insights of the re-grading needs within the first NN and he can set some weights for at least some parameters himself. For example the user can set the slope of the linear segment of the darkest pixel to the Para re-grading curve and the automaton can handle the other two. For example some embodiments may include a feedback input of the user selected first parameter into the second neural network so the network can determine the other two accordingly. In a simpler embodiment, instead of selector 331, there may be a weight recalculator circuit or algorithm that uses a pre-designed method to determine the other two weights of Para given a selected slope for dark (e.g., a fixed mid-tone width for the middle region of the parabola, and a slope for dark and light for PB_C depending on the user's selection; or in a more advanced version, the amount of different pixel brightness in the lightest region, etc.). In the simplest variant, the user sets the three final weights himself, for example by using one or three sliders to move between the weights of the two styles.
[0076] It is useful when the means for brightness regrading is physically included in the device containing the display panel. It can be a useful means for optimizing, for example, a television display in a home viewing setting or a mobile phone etc. This allows various receiving side devices to fine tune the image in their own style in a system that separates the image production from the image optimization for display.
[0077] The apparatus for brightness regrading is useful when it is included in a video encoding and communication apparatus for transmitting video to one or more receivers. As opposed to the receiving-side embodiments, it may also be useful in some cases if the creator uses the apparatus or method. For example, consumer-produced videos may benefit from the present technology because at least some consumers may not need the sophisticated colorimetric insights of a professional grader.
[0078] In such a configuration the regrading apparatus is typically used not only to compute a good secondary grading image for (final) display, but also to compute a good secondary grading for communication (e.g. a good LDR image corresponding to an input HDR image for SLHDR encoding).
[0079] The technology can also be performed by: a method for rescaling (300) the brightness of an input high dynamic range image (IM_HDR) of a first brightness dynamic range into a second image (IM_DR2) of a second brightness dynamic range, wherein the maximum brightness of the second image can be higher or lower than the maximum brightness of the input high dynamic range image, the method comprising:
[0080] using a pre-trained first neural network processing circuit (301), the pre-trained first neural network processing circuit having as input a set of pixel intensities of the input high dynamic range image (IM_HDR), wherein the first neural network processing circuit has at least two sets of outputs (S1, S2),
[0081] wherein the output set has an output node for supplying parameter values of a parameter re-scaling equation, wherein the parameter re-scaling equation comprises at least two partial functions, the amounts of the at least two partial functions in the re-scaling equation being controlled by at least two corresponding output parameter values (P11, P21),
[0082] wherein a first output set (S1) comprises at least two parameter values determining a shape of a reclassification function, and a second output set (S2) comprises at least two corresponding parameter values (P12) of parameters different from said parameter values in said first set, said at least two corresponding parameter values determining a different shape of said reclassification function;
[0083] using a second neural network processing circuit (302) having as input at least one measurement value (La) from at least one sensor (311) and having as output a set of weights having a quantity of weights at least equal to the quantity of the output set of the first neural network processing circuit;
[0084] adding a first parameter value (P11) of the at least two parameter values of the first output set of the first neural network processing circuit after being multiplied by a corresponding first weight (w11) from the second neural network processing circuit, which is a value of a corresponding parameter of the same reclassification function of the second output set of the first neural network processing circuit and is multiplied by a corresponding second weight (w12) from the second neural network processing circuit before said adding, to a corresponding first parameter value (P12) of the at least two parameter values of the second set, thereby producing a final parameter value (P1_f); and
[0085] An input luminance of the input high dynamic range image (IM_HDR) is mapped by applying a luminance mapping function having a curve shape defined by the final parameter value (P1_f) to obtain an output luminance of the second image (IM_DR2). BRIEF DESCRIPTION OF THE DRAWINGS
[0086] These and other aspects of the method and apparatus according to the invention will become apparent from the embodiments and examples described below, and are explained with reference to the accompanying drawings, which are intended only as non-limiting specific illustrations of the more general concepts, and in which dashed lines or dots may be used to indicate that a component is optional, and non-dashed components are not necessarily required. Dashes or dots may also be used to indicate elements that are interpreted as necessary but are hidden inside an object, or for intangible things, such as selection of objects / areas (and how they can be displayed on a display).
[0087] In the attached picture:
[0088] Figure 1 Schematically illustrating aspects involved in a more advanced HDR video encoding system, i.e. a system that does not merely encode the pixel colours of a master HDR image, but rather illustrates how a function represented by a mapping arrow between input and output luminances may be defined that defines at least one secondary regraded image of a different encoded peak brightness (e.g. SDR) than the master HDR image;
[0089] Figure 2Schematically illustrates an encoder and a decoder in a video communication system that transmits a master image (Master HDR) of a first dynamic range (DR_1) as a representative image of a different second dynamic range (DR_2);
[0090] Figure 3 Schematically shows the basic elements and some optional embodiment elements (dashed lines) of the device (300) for brightness re-grading of the present invention;
[0091] Figure 4 Schematically explained as Figure 3 A convolutional neural network with a good neural network topology of the first neural network processing circuit (301);
[0092] Figure 5 Schematic diagram of how the Figure 3 an exemplary video description data value input into a second neural network processing circuit (302);
[0093] Figure 6 Schematically illustrates an embodiment in which user weights are supplemented or replaced by weights from an external database;
[0094] Figure 7 The first prior art technical method is summarized;
[0095] Figure 8 The second prior art method is summarized, and
[0096] Fig. 9 Several example devices or applications are shown in which at least some of the present embodiments may be used. DETAILED DESCRIPTION
[0097] Figure 3Elements of a device (300) for brightness re-scaling are shown. It gets an input HDR image IM_HDR (e.g. 4K, but it can also be sub-sampled, as re-scaling often needs to be not strongly resolution dependent). This can be, for example, the main grading in the case of video encoding, or an image directly from the camera in the case of consumer mobile phone video capture, etc. Thus, in practice, when the device receives an input image to be brightness re-scaling in action, there can be as many input neurons (also called nodes) as the number of pixels (horizontal*vertical)x3 (as there are three color components) in the first neural network processing circuit (301). Regardless of various possible internal structures (number of hidden layers, etc.) (which can produce slightly better results), but at the cost of more computation, it is up to the device manufacturer to choose, depending on, for example, whether the device has a dedicated neural processor or can advantageously use a GPU or any circuit for massively parallel computation. As an output layer, there is a set of parameter values, e.g., parameters for two flavors of Para (e.g., P21 and P22 give the same mid-range width, but P11 produces a larger slope value for the dark linear segment of Para than P12, and P31 is a smaller slope than P32). Both of these are usually reasonable re-gradings of the current image, but not necessarily the final best function to be used in the luma mapping circuit 320. A better curve is determined based on further considerations, which are other parameters that characterize the situation (some of which may correspond to the input of the first NN, i.e., parameters from or related to the input image IM_HDR).
[0098] The second neural network processing circuit (302) obtains one or more situation-related variables. In practice, all selected measurements may be input together so that the second NN sorts them all out, but other embodiments are contemplated, such as a cascade of partial networks for various types of situation-related variables, which may then be switched into an overall second NN configuration, e.g., depending on whether a measurement result is available or desired, etc.
[0099] An illuminance meter (311) arranged to provide a measurement of the amount of light in the environment is a useful sensor to produce a measured situation-dependent input into the second NN. Other examples are parameters characterizing the input image, which may be supplied by the image summarization unit 310 ( Figure 5 Possible examples are taught).
[0100] The input to the HDR image in the second NN does not necessarily need to be as detailed as in the first NN, so embodiments may use subsampling to summarize or prove image features that are useful in style selection. For example, a texture metric may be useful as an input to the HDR image, typically to be used together with another value that characterizes the spread of object brightness (such as a contrast metric); a total micro-texture metric summed over the entire image may be used, but it may also be calculated for each region of the input image, resulting in a sub-sampled matrix of such local texture metrics; further, a texture metric may be used to blend based solely on the shape of typical mid-tones of the image, where, for example, an actor's face is expected, or the width of mid-tones such as in the Para example, but various texture characterization values for different brightness sub-ranges (dark to light) may be input in the second NN.
[0101] The combiner 303 receives as input the weights (first weight w11, second weight w21, etc.) for the current situation (i.e., input image, and surrounding and display-related aspects, such as its orientation, etc.) from the output layer of the second NN. The combiner will perform appropriate combination based on the relevant (corresponding) parameters of at least two of the equivalent parameter sets output from the first NN.
[0102] In the example of obtaining two weights (e.g. w11=0.6 and w21=0.4) from the second NN, it can be calculated:
[0103] P1_f=w11*P11+w21*P12;
[0104] P2_f = w11*P21+w21*P22;
[0105] P3_f = w11*P31+w21*P32; [Equation 3]
[0106] In the scenario where the second NN outputs six weights, the combiner can compute:
[0107] P1_f=w11*P11+w12*P12;
[0108] P2_f = w21*P21+w22*P22;
[0109] P3_f = w31*P31+w32*P32; [Equation 4]
[0110] These final parameters (P1_f, P2_f, P3_f) uniquely characterize the final re-grading function to be used by the luma mapping circuit 320, which maps all input luminances of the input HDR image (IM_HDR) to obtain output luminances of the corresponding re-graded output image of the second dynamic range.
[0111] In a fully automatically working basic configuration embodiment there would not be any selector 331 or further configuration circuitry. However, it may be useful if the user of the device could also have his own opinion about the combinations of useful reranking functions output from the first NN.
[0112] In addition, the user interface unit 330 can be incorporated in the user device, connected to the rest of the device for re-grading. It can have various forms, such as a slider to generate two or more weights (e.g., placing the slider in the 60 / 40 position, as explained using equation 3).
[0113] The first NN only needs to output a few parameters of one or more functions in at least two versions ( / sets), so there are several neural network topologies that can be trained to produce those parameters (which are the equivalent computational engines for the problem).
[0114] However, neural networks can extract spatial aspects of images that are useful.
[0115] Therefore, a useful preferred embodiment of the first NN is a Convolutional Neural Network (CNN).
[0116] We will further illustrate this with the CNN example, which will use Figure 4 Explain briefly.
[0117] While "classical" neural networks usually consist of a multi-layer network, where each unit of the first layer is connected to all units of the successive second layer via learnable weights (i.e., it computes the sum of weight_N*previous_value_N, and usually passes this sum as input to the activation function), CNNs try to regularize by having different kinds of preprocessing stages (in Figure 4 Schematically explained in ).
[0118] The processing of the NN starts with the first layer of nodes getting the input HDR image. If it is a 4K brightness-only image (i.e., horizontal pixel resolution Wim equals 4000 pixels and vertical resolution Him is approximately equal to 2000, Nim indicating the number of images in the training set), you will get about 8 million inputs for each training image, but for color images, there are also 3 color components per pixel (usually YCbCr). The first stage will perform convolutions to detect spatially localized features of interest. Usually, there is no need to learn something so complex that it mixes the top left pixel of the image with the bottom right pixel (which often leads to problems such as overmodeling or neurons getting stuck in their state, not to mention that unnecessary excess computations usually do not lead to better learning and output result accuracy).
[0119] Therefore, the convolution produces multiple (Fim) feature maps, a first feature map f1 until, for example, a third feature map f3.
[0120] The values of the pixels of the feature map (e.g. also a 4K image) are obtained by convolution with the learned kernel. What happens is illustrated with an exemplary kernel 401. Let us assume that the convolution values of this 3×3 kernel have been learned by the first feature map. Such a configuration with negative unit values on the left and positive unit values on the right is known from theoretical image processing as an edge detector for vertical edges. Therefore, convolution with this kernel in all positions of the image will show in the feature map whether such an edge exists (or how strongly such an edge exists is measured) at various image positions.
[0121] By doing this, even more data has been created, so at some point one wants to reduce the data by using so-called pooling layers. For example, a single value of a block of 10×10 values in the feature map can be determined, thereby reducing the resolution, and a first pooled map MP1 of, for example, 400×200 pixels is obtained as a subsequent layer to the first feature map (layer). Since the convolution kernels often start to correlate more and more the more they overlap with the localized pattern being detected, one can simply take the largest one of the results in the feature map. This may also be an insight into good learning for this layer, useful later on, because it is the ensemble of the NN that learns how to determine the correct reclassification function, but the network works by determining more complex and ultimately very interesting image features (e.g. a square can be seen as a set of two vertical and two horizontal lines). In practice, typically instead of using a single convolution and pooling layer as schematically illustrated, several pooling layers for successive data reduction will be used, each of which may have one or several convolution layers before it. Therefore, not only the derivatives (i.e. contrast) of small local regions can be seen, but also the derivatives (i.e. contrast) of regions on a coarser scale (i.e. farther away). Figure 1 The cave example ImSCN3 (and its optimal shape of the Para reclassification function, i.e., the values of its three curve shape control parameters) can be learned from the derivatives of the bright central region with respect to the very dark surroundings.
[0122] Instead of using fixed convolution kernels as in classical programmed machine vision, the NN will automatically learn the optimal kernel by back-propagation during the training phase. That is, for example, the first internal weight Win11_f1 of the first feature kernel will converge to -1 on consecutive training iterations.
[0123] Finally, it is time to reduce to fully connected network layers, because ultimately we want to learn from the image data as a whole, e.g. a person located 2 / 3 of the way in the image from the left needs a specific reclassification, while in the upper right corner (e.g. in 5%×5% of the image size rectangle) there is a lamp illuminating the cave. To do this, the data from the last convolutional layer must be flattened in a 1D vector of NN units and their values.
[0124] Thus, one or more 1D fully connected layers are typically followed, such as fully connected layer FC1, and a final fully connected (output) layer FC2 produces the desired understanding data, in this case, e.g. 2x3 parameters for two styles of useful re-grading Para for at least one image presented.
[0125] Finally, typically after the convolution, an activation function is used to condition the convolution, for example, in a preferred embodiment, a rectified linear unit activation function (ReLU) is used, which zeros out negative convolution results (if any).
[0126] An exemplary embodiment code of the first NN written in Pytorch is as follows (model training):
[0127] import torch
[0128] from torch.utils.data import Dataset,DataLoader
[0129] import torch.nn as nn
[0130] import torch.nn.functional as F
[0131] import torch.optim as optim
[0132] import torchvision
[0133] from torch.utils.data import Subset
[0134] from sklearn.model_selection import train_test_split
[0135] from torchvision import datasets,transforms
[0136] import pandas as pd
[0137] #pandas is a software library for data manipulation and analysis written in the Python programming language.
[0138] import cv2
[0139] import numpy as np
[0140] #NumPy is a library for the Python programming language that adds support for large multidimensional arrays and matrices
[0141] class hdrDataset(Dataset):
[0142] def__init__(self,dataPath,imageWidth,imageHeight,outputSize):
[0143] self.dataPath = dataPath
[0144] self.imageWidth = imageWidth
[0145] self.imageHeight=imageHeight
[0146] self.outputSize = outputSize self.data = pd.read_csv('C: / Data / hdr / y.csv')#Mapping curve parameters (y)
[0147] self.numberOfSamples=len(self.data.index)
[0148] def __len__(self):
[0149] return self.numberOfSamples
[0150] def__getitem__(self,idx):
[0151] if torch.is_tensor(idx):
[0152] idx = idx.tolist()
[0153] imageFile='C: / Data / hdr / x_'+str(idx+1)+'.png'
[0154] #HDR input image samples (x)
[0155] image=cv2.imread(imageFile,cv2.IMREAD_UNCHANGED).astype('float32') / 65535.0
[0156] x=torchvision.transforms.ToTensor()(image)
[0157] parameters=self.data.iloc[idx].to_numpy().astype('float32')
[0158] y = parameters[2:5]
[0159] #Predict 3 parameters (y)
[0160] sample={'x':x,'y':y}
[0161] #The sample is (x,y)
[0162] return sample
[0163] #Here, the neural network topology (layers, such as convolutional layers) is defined, and the processing of the layers thereafter (producing continuous values of new x) class hdrNet(nn.Module):
[0164] def__init__(self, outputSize):
[0165] super(hdrNet,self).__init__()#Network function
[0166] self.conv1 = nn.Conv2d(3,8,3)
[0167] # The three arguments in the call consecutively mean: 3 to 8 channels (i.e., 3 input channels for the input image, and 8 feature maps from that input image), using a 3x3 filter in the convolution
[0168] self.conv2=nn.Conv2d(8,32,3)
[0169] #8 to 32 channels (i.e., from the 8 feature maps in the first hidden layer, we multiply by 32 more knowledgeable secondary feature maps), 3x3 filter
[0170] self.conv3 = nn.Conv2d(32,64,3) #32 to 64 channels, 3x3 filter
[0171] self.fc1=nn.Linear(64*14*27,64)
[0172] #The image has size hxw=14x27; Here, after subsampling / pooling, we have a fully connected (i.e., every neuron of a layer is connected to every neuron of the consecutive layer) linear layer, but since the image has been downsampled to 14×27, it is a smaller network; The 64 comes from agglomerating the 64 feature maps we had in the last convolutional layer; The number of output nodes in this first fully connected layer is 64
[0173] self.fc2 = nn.Linear(64,128) # Fully connected linear layer that maps 64 inputs to 128 output nodes
[0174] self.fc3 = nn.Linear(128, outputSize) # In the case where the network is to be trained for two typical styles of reclassification functions of the exemplary type Para, outputSize is, for example, twice the 3 parameters
[0175] def forward(self,x):#How to connect functions
[0176] x = F.relu(self.conv1(x))
[0177] #Filter the 3 channel image with a 3x3 convolution kernel (learned by the NN during training)
[0178] x = F.max_pool2d(x,(8,8))
[0179] #8×8 reduction for 8 channels (the amount of feature maps obtained from the first convolutional layer as defined in self.conv1=nn.Conv2d(3,8,3))
[0180] x = F.relu(self.conv2(x))
[0181] # Use conv2 to filter the 8-channel low-resolution image (relu is an activation function that resets negative numbers to zero and keeps positive numbers unchanged)
[0182] x = F.max_pool2d(x,(8,8)) # 64x64 reduction of 32 channels
[0183] x = F.relu(self.conv3(x)) # Filter 32-channel low-resolution image
[0184] x=x.view(-1,self.num_flat_features(x))
[0185] #Convert from X, Y, Chan to 1D tensor (view is a dimension selection operation)
[0186] x = F.relu(self.fc1(x)) # Multilayer Perceptron (MLP)
[0187] x = F.relu(self.fc2(x))
[0188] x = F.relu(self.fc3(x))
[0189] return x
[0190] # Output mapping parameters (x is a 2x3 parameter that defines two styles of Para for example)
[0191] def num_flat_features(self,x):
[0192] size = x.size()[1:] # Includes all dimensions except the batch dimension
[0193] num_features=1
[0194] for s in size:
[0195] num_features*=s
[0196] return num_features
[0197] #This defines the training phase, iterating multiple times on the training data until the weights of the NN are reliable enough (the amount of iterations is controlled by the epochs variable, and batchsize defines how much training data is taken (usually depends on the available training resources, if there are fewer training resources, you have to train longer with smaller batches)).
[0198] def train(epochs,batchsize):
[0199] # Estimate 3 parameters
[0200] outputSize=3
[0201] #Create dataset
[0202] dataset=hdrDataset('dataPath',1920,1080,outputSize)
[0203] device=torch.device("cuda:0"if torch.cuda.is_available()else"cpu")
[0204] print(device)
[0205] #Create an object that automatically loads data during training
[0206] dataloader=DataLoader(dataset,batchsize,shuffle=True,num_workers=0)
[0207] #Define the model based on the network architecture
[0208] model = hdrNet(outputSize)
[0209] #Print model architecture
[0210] print(model)
[0211] #Transfer the model to GPU
[0212] model.to(device)
[0213] #Use the mean squared error between the predicted and true parameters (i.e., the error criterion chosen for learning to match the data in the training set is MSE)
[0214] criterion=torch.nn.MSELoss()
[0215] #Set parameters related to error minimization search (Ir is the learning rate)
[0216] optimizer=torch.optim.Adam(model.parameters(),lr=0.001, betas=(0.9,0.99))
[0217] # Run multiple times on the entire dataset (e.g. 50 rounds)
[0218] for epoch in range(epochs):
[0219] # Load a subset of all data (e.g. 10%)
[0220] for batch,sample in enumerate(dataloader):
[0221] #x = HDR input image, y = real-world mapping curve parameters
[0222] x = sample['x'].to(device)
[0223] y = sample['y'].to(device)
[0224] #Reset parameter gradients to zero
[0225] optimizer.zero_grad()
[0226] #Fitting
[0227] ypred = model(x) # predict parameters based on HDR image
[0228] loss = criterion (ypred, y) # calculate error
[0229] loss.backward()
[0230] #Backpropagation (i.e., backpropagation is used to train the model to get the correct weights)
[0231] optimizer.step()#Optimizer prepares for the next iteration
[0232] #Print the current round and batch error
[0233] print("epoch=",epoch,"batch=",batch,"loss=",loss.item())
[0234] #Save model weights
[0235] torch.save(model.state_dict(),'C: / Data / hdr / state_dict_model.pt')
[0236] def evaluate():
[0237] # Estimate 6 parameters
[0238] outputSize=6
[0239] #Get model architecture
[0240] model = hdrNet(outputSize)
[0241] # Load model parameters
[0242] model.load_state_dict(torch.load('C: / Data / hdr / state_dict_model.pt'))
[0243] #Load the dataset for evaluation
[0244] dataset=hdrDataset('dataPath',1920,1080,outputSize)
[0245] #Create a data loader
[0246] dataloader=DataLoader(dataset)
[0247] #Loop through the dataset one sample at a time
[0248] for batch,sample in enumerate(dataloader):
[0249] #Predict the mapping curve parameters based on the input HDR image
[0250] y = model(sample['x'])
[0251] #Print predicted parameters
[0252] print("predicted=",y)
[0253] #Print the actual parameters
[0254] print("true=",sample['y'])
[0255] #Finish
[0256] return 0
[0257] Another embodiment uses the above system to create 1 set of Para parameters in the third fully connected layer (i.e., outputsize=3), but then adds a fourth fully connected layer to derive various styles of the "average" Para of the third layer, with corresponding modified code sections:
[0258] class hdrNet(nn.Module):
[0259] def__init__(self, outputSize):
[0260] super(hdrNet,self).__init__()
[0261] self.conv1 = nn.Conv2d(3,8,3)
[0262] self.conv2=nn.Conv2d(8,32,3)
[0263] self.conv3=nn.Conv2d(32,64,3)
[0264] self.fc1=nn.Linear(64*14*27,64)
[0265] self.fc2 = nn.Linear(64,128)
[0266] self.fc3 = nn.Linear(128,128) # We include extra layers
[0267] self.fc4=nn.Linear(128,outputSize)
[0268] #For the example of 4 styles of Para, outputSize is 4x3=12 parameters
[0269] and
[0270] def forward(self,x):
[0271] x = F.relu(self.conv1(x))
[0272] x = F.max_pool2d(x,(8,8))
[0273] x = F.relu(self.conv2(x))
[0274] x = F.max_pool2d(x,(8,8))
[0275] x = F.relu(self.conv3(x))
[0276] x=x.view(-1,self.num_flat_features(x))
[0277] x = F.relu(self.fc1(x))
[0278] x = F.relu(self.fc2(x))
[0279] x = F.relu(self.fc3(x))
[0280] x = F.relu(self.fc4(x))
[0281] return x
[0282] The second NN will usually not be a CNN, since no such spatial preprocessing is needed, and it can be a fully connected network like a multilayer perceptron, or a deep belief network, etc.
[0283] An example 4-element sensor vector (of size Nsensor) may include:
[0284] - The device's heading in degrees relative to north (compass sensor in smartphone)
[0285] - Device azimuth in degrees
[0286] - Local time measured in hours of the day with values 0 to 23.
[0287] - Weather code [0=sunny, 1=partly sunny, 2=cloudy, 3=raining] (e.g. obt)
[0288] - Device ambient light sensor readings encoded in 100 levels.
[0289] These five variables are a way of providing information to the second NN’s model so that it learns to predict whether the smartphone screen is illuminated by bright light or viewed in the shadow.
[0290] A possible code for the second neural network is for example:
[0291] class hdrNet(nn.Module):
[0292] def__init__(self,Nsensor,Nweights):
[0293] super(hdrNet,self).__init__()
[0294] self.fc1=nn.Linear(Nsensor,64)
[0295] self.fc2 = nn.Linear(64,128)
[0296] self.fc3=nn.Linear(128,Nweights)
[0297] def forward(self,x2):
[0298] #x2 = sensor data vector (other embodiments may also obtain various x12 inputs for the HDR input image IM_HDR)
[0299] x = F.relu(self.fc1(x2))
[0300] x = F.relu(self.fc2(x))
[0301] x = F.relu(self.fc3(x))
[0302] return x
[0303] Figure 5 An example of how a simple contrast severity metric can be calculated is shown, which could be a good image summary input to the second NN to determine which would be good weightings. It determines in the luminance histogram N(Y) of the input image IM_HDR how far away from the darker lobe of luminance the bright objects (generally, i.e. wherever they are located; this could be improved by doing various measures for different locations) are located, and also weighted by how many bright pixels there are. So the metric could be, for example, a*DB*F(NB), where F(NB) is a function that increases saturation for really large numbers of bright pixels. Any such useful metric that is input could help the second NN to reach even better weight outputs.
[0304] Figure 6 A more advanced version of the apparatus for brightness regrading (600) is shown. It is particularly useful in applications where users want to control the grading of their own captured videos (i.e., for example in consumer devices such as video capturing mobile phones). Figure 3 The difference lies in the HDR image grading situation analysis unit 601. This unit will analyze the situation of the weights (wl2u) selected by the user and determine whether different weights can be arranged in sequence. In its most basic form, it will work based on the user weights and the weights of the second NN, and more advanced embodiments can also check the characteristics of the input image (instead of doing this itself, it can retrieve the input according to which one or more of the two neural networks have their own outputs, if they also produce the same characteristics of the image).
[0305] The HDR image grading situation analysis unit 601 is arranged to check the value of at least one of the weights of at least one of the user weights and the second NN weights (when checking both, it can check the difference of those corresponding weights). It can derive a situation summary signal (SITS), which can, for example, consist of an identification of the required weights for a type of regrading curve (e.g., the weights of the linear segment of the darkest brightness of Para). The signal requests the corresponding suggested weights w12su from an external database 612, for example, typically connected via the Internet. In the database, they can be good summary weights for a specific regrading situation, for example, typically collected from many regrading operations (e.g., via similar devices 600). Preferably, a certain type of HDR image situation is also transmitted in the situation summary signal SITS, so that a specific suggested weight for the currently viewed video scene can be retrieved. This can be as simple as, for example, the percentage of pixels below a first brightness threshold (typically dark pixels, for example, a threshold below 30% or 25% on the PQ scale) and / or the percentage of pixels above a second brightness threshold (e.g., 75% or higher), but can also contain vectors of other image description values. The management circuit of the database 612 can then deliver a suggested weight w12su, as long as it corresponds to an image close to the transmitted image statistics or general properties as transmitted in SITS. The image grading situation analysis unit 601 can then deliver the suggested weight w12su or the result of an equation balancing the two, such as an average weight.
[0306] Fig. 9 Several examples of devices (or applications) in which this embodiment can be used are shown. Before storing the image captured by the camera 901 in internal or external memory for later use, the mobile phone 900 can re-grade the image captured by the camera 901 based on the measured characteristics of the determined style. VR or AR goggles 950 show an application of re-grading the HDR image received via the image receiver circuit 951 by, for example, using a forward-looking camera 952. For example, in an AR application, the camera can measure how bright the environment the viewer is looking at is, and this is partially transmitted to his eyes, and given this embodiment, the superimposed HDR image information can be optimized.
[0307] The algorithmic components disclosed herein may be implemented (in whole or in part) in practice as hardware (e.g., part of a dedicated IC) or as software running on a special digital signal processor or a general purpose processor, etc. They may be semi-automatic in the sense that at least some user input may / exist (e.g., in factory or customer input or other human input).
[0308] It should be understood from our presentation by those skilled in the art which components may be optional improvements and may be implemented in combination with other components, and how the (optional) steps of the method correspond to the corresponding devices of the device, and vice versa. The fact that certain components are disclosed in the present invention in a specific relationship (e.g., in a single figure in a specific configuration) does not mean that other configurations are not possible as embodiments under the same inventive concept as the inventive concept disclosed herein for obtaining a patent. In addition, the fact that only limited range examples have been described for practical reasons does not mean that other variants cannot fall under the scope of the claims. In fact, the components of the present invention can be embodied in different variants along any use chain, for example, all variants of the creation side such as an encoder can be similar to or correspond to the corresponding device at the consumer side of the decomposed system such as a decoder, and vice versa. Several components of the embodiment can be encoded as specific signal data in the signal for transmission using any transmission technology between the encoder and the decoder or further use such as coordination. The term "device" is used in the present application in its broadest sense, i.e. a group of devices that allow a specific goal to be achieved, and thus may be, for example, (a small part of) an IC or a dedicated appliance (such as an appliance with a display), or part of a networked system, etc. An "arrangement" or "system" is also intended to be used in the broadest sense, and thus may include, inter alia, a single physical, purchasable device, a part of a device, a collection of (parts of) devices operating in coordination, etc.
[0309] The computer program product representation should be understood as any physical realization of a set of commands that enables a general or special processor to enter commands into the processor after a series of loading steps (which may include intermediate conversion steps, such as conversion to an intermediate language and a final processor language) in order to perform any of the characteristic functions of the invention. In particular, the computer program product can be implemented as data on a carrier such as a disk or tape, data present in a memory, data traveling via a network connection - wired or wireless - or program code on paper. In addition to the program code, characteristic data required by the program can also be embodied as a computer program product. Such data can be (partially) provided in any way.
[0310] Any data usable by the invention or any philosophy according to embodiments of the invention, such as video data, may also be embodied as a signal on a data carrier, which may be a removable memory such as an optical disc, a flash memory, a removable hard disk, a portable device writable via a wireless device, etc.
[0311] Some of the steps necessary for the operation of any presented method may replace the functions described in the computer program product or any unit already present in the processor or any device embodiment of the present invention, the device or method described herein (with details of the present invention embodiment), such as data input and output steps, are well known to typically merge such processing steps as standard display drivers. It should be noted that the above-mentioned embodiments illustrate but do not limit the present invention. In the case where the technician can easily realize the mapping of the presented examples to other areas of the claims, we have not yet mentioned all of these options in depth for the sake of brevity. In addition to the combination of elements of the present invention as combined in the claims, other combinations of elements are possible. Any combination of elements can be implemented in a single dedicated element.
[0312] Any reference signs between parentheses in a claim are not intended to limit the claim, nor is any particular sign in the drawings. The word "comprising" does not exclude the presence of elements or aspects not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
Claims
1. An apparatus for brightness rescaling (300) an input high dynamic range image (IM_HDR) of a first brightness dynamic range into a second image (IM_DR2) of a second brightness dynamic range, wherein: The maximum brightness of the second image can be higher or lower than the maximum brightness of the input high dynamic range image, and the device comprises: a first neural network processing circuit (301) having as input a set of pixel intensities of the input high dynamic range image (IM_HDR), wherein the first neural network processing circuit has at least two sets of outputs (S1, S2), wherein the output set has an output node for supplying parameter values of a parameter rescaling equation, wherein the parameter rescaling equation comprises at least two partial functions, the amounts of the at least two partial functions in the rescaling equation being controlled by at least two corresponding output parameter values (P11, P21); wherein a first output set (S1) comprises at least two parameter values (P11, P21) determining a first shape of a reclassification function, and a second output set (S2) comprises at least two corresponding parameter values (P12, P22) determining an alternative second shape of the reclassification function, the alternative second shape being determined by the same parameter definition but using different values for its parameters to obtain a different shape; a second neural network processing circuit (302) having as input at least one measurement value (La) from at least one sensor (311) and having as output nodes supplying a set of weights corresponding in number at least to the number of sets of outputs of the first neural network processing circuit; a combiner (303) arranged to add first parameter values (P11) of the first set of outputs of the first neural network processing circuit multiplied by corresponding first weights (w11) from the second neural network processing circuit and corresponding parameter values (P12) of the same reclassification function definition parameter of the second set of outputs of the first neural network processing circuit multiplied by corresponding second weights (w12) from the second neural network processing circuit, thereby producing a final parameter value (P1_f); and A luma mapping circuit (320) is arranged to map the input luma of the input high dynamic range image (IM_HDR) using a luma mapping function (F_L) to obtain an output luma of the second image (IM_DR2), the luma mapping function being defined by at least two parameters including the final parameter value (P1_f).
2. The device for brightness re-grading according to claim 1, wherein the device is specifically coupled to a sensor, wherein the sensor is coupled to a display.
3. The device for brightness re-grading according to one of the preceding claims, the device being coupled to a illuminance meter (311) arranged to provide a measure of the amount of light in the environment.
4. The device for brightness re-grading according to one of the preceding claims, the device being coupled to an image summarization unit (310) arranged to measure brightness aspects of the input high dynamic range image (IM_HDR).
5. The apparatus for brightness re-grading according to one of the preceding claims, comprising a user interface unit (330) arranged to determine a set of user-specified weights and a selector (331), the user interface unit being arranged to determine a set of user-specified weights, the selector being used to select at least one user-specified weight to enter the combiner (303) in place of a corresponding weight from the second neural network processing circuit (302).
6. Device for brightness regrading according to one of the preceding claims, characterized in that The device is included in a device including a display panel.
7. Device for brightness regrading according to one of the preceding claims, characterized in that The apparatus is included in a video encoding and communication apparatus for transmitting video to one or more receivers.
8. A method for brightness rescaling (300) an input high dynamic range image (IM_HDR) of a first brightness dynamic range into a second image (IM_DR2) of a second brightness dynamic range, wherein: The maximum brightness of the second image can be higher or lower than the maximum brightness of the input high dynamic range image, and the method comprises: using a pre-trained first neural network processing circuit (301), the pre-trained first neural network processing circuit having as input a set of pixel intensities of the input high dynamic range image (IM_HDR), wherein the first neural network processing circuit has at least two sets of outputs (S1, S2), wherein the output set has an output node for supplying parameter values of a parameter re-scaling equation, wherein the parameter re-scaling equation comprises at least two partial functions, the amounts of the at least two partial functions in the re-scaling equation being controlled by at least two corresponding output parameter values (P11, P21), wherein a first output set (S1) comprises at least two parameter values determining a shape of a reclassification function, and a second output set (S2) comprises at least two corresponding parameter values (P12) of parameters different from said parameter values in said first set, said at least two corresponding parameter values determining a different shape of said reclassification function; using a second neural network processing circuit (302) having as input at least one measurement value (La) from at least one sensor (311) and having as output a set of weights having a quantity of weights at least equal to the quantity of the output set of the first neural network processing circuit; adding a first parameter value (P11) of the at least two parameter values of the first output set of the first neural network processing circuit after being multiplied by a corresponding first weight (w11) from the second neural network processing circuit, which is a value of a corresponding parameter of the same reclassification function of the second output set of the first neural network processing circuit and is multiplied by a corresponding second weight (w12) from the second neural network processing circuit before said adding, to a corresponding first parameter value (P12) of the at least two parameter values of the second set, thereby producing a final parameter value (P1_f); and An input luminance of the input high dynamic range image (IM_HDR) is mapped by applying a luminance mapping function having a curve shape defined by the final parameter value (P1_f) to obtain an output luminance of the second image (IM_DR2).
9. A computer program product comprising code which, when run, implements the method according to claim 8.
