WO2021036991A1 - High dynamic range video generation method and device - Google Patents

High dynamic range video generation method and device Download PDF

Info

Publication number
WO2021036991A1
WO2021036991A1 PCT/CN2020/110825 CN2020110825W WO2021036991A1 WO 2021036991 A1 WO2021036991 A1 WO 2021036991A1 CN 2020110825 W CN2020110825 W CN 2020110825W WO 2021036991 A1 WO2021036991 A1 WO 2021036991A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal device
image frame
area
regions
dynamic range
Prior art date
Application number
PCT/CN2020/110825
Other languages
French (fr)
Chinese (zh)
Inventor
许亦然
张俪耀
马靖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021036991A1 publication Critical patent/WO2021036991A1/en

Links

Images

Classifications

    • G06T5/90
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/50Control of the SSIS exposure
    • H04N25/57Control of the dynamic range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • This application relates to the technical field of artificial intelligence (AI), and in particular to a method and device for generating a high dynamic range video.
  • AI artificial intelligence
  • dynamic range refers to the ratio of the brightness of the brightest light to the brightness of the darkest light on an image
  • the dynamic range is one of the important dimensions of image quality evaluation.
  • images can be divided into high dynamic range (HDR) images, low dynamic range (LDR) images, and so on.
  • the same object can be photographed multiple times in a short period of time to obtain an LDR image of the object with different exposure durations, and then these LDR images are synthesized into an HDR image.
  • LDR images are synthesized into an HDR image.
  • a short exposure image, a medium exposure image, and a long exposure image of the object are acquired, and then the three images are merged to obtain an HDR image.
  • HDR videos With the development of HDR technology and the gradual popularization of HDR displays, users’ demand for HDR videos is gradually increasing.
  • terminal devices are required to have the ability to shoot HDR videos or to convert LDR videos into HDR videos.
  • the video is composed of individual image frames. If each image frame is composed of images with different exposure time, the terminal device needs to shoot multiple images with different exposure time for each image frame in a short time, and then These images are combined into image frames, and then an HDR video is obtained from the multiple image frames.
  • the exposure time the dynamic range of the video captured by the terminal device is limited.
  • the embodiments of the present application provide a method and device for generating a high dynamic range video.
  • the HDR video is obtained by dividing an image frame into different regions and using different enhancement schemes for different regions.
  • an embodiment of the present application provides a method for generating a high dynamic range HDR video.
  • the method is described from the perspective of a terminal device.
  • the method includes: after the terminal device receives a user input request to generate an HDR video processing request , Divide each first image frame contained in the original video into at least two types of areas. Different types of areas have different first image features. Use the corresponding first enhancement processing method for the different types of areas to obtain the enhanced area, and then , Splicing multiple regions after the enhancement processing of each first image frame to obtain a second image frame corresponding to each first image frame, and obtain an HDR video based on the second image frames. In this process, there is no need to take multiple images with different exposure time for each first image frame.
  • the terminal device divides the image frame into different areas by dividing the original video.
  • the area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes.
  • the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
  • the terminal device uses the corresponding first enhancement processing method to process each of the multiple regions, and after obtaining the multiple regions after the enhancement processing, it also performs semantic segmentation on the first region to separate
  • the first area is divided into a plurality of sub-areas, and the plurality of sub-areas contains at least two types of sub-areas.
  • the second image features of the different types of sub-areas are different.
  • the first area is any one of the multiple areas.
  • the first image feature and the second image feature The second image feature is an image feature of different dimensions.
  • the second enhancement processing method of each sub-region is determined, and the corresponding second enhancement processing method is used for each sub-region of the multiple sub-regions, and the multiple sub-regions after the enhancement processing are stitched together.
  • the terminal device can further divide the area into multiple sub-regions according to the second image feature, determine the second enhancement processing mode for each sub-region, and adopt the second enhancement processing mode to perform the Perform processing to achieve the purpose of further enhancing the processing of each sub-region.
  • each pixel of the first image frame is extracted from the YUV color space data of the first image frame According to the Y data of each pixel of the first image frame, the gradient of each pixel is determined, and the first image frame is divided into multiple regions according to the gradient of each pixel.
  • the terminal device converts the first image frame into a YUV image before acquiring the YUV color space data of the first image frame.
  • the terminal device uses the corresponding first enhancement processing method to process each of the multiple regions respectively, and obtains the histogram of each of the multiple regions before obtaining the multiple regions after the enhancement processing.
  • the dynamic range value of the corresponding area is determined according to each histogram, and the first enhancement processing mode corresponding to each area is determined according to each dynamic range value.
  • each area contains the target area, and the dynamic range value includes the high-exposure dynamic range value and the low-light dynamic range value.
  • the terminal device determines the dynamic range value of the corresponding area according to each histogram, it extracts the peak value of the target area, Average value and area ratio. This area ratio is used to indicate the ratio of high exposure area and low exposure area. According to the peak value, average value and area ratio, determine the high exposure dynamic range value and low brightness dynamic range value of the target area.
  • the terminal device determines the high-exposure dynamic range and low-brightness dynamic range values of the target area, and then determines the first enhancement processing method according to the dynamic distribution, so that the terminal device uses different enhancement processing solutions for different types of areas. deal with.
  • the original video is the video currently being shot by the electronic device; or, the original video is the local LDR video of the electronic device.
  • the terminal device can record HDR video in real time or convert a pre-recorded video into HDR video.
  • an embodiment of the present application provides a high dynamic range HDR video generation device, including:
  • the transceiver unit is configured to receive a processing request input by a user, and the processing request is used to request the generation of an HDR video;
  • the processing unit the user divides the first image frame contained in the original video into a plurality of regions according to the processing request, and the plurality of regions include at least two types of regions.
  • Each area in each area is processed by the corresponding first enhancement processing method to obtain multiple areas after the enhancement processing, and the multiple areas after the enhancement processing are spliced to obtain a second image frame, which is generated according to the second image frame HDR video.
  • the processing unit is configured to perform semantic segmentation on the first area to divide the first area into a plurality of sub-areas, and the plurality of sub-areas includes at least two types of sub-areas, and different types of sub-areas.
  • the second image feature of the region is different, the first region is any one of the multiple regions, the first image feature and the second image feature are image features of different dimensions, and the difference of each subregion is determined
  • each of the multiple sub-regions is processed by a corresponding second enhancement processing manner, and the multiple sub-regions after the enhancement processing are spliced to obtain the first region.
  • the processing unit is configured to extract the Y data of each pixel of the first image frame from the YUV color space data of the first image frame, and according to the first image frame The Y data of each pixel of, determine the gradient of each pixel, and divide the first image frame into a plurality of regions according to the gradient of each pixel.
  • the processing unit is further configured to convert the first image frame into a YUV image before acquiring the YUV color space data of the first image frame.
  • the processing unit is used to process each of the multiple regions by using the corresponding first enhancement processing mode to obtain the multiple regions after the enhancement processing.
  • the processing unit is used to process each of the multiple regions by using the corresponding first enhancement processing mode to obtain the multiple regions after the enhancement processing.
  • the dynamic range value of the corresponding area is determined according to each of the histograms, and the first enhancement processing mode corresponding to each area is respectively determined according to each of the dynamic range values.
  • each region includes a target region
  • the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value
  • the processing unit is configured to extract the peak value and average value of the target region
  • the area proportion is used to indicate the ratio of the high-exposure area and the low-exposure area
  • the high-exposure dynamics of the target area is determined according to the peak value, the average value, and the area proportion Range value and the low-light dynamic range value.
  • the original video is a video currently being shot by the terminal device, or the original video is a local LDR video of the terminal device.
  • an embodiment of the present application provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and when the processor executes the program Perform the method in the first aspect or various possible implementation manners of the first aspect above.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a terminal device, cause the terminal device computer to execute the method in the first aspect or various possible implementation manners of the first aspect. .
  • an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a terminal device, causes the terminal device to execute the first aspect or the first aspect described above.
  • an embodiment of the present application provides a chip system.
  • the chip system includes a processor and may also include a memory, configured to implement the functions of the terminal device in the foregoing method.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • the terminal device after receiving a processing request input by a user requesting to generate an HDR video, divides each first image frame contained in the original video into at least two types of regions, different types The first image features of the regions are different, and the different types of regions are processed by the corresponding first enhancement processing method to obtain the enhanced region. After that, the enhanced regions of each first image frame are spliced to obtain each first image frame. A second image frame corresponding to each image frame is used to obtain an HDR video based on the second image frames. In this process, there is no need to take multiple images with different exposure time for each first image frame. Therefore, it is not limited to the long exposure process.
  • the terminal device divides the image frame into different areas by dividing the original video.
  • the area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes.
  • the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
  • Figure 1 is a schematic diagram of the process of generating HDR images
  • FIG. 2 is a flowchart of an HDR video generation method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an input processing request in the HDR video generation method provided by an embodiment of the present application
  • FIG. 4 is another schematic diagram of the input processing request in the HDR video generation method provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application.
  • FIG. 6 is another schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application.
  • FIG. 7 is a schematic diagram of the process of distinguishing segmentation and sub-region segmentation in the HDR video generation method provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of dividing a first image frame in the HDR video generation method provided by an embodiment of the present application.
  • FIG. 9 is a flowchart of determining the first enhancement processing mode in the HDR video generation method provided by the embodiment of the present application.
  • FIG. 10 is a schematic diagram of regions and histograms in the HDR video generation method provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a process of an HDR video generation method provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a high dynamic range HDR video generation device provided by an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application.
  • FIG. 1 is a schematic diagram of the process of generating HDR images.
  • a long exposure process T includes three stages: a short exposure stage, a medium exposure stage and a long exposure stage.
  • the exposure durations corresponding to the three stages are t1, t2, and t3, respectively, where t1 ⁇ t2 ⁇ t3 , T1+t2+t3 ⁇ T.
  • the terminal device obtains three images with different exposure durations, which are a short exposure duration image, a medium exposure duration image, and a long exposure duration image; after that, the three images are fused to obtain an HDR image.
  • the embodiments of the present application provide a method and device for generating a high dynamic range video, which divide the original video into different regions and use different enhancement schemes to obtain HDR videos.
  • the terminal device may directly shoot the HDR video, or the terminal device may also process the local original video to obtain the HDR video.
  • the original video may be an LDR video, a standard dynamic range (Standard Dynamic Range, SDR) video, etc., pre-shot by the terminal device or downloaded from the server.
  • SDR Standard Dynamic Range
  • the terminal device involved in the embodiment of the present application may be a terminal device capable of video broadcasting and video recording.
  • the terminal device may communicate with one or more core networks or the Internet via a radio access network (e.g., radio access network, RAN), and may be a mobile terminal device, such as a mobile phone (or called a "cellular "Phones, mobile phones), computers, and data cards, for example, can be portable, pocket-sized, handheld, computer-built or vehicle-mounted mobile devices, and they exchange language and/or data with the wireless access network.
  • a radio access network e.g., radio access network, RAN
  • a mobile terminal device such as a mobile phone (or called a "cellular "Phones, mobile phones), computers, and data cards, for example, can be portable, pocket-sized, handheld, computer-built or vehicle-mounted mobile devices, and they exchange language and/or data with the wireless access network.
  • Wireless terminal equipment can also be called system, subscriber unit, subscriber station, mobile station, mobile station (MS), remote station (remote station), access point ( access point (AP), remote terminal equipment (remote terminal), access terminal equipment (access terminal), user terminal equipment (user terminal), user agent (user agent), subscriber station (SS), user terminal equipment (customer premises equipment, CPE), terminal (terminal), user equipment (user equipment, UE), mobile terminal (mobile terminal, MT), etc.
  • Wireless terminal devices can also be wearable devices and next-generation communication systems, for example, terminal devices in 5G networks or terminal devices in public land mobile network (PLMN) networks that will evolve in the future, and in NR communication systems. Terminal equipment, etc.
  • Fig. 2 is a flowchart of an HDR video generation method provided by an embodiment of the present application. This embodiment is described from the perspective of a terminal device, and this embodiment includes:
  • the user may input a processing request to the terminal device through a voice method, a touch method, or the like.
  • a voice method a touch method, or the like.
  • a touch method a touch method
  • Fig. 3 is a schematic diagram of an input processing request in the HDR video generation method provided by an embodiment of the present application.
  • an HDR video generation application (application, APP) is installed on the terminal device.
  • the APP can be an APP that comes with the operating system of the terminal device, such as a camera, or it can be downloaded and installed by the user.
  • To the third-party APP on the terminal device Taking the APP as a third-party APP as an example, when the HDR video needs to be generated, the user clicks on the HDR video on the desktop to generate the APP to start the APP.
  • the terminal device In addition to the shooting button on the APP's interface, there are also options for users to choose, such as time-lapse shooting, slow motion, video, photo, panorama, etc. After the user selects the video (as shown by the dashed box in the figure), the terminal device appears to turn on the two options of flash and HDR for the user to choose. If the user selects the HDR option, the terminal device will shoot the HDR video in real time.
  • FIG. 4 is another schematic diagram of an input processing request in the HDR video generation method provided by the embodiment of the present application. Please refer to FIG. 4, the difference between this embodiment and FIG. 3 is that in this embodiment, after the user starts the APP, in addition to the shooting button, there are also options for the user to select, such as time-lapse shooting, Slow motion, normal video, HDR video, photo, panorama and other options, users can select HDR video, then you can shoot HDR video in real time.
  • FIG. 3 and 4 illustrate the embodiments of the present application by taking real-time HDR video shooting as an example, the embodiments of the present application are not limited. In other feasible implementation manners, it may also be a user
  • a selection button is also displayed on the APP interface. When the user clicks the selection button, the terminal device pops up a selection page. The selection page displays a series of videos that have been downloaded or recorded by the terminal device. After the user selects the original video , The terminal device generates an HDR video based on the selected original video.
  • the processing request divide the first image frame included in the original video into a plurality of regions, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different.
  • the terminal device when the terminal device directly shoots the HDR video, the original video is a video captured in real time in the viewing frame of the terminal device, and the first image frame is an image frame in the original video.
  • the terminal device converts the local video to HDR video, the original video is the video stored locally on the terminal device, but it is pre-recorded or downloaded from the server by the terminal device, and the first image frame is any image frame in the original video.
  • the terminal device divides the first image frame into a plurality of areas. These areas can be divided into at least two types of areas. Each type of area includes at least one area.
  • the two or more regions are not continuous in the first image frame, and the first image features of regions of different types are different.
  • the image characteristics include brightness, contained content, color, texture, shape, and so on.
  • how to divide the image frame into multiple regions will be described by taking the image feature as the brightness and the content contained in the image as an example. Exemplary, please refer to Fig. 5 and Fig. 6.
  • FIG. 5 is a schematic diagram of each area of the first image frame in the HDR video generation method provided by an embodiment of the present application.
  • the image frame is a YUV image
  • the YUV color space data of the first image frame can be obtained according to the first image frame, where the Y data represents brightness (luminance or luma), that is, brightness; and " U” and “V” represent chrominance (chrominance or chroma), which are used to describe the color and saturation of an image.
  • Y data is also called brightness information
  • U data and V data are also called color information.
  • the terminal device extracts the brightness of each pixel of the first image frame, and determines the interval range to which the brightness of each pixel belongs, so as to divide the first image frame into three brightness regions according to the brightness, each of which is high brightness Area, medium-brightness area and low-brightness area, the same brightness area can be discontinuous.
  • the high-brightness area includes area A and area B
  • the medium-brightness area includes area C and area D
  • the low-brightness area includes area E.
  • FIG. 6 is another schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application.
  • the terminal device uses image detection algorithms, such as inter-frame difference method, background modeling method, point detection method, image segmentation method, cluster analysis method, and motion vector field method, to detect whether the first image frame contains Specific content, such as characters, sky, buildings, trees, etc., may not be continuous in areas containing the same specific content.
  • the terminal device divides the first image frame into four types of areas according to the content, which are a person area, a sky area, a building area, and a tree area.
  • the terminal device determines the corresponding first enhancement processing mode for each type of area, and the first enhancement processing mode is different for different types of areas. After that, for each area, the terminal device adopts the first enhancement processing manner corresponding to the area to perform enhancement processing on the area. For example, referring to Figure 5, the terminal device performs color-brightening processing on high-brightness areas, such as area A and area B; for medium-brightness areas, such as area C and area D, it performs processing to increase the contrast; for low-brightness areas, such as area E Perform processing to increase the exposure intensity.
  • the terminal device performs skin tone enhancement processing on the character area; color brightening processing on the sky area; blurring processing on the building area; texture enhancement processing on the tree area to ensure that the first image frame The quality of each area of the video is improved, thereby ensuring the improvement of video quality.
  • step 103 multiple regions after the enhancement processing of each first image frame can be obtained.
  • this step for each first image frame, through alpha-blending (alpha-blending, alpha-blending) , Laplacian blending (laplacian blending), etc., splicing multiple regions after enhancement processing to obtain a second image frame corresponding to each first image frame.
  • the original video includes multiple first image frames, and different first image frames correspond to different second image frames.
  • the terminal device After obtaining the second image frame from the first image frame, the terminal device fuses the second image frames to obtain the HDR video.
  • the terminal device after receiving a user input request to generate an HDR video processing request, divides each first image frame contained in the original video into at least two types of regions, and the first image of the different types of regions With different characteristics, the different types of regions are processed by the corresponding first enhancement processing method to obtain the enhanced region. After that, the enhanced regions of each first image frame are spliced to obtain the corresponding first image frame. Based on the second image frames of, the HDR video is obtained. In this process, there is no need to take multiple images with different exposure time for each first image frame. Therefore, it is not limited to the long exposure process.
  • the terminal device divides the image frame into different areas by dividing the original video.
  • the area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes.
  • the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
  • the specific enhancement processing method used can be based on the first image frame.
  • the overall condition is determined. For example, if the overall brightness of the first image frame is relatively good, the overall color of the first image frame is brightened. This method has limitations and cannot improve the effect of the dynamic range of the entire scene. Therefore, by customizing the enhancement processing scheme by region, the limitations brought by a single enhancement processing scheme can be improved.
  • each type of area corresponds to a first enhanced processing mode
  • the terminal device uses the corresponding first enhanced processing mode for processing for each area.
  • the terminal device may further divide the area into a plurality of sub-areas according to the second image characteristics, determine the second enhancement processing mode for each sub-areas, and adopt the second enhancement processing mode, Each sub-area is processed. The following describes in detail how the terminal device divides sub-areas and so on.
  • the terminal device first divides the first image frame into a plurality of regions, these regions include at least two types of regions, the first image features of the same type of regions are the same, and the first image features of different types of regions are different. .
  • the terminal device performs semantic segmentation on the first area to divide the first area into multiple sub-areas.
  • the sub-region includes at least two types of sub-regions.
  • the second image features of the same category of sub-regions are the same, and the second image features of different categories of sub-regions are different.
  • the first image feature and the second image feature are images of different dimensions. Feature, determine the second enhancement processing method for each sub-region, and process each of the multiple sub-regions by using the corresponding second enhancement processing method respectively, and splice the multiple sub-regions after the enhancement processing to obtain the first One area.
  • the terminal device divides the first area into multiple sub-areas according to the second image feature.
  • FIG. 7 is a schematic diagram of the process of distinguishing segmentation and sub-region segmentation in the HDR video generation method provided by an embodiment of the present application. Referring to Figure 7, assuming that the first image feature is brightness and the second image feature is the content contained in the image, the terminal device divides the first image frame into a high-brightness area, a low-brightness area, and a medium-brightness area. Take a high-brightness area as an example.
  • the terminal device further performs semantic segmentation on the high-brightness area, and divides the high-brightness area into a person sub-areas, a sky sub-areas, a grass sub-areas, etc. (not shown in the figure). Then, determine the second enhancement processing method corresponding to each sub-region, and use the second enhancement processing method to enhance the corresponding sub-region; then, stitch each sub-region to obtain the corresponding region, and then stitch each region, Get the second image frame.
  • each area in each type of area is processed by the first enhancement processing method corresponding to the area type, and then After dividing any one of the types of areas (hereinafter referred to as the first area) to obtain at least two types of sub-areas, the second enhancement processing method corresponding to the sub-area category is used for each sub-area for processing.
  • the embodiments of the present application are not limited. In other feasible implementation manners, after the first image frame is divided into multiple regions, these regions are not processed, but each region is further divided into subregions. After that, each sub-region is processed.
  • the terminal device performs semantic segmentation on the first area to obtain two sub-areas, where the person in one sub-area is male, and the person in the other sub-area For females, different enhancement processing methods are used to process the two character sub-regions.
  • the terminal device may further divide the area into a plurality of sub-areas according to the second image feature, determine the second enhancement processing method for each sub-areas, and adopt the second enhancement processing method for each sub-area. Perform processing to achieve the purpose of further enhancing the processing of each sub-region.
  • FIG. 8 is a flowchart of dividing the first image frame in the HDR video generation method provided in an embodiment of the present application. This embodiment includes:
  • the terminal device sequentially inputs any image frame of the original video, that is, the first image frame, into the HDR video generating device.
  • the terminal device performs framing processing on it to obtain an image frame sequence, and according to the order of each image frame in the image frame sequence, the image frames are sequentially input to the HDR video generating device.
  • the terminal device captures each image frame frame by frame and sequentially inputs it into the HDR video generating device.
  • the first image frame is a YUV image.
  • the first image frame is not a YUV image, such as red green blue (RGB), etc.
  • the first image frame needs to be converted into a YUV image, and the hue, brightness, and saturation ( hue Luminance Saturation, HLS) and other images that facilitate the extraction of brightness information.
  • RGB red green blue
  • HLS hue Luminance Saturation
  • the Y data in the YUV color space data represents brightness (luminance or luma), that is, brightness; while "U” and “V” represent chrominance (chrominance or chroma), which are used to describe the color of an image And saturation.
  • the terminal device extracts the Y data of each pixel of the first image frame, thereby obtaining multiple Y data.
  • the terminal device filters the sum data to obtain smooth Y data.
  • the terminal device uses Gaussian filtering or the like to perform smoothing processing on the Y data, so as to obtain smooth Y data.
  • the terminal device uses Robert edge detection operator, Sobel edge detection operator, etc., to determine the gradient G of each pixel.
  • G x is the gradient in the horizontal axis direction of a pixel
  • G y is the gradient in the vertical axis direction of the corresponding pixel.
  • G x is equal to the absolute value of the difference between the Y data of pixel a and the Y data of pixel b
  • G y is equal to the absolute value of the difference between the Y data of pixel a and the Y data of pixel c.
  • a first threshold and a second threshold are preset, where the first threshold is expressed as a high threshold (Highthreshold). If a pixel is a high-brightness pixel, the gradient of the pixel cannot be lower than the first threshold; The second threshold is expressed as a low threshold. If a pixel is a low-brightness pixel, the gradient of the pixel cannot be higher than the second threshold. For any pixel in the first image frame, mark the gradient of the pixel as G p .
  • G p is greater than or equal to the first threshold, it means that the pixel is a high-brightness pixel; if G p is less than or equal to the second threshold , It means that the pixel is a low-brightness pixel; if G p is between the first threshold and the second threshold, it means that the pixel is a medium-brightness pixel.
  • the terminal device uses the pixels in the first image frame that exceed the first threshold and are grouped together as one area. Since the pixels with gradients exceeding the first threshold are likely to be distributed in different places in the first image frame, a threshold can be set, such as 100. Continuous 100 or more pixels with gradients exceeding the first threshold form a high Brightness area. In this way, there is likely to be more than one high-brightness area in the first image frame. In the same way, the low-brightness area and the medium-brightness area are obtained in the same way, so that the first image frame is divided into multiple areas.
  • a threshold can be set, such as 100. Continuous 100 or more pixels with gradients exceeding the first threshold form a high Brightness area. In this way, there is likely to be more than one high-brightness area in the first image frame. In the same way, the low-brightness area and the medium-brightness area are obtained in the same way, so that the first image frame is divided into multiple areas.
  • the purpose of dividing the first image frame into multiple regions according to brightness is achieved.
  • FIG. 9 is a flowchart of determining the first enhancement processing mode in the HDR video generation method provided in an embodiment of the present application. This embodiment includes:
  • the terminal device may make a histogram of each area based on color characteristics and the like.
  • each area includes a target area
  • the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value.
  • the terminal device extracts the peak value and the average value based on the histogram corresponding to the target area.
  • the dynamic range (DR) value of the target area is determined based on parameters such as the value, the proportion of high-exposure/low-bright areas, and so on.
  • a, b, and c are positive numbers, and the lower the DR value, the better the dynamic range.
  • the high-exposure DR is used to reflect the high-exposure degree of the target area
  • the low-exposure DR is used to reflect the low-exposure degree of the target area. If the high-exposure DR to and the low-exposure DR value are both low, the dynamic range of the target area is better.
  • different dynamic range values correspond to different first enhancement processing methods.
  • the terminal device can obtain the first enhancement processing method of the area by looking up a table or the like. For example, for the target area, the terminal device determines the first enhancement processing mode of the target area according to the exposure DR value and the low-brightness DR value.
  • the purpose of obtaining the first enhanced processing mode of the area by the terminal device according to the dynamic range value of the area is achieved.
  • FIG. 11 is a schematic diagram of a process of an HDR video generation method provided in an embodiment of the present application.
  • the terminal device is currently recording a video V0, which is the original video described above.
  • the terminal device captures image frames frame by frame.
  • the first captured image frame contains the bridge hole and the scenery.
  • the bridge hole is darker, and the scenery outside the bridge hole is brighter.
  • the terminal device divides the first image frame into area 1 and area 2 according to brightness, where area 1 is a bridge hole portion, which is a low-brightness area, area 2 is a scenery portion, and this portion is a high-brightness area.
  • the first enhancement processing method corresponding to area 1 is high-exposure recovery processing
  • the first enhancement processing method corresponding to area 2 is dark area brightening processing
  • the terminal device performs high-exposure recovery processing on area 1, so that the bridge holes in area 1 are exposed
  • the terminal device performs dark area brightening processing on area 2, so that the brightness of the scenery in area 2 is enhanced.
  • the terminal device uses an edge fusion algorithm to splice the strongly processed area 1 and the enhanced processed area 2 to obtain a second image frame.
  • the terminal device performs the above-mentioned processing on each captured first image frame and synthesizes the second image frame to obtain the second image frame corresponding to each image frame, and finally, synthesize each second image frame.
  • Image frame get HDR video.
  • the terminal device when the terminal device divides the first image frame into regions, it divides the first image frame according to the first image feature.
  • the terminal device may also combine the first image feature and the second image feature to partition the first image frame. For example, if the first image feature is brightness and the second image feature is a person, when the terminal device divides the first image frame containing the person, it can divide the person in the first image frame and use it as a region. The remaining area is subdivided into high-brightness areas and low-brightness areas.
  • FIG. 12 is a schematic structural diagram of a high dynamic range HDR video generation device provided by an embodiment of the present invention.
  • the HDR video generating apparatus 100 may be implemented in software and/or hardware. As shown in FIG. 12, the HDR video generation device 100 includes:
  • the transceiver unit 11 is configured to receive a processing request input by a user, and the processing request is used to request the generation of an HDR video;
  • the processing unit 12 the user divides the first image frame contained in the original video into a plurality of regions according to the processing request, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different.
  • Each of the multiple regions is processed by the corresponding first enhancement processing method to obtain multiple regions after the enhancement processing, and the multiple regions after the enhancement processing are spliced to obtain a second image frame, according to the second image frame Generate HDR video.
  • the processing unit 12 is configured to perform semantic segmentation on the first area to divide the first area into a plurality of sub-areas, and the plurality of sub-areas includes at least two types of sub-areas.
  • the second image features of the category subregions are different, the first region is any one of the multiple regions, the first image feature and the second image feature are image features of different dimensions, and each subregion is determined
  • the second enhancement processing method of the region, for each of the plurality of subregions respectively uses the corresponding second enhancement processing method to process, and the multiple subregions after the enhancement processing are spliced to obtain the first region.
  • the processing unit 12 is configured to extract the Y data of each pixel of the first image frame from the YUV color space data of the first image frame, and according to the first image frame
  • the Y data of each pixel of the image frame determines the gradient of each pixel, and the first image frame is divided into a plurality of regions according to the gradient of each pixel.
  • the processing unit 12 is further configured to convert the first image frame into a YUV image before acquiring the YUV color space data of the first image frame.
  • the processing unit 12 is used to process each of the multiple regions by using the corresponding first enhancement processing mode to obtain the multiple regions after the enhancement processing. Obtain a histogram of each of the multiple areas, determine the dynamic range value of the corresponding area according to each of the histograms, and determine the first enhancement processing mode corresponding to each area according to each of the dynamic range values.
  • each area includes a target area
  • the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value
  • the processing unit 12 is configured to extract the peak value
  • the average value and the area ratio is used to indicate the ratio of the high exposure area and the low exposure area
  • the high value of the target area is determined according to the peak value, the average value, and the area ratio.
  • the original video is a video currently being shot by the terminal device, or the original video is a local LDR video of the terminal device.
  • the HDR video generation device provided in the embodiment of the present invention can perform the actions of the terminal device in the foregoing embodiment, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the above transceiving unit may be a transceiver when actually implemented, and the processing unit may be implemented in a form of software calling through a processing element; it may also be implemented in a form of hardware.
  • the processing unit may be a separate processing element, or it may be integrated in a chip of the above-mentioned device for implementation.
  • it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device Call and execute the functions of the above processing unit.
  • all or part of these units can be integrated together or implemented independently.
  • the processing element described here may be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above units may be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
  • the above units may be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (FPGA), etc.
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • FPGA field programmable gate arrays
  • the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes.
  • CPU central processing unit
  • these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • FIG. 13 is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 13, the terminal device 200 includes:
  • the memory 22 stores computer execution instructions
  • the processor 21 executes the computer-executable instructions stored in the memory 22, so that the processor 21 executes the HDR video generation method corresponding to the above terminal device.
  • the terminal device 200 further includes a communication interface 23.
  • the processor 21, the memory 22, and the communication interface 23 may be connected through a bus 24.
  • the embodiment of the present invention also provides a storage medium, and the storage medium stores computer-executable instructions, and when the computer-executed instructions are executed by a processor, they are used to implement the HDR video generation method executed by the above terminal device.
  • the embodiment of the present invention also provides a computer program product, which is used to implement the HDR video generation method executed by the terminal device when the computer program product runs on the terminal device.
  • FIG. 14 is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application.
  • the terminal device 1000 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, Processor 110, power supply 111 and other components.
  • Those skilled in the art can understand that the structure of the terminal device shown in FIG. 14 does not constitute a limitation on the terminal device, and the terminal device 1000 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. Component arrangement.
  • terminal devices include, but are not limited to, mobile phones, tablet computers, palmtop computers, and so on.
  • the user input unit 107 is used to receive user input; the display unit 106 is used to respond to the input received by the user input unit 107 and display content according to the input.
  • the radio frequency unit 101 can be used for receiving and sending signals in the process of sending and receiving information or talking. Specifically, after receiving downlink data from a master base station or a secondary base station, it is processed by the processor 110; In addition, the uplink data is sent to the primary base station or the secondary base station.
  • the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency unit 101 can also communicate with the network and other devices through a wireless communication system.
  • the terminal device 1000 provides users with wireless broadband Internet access through the network module 102, such as helping users to send and receive emails, browse web pages, and access streaming media.
  • the audio output unit 103 can convert the audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output it as sound. Moreover, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 1000 (for example, call signal reception sound, message reception sound, etc.).
  • the audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
  • the input unit 104 is used to receive audio or video signals.
  • the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042.
  • the graphics processor 1041 is used to process image data of pictures or videos captured by a camera or the like.
  • the processed image frame can be displayed on the display unit 106.
  • the image frame processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the network module 102.
  • the microphone 1042 can receive sound, and can process such sound into audio data.
  • the processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 101 for output in the case of a telephone call mode.
  • the terminal device 1000 further includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor includes an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light.
  • the proximity sensor can close the display panel 1061 and the display panel 1061 when the terminal device 1000 is moved to the ear. / Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the terminal device (such as horizontal and vertical screen switching, related games , Magnetometer posture calibration), vibration recognition related functions (such as pedometer, tap), etc.; sensor 105 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.
  • the display unit 106 is used to display information input by the user or information provided to the user.
  • the display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • the user input unit 107 can be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the terminal device.
  • the user input unit 107 includes a touch panel 1071 and other input devices 1072.
  • the touch panel 1071 also called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 1071 or near the touch panel 1071. operating).
  • the touch panel 1071 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 110, the command sent by the processor 110 is received and executed.
  • the touch panel 1071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the user input unit 107 may also include other input devices 1072.
  • other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick, which will not be repeated here.
  • the touch panel 1071 can be overlaid on the display panel 1061.
  • the touch panel 1071 detects a touch operation on or near it, it transmits it to the processor 110 to determine the type of the touch event, and then the processor 110 determines the type of the touch event according to the touch.
  • the type of event provides corresponding visual output on the display panel 1061.
  • the touch panel 1071 and the display panel 1061 are used as two independent components to realize the input and output functions of the terminal device, but in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated
  • the implementation of the input and output functions of the terminal device is not specifically limited here.
  • the interface unit 108 is an interface for connecting an external device with the terminal device 1000.
  • the external device may include a wired or wireless headset port, an external power source (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) port, video I/O port, headphone port, etc.
  • the interface unit 108 may be used to receive input (for example, data information, power, etc.) from an external device and transmit the received input to one or more elements in the terminal device 1000 or may be used to connect to the terminal device 1000 and an external device. Transfer data between devices.
  • the memory 109 can be used to store software programs and various data.
  • the memory 109 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of mobile phones (such as audio data, phone book, etc.), etc.
  • the memory 109 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the processor 110 is the control center of the terminal device. It uses various interfaces and lines to connect the various parts of the entire terminal device, runs or executes software programs and/or modules stored in the memory 109, and calls data stored in the memory 109. , Perform various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole.
  • the processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc.
  • the adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 110.
  • a computer program is stored in the memory 109, wherein the processor 110 runs the computer program so that the terminal device executes the above-mentioned HDR video generation method
  • the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may implement or Perform the methods, steps, and logical block diagrams disclosed in the embodiments of the present application.
  • the general-purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), for example Random-access memory (random-access memory, RAM).
  • the memory is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.
  • the memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
  • the methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, SSD).

Abstract

The present application provides a high dynamic range (HDR) video generation method and device, relating to the technical field of artificial intelligence (AI). The method comprises: a terminal apparatus receiving a processing request inputted by a user and requesting generation of a HDR video; dividing each first image frame comprised in an original video to at least two types of regions, wherein first image features of different types of regions are different; processing the different types of regions by using corresponding first enhancement processing methods to acquire enhanced regions; combining multiple enhanced regions of each first image frame to acquire a second image frame respectively corresponding to each first image frame; and acquiring a HDR video on the basis of these second image frames. In the process, acquiring images of different exposure times does not require each first image frame to be captured, and therefore a long exposure process is not necessary. The terminal apparatus divides an image frame of an original video into different regions, which are further divided into at least two types of regions. An enhancement scheme of each type of region can be determined according to a first image feature of the type of region, such that different types of regions use different enhancement schemes.

Description

高动态范围视频生成方法及装置Method and device for generating high dynamic range video
本申请要求于2019年08月30日提交中国专利局、申请号为201910817877.2、申请名称为“高动态范围视频生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on August 30, 2019, the application number is 201910817877.2, and the application name is "High Dynamic Range Video Generation Method and Apparatus", the entire content of which is incorporated into this application by reference in.
技术领域Technical field
本申请涉及人工智能(artificial intelligence,AI)技术领域,尤其涉及一种高动态范围视频生成方法及装置。This application relates to the technical field of artificial intelligence (AI), and in particular to a method and device for generating a high dynamic range video.
背景技术Background technique
在图像处理领域中,动态范围(dynamic range)指在图像上最亮的光照亮度和最暗的光照亮度的比值,动态范围是图像质量评价很重要的维度之一。根据动态范围可以将图像分为高动态范围(high dynamic range,HDR)图像、低动态范围(low dynamic range,LDR)图像等。In the field of image processing, dynamic range refers to the ratio of the brightness of the brightest light to the brightness of the darkest light on an image, and the dynamic range is one of the important dimensions of image quality evaluation. According to the dynamic range, images can be divided into high dynamic range (HDR) images, low dynamic range (LDR) images, and so on.
一般情况下,为得到HDR图像,可以短时间内对同一对象进行多次拍摄,以得到该对象不同曝光时长的LDR图像,进而将该些LDR图像合成HDR图像。例如,一个长曝光过程中,获取该对象的短曝光图像、中曝光图像和长曝光图像,然后对该三张图像进行融合,从而得到HDR图像。Generally, in order to obtain an HDR image, the same object can be photographed multiple times in a short period of time to obtain an LDR image of the object with different exposure durations, and then these LDR images are synthesized into an HDR image. For example, in a long exposure process, a short exposure image, a medium exposure image, and a long exposure image of the object are acquired, and then the three images are merged to obtain an HDR image.
随着HDR技术的发展以及HDR显示器的逐步普及,用户对HDR视频的需求逐步增加,此时,要求终端设备具备拍摄HDR视频的能力或者将LDR视频转换为HDR视频的能力。然而,视频是由一个个的图像帧组成的,若每一图像帧都由不同曝光时长的图像合成,则需要终端设备短时间内针对每个图像帧拍摄多张不同曝光时长的图像,再将该些图像合成图像帧,进而根据多个图像帧得到HDR视频。显然,受限于曝光时长,终端设备拍摄到的视频动态范围受限。With the development of HDR technology and the gradual popularization of HDR displays, users’ demand for HDR videos is gradually increasing. At this time, terminal devices are required to have the ability to shoot HDR videos or to convert LDR videos into HDR videos. However, the video is composed of individual image frames. If each image frame is composed of images with different exposure time, the terminal device needs to shoot multiple images with different exposure time for each image frame in a short time, and then These images are combined into image frames, and then an HDR video is obtained from the multiple image frames. Obviously, limited by the exposure time, the dynamic range of the video captured by the terminal device is limited.
发明内容Summary of the invention
本申请实施例提供一种高动态范围视频生成方法及装置,通过将图像帧划分成不同的区域,不同区域使用不同的增强方案,从而得到HDR视频。The embodiments of the present application provide a method and device for generating a high dynamic range video. The HDR video is obtained by dividing an image frame into different regions and using different enhancement schemes for different regions.
第一方面,本申请实施例提供一种高动态范围HDR视频生成方法,该方法是从终端设备的角度进行说明的,该方法包括:终端设备接收到用户输入的请求生成HDR视频的处理请求后,将原始视频包含的各第一图像帧分割至少两类区域,不同类别区域的第一图像特征不同,对不同类别区域采用对应的第一增强处理方式进行处理,得到增强处理后的区域,之后,拼接各第一图像帧的增强处理后的多个区域,得到各第一图像帧各自对应的第二图像帧,基于该些第二图像帧得到HDR视频。该过程中,无需对每一个第一图像帧拍摄得到多个不同曝光时长的图像,因此,不受限于长曝光过程,终端设备通过将原始视频将图像帧划分成不同的区域,该些不同的区域分成至少两类区域,可以根据每一类区域 的第一图像特征确定该类区域的增强方案,使得不同类的区域使用不同的增强方案。另外,由于本申请实施例是对每一图像帧进行处理得到HDR视频,而无需拍摄曝光时长较长的图像,例如,无需拍摄中曝光时长、长曝光时长的图像,也就是说,本申请实施例不需要终端设备通过拉长曝光得到高动态视频,因此,得到的HDR视频不会有鬼影出现。In the first aspect, an embodiment of the present application provides a method for generating a high dynamic range HDR video. The method is described from the perspective of a terminal device. The method includes: after the terminal device receives a user input request to generate an HDR video processing request , Divide each first image frame contained in the original video into at least two types of areas. Different types of areas have different first image features. Use the corresponding first enhancement processing method for the different types of areas to obtain the enhanced area, and then , Splicing multiple regions after the enhancement processing of each first image frame to obtain a second image frame corresponding to each first image frame, and obtain an HDR video based on the second image frames. In this process, there is no need to take multiple images with different exposure time for each first image frame. Therefore, it is not limited to the long exposure process. The terminal device divides the image frame into different areas by dividing the original video. The area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes. In addition, since the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
一种可行的设计中,终端设备对多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之后,还对第一区域进行语义分割,以将第一区域分割成多个子区域,该多个子区域包含至少两类子区域,不同类别子区域的第二图像特征不同,第一区域是多个区域中的任意一个区域,第一图像特征和第二图像特征是不同维度的图像特征,确定各子区域的第二增强处理方式,对多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理,拼接增强处理后的多个子区域,得到第一区域。采用该种方案,终端设备还可以进一步的按照第二图像特征将该区域划分为多个子区域,对各子区域分别确定出第二增强处理方式,并采用第二增强处理方式,对各子区域进行处理,实现进一步增强处理各子区域的目的。In a feasible design, the terminal device uses the corresponding first enhancement processing method to process each of the multiple regions, and after obtaining the multiple regions after the enhancement processing, it also performs semantic segmentation on the first region to separate The first area is divided into a plurality of sub-areas, and the plurality of sub-areas contains at least two types of sub-areas. The second image features of the different types of sub-areas are different. The first area is any one of the multiple areas. The first image feature and the second image feature The second image feature is an image feature of different dimensions. The second enhancement processing method of each sub-region is determined, and the corresponding second enhancement processing method is used for each sub-region of the multiple sub-regions, and the multiple sub-regions after the enhancement processing are stitched together. Area, get the first area. With this solution, the terminal device can further divide the area into multiple sub-regions according to the second image feature, determine the second enhancement processing mode for each sub-region, and adopt the second enhancement processing mode to perform the Perform processing to achieve the purpose of further enhancing the processing of each sub-region.
一种可行的设计中,终端设备根据处理请求,将原始视频包含的第一图像帧分割成多个区域时,从第一图像帧的YUV色彩空间数据中提取出第一图像帧的各像素点的Y数据,根据该第一图像帧的各像素点的Y数据,确定各像素点的梯度,根据各像素点的梯度,将第一图像帧分割成多个区域。采用该种方案,实现根据亮度将第一图像帧分割成多个区域的目的。In a feasible design, when the terminal device divides the first image frame contained in the original video into multiple regions according to the processing request, each pixel of the first image frame is extracted from the YUV color space data of the first image frame According to the Y data of each pixel of the first image frame, the gradient of each pixel is determined, and the first image frame is divided into multiple regions according to the gradient of each pixel. With this solution, the purpose of dividing the first image frame into multiple regions according to brightness is achieved.
一种可行的设计中,终端设备获取第一图像帧的YUV色彩空间数据之前,还将该第一图像帧转换为YUV图像。采用该种方案,实现根据亮度将第一图像帧分割成多个区域的目的。In a feasible design, the terminal device converts the first image frame into a YUV image before acquiring the YUV color space data of the first image frame. With this solution, the purpose of dividing the first image frame into multiple regions according to brightness is achieved.
一种可行的设计中,终端设备对多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之前,还获取多个区域中的各区域的直方图,根据各直方图确定对应区域的动态范围值,根据各该动态范围值,分别确定各区域对应的第一增强处理方式。采用该种方案,实现终端设备根据区域的动态范围值,获取该区域的第一增强处理方式的目的。In a feasible design, the terminal device uses the corresponding first enhancement processing method to process each of the multiple regions respectively, and obtains the histogram of each of the multiple regions before obtaining the multiple regions after the enhancement processing. In the figure, the dynamic range value of the corresponding area is determined according to each histogram, and the first enhancement processing mode corresponding to each area is determined according to each dynamic range value. By adopting this solution, the purpose of obtaining the first enhanced processing mode of the area by the terminal device according to the dynamic range value of the area is realized.
一种可行的设计中,各区域包含目标区域,动态范围值包括高曝动态范围值和低亮动态范围值,终端设备根据各直方图确定对应区域的动态范围值时,提取目标区域的峰值、平均值以及区域占比,该区域占比用于指示高曝区域和低曝光区域的比值,根据峰值、平均值以及区域占比,确定目标区域的高曝动态范围值和低亮动态范围值。采用该种方案,终端设备确定出目标区域的高曝动态范围和低亮动态范围值,进而根据该动态分布确定第一增强处理方式,使得终端设备对不同类的区域采用不同的增强处理方案进行处理。In a feasible design, each area contains the target area, and the dynamic range value includes the high-exposure dynamic range value and the low-light dynamic range value. When the terminal device determines the dynamic range value of the corresponding area according to each histogram, it extracts the peak value of the target area, Average value and area ratio. This area ratio is used to indicate the ratio of high exposure area and low exposure area. According to the peak value, average value and area ratio, determine the high exposure dynamic range value and low brightness dynamic range value of the target area. Using this solution, the terminal device determines the high-exposure dynamic range and low-brightness dynamic range values of the target area, and then determines the first enhancement processing method according to the dynamic distribution, so that the terminal device uses different enhancement processing solutions for different types of areas. deal with.
一种可行的设计中,原始视频是电子设备当前正在拍摄的视频;或者,原始视频电子设备本地的LDR视频。采用该种方案,终端设备可以实时录制出HDR视频或将预先录制的视频转换为HDR视频。In a feasible design, the original video is the video currently being shot by the electronic device; or, the original video is the local LDR video of the electronic device. With this solution, the terminal device can record HDR video in real time or convert a pre-recorded video into HDR video.
第二方面,本申请实施例提供一种高动态范围HDR视频生成装置,包括:In the second aspect, an embodiment of the present application provides a high dynamic range HDR video generation device, including:
收发单元,用于接收用户输入的处理请求,所述处理请求用于请求生成HDR视频;The transceiver unit is configured to receive a processing request input by a user, and the processing request is used to request the generation of an HDR video;
处理单元,用户根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,所述多个区域包含至少两类区域,不同类别区域的第一图像特征不同,对所述多个区域中 的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域,拼接增强处理后的多个区域,得到第二图像帧,根据所述第二图像帧生成HDR视频。The processing unit, the user divides the first image frame contained in the original video into a plurality of regions according to the processing request, and the plurality of regions include at least two types of regions. Each area in each area is processed by the corresponding first enhancement processing method to obtain multiple areas after the enhancement processing, and the multiple areas after the enhancement processing are spliced to obtain a second image frame, which is generated according to the second image frame HDR video.
一种可行的设计中,所述处理单元,用于对第一区域进行语义分割,以将所述第一区域分割成多个子区域,所述多个子区域包含至少两类子区域,不同类别子区域的第二图像特征不同,所述第一区域是所述多个区域中的任意一个区域,所述第一图像特征和所述第二图像特征是不同维度的图像特征,确定各子区域的第二增强处理方式,对所述多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理,拼接增强处理后的多个子区域,得到所述第一区域。In a feasible design, the processing unit is configured to perform semantic segmentation on the first area to divide the first area into a plurality of sub-areas, and the plurality of sub-areas includes at least two types of sub-areas, and different types of sub-areas. The second image feature of the region is different, the first region is any one of the multiple regions, the first image feature and the second image feature are image features of different dimensions, and the difference of each subregion is determined In the second enhancement processing manner, each of the multiple sub-regions is processed by a corresponding second enhancement processing manner, and the multiple sub-regions after the enhancement processing are spliced to obtain the first region.
一种可行的设计中,所述处理单元,用于从所述第一图像帧的YUV色彩空间数据中提取出所述第一图像帧的各像素点的Y数据,根据所述第一图像帧的各像素点的Y数据,确定各所述像素点的梯度,根据各所述像素点的梯度,将所述第一图像帧分割成多个区域。In a feasible design, the processing unit is configured to extract the Y data of each pixel of the first image frame from the YUV color space data of the first image frame, and according to the first image frame The Y data of each pixel of, determine the gradient of each pixel, and divide the first image frame into a plurality of regions according to the gradient of each pixel.
一种可行的设计中,所述处理单元,在获取所述第一图像帧的YUV色彩空间数据之前,还用于将所述第一图像帧转换为YUV图像。In a feasible design, the processing unit is further configured to convert the first image frame into a YUV image before acquiring the YUV color space data of the first image frame.
一种可行的设计中,所述处理单元,在对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之前,还用于获取所述多个区域中的各区域的直方图,根据各所述直方图确定对应区域的动态范围值,根据各所述动态范围值,分别确定各区域对应的第一增强处理方式。In a feasible design, the processing unit is used to process each of the multiple regions by using the corresponding first enhancement processing mode to obtain the multiple regions after the enhancement processing. According to the histogram of each of the multiple areas, the dynamic range value of the corresponding area is determined according to each of the histograms, and the first enhancement processing mode corresponding to each area is respectively determined according to each of the dynamic range values.
一种可行的设计中,所述各区域包含目标区域,所述动态范围值包括高曝动态范围值和低亮动态范围值,所述处理单元,用于提取所述目标区域的峰值、平均值以及区域占比,所述区域占比用于指示高曝区域和低曝光区域的比值,根据所述峰值、所述平均值以及所述区域占比,确定所述目标区域的所述高曝动态范围值和所述低亮动态范围值。In a feasible design, each region includes a target region, the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value, and the processing unit is configured to extract the peak value and average value of the target region And the area proportion, the area proportion is used to indicate the ratio of the high-exposure area and the low-exposure area, and the high-exposure dynamics of the target area is determined according to the peak value, the average value, and the area proportion Range value and the low-light dynamic range value.
一种可行的设计中,所述原始视频是所述终端设备当前正在拍摄的视频,或者,所述原始视频所述终端设备本地的LDR视频。In a feasible design, the original video is a video currently being shot by the terminal device, or the original video is a local LDR video of the terminal device.
第三方面,本申请实施例提供一种终端设备,包括:处理器、存储器,以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时执行如上第一方面或第一方面的各种可能的实现方式中的方法。In a third aspect, an embodiment of the present application provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and when the processor executes the program Perform the method in the first aspect or various possible implementation manners of the first aspect above.
第四方面,本申请实施例提供一种包含指令的计算机程序产品,当其在终端设备上运行时,使得终端设备计算机执行上述第一方面或第一方面的各种可能的实现方式中的方法。In a fourth aspect, the embodiments of the present application provide a computer program product containing instructions, which when run on a terminal device, cause the terminal device computer to execute the method in the first aspect or various possible implementation manners of the first aspect. .
第五方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在终端设备上运行时,使得终端设备执行上述第一方面或第一方面的各种可能的实现方式中的方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a terminal device, causes the terminal device to execute the first aspect or the first aspect described above. Of the various possible implementation methods.
第六方面,本申请实施例提供一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述方法中终端设备的功能。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a sixth aspect, an embodiment of the present application provides a chip system. The chip system includes a processor and may also include a memory, configured to implement the functions of the terminal device in the foregoing method. The chip system can be composed of chips, or it can include chips and other discrete devices.
本申请实施例提供的高动态范围HDR视频生成方法及装置,终端设备接收到用户输入的请求生成HDR视频的处理请求后,将原始视频包含的各第一图像帧分割至少两类区域,不同类别区域的第一图像特征不同,对不同类别区域采用对应的第一增强处理方式进行处理,得到增强处理后的区域,之后,拼接各第一图像帧的增强处理后的多个区域,得到各第一图像帧各自对应的第二图像帧,基于该些第二图像帧得到HDR 视频。该过程中,无需对每一个第一图像帧拍摄得到多个不同曝光时长的图像,因此,不受限于长曝光过程,终端设备通过将原始视频将图像帧划分成不同的区域,该些不同的区域分成至少两类区域,可以根据每一类区域的第一图像特征确定该类区域的增强方案,使得不同类的区域使用不同的增强方案。另外,由于本申请实施例是对每一图像帧进行处理得到HDR视频,而无需拍摄曝光时长较长的图像,例如,无需拍摄中曝光时长、长曝光时长的图像,也就是说,本申请实施例不需要终端设备通过拉长曝光得到高动态视频,因此,得到的HDR视频不会有鬼影出现。In the high dynamic range HDR video generation method and device provided by the embodiments of the present application, after receiving a processing request input by a user requesting to generate an HDR video, the terminal device divides each first image frame contained in the original video into at least two types of regions, different types The first image features of the regions are different, and the different types of regions are processed by the corresponding first enhancement processing method to obtain the enhanced region. After that, the enhanced regions of each first image frame are spliced to obtain each first image frame. A second image frame corresponding to each image frame is used to obtain an HDR video based on the second image frames. In this process, there is no need to take multiple images with different exposure time for each first image frame. Therefore, it is not limited to the long exposure process. The terminal device divides the image frame into different areas by dividing the original video. The area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes. In addition, since the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
附图说明Description of the drawings
图1为生成HDR图像的过程示意图;Figure 1 is a schematic diagram of the process of generating HDR images;
图2是本申请实施例提供的HDR视频生成方法的流程图;Figure 2 is a flowchart of an HDR video generation method provided by an embodiment of the present application;
图3是本申请实施例提供的HDR视频生成方法中输入处理请求的一种示意图;FIG. 3 is a schematic diagram of an input processing request in the HDR video generation method provided by an embodiment of the present application;
图4是本申请实施例提供的HDR视频生成方法中输入处理请求的另一种示意图;FIG. 4 is another schematic diagram of the input processing request in the HDR video generation method provided by the embodiment of the present application;
图5是本申请实施例提供的HDR视频生成方法中第一图像帧的各区域的一个示意图;FIG. 5 is a schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application;
图6是本申请实施例提供的HDR视频生成方法中第一图像帧的各区域的另一个示意图;6 is another schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application;
图7是本申请实施例提供的HDR视频生成方法中区分分割和子区域分割的过程示意图;FIG. 7 is a schematic diagram of the process of distinguishing segmentation and sub-region segmentation in the HDR video generation method provided by an embodiment of the present application;
图8是本申请实施例提供的HDR视频生成方法中分割第一图像帧的流程图;FIG. 8 is a flowchart of dividing a first image frame in the HDR video generation method provided by an embodiment of the present application;
图9是本申请实施例提供的HDR视频生成方法中确定第一增强处理方式的流程图;FIG. 9 is a flowchart of determining the first enhancement processing mode in the HDR video generation method provided by the embodiment of the present application;
图10是本申请实施例提供的HDR视频生成方法中区域和直方图的示意图;FIG. 10 is a schematic diagram of regions and histograms in the HDR video generation method provided by an embodiment of the present application;
图11是本申请实施例提供的HDR视频生成方法的过程示意图;FIG. 11 is a schematic diagram of a process of an HDR video generation method provided by an embodiment of the present application;
图12为本发明实施例提供的一种高动态范围HDR视频生成装置的结构示意图;FIG. 12 is a schematic structural diagram of a high dynamic range HDR video generation device provided by an embodiment of the present invention;
图13是本申请实施例提供的一种终端设备的结构示意图;FIG. 13 is a schematic structural diagram of a terminal device provided by an embodiment of the present application;
图14为本申请实施例提供的一种终端设备的硬件结构示意图。FIG. 14 is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application.
具体实施方式detailed description
目前,为得到HDR图像,需要获得多个不同曝光时长的LDR图像,然后,将该些LDR图像合成HDR图像。图1为生成HDR图像的过程示意图。请参照图1,一个长曝光过程T包括三个阶段:短曝光阶段、中曝光阶段和长曝光阶段,该三个阶段对应的曝光时长分别为t1、t2和t3,其中,t1<t2<t3,t1+t2+t3≤T。终端设备获得三张不同曝光时长的图像,分别为短曝光时长图像、中曝光时长图像和长曝光时长图像;之后,对该三张图像进行融合处理,从而得到HDR图像。At present, in order to obtain HDR images, it is necessary to obtain multiple LDR images with different exposure durations, and then synthesize these LDR images into HDR images. Figure 1 is a schematic diagram of the process of generating HDR images. Please refer to Figure 1, a long exposure process T includes three stages: a short exposure stage, a medium exposure stage and a long exposure stage. The exposure durations corresponding to the three stages are t1, t2, and t3, respectively, where t1<t2<t3 , T1+t2+t3≤T. The terminal device obtains three images with different exposure durations, which are a short exposure duration image, a medium exposure duration image, and a long exposure duration image; after that, the three images are fused to obtain an HDR image.
根据上述可知:图1中,将一个长曝光过程中的三张不同曝光时长的图像进行融合,部分或全部图像很有很可能因为曝光时长太长、用户拍摄时出现手抖等原因而出现鬼影,如中曝光时长图像和长曝光时长图像会出现鬼影,导致根据该些图像合成的HDR图像也会出现鬼影。将该方法应用于生成HDR视频时,需要针对视频中的每个图像帧分别生成不同曝光时长的图像,而视频中的很多对象是运动,导致各不同曝光时长的图像出现鬼影;另外,一个长曝光过程T是有限的,显然,终端设备无法在有限的长曝光过程T中拍摄出多个图像帧,且针对每个图像帧分别拍摄不同曝光时长的图像。因此,上述的通过多个不同曝光时长的LDR图像合成HDR图像的方法并不适 用于HDR视频的生成。According to the above: in Figure 1, three images with different exposure durations in a long exposure process are merged. Some or all of the images are likely to appear ghosts due to the long exposure time and the user's hand shaking when shooting. For example, ghost images may appear in medium-exposure duration images and long-exposure duration images, resulting in HDR images synthesized from these images. When this method is applied to generate HDR video, it is necessary to generate images with different exposure durations for each image frame in the video, and many objects in the video are motion, resulting in ghost images in images with different exposure durations; in addition, a The long exposure process T is limited. Obviously, the terminal device cannot shoot multiple image frames in the limited long exposure process T, and shoot images with different exposure durations for each image frame. Therefore, the above-mentioned method of synthesizing HDR images from multiple LDR images with different exposure durations is not suitable for HDR video generation.
因此,本申请实施例提供一种高动态范围视频生成方法及装置,通过将原始视频将图像帧划分成不同的区域,不同区域使用不同的增强方案,从而得到HDR视频。Therefore, the embodiments of the present application provide a method and device for generating a high dynamic range video, which divide the original video into different regions and use different enhancement schemes to obtain HDR videos.
本申请实施例中,终端设备可以在直接拍摄出HDR视频,或者,终端设备也可以对本地的原始视频进行处理,得到HDR视频。其中,原始视频可以是终端设备预先拍摄或从服务器下载的LDR视频、标准动态范围(Standard Dynamic Range,SDR)视频等。In the embodiment of the present application, the terminal device may directly shoot the HDR video, or the terminal device may also process the local original video to obtain the HDR video. Among them, the original video may be an LDR video, a standard dynamic range (Standard Dynamic Range, SDR) video, etc., pre-shot by the terminal device or downloaded from the server.
本申请实施例中涉及的终端设备,可以是能够视频播发、视频录制的终端设备。本申请实施例中,终端设备可以经无线接入网(如,radio access network,RAN)与一个或多个核心网或者互联网进行通信,可以是移动终端设备,如移动电话(或称为“蜂窝”电话,手机(mobile phone))、计算机和数据卡,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语言和/或数据。例如,个人通信业务(personal communication service,PCS)电话、无绳电话、会话发起协议(SIP)话机、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、平板电脑(Pad)、带无线收发功能的电脑等设备。无线终端设备也可以称为系统、订户单元(subscriber unit)、订户站(subscriber station),移动站(mobile station)、移动台(mobile station,MS)、远程站(remote station)、接入点(access point,AP)、远程终端设备(remote terminal)、接入终端设备(access terminal)、用户终端设备(user terminal)、用户代理(user agent)、用户站(subscriber station,SS)、用户端设备(customer premises equipment,CPE)、终端(terminal)、用户设备(user equipment,UE)、移动终端(mobile terminal,MT)等。无线终端设备也可以是可穿戴设备以及下一代通信系统,例如,5G网络中的终端设备或者未来演进的公共陆地移动网络(public land mobile network,PLMN)网络中的终端设备,NR通信系统中的终端设备等。The terminal device involved in the embodiment of the present application may be a terminal device capable of video broadcasting and video recording. In the embodiments of this application, the terminal device may communicate with one or more core networks or the Internet via a radio access network (e.g., radio access network, RAN), and may be a mobile terminal device, such as a mobile phone (or called a "cellular "Phones, mobile phones), computers, and data cards, for example, can be portable, pocket-sized, handheld, computer-built or vehicle-mounted mobile devices, and they exchange language and/or data with the wireless access network. For example, personal communication service (PCS) phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), and tablets Computers (Pad), computers with wireless transceiver functions and other equipment. Wireless terminal equipment can also be called system, subscriber unit, subscriber station, mobile station, mobile station (MS), remote station (remote station), access point ( access point (AP), remote terminal equipment (remote terminal), access terminal equipment (access terminal), user terminal equipment (user terminal), user agent (user agent), subscriber station (SS), user terminal equipment (customer premises equipment, CPE), terminal (terminal), user equipment (user equipment, UE), mobile terminal (mobile terminal, MT), etc. Wireless terminal devices can also be wearable devices and next-generation communication systems, for example, terminal devices in 5G networks or terminal devices in public land mobile network (PLMN) networks that will evolve in the future, and in NR communication systems. Terminal equipment, etc.
下面,以终端设备拍摄HDR视频为例,对本申请实施例所述的HDR视频生成方法进行详细说明。In the following, taking HDR video shooting by a terminal device as an example, the HDR video generation method described in the embodiment of the present application will be described in detail.
图2是本申请实施例提供的HDR视频生成方法的流程图,本实施例是从终端设备的角度进行说明的,本实施例包括:Fig. 2 is a flowchart of an HDR video generation method provided by an embodiment of the present application. This embodiment is described from the perspective of a terminal device, and this embodiment includes:
101、接收用户输入的处理请求,所述处理请求用于请求生成HDR视频。101. Receive a processing request input by a user, where the processing request is used to request generation of an HDR video.
示例性的,用户可通过语音方式、触摸方式等向终端设备输入处理请求。示例性的,可参见图3和图4。Exemplarily, the user may input a processing request to the terminal device through a voice method, a touch method, or the like. Exemplary, please refer to Fig. 3 and Fig. 4.
图3是本申请实施例提供的HDR视频生成方法中输入处理请求的一种示意图。请参照图3,本实施例中,终端设备上安装有HDR视频生成应用程序(application,APP),该APP可以是终端设备的操作系统自带的APP,如照相机,也可以是用户下载并安装到终端设备上的第三方的APP。以APP为第三方的APP为例,需要生成HDR视频时,用户点击桌面上的HDR视频生成APP,从而开启该APP。该APP的界面上除了拍摄按钮外,还有供用户选择的选项,如延时拍摄、慢动作、视频、照片、全景等。用户选中视频(如图中虚线框所示)后,终端设备的出现开启闪光灯和HDR两个选项供用户选择,用户选中HDR选项,则终端设备实时拍摄出HDR视频。Fig. 3 is a schematic diagram of an input processing request in the HDR video generation method provided by an embodiment of the present application. Referring to Figure 3, in this embodiment, an HDR video generation application (application, APP) is installed on the terminal device. The APP can be an APP that comes with the operating system of the terminal device, such as a camera, or it can be downloaded and installed by the user. To the third-party APP on the terminal device. Taking the APP as a third-party APP as an example, when the HDR video needs to be generated, the user clicks on the HDR video on the desktop to generate the APP to start the APP. In addition to the shooting button on the APP's interface, there are also options for users to choose, such as time-lapse shooting, slow motion, video, photo, panorama, etc. After the user selects the video (as shown by the dashed box in the figure), the terminal device appears to turn on the two options of flash and HDR for the user to choose. If the user selects the HDR option, the terminal device will shoot the HDR video in real time.
图4是本申请实施例提供的HDR视频生成方法中输入处理请求的另一种示意图。 请参照图4,本实施例与图3的不同之处在于,本实施例中,用户开启APP后,该APP的界面上除了拍摄按钮外,还有供用户选择的选项,如延时拍摄、慢动作、普通视频、HDR视频、照片、全景等选项,用户选中HDR视频,则可以实时拍摄HDR视频。FIG. 4 is another schematic diagram of an input processing request in the HDR video generation method provided by the embodiment of the present application. Please refer to FIG. 4, the difference between this embodiment and FIG. 3 is that in this embodiment, after the user starts the APP, in addition to the shooting button, there are also options for the user to select, such as time-lapse shooting, Slow motion, normal video, HDR video, photo, panorama and other options, users can select HDR video, then you can shoot HDR video in real time.
需要说明的是,虽然上述图3和图4是以实时拍摄HDR视频为例对本申请实施例进行说明的,然而,本申请实施例并不限制,在其他可行的实现方式中,也可以是用户开启APP后,APP的界面上还显示一个选择按钮,当用户点击选择按钮时,终端设备弹出选择页面,该选择页面上展示了一系列终端设备已下载或已录制的视频,用户选中原始视频后,终端设备基于该选中的原始视频生成HDR视频。It should be noted that although the foregoing Figures 3 and 4 illustrate the embodiments of the present application by taking real-time HDR video shooting as an example, the embodiments of the present application are not limited. In other feasible implementation manners, it may also be a user After starting the APP, a selection button is also displayed on the APP interface. When the user clicks the selection button, the terminal device pops up a selection page. The selection page displays a series of videos that have been downloaded or recorded by the terminal device. After the user selects the original video , The terminal device generates an HDR video based on the selected original video.
102、根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,所述多个区域包含至少两类区域,不同类别区域的第一图像特征不同。102. According to the processing request, divide the first image frame included in the original video into a plurality of regions, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different.
示例性的,当终端设备直接拍摄HDR视频时,原始视频为终端设备取景框内实时捕捉到的视频,第一图像帧为原始视频中的一个图像帧。当终端设备将本地视频转换为HDR视频时,原始视频是终端设备本地存储的视频,可是是终端设备预先录制的或从服务器下载的,第一图像帧为原始视频中的任意一个图像帧。对于每一个第一图像帧,终端设备将该第一图像帧划分为多个区域,该些区域可以被划分为至少两类区域,每一类区域包含至少一个区域,当至少一个区域包含两个或两个以上的区域时,该两个或两个以上的区域在第一图像帧中不连续,不同类别的区域的第一图像特征不同。其中,图像特征包括亮度、包含的内容、颜色、纹理、形状等。下面,以图像特征为亮度和图像包含的内容为例,对如何将图像帧划分为多个区域进行说明。示例性的,可参见图5和图6。Exemplarily, when the terminal device directly shoots the HDR video, the original video is a video captured in real time in the viewing frame of the terminal device, and the first image frame is an image frame in the original video. When the terminal device converts the local video to HDR video, the original video is the video stored locally on the terminal device, but it is pre-recorded or downloaded from the server by the terminal device, and the first image frame is any image frame in the original video. For each first image frame, the terminal device divides the first image frame into a plurality of areas. These areas can be divided into at least two types of areas. Each type of area includes at least one area. When at least one area includes two Or when there are more than two regions, the two or more regions are not continuous in the first image frame, and the first image features of regions of different types are different. Among them, the image characteristics include brightness, contained content, color, texture, shape, and so on. In the following, how to divide the image frame into multiple regions will be described by taking the image feature as the brightness and the content contained in the image as an example. Exemplary, please refer to Fig. 5 and Fig. 6.
图5是本申请实施例提供的HDR视频生成方法中第一图像帧的各区域的一个示意图。本申请实施例中,图像帧为YUV图像,根据第一图像帧可以得到该第一图像帧的YUV色彩空间数据,其中,Y数据代表明亮度(luminance或luma),也就是明亮度;而“U”和“V”表示的是色度(chrominance或chroma),作用是描述图像色彩及饱和度,Y数据也称之为亮度信息,U数据和V数据也称之为色彩信息。假设全部亮度具有0~255,共255灰阶的亮度,预先将该255灰阶的亮度分成三种:0~193灰度区间为低亮度区间,194~223灰度区间为中亮度区间,224~255灰度区间为高亮度区间。请参照图5,终端设备提取第一图像帧的各个像素点的亮度,并确定各个像素点的亮度所属的区间范围,从而按照亮度将第一图像帧划分为三种亮度区域,分别是高亮度区域、中亮度区域和低亮度区域,同一种亮度区域可以不连续,如图5中,高亮度区域包括区域A、区域B,中亮度区域包括区域C、区域D,低亮度区域包括区域E。FIG. 5 is a schematic diagram of each area of the first image frame in the HDR video generation method provided by an embodiment of the present application. In the embodiment of this application, the image frame is a YUV image, and the YUV color space data of the first image frame can be obtained according to the first image frame, where the Y data represents brightness (luminance or luma), that is, brightness; and " U" and "V" represent chrominance (chrominance or chroma), which are used to describe the color and saturation of an image. Y data is also called brightness information, and U data and V data are also called color information. Assuming that all the brightness has a brightness of 0 to 255, a total of 255 gray scales, the brightness of the 255 gray scale is divided into three types in advance: 0 to 193 gray scale interval is low brightness interval, 194 to 223 gray scale interval is middle brightness interval, 224 The ~255 gradation interval is the high brightness interval. Referring to FIG. 5, the terminal device extracts the brightness of each pixel of the first image frame, and determines the interval range to which the brightness of each pixel belongs, so as to divide the first image frame into three brightness regions according to the brightness, each of which is high brightness Area, medium-brightness area and low-brightness area, the same brightness area can be discontinuous. As shown in Figure 5, the high-brightness area includes area A and area B, the medium-brightness area includes area C and area D, and the low-brightness area includes area E.
图6是本申请实施例提供的HDR视频生成方法中第一图像帧的各区域的另一个示意图。请参照图6,终端设备利用图片检测算法,如帧间差分法、背景建模法、点检测法、图像分割法、聚类分析法和运动矢量场法等,检测第一图像帧中是否包含特定的内容,如人物、天空、建筑物、树木等内容,包含同一特定内容的区域可以不连续。终端设备按照内容将第一图像帧划分为四种类别的区域,分别是人物区域、天空区域、建筑物区域和树木区域。FIG. 6 is another schematic diagram of each area of the first image frame in the HDR video generation method provided by the embodiment of the present application. Referring to Figure 6, the terminal device uses image detection algorithms, such as inter-frame difference method, background modeling method, point detection method, image segmentation method, cluster analysis method, and motion vector field method, to detect whether the first image frame contains Specific content, such as characters, sky, buildings, trees, etc., may not be continuous in areas containing the same specific content. The terminal device divides the first image frame into four types of areas according to the content, which are a person area, a sky area, a building area, and a tree area.
103、对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域。103. Use a corresponding first enhancement processing manner to process each of the multiple regions, respectively, to obtain multiple regions after enhancement processing.
示例性的,终端设备针对每一类别的区域,确定对应的第一增强处理方式,不同类别的区域的第一增强处理方式不同。之后,终端设备对于每个区域,采用该区域对应的第一增强处理方式对该区域进行增强处理。例如,请参照图5,终端设备对高亮度区域,如区域A和区域B进行色彩提亮处理;对于中亮度区域,如区域C和区域D进行增加对比度的处理;对于低亮度区域,如区域E进行增强曝光强度的处理。再如,请参照图6,终端设备对人物区域进行肤色增强处理;对天空区域进行色彩提亮处理;对建筑物区域进行模糊处理;对树木区域进行纹理增强处理,以保证第一图像帧中的各个区域的质量提升,进而保证视频质量提升。Exemplarily, the terminal device determines the corresponding first enhancement processing mode for each type of area, and the first enhancement processing mode is different for different types of areas. After that, for each area, the terminal device adopts the first enhancement processing manner corresponding to the area to perform enhancement processing on the area. For example, referring to Figure 5, the terminal device performs color-brightening processing on high-brightness areas, such as area A and area B; for medium-brightness areas, such as area C and area D, it performs processing to increase the contrast; for low-brightness areas, such as area E Perform processing to increase the exposure intensity. For another example, please refer to Figure 6, the terminal device performs skin tone enhancement processing on the character area; color brightening processing on the sky area; blurring processing on the building area; texture enhancement processing on the tree area to ensure that the first image frame The quality of each area of the video is improved, thereby ensuring the improvement of video quality.
104、拼接增强处理后的多个区域,得到第二图像帧。104. Join the multiple regions after the enhancement processing to obtain a second image frame.
示例性的,上述步骤103中,可以得到每个第一图像帧的增强处理后的多个区域,本步骤中,对于每个第一图像帧,通过α融合(alpha-blending,α-blending)、拉普拉斯融合(laplacian blending)等方式拼接增强处理后的多个区域,得到各第一图像帧对应的第二图像帧。Exemplarily, in the above step 103, multiple regions after the enhancement processing of each first image frame can be obtained. In this step, for each first image frame, through alpha-blending (alpha-blending, alpha-blending) , Laplacian blending (laplacian blending), etc., splicing multiple regions after enhancement processing to obtain a second image frame corresponding to each first image frame.
105、根据所述第二图像帧生成所述HDR视频。105. Generate the HDR video according to the second image frame.
示例性的,原始视频包含多个第一图像帧,不同的第一图像帧对应不同的第二图像帧。终端设备在根据第一图像帧得到第二图像帧后,融合该些第二图像帧,得到HDR视频。Exemplarily, the original video includes multiple first image frames, and different first image frames correspond to different second image frames. After obtaining the second image frame from the first image frame, the terminal device fuses the second image frames to obtain the HDR video.
本申请实施例提供的HDR视频生成方法,终端设备接收到用户输入的请求生成HDR视频的处理请求后,将原始视频包含的各第一图像帧分割至少两类区域,不同类别区域的第一图像特征不同,对不同类别区域采用对应的第一增强处理方式进行处理,得到增强处理后的区域,之后,拼接各第一图像帧的增强处理后的多个区域,得到各第一图像帧各自对应的第二图像帧,基于该些第二图像帧得到HDR视频。该过程中,无需对每一个第一图像帧拍摄得到多个不同曝光时长的图像,因此,不受限于长曝光过程,终端设备通过将原始视频将图像帧划分成不同的区域,该些不同的区域分成至少两类区域,可以根据每一类区域的第一图像特征确定该类区域的增强方案,使得不同类的区域使用不同的增强方案。另外,由于本申请实施例是对每一图像帧进行处理得到HDR视频,而无需拍摄曝光时长较长的图像,例如,无需拍摄中曝光时长、长曝光时长的图像,也就是说,本申请实施例不需要终端设备通过拉长曝光得到高动态视频,因此,得到的HDR视频不会有鬼影出现。In the HDR video generation method provided by the embodiments of the present application, after receiving a user input request to generate an HDR video processing request, the terminal device divides each first image frame contained in the original video into at least two types of regions, and the first image of the different types of regions With different characteristics, the different types of regions are processed by the corresponding first enhancement processing method to obtain the enhanced region. After that, the enhanced regions of each first image frame are spliced to obtain the corresponding first image frame. Based on the second image frames of, the HDR video is obtained. In this process, there is no need to take multiple images with different exposure time for each first image frame. Therefore, it is not limited to the long exposure process. The terminal device divides the image frame into different areas by dividing the original video. The area of is divided into at least two types of areas, and the enhancement scheme for this type of area can be determined according to the first image feature of each type of area, so that different types of areas use different enhancement schemes. In addition, since the embodiment of the present application processes each image frame to obtain HDR video, it is not necessary to shoot images with a long exposure time, for example, there is no need to shoot images with medium exposure time and long exposure time, that is to say, the implementation of this application For example, there is no need for terminal equipment to obtain high-dynamic video by lengthening the exposure. Therefore, the obtained HDR video will not have ghost images.
需要说明的是,上述实施中,也可以不进行区域的划分,而是对第一图像帧采用某一种增强处理方式等进行增强处理,具体用哪种增强处理方式可以根据第一图像帧的整体状况确定,例如,该第一图像帧整体亮度较好,则对第一图像帧整体进行色彩提亮。该种方式具有局限性,无法提升全场景动态范围的效果,因此,通过分区域定制增强处理方案,可以提高单一增强处理方案带来的局限性。It should be noted that in the above implementation, it is not necessary to divide the region, but to use a certain enhancement processing method for the first image frame to perform enhancement processing. The specific enhancement processing method used can be based on the first image frame. The overall condition is determined. For example, if the overall brightness of the first image frame is relatively good, the overall color of the first image frame is brightened. This method has limitations and cannot improve the effect of the dynamic range of the entire scene. Therefore, by customizing the enhancement processing scheme by region, the limitations brought by a single enhancement processing scheme can be improved.
上述实施例中,每种类型的区域分别对应一个第一增强处理方式,终端设备针对每个区域采用对应的第一增强处理方式进行处理。进一步的,对于每个区域,终端设备还可以进一步的按照第二图像特征将该区域划分为多个子区域,对各子区域分别确定出第二增强处理方式,并采用第二增强处理方式,对各子区域进行处理。下面,对终端设备如何划分子区域等进行详细说明。In the foregoing embodiment, each type of area corresponds to a first enhanced processing mode, and the terminal device uses the corresponding first enhanced processing mode for processing for each area. Further, for each area, the terminal device may further divide the area into a plurality of sub-areas according to the second image characteristics, determine the second enhancement processing mode for each sub-areas, and adopt the second enhancement processing mode, Each sub-area is processed. The following describes in detail how the terminal device divides sub-areas and so on.
一种可行的实现方式中,终端设备先将第一图像帧分割成多个区域,该些区域包含至少两类区域,同一类别区域的第一图像特征相同,不同类别区域的第一图像特征不同。之后,对于一类区域包含的多个区域中的任意一个区域,以下称之为第一区域,终端设备对该第一区域进行语义分割,以将该第一区域分割成多个子区域,该些子区域包含至少两类子区域,同一个类别子区域的第二图像特征相同,不同类别子区域的第二图像特征不同,所述第一图像特征和所述第二图像特征是不同维度的图像特征,确定各子区域的第二增强处理方式,对所述多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理,拼接增强处理后的多个子区域,得到所述第一区域。In a feasible implementation manner, the terminal device first divides the first image frame into a plurality of regions, these regions include at least two types of regions, the first image features of the same type of regions are the same, and the first image features of different types of regions are different. . After that, for any one of the multiple areas included in a type of area, hereinafter referred to as the first area, the terminal device performs semantic segmentation on the first area to divide the first area into multiple sub-areas. The sub-region includes at least two types of sub-regions. The second image features of the same category of sub-regions are the same, and the second image features of different categories of sub-regions are different. The first image feature and the second image feature are images of different dimensions. Feature, determine the second enhancement processing method for each sub-region, and process each of the multiple sub-regions by using the corresponding second enhancement processing method respectively, and splice the multiple sub-regions after the enhancement processing to obtain the first One area.
示例性的,终端设备对于第一图像帧的多个区域中的任意一个区域,以下称之为第一区域,按照第二图像特征将该第一区域分割成多个子区域。图7是本申请实施例提供的HDR视频生成方法中区分分割和子区域分割的过程示意图。请参照图7,假设第一图像特征为亮度,第二图像特征为图像包含的内容,终端设备将第一图像帧划分为高亮度区域、低亮度区域和中亮度区域后,针对各区域,以高亮度区域为例,终端设备进一步的将该高亮度区域进行语义分割,将高亮度区域划分为人物子区域、天空子区域、草地子区域等(图中未示出)。然后,确定各子区域分别对应的第二增强处理方式,并采用第二增强处理方式对对应的子区域进行增强处理;之后,拼接各子区域,得到对应的区域,再对各区域进行拼接,得到第二图像帧。Exemplarily, for any one area of the multiple areas of the first image frame, which is referred to as the first area hereinafter, the terminal device divides the first area into multiple sub-areas according to the second image feature. FIG. 7 is a schematic diagram of the process of distinguishing segmentation and sub-region segmentation in the HDR video generation method provided by an embodiment of the present application. Referring to Figure 7, assuming that the first image feature is brightness and the second image feature is the content contained in the image, the terminal device divides the first image frame into a high-brightness area, a low-brightness area, and a medium-brightness area. Take a high-brightness area as an example. The terminal device further performs semantic segmentation on the high-brightness area, and divides the high-brightness area into a person sub-areas, a sky sub-areas, a grass sub-areas, etc. (not shown in the figure). Then, determine the second enhancement processing method corresponding to each sub-region, and use the second enhancement processing method to enhance the corresponding sub-region; then, stitch each sub-region to obtain the corresponding region, and then stitch each region, Get the second image frame.
需要说明的是,虽然上述实施例中,将第一图像帧分割成至少两类区域后,对每一类区域中的每个区域,采用该区域类别对应的第一增强处理方式进行处理,之后,将该类区域中的任意一个区域(以下称之为第一区域),分割得到至少两类子区域后,对各子区域采用子区域类别对应的第二增强处理方式进行处理。然而,本申请实施例并不限制,在其他可行的实现方式中,也可以是将第一图像帧分成多个区域后,不对该些区域进行处理,而是在将各区域进一步的分成子区域后,对各子区域进行处理。或者,在对各区域划分得到子区域后,根据子区域内的图像内容,采用不同的增强处理方式。例如,再请参照图6,以第一区域为人物区域为例,终端设备将第一区域进行语义分割,得到两个子区域,其中一个子区域中的人物为男性,另一个子区域中的人物为女性,则对该两个人物子区域采用不同的增强处理方式进行处理。It should be noted that although in the above embodiment, after the first image frame is divided into at least two types of areas, each area in each type of area is processed by the first enhancement processing method corresponding to the area type, and then After dividing any one of the types of areas (hereinafter referred to as the first area) to obtain at least two types of sub-areas, the second enhancement processing method corresponding to the sub-area category is used for each sub-area for processing. However, the embodiments of the present application are not limited. In other feasible implementation manners, after the first image frame is divided into multiple regions, these regions are not processed, but each region is further divided into subregions. After that, each sub-region is processed. Or, after sub-regions are obtained by dividing each region, different enhancement processing methods are adopted according to the image content in the sub-regions. For example, referring to Figure 6 again, taking the first area as the person area as an example, the terminal device performs semantic segmentation on the first area to obtain two sub-areas, where the person in one sub-area is male, and the person in the other sub-area For females, different enhancement processing methods are used to process the two character sub-regions.
本实施例中,终端设备还可以进一步的按照第二图像特征将该区域划分为多个子区域,对各子区域分别确定出第二增强处理方式,并采用第二增强处理方式,对各子区域进行处理,实现进一步增强处理各子区域的目的。In this embodiment, the terminal device may further divide the area into a plurality of sub-areas according to the second image feature, determine the second enhancement processing method for each sub-areas, and adopt the second enhancement processing method for each sub-area. Perform processing to achieve the purpose of further enhancing the processing of each sub-region.
下面,以第一图像特征为亮度为例,对终端设备如何根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域进行详细说明。示例性的,可参见图8,图8是本申请实施例提供的HDR视频生成方法中分割第一图像帧的流程图,本实施例包括:In the following, taking the first image feature as brightness as an example, how the terminal device divides the first image frame included in the original video into multiple regions according to the processing request will be described in detail. Exemplarily, refer to FIG. 8. FIG. 8 is a flowchart of dividing the first image frame in the HDR video generation method provided in an embodiment of the present application. This embodiment includes:
201、获取第一图像帧。201. Acquire a first image frame.
示例性的,终端设备将原始视频的任意一个图像帧,即第一图像帧,依次输入HDR视频生成装置中。例如,当原始视频为已录制好的视频时,终端设备对其进行分帧处理,得到图像帧序列,按照图像帧序列中各图像帧的顺序,依次将图像帧输入至HDR视频生成装置。再如,当原始视频为终端设备当前正在拍摄的视频时,终端设备逐帧捕捉每一个图像帧并依次输入HDR视频生成装置中。其中,第一图像帧为YUV图像,若第一图像帧 不是YUV图像,如红绿蓝(red green blue,RGB)等时,需要将该第一图像帧转换为YUV图像、色相亮度饱和度(hue luminance saturation,HLS)等便于提取亮度信息的图像。Exemplarily, the terminal device sequentially inputs any image frame of the original video, that is, the first image frame, into the HDR video generating device. For example, when the original video is a recorded video, the terminal device performs framing processing on it to obtain an image frame sequence, and according to the order of each image frame in the image frame sequence, the image frames are sequentially input to the HDR video generating device. For another example, when the original video is the video currently being shot by the terminal device, the terminal device captures each image frame frame by frame and sequentially inputs it into the HDR video generating device. Among them, the first image frame is a YUV image. If the first image frame is not a YUV image, such as red green blue (RGB), etc., the first image frame needs to be converted into a YUV image, and the hue, brightness, and saturation ( hue Luminance Saturation, HLS) and other images that facilitate the extraction of brightness information.
202、从所述第一图像帧的YUV色彩空间数据中提取出所述第一图像帧的各像素点的Y数据。202. Extract Y data of each pixel of the first image frame from the YUV color space data of the first image frame.
示例性的,YUV色彩空间数据中的Y数据代表明亮度(luminance或luma),也就是明亮度;而“U”和“V”表示的是色度(chrominance或chroma),作用是描述图像色彩及饱和度。终端设备提取出第一图像帧的每个像素点的Y数据,从而得到多个Y数据。Exemplarily, the Y data in the YUV color space data represents brightness (luminance or luma), that is, brightness; while "U" and "V" represent chrominance (chrominance or chroma), which are used to describe the color of an image And saturation. The terminal device extracts the Y data of each pixel of the first image frame, thereby obtaining multiple Y data.
203、终端设备对该些与数据进行滤波,得到平滑的Y数据。203. The terminal device filters the sum data to obtain smooth Y data.
示例性的,终端设备对该些Y数据使用高斯滤波等进行平滑处理,从而得到平滑的Y数据。Exemplarily, the terminal device uses Gaussian filtering or the like to perform smoothing processing on the Y data, so as to obtain smooth Y data.
204、根据所述第一图像帧的各像素点的Y数据,确定各所述像素点的梯度。204. Determine the gradient of each pixel point according to the Y data of each pixel point of the first image frame.
示例性的,终端设备使用罗伯特(Robert)边缘检测算子、索贝尔(sobel)边缘检测算子等,确定各像素点的梯度G。Exemplarily, the terminal device uses Robert edge detection operator, Sobel edge detection operator, etc., to determine the gradient G of each pixel.
Figure PCTCN2020110825-appb-000001
Figure PCTCN2020110825-appb-000001
其中,G x为一个像素点横轴方向的梯度,G y为对应像素点纵轴方向的梯度。假设横轴方向上,像素点a和像素点b为两个相邻的像素点,纵轴方向上,像素点a和像素点c为相邻的两个像素点,则对于像素点a而言,G x等于像素点a的Y数据与像素点b的Y数据的差值的绝对值,G y等于像素点a的Y数据和像素点c的Y数据的差值的绝对值。 Among them, G x is the gradient in the horizontal axis direction of a pixel, and G y is the gradient in the vertical axis direction of the corresponding pixel. Assuming that in the horizontal axis direction, pixel point a and pixel point b are two adjacent pixels, and in the vertical axis direction, pixel point a and pixel point c are two adjacent pixels, then for pixel point a , G x is equal to the absolute value of the difference between the Y data of pixel a and the Y data of pixel b, and G y is equal to the absolute value of the difference between the Y data of pixel a and the Y data of pixel c.
分割过程中,预设第一阈值和第二阈值,其中,第一阈值表示为高阈值(Highthreshold),若一个像素点为高亮度像素点,则该像素点的梯度不能低于第一阈值;第二阈值表示为低阈值(Lowthreshold),若一个像素点为低亮度像素点,则该像素点的梯度不能高于第二阈值。对于第一图像帧中的任意像素点,将该像素点的梯度记为G p,若G p大于等于第一阈值,则说明该像素点为高亮度像素点;若G p小于等于第二阈值,则说明该像素点为低亮度像素点;若G p介于第一阈值和第二阈值之间,则说明该像素点为中亮度像素点。 During the segmentation process, a first threshold and a second threshold are preset, where the first threshold is expressed as a high threshold (Highthreshold). If a pixel is a high-brightness pixel, the gradient of the pixel cannot be lower than the first threshold; The second threshold is expressed as a low threshold. If a pixel is a low-brightness pixel, the gradient of the pixel cannot be higher than the second threshold. For any pixel in the first image frame, mark the gradient of the pixel as G p . If G p is greater than or equal to the first threshold, it means that the pixel is a high-brightness pixel; if G p is less than or equal to the second threshold , It means that the pixel is a low-brightness pixel; if G p is between the first threshold and the second threshold, it means that the pixel is a medium-brightness pixel.
205、根据各所述像素点的梯度,将所述第一图像帧分割成多个区域。205. Divide the first image frame into multiple regions according to the gradient of each pixel.
示例性的,终端设备将第一图像帧中超过第一阈值、且集中在一起的像素点作为一个区域。由于梯度超过第一阈值的像素点很有可能分布在第一图像帧中的不同地方,因此,可以设置一个阈值,如100,连续的100个及以上的梯度超过第一阈值的像素形成一个高亮度区域。如此一来,第一图像帧中,高亮度区域很有可能不止一个。同理,采用同样的方式得到低亮度区域和中亮度区域,从而将第一图像帧分割成多个区域。Exemplarily, the terminal device uses the pixels in the first image frame that exceed the first threshold and are grouped together as one area. Since the pixels with gradients exceeding the first threshold are likely to be distributed in different places in the first image frame, a threshold can be set, such as 100. Continuous 100 or more pixels with gradients exceeding the first threshold form a high Brightness area. In this way, there is likely to be more than one high-brightness area in the first image frame. In the same way, the low-brightness area and the medium-brightness area are obtained in the same way, so that the first image frame is divided into multiple areas.
本实施例中,实现根据亮度将第一图像帧分割成多个区域的目的。In this embodiment, the purpose of dividing the first image frame into multiple regions according to brightness is achieved.
下面,对上述实施例中,如何确定各类别的区域的第一增强处理方式进行详细说明。示例性的,可参见图9,图9是本申请实施例提供的HDR视频生成方法中确定第一增强处理方式的流程图,本实施例包括:Hereinafter, how to determine the first enhancement processing mode of each category of region in the above-mentioned embodiment will be described in detail. Exemplarily, refer to FIG. 9. FIG. 9 is a flowchart of determining the first enhancement processing mode in the HDR video generation method provided in an embodiment of the present application. This embodiment includes:
301、获取所述多个区域中的各区域的直方图。301. Obtain a histogram of each of the multiple regions.
示例性的,对于多个区域中的每个区域,终端设备可以基于颜色特征等制作各区域的直方图。图10是本申请实施例提供的HDR视频生成方法中区域和直方图的示意图。请参照图10,对于多个区域中的每个区域,直方图分别f(x),x=0,1,2,……255。Exemplarily, for each of the multiple areas, the terminal device may make a histogram of each area based on color characteristics and the like. FIG. 10 is a schematic diagram of regions and histograms in the HDR video generation method provided by an embodiment of the present application. Please refer to FIG. 10, for each of the multiple regions, the histogram is f(x), x=0,1,2,...255.
302、根据各所述直方图确定对应区域的动态范围值。302. Determine the dynamic range value of the corresponding area according to each of the histograms.
示例性的,所述各区域包含目标区域,所述动态范围值包括高曝动态范围值和低亮动态范围值,对于该目标区域,终端设备基于该目标区域对应的直方图,提取峰值、平均值、高曝/低亮区域占比等参数,并基于该些参数确定目标区域的动态范围(dynamic range,DR)值。Exemplarily, each area includes a target area, and the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value. For the target area, the terminal device extracts the peak value and the average value based on the histogram corresponding to the target area. The dynamic range (DR) value of the target area is determined based on parameters such as the value, the proportion of high-exposure/low-bright areas, and so on.
例如,再请参照图10,假设峰值p={x|where max(f(x))};For example, please refer to Figure 10 again, assuming that the peak value p={x|where max(f(x))};
平均值
Figure PCTCN2020110825-appb-000002
average value
Figure PCTCN2020110825-appb-000002
高曝/低亮区域占比
Figure PCTCN2020110825-appb-000003
或者,高曝/低亮区域占比
Figure PCTCN2020110825-appb-000004
Proportion of high-exposure/low-bright areas
Figure PCTCN2020110825-appb-000003
Or, the proportion of high-exposure/low-bright areas
Figure PCTCN2020110825-appb-000004
高曝
Figure PCTCN2020110825-appb-000005
High exposure
Figure PCTCN2020110825-appb-000005
低曝
Figure PCTCN2020110825-appb-000006
Low exposure
Figure PCTCN2020110825-appb-000006
其中,a、b、c为正数,DR值越低则动态范围越好。高曝DR用于反映目标区域的高曝程度,低曝DR用于反映目标区域的低曝程度,若高曝DR至和低曝DR值均很低,则说明目标区域的动态范围越好。Among them, a, b, and c are positive numbers, and the lower the DR value, the better the dynamic range. The high-exposure DR is used to reflect the high-exposure degree of the target area, and the low-exposure DR is used to reflect the low-exposure degree of the target area. If the high-exposure DR to and the low-exposure DR value are both low, the dynamic range of the target area is better.
303、根据各所述动态范围值,分别确定各区域对应的第一增强处理方式。303. Determine the first enhancement processing mode corresponding to each region according to each of the dynamic range values.
示例性的,不同的动态范围值对应不同的第一增强处理方式,终端设备在确定出一个区域的动态范围值后,通过查表等方式,即可获得该区域的第一增强处理方式。例如,对于目标区域,终端设备根据曝光DR值和低亮DR值确定目标区域的第一增强处理方式。Exemplarily, different dynamic range values correspond to different first enhancement processing methods. After determining the dynamic range value of an area, the terminal device can obtain the first enhancement processing method of the area by looking up a table or the like. For example, for the target area, the terminal device determines the first enhancement processing mode of the target area according to the exposure DR value and the low-brightness DR value.
本实施例中,实现终端设备根据区域的动态范围值,获取该区域的第一增强处理方式的目的。In this embodiment, the purpose of obtaining the first enhanced processing mode of the area by the terminal device according to the dynamic range value of the area is achieved.
下面,用一个示例对上述的HDR视频生成方法进行详细说明。示例性的,可参见图11,图11是本申请实施例提供的HDR视频生成方法的过程示意图。In the following, an example is used to describe the above-mentioned HDR video generation method in detail. Exemplarily, refer to FIG. 11, which is a schematic diagram of a process of an HDR video generation method provided in an embodiment of the present application.
请参照图11,终端设备当前正在录制视频V0,该视频V0即为上述的原始视频。终端设备在录制V0的过程中,逐帧捕捉图像帧,捕捉到的第一图像帧为包含桥洞和景色,桥洞部分较暗,桥洞以外的景色部分较亮。终端设备按照亮度,将第一图像帧分割为区域1和区域2,其中,区域1为桥洞部分,该部分为低亮度区域,区域2为景色部分,该部分为高亮度区域。区域1对应的第一增强处理方式为高曝恢复处理,区域2对应的第一增强处理方式为暗区提亮处理,则终端设备对区域1进行高曝恢复处理,使得区域1中的桥洞曝光度增强,终端设备对区域2进行暗区提亮处理,使得区域2中的景色的亮度增强。之后,终端设备运用边缘融合算法对强处理后的区域1和增强处理后的区域2进行拼接,得到第二图像帧。拍摄视频的过程中,终端设备对捕捉到的每一个第一图像帧均进行上述的处理并合成第二图像帧,得到每个一个图像帧分别对应的第二图像帧,最后,合成各第二图像帧,得到HDR视频。Referring to FIG. 11, the terminal device is currently recording a video V0, which is the original video described above. In the process of recording V0, the terminal device captures image frames frame by frame. The first captured image frame contains the bridge hole and the scenery. The bridge hole is darker, and the scenery outside the bridge hole is brighter. The terminal device divides the first image frame into area 1 and area 2 according to brightness, where area 1 is a bridge hole portion, which is a low-brightness area, area 2 is a scenery portion, and this portion is a high-brightness area. The first enhancement processing method corresponding to area 1 is high-exposure recovery processing, and the first enhancement processing method corresponding to area 2 is dark area brightening processing, and the terminal device performs high-exposure recovery processing on area 1, so that the bridge holes in area 1 are exposed When the intensity is enhanced, the terminal device performs dark area brightening processing on area 2, so that the brightness of the scenery in area 2 is enhanced. After that, the terminal device uses an edge fusion algorithm to splice the strongly processed area 1 and the enhanced processed area 2 to obtain a second image frame. In the process of shooting video, the terminal device performs the above-mentioned processing on each captured first image frame and synthesizes the second image frame to obtain the second image frame corresponding to each image frame, and finally, synthesize each second image frame. Image frame, get HDR video.
需要说明的是,上述实施例中,终端设备在对第一图像帧划分区域的时候,是根据第 一图像特征对第一图像帧进行区域划分的,然而,本申请实施例并不限制,在其他可行的实现方式中的,终端设备也可以结合第一图像特征和第二图像特征,对第一图像帧进行区域划分。例如,第一图像特征为亮度,第二图像特征为人物,则终端设备对包含人物的第一图像帧进行划分时,可以将该第一图像帧中的人物划分出来,将其作为一个区域,将剩余区域再划分为高亮度区域和低亮度区域。It should be noted that, in the foregoing embodiment, when the terminal device divides the first image frame into regions, it divides the first image frame according to the first image feature. However, the embodiment of the present application is not limited. In other feasible implementation manners, the terminal device may also combine the first image feature and the second image feature to partition the first image frame. For example, if the first image feature is brightness and the second image feature is a person, when the terminal device divides the first image frame containing the person, it can divide the person in the first image frame and use it as a region. The remaining area is subdivided into high-brightness areas and low-brightness areas.
下述为本发明装置实施例,可以用于执行本发明方法实施例。对于本发明装置实施例中未披露的细节,请参照本发明方法实施例。The following are device embodiments of the present invention, which can be used to implement the method embodiments of the present invention. For details that are not disclosed in the device embodiment of the present invention, please refer to the method embodiment of the present invention.
图12为本发明实施例提供的一种高动态范围HDR视频生成装置的结构示意图。该HDR视频生成装置100可以通过软件和/或硬件的方式实现。如图12所示,该HDR视频生成装置100包括:FIG. 12 is a schematic structural diagram of a high dynamic range HDR video generation device provided by an embodiment of the present invention. The HDR video generating apparatus 100 may be implemented in software and/or hardware. As shown in FIG. 12, the HDR video generation device 100 includes:
收发单元11,用于接收用户输入的处理请求,所述处理请求用于请求生成HDR视频;The transceiver unit 11 is configured to receive a processing request input by a user, and the processing request is used to request the generation of an HDR video;
处理单元12,用户根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,所述多个区域包含至少两类区域,不同类别区域的第一图像特征不同,对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域,拼接增强处理后的多个区域,得到第二图像帧,根据所述第二图像帧生成HDR视频。The processing unit 12, the user divides the first image frame contained in the original video into a plurality of regions according to the processing request, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different. Each of the multiple regions is processed by the corresponding first enhancement processing method to obtain multiple regions after the enhancement processing, and the multiple regions after the enhancement processing are spliced to obtain a second image frame, according to the second image frame Generate HDR video.
一种可行的实现方式中,所述处理单元12,用于对第一区域进行语义分割,以将所述第一区域分割成多个子区域,所述多个子区域包含至少两类子区域,不同类别子区域的第二图像特征不同,所述第一区域是所述多个区域中的任意一个区域,所述第一图像特征和所述第二图像特征是不同维度的图像特征,确定各子区域的第二增强处理方式,对所述多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理,拼接增强处理后的多个子区域,得到所述第一区域。In a feasible implementation manner, the processing unit 12 is configured to perform semantic segmentation on the first area to divide the first area into a plurality of sub-areas, and the plurality of sub-areas includes at least two types of sub-areas. The second image features of the category subregions are different, the first region is any one of the multiple regions, the first image feature and the second image feature are image features of different dimensions, and each subregion is determined The second enhancement processing method of the region, for each of the plurality of subregions, respectively uses the corresponding second enhancement processing method to process, and the multiple subregions after the enhancement processing are spliced to obtain the first region.
一种可行的实现方式中,所述处理单元12,用于从所述第一图像帧的YUV色彩空间数据中提取出所述第一图像帧的各像素点的Y数据,根据所述第一图像帧的各像素点的Y数据,确定各所述像素点的梯度,根据各所述像素点的梯度,将所述第一图像帧分割成多个区域。In a feasible implementation manner, the processing unit 12 is configured to extract the Y data of each pixel of the first image frame from the YUV color space data of the first image frame, and according to the first image frame The Y data of each pixel of the image frame determines the gradient of each pixel, and the first image frame is divided into a plurality of regions according to the gradient of each pixel.
一种可行的实现方式中,所述处理单元12,在获取所述第一图像帧的YUV色彩空间数据之前,还用于将所述第一图像帧转换为YUV图像。In a feasible implementation manner, the processing unit 12 is further configured to convert the first image frame into a YUV image before acquiring the YUV color space data of the first image frame.
一种可行的实现方式中,所述处理单元12,在对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之前,还用于获取所述多个区域中的各区域的直方图,根据各所述直方图确定对应区域的动态范围值,根据各所述动态范围值,分别确定各区域对应的第一增强处理方式。In a feasible implementation manner, the processing unit 12 is used to process each of the multiple regions by using the corresponding first enhancement processing mode to obtain the multiple regions after the enhancement processing. Obtain a histogram of each of the multiple areas, determine the dynamic range value of the corresponding area according to each of the histograms, and determine the first enhancement processing mode corresponding to each area according to each of the dynamic range values.
一种可行的实现方式中,所述各区域包含目标区域,所述动态范围值包括高曝动态范围值和低亮动态范围值,所述处理单元12,用于提取所述目标区域的峰值、平均值以及区域占比,所述区域占比用于指示高曝区域和低曝光区域的比值,根据所述峰值、所述平均值以及所述区域占比,确定所述目标区域的所述高曝动态范围值和所述低亮动态范围值。In a feasible implementation manner, each area includes a target area, the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value, and the processing unit 12 is configured to extract the peak value, The average value and the area ratio, the area ratio is used to indicate the ratio of the high exposure area and the low exposure area, and the high value of the target area is determined according to the peak value, the average value, and the area ratio. Exposure dynamic range value and the low light dynamic range value.
一种可行的实现方式中,所述原始视频是所述终端设备当前正在拍摄的视频,或者,所述原始视频所述终端设备本地的LDR视频。In a feasible implementation manner, the original video is a video currently being shot by the terminal device, or the original video is a local LDR video of the terminal device.
本发明实施例提供的HDR视频生成装置,可以执行上述实施例中终端设备的动作,其实现原理和技术效果类似,在此不再赘述。The HDR video generation device provided in the embodiment of the present invention can perform the actions of the terminal device in the foregoing embodiment, and its implementation principles and technical effects are similar, and will not be repeated here.
需要说明的是,应理解以上收发单元实际实现时可以是收发器,处理单元可以以软件通过处理元件调用的形式实现;也可以以硬件的形式实现。例如,处理单元可以为单独设立的处理元件,也可以集成在上述装置的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述装置的存储器中,由上述装置的某一个处理元件调用并执行以上处理单元的功能。此外这些单元全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个单元可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be noted that it should be understood that the above transceiving unit may be a transceiver when actually implemented, and the processing unit may be implemented in a form of software calling through a processing element; it may also be implemented in a form of hardware. For example, the processing unit may be a separate processing element, or it may be integrated in a chip of the above-mentioned device for implementation. In addition, it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device Call and execute the functions of the above processing unit. In addition, all or part of these units can be integrated together or implemented independently. The processing element described here may be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above units may be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
例如,以上这些单元可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个专用集成电路(application specific integrated circuit,ASIC),或,一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)等。再如,当以上某个单元通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(central processing unit,CPU)或其它可以调用程序代码的处理器。再如,这些单元可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。For example, the above units may be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (FPGA), etc. For another example, when one of the above units is implemented in the form of processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
图13是本申请实施例提供的一种终端设备的结构示意图,如图13所示,该终端设备200包括:FIG. 13 is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 13, the terminal device 200 includes:
处理器21和存储器22; Processor 21 and memory 22;
所述存储器22存储计算机执行指令;The memory 22 stores computer execution instructions;
所述处理器21执行所述存储器22存储的计算机执行指令,使得所述处理器21执行如上终端设备对应的HDR视频生成方法。The processor 21 executes the computer-executable instructions stored in the memory 22, so that the processor 21 executes the HDR video generation method corresponding to the above terminal device.
处理器21的具体实现过程可参见上述方法实施例,其实现原理和技术效果类似,本实施例此处不再赘述。For the specific implementation process of the processor 21, refer to the foregoing method embodiments, and the implementation principles and technical effects are similar, and will not be repeated here in this embodiment.
可选地,该终端设备200还包括通信接口23。其中,处理器21、存储器22以及通信接口23可以通过总线24连接。Optionally, the terminal device 200 further includes a communication interface 23. Among them, the processor 21, the memory 22, and the communication interface 23 may be connected through a bus 24.
本发明实施例还提供一种存储介质,所述存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如上终端设备执行的HDR视频生成方法。The embodiment of the present invention also provides a storage medium, and the storage medium stores computer-executable instructions, and when the computer-executed instructions are executed by a processor, they are used to implement the HDR video generation method executed by the above terminal device.
本发明实施例还提供一种计算机程序产品,当所述计算机程序产品在终端设备上运行时,用于实现终端设备执行的HDR视频生成方法。The embodiment of the present invention also provides a computer program product, which is used to implement the HDR video generation method executed by the terminal device when the computer program product runs on the terminal device.
图14为本申请实施例提供的一种终端设备的硬件结构示意图。如图14所示,终端设备1000包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、处理器110、电源111等部件。本领域技术人员可以理解,图14中示出的终端设备结构并不构成对终端设备的限定,终端设备1000可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本申请实施例中,终端设备包括但不限于手机、平板电脑、掌上电脑等。FIG. 14 is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application. As shown in FIG. 14, the terminal device 1000 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, Processor 110, power supply 111 and other components. Those skilled in the art can understand that the structure of the terminal device shown in FIG. 14 does not constitute a limitation on the terminal device, and the terminal device 1000 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. Component arrangement. In the embodiments of the present application, terminal devices include, but are not limited to, mobile phones, tablet computers, palmtop computers, and so on.
其中,用户输入单元107,用于接收用户的输入;显示单元106,用于响应于用户输入单元107接收的输入,根据输入显示内容。Among them, the user input unit 107 is used to receive user input; the display unit 106 is used to respond to the input received by the user input unit 107 and display content according to the input.
应理解的是,本申请实施例中,射频单元101可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自主基站或辅基站的下行数据接收后,给处理器110处理;另 外,将上行的数据发送给主基站或辅基站。通常,射频单元101包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元101还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in the embodiment of the present application, the radio frequency unit 101 can be used for receiving and sending signals in the process of sending and receiving information or talking. Specifically, after receiving downlink data from a master base station or a secondary base station, it is processed by the processor 110; In addition, the uplink data is sent to the primary base station or the secondary base station. Generally, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with the network and other devices through a wireless communication system.
终端设备1000通过网络模块102为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The terminal device 1000 provides users with wireless broadband Internet access through the network module 102, such as helping users to send and receive emails, browse web pages, and access streaming media.
音频输出单元103可以将射频单元101或网络模块102接收的或者在存储器109中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元103还可以提供与终端设备1000执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等)。音频输出单元103包括扬声器、蜂鸣器以及受话器等。The audio output unit 103 can convert the audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output it as sound. Moreover, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 1000 (for example, call signal reception sound, message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
输入单元104用于接收音频或视频信号。输入单元104可以包括图形处理器(Graphics Processing Unit,GPU)1041和麦克风1042,图形处理器1041用于对摄像头等捕捉的图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元106上。经图形处理器1041处理后的图像帧可以存储在存储器109(或其它存储介质)中或者经由射频单元101或网络模块102进行发送。麦克风1042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元101发送到移动通信基站的格式输出。The input unit 104 is used to receive audio or video signals. The input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The graphics processor 1041 is used to process image data of pictures or videos captured by a camera or the like. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the network module 102. The microphone 1042 can receive sound, and can process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 101 for output in the case of a telephone call mode.
终端设备1000还包括至少一种传感器105,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1061的亮度,接近传感器可在终端设备1000移动到耳边时,关闭显示面板1061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器105还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The terminal device 1000 further includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light. The proximity sensor can close the display panel 1061 and the display panel 1061 when the terminal device 1000 is moved to the ear. / Or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the terminal device (such as horizontal and vertical screen switching, related games , Magnetometer posture calibration), vibration recognition related functions (such as pedometer, tap), etc.; sensor 105 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.
显示单元106用于显示由用户输入的信息或提供给用户的信息。显示单元106可包括显示面板1061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1061。The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
用户输入单元107可用于接收输入的数字或字符信息,以及产生与终端设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元107包括触控面板1071以及其他输入设备1072。触控面板1071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1071上或在触控面板1071附近的操作)。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器110,接收处理器110发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1071。除了触控面板1071,用户输入单元107还可以包括其他输入设备1072。具体地,其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 107 can be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the terminal device. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. The touch panel 1071, also called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 1071 or near the touch panel 1071. operating). The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 110, the command sent by the processor 110 is received and executed. In addition, the touch panel 1071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick, which will not be repeated here.
进一步的,触控面板1071可覆盖在显示面板1061上,当触控面板1071检测到在其 上或附近的触摸操作后,传送给处理器110以确定触摸事件的类型,随后处理器110根据触摸事件的类型在显示面板1061上提供相应的视觉输出。虽然在图14中,触控面板1071与显示面板1061是作为两个独立的部件来实现终端设备的输入和输出功能,但是在某些实施例中,可以将触控面板1071与显示面板1061集成而实现终端设备的输入和输出功能,具体此处不做限定。Further, the touch panel 1071 can be overlaid on the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits it to the processor 110 to determine the type of the touch event, and then the processor 110 determines the type of the touch event according to the touch. The type of event provides corresponding visual output on the display panel 1061. Although in FIG. 14, the touch panel 1071 and the display panel 1061 are used as two independent components to realize the input and output functions of the terminal device, but in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated The implementation of the input and output functions of the terminal device is not specifically limited here.
接口单元108为外部装置与终端设备1000连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元108可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到终端设备1000内的一个或多个元件或者可以用于在终端设备1000和外部装置之间传输数据。The interface unit 108 is an interface for connecting an external device with the terminal device 1000. For example, the external device may include a wired or wireless headset port, an external power source (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) port, video I/O port, headphone port, etc. The interface unit 108 may be used to receive input (for example, data information, power, etc.) from an external device and transmit the received input to one or more elements in the terminal device 1000 or may be used to connect to the terminal device 1000 and an external device. Transfer data between devices.
存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器109可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of mobile phones (such as audio data, phone book, etc.), etc. In addition, the memory 109 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
处理器110是终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器109内的软件程序和/或模块,以及调用存储在存储器109内的数据,执行终端设备的各种功能和处理数据,从而对终端设备进行整体监控。处理器110可包括一个或多个处理单元;可选的,处理器110可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。The processor 110 is the control center of the terminal device. It uses various interfaces and lines to connect the various parts of the entire terminal device, runs or executes software programs and/or modules stored in the memory 109, and calls data stored in the memory 109. , Perform various functions of the terminal equipment and process data, so as to monitor the terminal equipment as a whole. The processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc. The adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 110.
请参照图14,本申请实施例中,存储器109中存储计算机程序,其中,所述处理器110运行所述计算机程序,以使得所述终端设备执行上述的HDR视频生成方法Referring to FIG. 14, in this embodiment of the present application, a computer program is stored in the memory 109, wherein the processor 110 runs the computer program so that the terminal device executes the above-mentioned HDR video generation method
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may implement or Perform the methods, steps, and logical block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
在本申请实施例中,存储器可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。In the embodiment of the present application, the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), for example Random-access memory (random-access memory, RAM). The memory is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
本申请各实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计 算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,SSD)等。The methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the procedures or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, SSD).
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the scope of the application. In this way, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims (17)

  1. 一种高动态范围HDR视频生成方法,其特征在于,包括:A high dynamic range HDR video generation method, which is characterized in that it includes:
    终端设备接收用户输入的处理请求,所述处理请求用于请求生成HDR视频;The terminal device receives a processing request input by the user, and the processing request is used to request the generation of an HDR video;
    所述终端设备根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,所述多个区域包含至少两类区域,不同类别区域的第一图像特征不同;According to the processing request, the terminal device divides the first image frame included in the original video into a plurality of regions, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different;
    所述终端设备对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域;The terminal device respectively uses a corresponding first enhancement processing method to process each of the multiple areas to obtain multiple areas after enhancement processing;
    所述终端设备拼接增强处理后的多个区域,得到第二图像帧;Splicing the multiple regions after the enhancement processing by the terminal device to obtain a second image frame;
    所述终端设备根据所述第二图像帧生成HDR视频。The terminal device generates an HDR video according to the second image frame.
  2. 根据权利要求1所述的方法,其特征在于,所述终端设备对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之后,还包括:The method according to claim 1, wherein the terminal device uses a corresponding first enhancement processing method to process each of the multiple areas respectively, and after obtaining the multiple areas after the enhancement processing, the include:
    所述终端设备对第一区域进行语义分割,以将所述第一区域分割成多个子区域,所述多个子区域包含至少两类子区域,不同类别子区域的第二图像特征不同,所述第一区域是所述多个区域中的任意一个区域,所述第一图像特征和所述第二图像特征是不同维度的图像特征;The terminal device performs semantic segmentation on the first area to divide the first area into a plurality of sub-areas, and the plurality of sub-areas includes at least two types of sub-areas, and the second image features of the different types of sub-areas are different. The first area is any one of the plurality of areas, and the first image feature and the second image feature are image features of different dimensions;
    所述终端设备确定各子区域的第二增强处理方式;The terminal device determines the second enhancement processing mode of each sub-region;
    所述终端设备对所述多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理;The terminal device respectively uses a corresponding second enhanced processing mode to process each of the multiple sub-areas;
    所述终端设备拼接增强处理后的多个子区域,得到所述第一区域。The terminal device splices the multiple sub-regions after the enhancement processing to obtain the first region.
  3. 根据权利要求1或2所述的方法,其特征在于,所述终端设备根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,包括:The method according to claim 1 or 2, wherein the terminal device divides the first image frame contained in the original video into multiple regions according to the processing request, comprising:
    所述终端设备从所述第一图像帧的YUV色彩空间数据中提取出所述第一图像帧的各像素点的Y数据;The terminal device extracts the Y data of each pixel of the first image frame from the YUV color space data of the first image frame;
    所述终端设备根据所述第一图像帧的各像素点的Y数据,确定各所述像素点的梯度;The terminal device determines the gradient of each pixel according to the Y data of each pixel of the first image frame;
    所述终端设备根据各所述像素点的梯度,将所述第一图像帧分割成多个区域。The terminal device divides the first image frame into multiple regions according to the gradient of each pixel.
  4. 根据权利要求3所述的方法,其特征在于,所述终端设备获取所述第一图像帧的YUV色彩空间数据之前,还包括:The method according to claim 3, wherein before the terminal device obtains the YUV color space data of the first image frame, the method further comprises:
    所述终端设备将所述第一图像帧转换为YUV图像。The terminal device converts the first image frame into a YUV image.
  5. 根据权利要求1~4任一项所述的方法,其特征在于,所述终端设备对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之前,还包括:The method according to any one of claims 1 to 4, wherein the terminal device uses a corresponding first enhancement processing method to process each of the multiple regions, respectively, to obtain the enhanced multiple Before this area, it also includes:
    所述终端设备获取所述多个区域中的各区域的直方图;Acquiring, by the terminal device, a histogram of each of the multiple areas;
    所述终端设备根据各所述直方图确定对应区域的动态范围值;The terminal device determines the dynamic range value of the corresponding area according to each of the histograms;
    所述终端设备根据各所述动态范围值,分别确定各区域对应的第一增强处理方式。The terminal device respectively determines the first enhancement processing mode corresponding to each area according to each of the dynamic range values.
  6. 根据权利要求5所述的方法,其特征在于,所述各区域包含目标区域,所述动态范围值包括高曝动态范围值和低亮动态范围值,所述根据各所述直方图确定对应区域的动态范围值,包括:The method according to claim 5, wherein each of the areas includes a target area, the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value, and the corresponding area is determined according to each of the histograms The dynamic range value of includes:
    所述终端设备提取所述目标区域的峰值、平均值以及区域占比,所述区域占比用于指 示高曝区域和低曝光区域的比值;The terminal device extracts the peak value, the average value, and the area proportion of the target area, and the area proportion is used to indicate the ratio of the high-exposure area and the low-exposure area;
    所述终端设备根据所述峰值、所述平均值以及所述区域占比,确定所述目标区域的所述高曝动态范围值和所述低亮动态范围值。The terminal device determines the high-exposure dynamic range value and the low-brightness dynamic range value of the target area according to the peak value, the average value, and the area proportion.
  7. 根据权利要求1~6任一项所述的方法,其特征在于,The method according to any one of claims 1 to 6, characterized in that:
    所述原始视频是所述终端设备当前正在拍摄的视频;The original video is a video currently being shot by the terminal device;
    或者,or,
    所述原始视频所述终端设备本地的LDR视频。The original video is a local LDR video of the terminal device.
  8. 一种终端设备,其特征在于,包括:处理器、存储器,以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如下步骤:A terminal device, characterized by comprising: a processor, a memory, and a computer program stored on the memory and running on the processor, wherein the processor executes the program when the program is executed. The following steps:
    接收用户输入的处理请求,所述处理请求用于请求生成HDR视频;Receiving a processing request input by a user, where the processing request is used to request the generation of an HDR video;
    根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,所述多个区域包含至少两类区域,不同类别区域的第一图像特征不同;According to the processing request, dividing the first image frame included in the original video into a plurality of regions, the plurality of regions include at least two types of regions, and the first image features of the different types of regions are different;
    对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域;Each region of the multiple regions is processed by a corresponding first enhancement processing mode, respectively, to obtain multiple regions after the enhancement processing;
    拼接增强处理后的多个区域,得到第二图像帧;Stitching multiple regions after the enhancement processing to obtain a second image frame;
    根据所述第二图像帧生成HDR视频。The HDR video is generated according to the second image frame.
  9. 根据权利要求8所述的终端设备,其特征在于,所述对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之后,还包括:8. The terminal device according to claim 8, wherein said processing each of said multiple areas using a corresponding first enhancement processing mode respectively, and after obtaining multiple areas after enhancement processing, further comprising: :
    对第一区域进行语义分割,以将所述第一区域分割成多个子区域,所述多个子区域包含至少两类子区域,不同类别子区域的第二图像特征不同,所述第一区域是所述多个区域中的任意一个区域,所述第一图像特征和所述第二图像特征是不同维度的图像特征;Perform semantic segmentation on the first region to divide the first region into a plurality of subregions, the plurality of subregions include at least two types of subregions, and the second image features of the different types of subregions are different, and the first region is In any one of the plurality of regions, the first image feature and the second image feature are image features of different dimensions;
    确定各子区域的第二增强处理方式;Determine the second enhancement processing mode for each sub-region;
    对所述多个子区域中的每个子区域,分别采用对应的第二增强处理方式进行处理;For each of the multiple sub-regions, a corresponding second enhancement processing method is used for processing;
    拼接增强处理后的多个子区域,得到所述第一区域。The multiple sub-regions after the enhancement processing are spliced to obtain the first region.
  10. 根据权利要求8或9所述的终端设备,其特征在于,所述根据所述处理请求,将原始视频包含的第一图像帧分割成多个区域,包括:The terminal device according to claim 8 or 9, wherein the dividing the first image frame contained in the original video into multiple regions according to the processing request comprises:
    所述终端设备从所述第一图像帧的YUV色彩空间数据中提取出所述第一图像帧的各像素点的Y数据;The terminal device extracts the Y data of each pixel of the first image frame from the YUV color space data of the first image frame;
    所述终端设备根据所述第一图像帧的各像素点的Y数据,确定各所述像素点的梯度;The terminal device determines the gradient of each pixel according to the Y data of each pixel of the first image frame;
    所述终端设备根据各所述像素点的梯度,将所述第一图像帧分割成多个区域。The terminal device divides the first image frame into multiple regions according to the gradient of each pixel.
  11. 根据权利要求10所述的终端设备,其特征在于,所述获取所述第一图像帧的YUV色彩空间数据之前,还包括:The terminal device according to claim 10, wherein before the acquiring YUV color space data of the first image frame, the method further comprises:
    将所述第一图像帧转换为YUV图像。The first image frame is converted into a YUV image.
  12. 根据权利要求8~11任一项所述的终端设备,其特征在于,所述对所述多个区域中的各区域分别采用对应的第一增强处理方式进行处理,得到增强处理后的多个区域之前,还包括:The terminal device according to any one of claims 8 to 11, wherein the corresponding first enhancement processing method is used to process each of the plurality of regions to obtain a plurality of enhanced processing methods. Before the area, it also includes:
    获取所述多个区域中的各区域的直方图;Acquiring a histogram of each of the multiple areas;
    根据各所述直方图确定对应区域的动态范围值;Determine the dynamic range value of the corresponding area according to each of the histograms;
    根据各所述动态范围值,分别确定各区域对应的第一增强处理方式。According to each of the dynamic range values, the first enhancement processing mode corresponding to each region is determined respectively.
  13. 根据权利要求12所述的终端设备,其特征在于,所述各区域包含目标区域,所述动态范围值包括高曝动态范围值和低亮动态范围值,所述根据各所述直方图确定对应区域的动态范围值,包括:The terminal device according to claim 12, wherein each area includes a target area, the dynamic range value includes a high-exposure dynamic range value and a low-brightness dynamic range value, and the corresponding value is determined according to each of the histograms. The dynamic range value of the area, including:
    提取所述目标区域的峰值、平均值以及区域占比,所述区域占比用于指示高曝区域和低曝光区域的比值;Extracting the peak value, average value, and area proportion of the target area, where the area proportion is used to indicate the ratio of the high-exposure area and the low-exposure area;
    根据所述峰值、所述平均值以及所述区域占比,确定所述目标区域的所述高曝动态范围值和所述低亮动态范围值。The high-exposure dynamic range value and the low-brightness dynamic range value of the target area are determined according to the peak value, the average value, and the area proportion.
  14. 根据权利要求8~13任一项所述的终端设备,其特征在于,The terminal device according to any one of claims 8-13, wherein:
    所述原始视频是所述终端设备当前正在拍摄的视频;The original video is a video currently being shot by the terminal device;
    或者,or,
    所述原始视频所述终端设备本地的LDR视频。The original video is a local LDR video of the terminal device.
  15. 一种计算机存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得终端设备执行上述权利要求1~7任一项所述的方法。A computer storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions run on a terminal device, the terminal device executes the method according to any one of claims 1 to 7 .
  16. 一种包含指令的计算机程序产品,其特征在于,所述指令在终端设备上运行时,使得终端设备执行上述权利要求1~7任一项所述的方法。A computer program product containing instructions, characterized in that, when the instructions run on a terminal device, the terminal device executes the method according to any one of claims 1 to 7.
  17. 一种程序产品,其特征在于,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,通信装置的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得通信装置实施如权利要求1-7任意一项所述的方法。A program product, characterized in that the program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of a communication device can read the computer program from the readable storage medium The execution of the computer program by the at least one processor causes the communication device to implement the method according to any one of claims 1-7.
PCT/CN2020/110825 2019-08-30 2020-08-24 High dynamic range video generation method and device WO2021036991A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910817877.2 2019-08-30
CN201910817877.2A CN112449120B (en) 2019-08-30 2019-08-30 High dynamic range video generation method and device

Publications (1)

Publication Number Publication Date
WO2021036991A1 true WO2021036991A1 (en) 2021-03-04

Family

ID=74683752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/110825 WO2021036991A1 (en) 2019-08-30 2020-08-24 High dynamic range video generation method and device

Country Status (2)

Country Link
CN (1) CN112449120B (en)
WO (1) WO2021036991A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118850A (en) * 2022-06-22 2022-09-27 海信视像科技股份有限公司 Image processing method and display device
CN115293994A (en) * 2022-09-30 2022-11-04 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer equipment and storage medium
CN116095503A (en) * 2022-06-15 2023-05-09 荣耀终端有限公司 Terminal device and method for creating/displaying HDR image
WO2024011976A1 (en) * 2022-07-14 2024-01-18 荣耀终端有限公司 Method for expanding dynamic range of image and electronic device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114219744B (en) * 2021-11-25 2023-01-06 北京百度网讯科技有限公司 Image generation method, device, equipment and storage medium
CN116437222B (en) * 2021-12-29 2024-04-19 荣耀终端有限公司 Image processing method and electronic equipment
CN117651221A (en) * 2022-08-09 2024-03-05 荣耀终端有限公司 Video processing method and electronic equipment
CN115334260B (en) * 2022-08-17 2024-02-27 深圳市元视芯智能科技有限公司 Image sensor and pixel-level exposure control method
CN115242983B (en) * 2022-09-26 2023-04-07 荣耀终端有限公司 Photographing method, electronic device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335123A (en) * 2015-10-30 2016-02-17 天津大学 Method for displaying rich-layer HDR (High Dynamic Range) based on LCD (Liquid Crystal Display)
CN107292829A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 Image processing method and device
CN108074220A (en) * 2017-12-11 2018-05-25 上海顺久电子科技有限公司 A kind of processing method of image, device and television set
CN109544463A (en) * 2018-10-17 2019-03-29 天津大学 The inverse tone mapping (ITM) method of image content-based
US20190347776A1 (en) * 2018-05-08 2019-11-14 Altek Corporation Image processing method and image processing device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5880165B2 (en) * 2012-03-13 2016-03-08 株式会社Jvcケンウッド Video signal processing apparatus, video signal processing method, video signal processing program
CN103888689B (en) * 2014-03-13 2017-10-31 北京智谷睿拓技术服务有限公司 Image-pickup method and image collecting device
WO2018113975A1 (en) * 2016-12-22 2018-06-28 Huawei Technologies Co., Ltd. Generation of ghost-free high dynamic range images
CN107465882B (en) * 2017-09-22 2019-11-05 维沃移动通信有限公司 A kind of image capturing method and mobile terminal
CN107862671A (en) * 2017-12-11 2018-03-30 上海顺久电子科技有限公司 A kind of processing method of image, device and television set
CN108307109B (en) * 2018-01-16 2020-04-17 维沃移动通信有限公司 High dynamic range image preview method and terminal equipment
CN108495030A (en) * 2018-03-16 2018-09-04 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN108805883B (en) * 2018-06-08 2021-04-16 Oppo广东移动通信有限公司 Image segmentation method, image segmentation device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335123A (en) * 2015-10-30 2016-02-17 天津大学 Method for displaying rich-layer HDR (High Dynamic Range) based on LCD (Liquid Crystal Display)
CN107292829A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 Image processing method and device
CN108074220A (en) * 2017-12-11 2018-05-25 上海顺久电子科技有限公司 A kind of processing method of image, device and television set
US20190347776A1 (en) * 2018-05-08 2019-11-14 Altek Corporation Image processing method and image processing device
CN109544463A (en) * 2018-10-17 2019-03-29 天津大学 The inverse tone mapping (ITM) method of image content-based

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095503A (en) * 2022-06-15 2023-05-09 荣耀终端有限公司 Terminal device and method for creating/displaying HDR image
CN115118850A (en) * 2022-06-22 2022-09-27 海信视像科技股份有限公司 Image processing method and display device
CN115118850B (en) * 2022-06-22 2024-04-05 海信视像科技股份有限公司 Image processing method and display device
WO2024011976A1 (en) * 2022-07-14 2024-01-18 荣耀终端有限公司 Method for expanding dynamic range of image and electronic device
CN115293994A (en) * 2022-09-30 2022-11-04 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer equipment and storage medium
CN115293994B (en) * 2022-09-30 2022-12-16 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112449120A (en) 2021-03-05
CN112449120B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
WO2021036991A1 (en) High dynamic range video generation method and device
WO2021052232A1 (en) Time-lapse photography method and device
CN112150399B (en) Image enhancement method based on wide dynamic range and electronic equipment
KR102149187B1 (en) Electronic device and control method of the same
US20220319077A1 (en) Image-text fusion method and apparatus, and electronic device
WO2021037227A1 (en) Image processing method, electronic device and cloud server
EP3893495B1 (en) Method for selecting images based on continuous shooting and electronic device
CN111179282A (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN113810603B (en) Point light source image detection method and electronic equipment
US20220245778A1 (en) Image bloom processing method and apparatus, and storage medium
CN113179374A (en) Image processing method, mobile terminal and storage medium
US20240119566A1 (en) Image processing method and apparatus, and electronic device
WO2022266907A1 (en) Processing method, terminal device and storage medium
WO2023160295A1 (en) Video processing method and apparatus
WO2023160285A1 (en) Video processing method and apparatus
CN108616687B (en) Photographing method and device and mobile terminal
CN114429495A (en) Three-dimensional scene reconstruction method and electronic equipment
CN109547699A (en) A kind of method and device taken pictures
CN114143471B (en) Image processing method, system, mobile terminal and computer readable storage medium
CN115631250B (en) Image processing method and electronic equipment
CN113891008B (en) Exposure intensity adjusting method and related equipment
WO2022115996A1 (en) Image processing method and device
CN112188102A (en) Photographing method, mobile terminal and storage medium
WO2024082863A1 (en) Image processing method and electronic device
CN115705663B (en) Image processing method and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20857788

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20857788

Country of ref document: EP

Kind code of ref document: A1