A video image dynamic conversion method, device, electronic device and storage medium
By performing image framing, convolutional network feature extraction and attention mechanism information description on SDR images, the problem of poor conversion effect from SDR images to HDR images in traditional technology is solved, and a more natural dynamic range transformation effect is achieved.
Patent Information
- Application Number
- CN202111478511.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-12-06
AI Technical Summary
Traditional SDR image to HDR image reversal technology can easily lead to unreasonable brightness changes, resulting in unnatural shadows and exposure areas, affecting the conversion effect.
A video image dynamic conversion method is adopted to convert the SDR image into an HDR image through image frame-based, convolutional network feature extraction and attention mechanism information description, and stitching to realize dynamic range transformation.
The conversion effect of SDR images to HDR images is improved, unreasonable brightness changes are reduced, and the conversion effect is guaranteed.
Smart Images

Figure CN114372923B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a video image dynamic conversion method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the development of HDR (High Dynamic Range, HDR) related technologies, more and more video platforms and equipment manufacturers continue to promote the production and dissemination of HDR content. Traditional SDR (Standard Dynamic Range, SDR) video images cannot meet the modern people's requirements for the use of high dynamic range images, so the reverse conversion technology that converts SDR images into HDR images came into being.
[0003] At present, traditional inverse transformation technology uses fixed static functions or specific parameterized functions to directly map SDR images to HDR images. In practice, it is found that this method is prone to cause unreasonable brightness changes, unnatural shadows and exposure areas, which will affect the conversion effect of SDR images to HDR images. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a video image dynamic conversion method, device, electronic device and computer-readable storage medium, which can improve the conversion effect of SDR images to HDR images.
[0005] In a first aspect, the present invention provides a method for dynamic conversion of video images, comprising:
[0006] Acquire an SDR video to be converted, and perform image segmentation on the SDR video to obtain an SDR image;
[0007] Using the convolutional network in the trained image information recognition model to extract features from the SDR image, to obtain a feature image of the SDR image;
[0008] Describing the feature image using the attention mechanism in the image information recognition model to obtain description information of the feature image;
[0009] Convert the SDR image into an HDR image according to the description information;
[0010] The HDR images are stitched together to obtain an HDR video of the SDR video.
[0011] In a possible implementation manner of the first aspect, the step of performing image framing on the SDR video to obtain an SDR image includes:
[0012] Obtaining a total number of image frames of the SDR video, and dividing the SDR video into a plurality of frame images according to the total number of image frames and a preset frame time;
[0013] The format of each of the framed images is converted into a preset picture format to obtain an SDR image.
[0014] In a possible implementation of the first aspect, extracting features from the SDR image using a convolutional network in a trained image information recognition model to obtain a feature image of the SDR image includes:
[0015] Using the convolutional layer in the convolutional network to extract features from the SDR image, to obtain an initial feature image;
[0016] Performing pooling processing on the initial feature image using the pooling layer in the convolutional network to obtain a standard feature image;
[0017] The standard feature image is activated using the fully connected layer in the convolutional network to obtain the feature image of the SDR image.
[0018] In a possible implementation manner of the first aspect, the using the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image includes:
[0019] Using the encoder in the attention mechanism to identify the character position sequence of the feature image;
[0020] Using the decoder in the attention mechanism to recognize text information of the character position sequence;
[0021] According to the text information, the feedforward network in the attention mechanism is used to output the description information of the feature image.
[0022] In a possible implementation manner of the first aspect, the step of using an encoder in the attention mechanism to identify a character position sequence of the feature image includes:
[0023] Calculating the state value of the feature image using an input gate in the encoder;
[0024] Calculating the activation value of the feature image using the forget gate in the encoder;
[0025] Calculating a state update value of the feature image according to the state value and the activation value;
[0026] The character position sequence of the state update value is calculated using the output gate in the encoder.
[0027] In a possible implementation manner of the first aspect, the step of using a decoder in the attention mechanism to recognize text information of the character position sequence includes:
[0028] Using the mask layer in the decoder to perform character information masking on the character position sequence to obtain character information;
[0029] Calculating a text sequence of the character information using an attention module in the decoder;
[0030] The text information of the text sequence is recognized using a text recognition algorithm in the decoder.
[0031] In a possible implementation manner of the first aspect, converting the SDR image into an HDR image according to the description information includes:
[0032] Determining range transformation parameters of the SDR image according to the description information;
[0033] According to the range transformation parameters, the SDR image is converted into an HDR image using a preset image conversion tool.
[0034] In a second aspect, the present invention provides a video image dynamic conversion device, the device comprising:
[0035] An image framing module is used to obtain an SDR video to be converted, perform image framing on the SDR video, and obtain an SDR image;
[0036] A feature image extraction module, used to extract features of the SDR image using a convolutional network in a trained image information recognition model to obtain a feature image of the SDR image;
[0037] A description information recognition module, used to use the attention mechanism in the image information recognition model to describe the feature image to obtain description information of the feature image;
[0038] An image conversion module, used for converting the SDR image into an HDR image according to the description information;
[0039] The image stitching module is used to stitch the HDR images to obtain an HDR video of the SDR video.
[0040] In a third aspect, the present invention provides an electronic device, comprising:
[0041] at least one processor; and a memory communicatively coupled to the at least one processor;
[0042] The memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the video image dynamic conversion method as described in any one of the first aspects above.
[0043] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method for dynamic conversion of video images as described in any one of the first aspects above is implemented.
[0044] Compared with the prior art, the technical principle and beneficial effects of this solution are:
[0045] This solution first obtains an SDR image by performing image segmentation on the SDR video to be converted, so as to ensure the premise of converting the SDR video from the standard dynamic range to the high dynamic range; secondly, the embodiment of the present invention extracts features from the SDR image by using the convolutional network in the trained image information recognition model to obtain the feature image of the SDR image, and can obtain the feature image in the SDR image, thereby identifying the feature description information of the SDR image, and uses the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image, so as to obtain the information of the SDR image Description, thereby avoiding directly mapping the SDR image to a high dynamic range image through a static function or a specific parameterized function, and improving the conversion effect of the SDR image; further, the embodiment of the present invention converts the SDR image into an HDR image according to the description information, and splices the HDR image to obtain the HDR video of the SDR video, which can realize the mapping supervision of the SDR image during the dynamic range transformation, avoiding the direct conversion of the SDR image to the HDR image, thereby reducing the unreasonable brightness change phenomenon when the SDR image is converted to the HDR image, and ensuring the conversion effect of the SDR image. Therefore, a video image dynamic conversion method, device, electronic device and storage medium proposed in the embodiment of the present invention can improve the conversion effect of the SDR image. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 A schematic diagram of a flow chart of a method for dynamic conversion of video images provided by an embodiment of the present invention;
[0049] Figure 2 In one embodiment of the present invention Figure 1 A flowchart of one of the steps of a method for dynamic conversion of video images is provided;
[0050] Figure 3 In one embodiment of the present invention Figure 1 A schematic flow chart of another step of a method for dynamic conversion of video images is provided;
[0051] Figure 4 A schematic diagram of a module of a video image dynamic conversion device provided by an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the internal structure of an electronic device for implementing a method for dynamic conversion of video images provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0054] The embodiment of the present invention provides a method for dynamic conversion of video images, and the execution subject of the method for dynamic conversion of video images includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present invention. In other words, the method for dynamic conversion of video images can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0055] See also Figure 1 FIG. 1 is a flow chart of a method for dynamic conversion of video images provided by an embodiment of the present invention. Figure 1 The video image dynamic conversion method described in the invention comprises:
[0056] S1. Obtain an SDR video to be converted, and perform image segmentation on the SDR video to obtain an SDR image.
[0057] In an embodiment of the present invention, the SDR video refers to a video formed by a combination of SDR (Standard Dynamic Range) images. The SDR image can be understood as an image with an image variation range of 8 bits (0-255). For example, for a grayscale image, it can be divided into 256 images from black to white. Therefore, the embodiment of the present invention performs image framing on the SDR video to ensure the premise of converting the SDR video from a standard dynamic range to a high dynamic range.
[0058] As an embodiment of the present invention, the method of performing image framing on the SDR video to obtain an SDR image includes: obtaining the total number of image frames of the SDR video, dividing the SDR video into a plurality of frame images according to the total number of image frames and a preset frame time, and converting the format of each of the frame images into a preset picture format to obtain an SDR image.
[0059] Among them, the total number of image frames is obtained by querying the video properties of the SDR video, the preset frame time can be set to 0.5S, or can be set according to the actual business scenario, and the preset picture format includes jpg, png and other formats.
[0060] S2. Use the convolutional network in the trained image information recognition model to extract features of the SDR image to obtain a feature image of the SDR image.
[0061] In an embodiment of the present invention, the image information recognition model is used to identify the image description information of the SDR image when performing high dynamic range conversion, thereby realizing the dynamic conversion premise of the SDR image, wherein the image information recognition model includes a convolutional network and an attention mechanism, wherein the convolutional network includes a convolutional neural network (CNN), which is used to extract feature images from the SDR image to identify high-dimensional features of the SDR image, and the attention mechanism includes a self-attention mechanism (self-attention), which is used to generate image description information of the feature image.
[0062] Furthermore, the embodiment of the present invention performs feature extraction on the SDR image by utilizing a convolutional network in a trained image information recognition model to obtain a feature image in the SDR image, thereby identifying feature description information of the SDR image.
[0063] As an embodiment of the present invention, see Figure 2 As shown, the convolutional network in the trained image information recognition model is used to extract features from the SDR image to obtain a feature image of the SDR image, including:
[0064] S201, extracting features from the SDR image using the convolutional layer in the convolutional network to obtain an initial feature image;
[0065] S202, performing pooling processing on the initial feature image by using the pooling layer in the convolutional network to obtain a standard feature image;
[0066] S203. Activate the standard feature image using the fully connected layer in the convolutional network to obtain a feature image of the SDR image.
[0067] Among them, the feature extraction of the SDR image is realized by the convolution kernel in the convolution layer, the pooling processing of the initial feature image is realized by the pooling algorithm in the pooling layer, such as mean pooling, maximum pooling and other algorithms, and the activation of the standard feature image is realized by the activation function in the fully connected layer.
[0068] Furthermore, in an optional embodiment of the present invention, the standard feature image is activated using the following formula:
[0069]
[0070] Among them, S′ i represents the feature image, and s represents the standard feature image.
[0071] S3. Utilize the attention mechanism in the image information recognition model to describe the feature image to obtain description information of the feature image.
[0072] The embodiment of the present invention can obtain the information description of the SDR image by utilizing the attention mechanism in the image information recognition model to describe the feature image, thereby avoiding directly mapping the SDR image to a high dynamic range image through a static function or a specific parameterized function, thereby improving the conversion effect of the SDR image.
[0073] As an embodiment of the present invention, see Figure 3 As shown, the use of the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image includes:
[0074] S301, using the encoder in the attention mechanism to identify the character position sequence of the feature image;
[0075] S302, using the decoder in the attention mechanism to recognize text information of the character position sequence;
[0076] S303: Based on the text information, use the feedforward network in the attention mechanism to output description information of the feature image.
[0077] The encoder is used to compress the feature image into a latent space representation, thereby extracting a character position sequence of the feature image, and the decoder is used to decode text information of the character position sequence.
[0078] Furthermore, in an optional embodiment of the present invention, the use of the encoder in the attention mechanism to identify the character position sequence of the feature image includes: using the input gate in the encoder to calculate the state value of the feature image; using the forgetting gate in the encoder to calculate the activation value of the feature image; calculating the state update value of the feature image based on the state value and the activation value; and using the output gate in the encoder to calculate the character position sequence of the state update value.
[0079] Furthermore, in another optional embodiment of the present invention, the state value of the feature image is calculated using the following formula:
[0080]
[0081] Among them, i t Indicates the status value. represents the bias of the cell in the input gate, w i represents the activation factor of the input gate, h t-1 represents the peak value of the feature image at the input gate t-1, x t represents the feature image at time t, b i Represents the weight of the cell in the input gate.
[0082] Furthermore, in another optional embodiment of the present invention, the activation value of the feature image is calculated using the following formula:
[0083]
[0084] Among them, f t represents the activation value, represents the bias of the cell in the forget gate, w f represents the activation factor of the forget gate, represents the peak value of the feature image at the forget gate t-1, x t represents the feature image input at time t, b f Represents the weight of the cell in the forget gate.
[0085] Furthermore, in another optional embodiment of the present invention, the state update value is calculated using the following formula:
[0086]
[0087] Among them, c t Indicates the state update value, h t-1 represents the peak value of the feature image at the input gate t-1, Represents the peak value of the feature image at the forget gate t-1.
[0088] Furthermore, in yet another optional embodiment of the present invention, the character position sequence of the state update value is calculated using the following formula:
[0089] o t =tan h (c t )
[0090] Among them, t represents the character position sequence, tan h represents the activation function of the output gate, c t Indicates the status update value.
[0091] Furthermore, in an optional embodiment of the present invention, the use of the decoder in the attention mechanism to identify the text information of the character position sequence includes: using the mask layer in the decoder to mask the character position sequence to obtain character information; using the attention module in the decoder to calculate the text sequence of the character information; and using the text recognition algorithm in the decoder to identify the text information of the text sequence.
[0092] The character information mask refers to length sequence alignment of the vectors of the character position sequence and information masking of the context vector to reconstruct the text sequence of the character position sequence, and the text recognition algorithm includes a beam search algorithm.
[0093] S4. Convert the SDR image into an HDR image according to the description information.
[0094] It should be understood that the description information includes the image feature information of the SDR image. Therefore, the embodiment of the present invention converts the SDR image into an HDR image according to the description information to achieve mapping supervision of the SDR image during dynamic range transformation, thereby avoiding direct conversion of the SDR image to the HDR image, thereby reducing unreasonable brightness changes when the SDR image is converted to the HDR image, and improving the conversion effect of the SDR image. The HDR image can be understood as an image with an image change range of 10 bits (0-1023). For example, for a grayscale image, it can be divided into 1024 images from black to white.
[0095] As an embodiment of the present invention, converting the SDR image into an HDR image according to the description information includes: determining a range transformation parameter of the SDR image according to the description information, and converting the SDR image into an HDR image using a preset image conversion tool according to the range transformation parameter.
[0096] The range transformation parameters include color, brightness, exposure, etc., and the preset image conversion tools include tools such as DaVinci software, Wonder Look Pro software, and Premiere Pro.
[0097] S5. Stitching the HDR images to obtain an HDR video of the SDR video.
[0098] In the embodiment of the present invention, the HDR images are spliced to obtain an HDR video of the SDR video.
[0099] As an embodiment of the present invention, the HDR images are spliced in a preset order to obtain an HDR video of the SDR video, including: identifying the splicing order and splicing time of the HDR images, and according to the splicing order and the splicing time, using a preset video synthesis tool to splice the HDR images to obtain the HDR video of the SDR video.
[0100] Among them, the splicing order and splicing time are determined based on the framing order and framing time of the SDR video when the image is framed, that is, the splicing order and splicing time of the HDR image are determined according to the framing position and framing time of the HDR image when the image is framed, and the preset video synthesis tools include image master, movie maker and other tools.
[0101] It can be seen that the embodiment of the present invention first obtains an SDR image by performing image segmentation on the SDR video to be converted, so as to ensure the premise of converting the SDR video from the standard dynamic range to the high dynamic range; secondly, the embodiment of the present invention extracts features from the SDR image by using the convolutional network in the trained image information recognition model to obtain the feature image of the SDR image, and can obtain the feature image in the SDR image, thereby identifying the feature description information of the SDR image, and uses the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image, and can obtain the SDR image The information description of the image can avoid directly mapping the SDR image to the high dynamic range image through a static function or a specific parameterized function, thereby improving the conversion effect of the SDR image; further, the embodiment of the present invention converts the SDR image into an HDR image according to the description information, and splices the HDR image to obtain the HDR video of the SDR video, which can realize the mapping supervision of the SDR image during the dynamic range transformation, avoid the direct conversion of the SDR image to the HDR image, thereby reducing the unreasonable brightness change phenomenon when the SDR image is converted to the HDR image, and ensuring the conversion effect of the SDR image. Therefore, a video image dynamic conversion method proposed in an embodiment of the present invention can improve the conversion effect of the SDR image.
[0102] like Figure 4 The figure shows a functional module diagram of the video image dynamic conversion device of the present invention.
[0103] The video image dynamic conversion device 400 of the present invention can be installed in an electronic device. According to the functions to be implemented, the video image dynamic conversion device can include an image framing module 401, a feature image extraction module 402, a description information recognition module 403, an image conversion model 404, and an image stitching module 405. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0104] In the embodiment of the present invention, the functions of each module / unit are as follows:
[0105] The image framing module 401 is used to obtain an SDR video to be converted, perform image framing on the SDR video, and obtain an SDR image;
[0106] The feature image extraction module 402 is used to extract features of the SDR image using the convolutional network in the trained image information recognition model to obtain a feature image of the SDR image;
[0107] The description information recognition module 403 is used to describe the feature image using the attention mechanism in the image information recognition model to obtain the description information of the feature image;
[0108] The image conversion module 404 is used to convert the SDR image into an HDR image according to the description information;
[0109] The image stitching module 405 is used to stitch the HDR images to obtain an HDR video of the SDR video.
[0110] In detail, the modules in the video image dynamic conversion device 400 in the embodiment of the present invention are used in the same manner as described above. Figures 1 to 3 The same technical means as the video image dynamic conversion method described in and can produce the same technical effects are used, which will not be repeated here.
[0111] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing the method for dynamic conversion of video images according to the present invention.
[0112] The electronic device may include a processor 50, a memory 51, a communication bus 52 and a communication interface 53, and may also include a computer program stored in the memory 51 and executable on the processor 50, such as a video image dynamic conversion program.
[0113] In some embodiments, the processor 50 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 50 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 51 (for example, executing a video image dynamic conversion program, etc.), and calls data stored in the memory 51 to execute various functions of the electronic device and process data.
[0114] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 51 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 51 can also include both an internal storage unit of the electronic device and an external storage device. The memory 51 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a video image dynamic conversion program, but also can be used to temporarily store data that has been output or is to be output.
[0115] The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 51 and at least one processor 50, etc.
[0116] The communication interface 53 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0117] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0118] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 50 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0119] It should be understood that the embodiment is for illustrative purposes only and the scope of the patent invention is not limited to this structure.
[0120] The video image dynamic conversion program stored in the memory 51 in the electronic device is a combination of multiple computer programs. When running in the processor 50, it can achieve:
[0121] Acquire an SDR video to be converted, and perform image segmentation on the SDR video to obtain an SDR image;
[0122] Using the convolutional network in the trained image information recognition model to extract features from the SDR image, to obtain a feature image of the SDR image;
[0123] Describing the feature image using the attention mechanism in the image information recognition model to obtain description information of the feature image;
[0124] Convert the SDR image into an HDR image according to the description information;
[0125] The HDR images are stitched together to obtain an HDR video of the SDR video.
[0126] Specifically, the specific implementation method of the processor 50 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0127] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0128] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0129] Acquire an SDR video to be converted, and perform image segmentation on the SDR video to obtain an SDR image;
[0130] Using the convolutional network in the trained image information recognition model to extract features from the SDR image, to obtain a feature image of the SDR image;
[0131] Describing the feature image using the attention mechanism in the image information recognition model to obtain description information of the feature image;
[0132] Convert the SDR image into an HDR image according to the description information;
[0133] The HDR images are stitched together to obtain an HDR video of the SDR video.
[0134] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0135] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0137] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0138] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0139] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0140] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for dynamic conversion of video images, characterized in that: The method comprises: Acquire an SDR video to be converted, and perform image segmentation on the SDR video to obtain an SDR image; Using the convolutional network in the trained image information recognition model to extract features from the SDR image, to obtain a feature image of the SDR image; Describing the feature image using the attention mechanism in the image information recognition model to obtain description information of the feature image; Convert the SDR image into an HDR image according to the description information; Stitching the HDR images to obtain an HDR video of the SDR video; The step of performing image framing on the SDR video to obtain an SDR image includes: obtaining a total number of image frames of the SDR video, and dividing the SDR video into a plurality of framed images according to the total number of image frames and a preset frame time; converting the format of each of the framed images into a preset picture format to obtain an SDR image; the total number of image frames is obtained by querying a video attribute of the SDR video; The step of using the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image comprises: using the encoder in the attention mechanism to identify the character position sequence of the feature image; using the decoder in the attention mechanism to identify the text information of the character position sequence; and using the feedforward network in the attention mechanism to output the description information of the feature image according to the text information; The encoder is used to compress the feature image into a latent space representation so as to extract the character position sequence of the feature image; the decoder is used to decode the text information of the character position sequence; The image information recognition model includes a convolutional network and an attention mechanism, wherein the convolutional network includes a convolutional neural network, which is used to extract a feature image in the SDR image to identify high-dimensional features of the SDR image; the attention mechanism includes a self-attention mechanism, which is used to generate image description information of the feature image; The method of using the decoder in the attention mechanism to identify the text information of the character position sequence includes: using the mask layer in the decoder to perform character information masking on the character position sequence to obtain character information; using the attention module in the decoder to calculate the text sequence of the character information; and using the text recognition algorithm in the decoder to identify the text information of the text sequence. The character information masking refers to performing length sequence alignment on the vectors of the character position sequence and information masking of the context vector to reconstruct the text sequence of the character position sequence, and the text recognition algorithm includes a beam search algorithm; The converting the SDR image into the HDR image according to the description information comprises: determining a range transformation parameter of the SDR image according to the description information; converting the SDR image into the HDR image using a preset image conversion tool according to the range transformation parameter; the range transformation parameter comprises color, brightness and exposure; The step of splicing the HDR images in a preset order to obtain the HDR video of the SDR video includes: identifying a splicing order and a splicing time of the HDR images, and splicing the HDR images according to the splicing order and the splicing time using a preset video synthesis tool to obtain the HDR video of the SDR video; The splicing order and splicing time are determined based on the framing order and framing time of the SDR video when the image is framed, that is, the splicing order and splicing time of the HDR image are determined according to the framing position and framing time of the HDR image when the image is framed.
2. The method according to claim 1, characterized in that The step of extracting features of the SDR image using the convolutional network in the trained image information recognition model to obtain a feature image of the SDR image includes: Using the convolutional layer in the convolutional network to extract features from the SDR image, to obtain an initial feature image; Performing pooling processing on the initial feature image using the pooling layer in the convolutional network to obtain a standard feature image; The standard feature image is activated using the fully connected layer in the convolutional network to obtain the feature image of the SDR image.
3. The method according to claim 2, characterized in that The step of using the encoder in the attention mechanism to identify the character position sequence of the feature image includes: Calculating the state value of the feature image using an input gate in the encoder; Calculating the activation value of the feature image using a forget gate in the encoder; Calculating a state update value of the feature image according to the state value and the activation value; The character position sequence of the state update value is calculated using the output gate in the encoder.
4. A video image dynamic conversion device, characterized in that: The device comprises: An image framing module is used to obtain an SDR video to be converted, perform image framing on the SDR video, and obtain an SDR image; A feature image extraction module, used to extract features of the SDR image using a convolutional network in a trained image information recognition model to obtain a feature image of the SDR image; A description information recognition module, used to use the attention mechanism in the image information recognition model to describe the feature image to obtain description information of the feature image; An image conversion module, used for converting the SDR image into an HDR image according to the description information; An image stitching module, used for stitching the HDR images to obtain an HDR video of the SDR video; The step of performing image framing on the SDR video to obtain an SDR image includes: obtaining a total number of image frames of the SDR video, and dividing the SDR video into a plurality of framed images according to the total number of image frames and a preset frame time; converting the format of each of the framed images into a preset picture format to obtain an SDR image; the total number of image frames is obtained by querying a video attribute of the SDR video; The step of using the attention mechanism in the image information recognition model to describe the feature image to obtain the description information of the feature image comprises: using the encoder in the attention mechanism to identify the character position sequence of the feature image; using the decoder in the attention mechanism to identify the text information of the character position sequence; and using the feedforward network in the attention mechanism to output the description information of the feature image according to the text information; The encoder is used to compress the feature image into a latent space representation so as to extract the character position sequence of the feature image; the decoder is used to decode the text information of the character position sequence; The image information recognition model includes a convolutional network and an attention mechanism, wherein the convolutional network includes a convolutional neural network, which is used to extract a feature image in the SDR image to identify high-dimensional features of the SDR image; the attention mechanism includes a self-attention mechanism, which is used to generate image description information of the feature image; The method of using the decoder in the attention mechanism to identify the text information of the character position sequence includes: using the mask layer in the decoder to perform character information masking on the character position sequence to obtain character information; using the attention module in the decoder to calculate the text sequence of the character information; and using the text recognition algorithm in the decoder to identify the text information of the text sequence. The character information masking refers to performing length sequence alignment on the vectors of the character position sequence and information masking of the context vector to reconstruct the text sequence of the character position sequence, and the text recognition algorithm includes a beam search algorithm; The converting the SDR image into the HDR image according to the description information comprises: determining a range transformation parameter of the SDR image according to the description information; converting the SDR image into the HDR image using a preset image conversion tool according to the range transformation parameter; the range transformation parameter comprises color, brightness and exposure; The step of splicing the HDR images in a preset order to obtain the HDR video of the SDR video includes: identifying a splicing order and a splicing time of the HDR images, and splicing the HDR images according to the splicing order and the splicing time using a preset video synthesis tool to obtain the HDR video of the SDR video; The splicing order and splicing time are determined based on the framing order and framing time of the SDR video when the image is framed, that is, the splicing order and splicing time of the HDR image are determined according to the framing position and framing time of the HDR image when the image is framed.
5. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video image dynamic conversion method as described in any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for dynamic conversion of video images as claimed in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Target object position detection method and device based on video stream, equipment and medium
CN112137591A
High dynamic range video generation method and device
CN112449120A
Character recognition system based on Gabor convolution and linear sparse attention
CN113221874A
Image format conversion method and device, equipment, storage medium and program product
CN113487524A