CN110992251B - Logo replacing method and device in video and electronic equipment - Google Patents

Logo replacing method and device in video and electronic equipment Download PDF

Info

Publication number
CN110992251B
CN110992251B CN201911203376.1A CN201911203376A CN110992251B CN 110992251 B CN110992251 B CN 110992251B CN 201911203376 A CN201911203376 A CN 201911203376A CN 110992251 B CN110992251 B CN 110992251B
Authority
CN
China
Prior art keywords
logo
image
original
target
background image
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911203376.1A
Other languages
Chinese (zh)
Other versions
CN110992251A (en
Inventor
李果
张玉梅
张文杰
贺沁雯
樊鸿飞
蔡媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911203376.1A priority Critical patent/CN110992251B/en
Publication of CN110992251A publication Critical patent/CN110992251A/en
Application granted granted Critical
Publication of CN110992251B publication Critical patent/CN110992251B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a logo replacing method and device in video and electronic equipment. The method comprises the following steps: determining image information of an original logo image in a video frame, wherein the image information comprises original logo characters and an original logo background image; replacing the original logo background image with a target logo background image; according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted; and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame. According to the embodiment of the invention, automatic replacement of logo in the video can be realized, the labor cost is saved, and the efficiency is effectively improved.

Description

Logo replacing method and device in video and electronic equipment
Technical Field
The present invention relates to the field of video processing technology, and more particularly, to a logo replacing method in video, a logo replacing device in video, an electronic device, and a computer readable storage medium.
Background
Currently, users often choose to watch video for leisure time. Therefore, embedding advertising logo of commodity or brand in video becomes an effective means for improving exposure rate for merchants. Adding or replacing logo in video typically requires manual handling by a worker. This approach is inefficient and labor-intensive. Therefore, there is a need to provide a new method to implement the replacement of logo in video.
Disclosure of Invention
An object of the embodiment of the invention is to provide a new technical scheme for logo replacement.
According to a first aspect of the present invention, there is provided a logo replacing method in video, comprising:
determining image information of an original logo image in a video frame, wherein the image information comprises original logo characters and original logo background images;
replacing the original logo background image with a target logo background image;
according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted;
and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame.
Optionally, the replacing the original logo background image with the target logo background image includes:
converting the formats of the original logo background image and the target logo background image into YUV formats to obtain YUV values of the original logo image and YUV values of the target logo image respectively;
and replacing the UV value of the original logo image with the UV value of the target logo image so as to replace the original logo background image with the target logo background image.
Optionally, before replacing the original logo background image with the target logo background image, the method further includes:
discarding image information corresponding to the area where the original logo characters are located;
and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
Optionally, the adjusting the gesture of the target logo text to be added according to the gesture of the original logo text includes:
and adjusting the gesture of the target logo character to be added according to the gesture of the original logo character through an affine transformation algorithm.
Optionally, the method further comprises:
and performing edge antialiasing treatment on the target logo image through an antialiasing algorithm.
According to a second aspect of an embodiment of the present invention, there is provided a logo replacing device in video, the device including:
the determining module is used for determining image information of an original logo image in a video frame, wherein the logo image information comprises original logo characters and original logo background images;
the replacing module is used for replacing the original logo background image with a target logo background image;
the adjusting module is used for adjusting the gesture of the target logo word to be added according to the gesture of the original logo word;
and the adding module is used for adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame.
Optionally, the replacing module is specifically configured to:
converting the formats of the original logo background image and the target logo background image into YUV formats to obtain YUV values of the original logo image and YUV values of the target logo image respectively;
and replacing the UV value of the original logo image with the UV value of the target logo image so as to replace the original logo background image with the target logo background image.
Optionally, the apparatus further comprises: the restoration module is used for discarding the image information corresponding to the area where the original logo characters are located; and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
According to a third aspect of an embodiment of the present invention, there is further provided an electronic device including a logo replacing device in video according to any one of the second aspect of the embodiment of the present invention, or the electronic device includes:
a memory for storing executable commands;
and the processor is used for executing the logo replacing method in the video according to any one of the first aspect of the embodiment of the invention under the control of the executable command.
According to a fourth aspect of embodiments of the present invention, there is also provided a computer readable storage medium storing executable instructions that, when executed by a processor, perform a logo replacement method in video as set forth in any one of the first aspects of embodiments of the present invention.
According to one embodiment of the invention, by determining the image information of an original logo image in a video frame, the logo image information comprises original logo characters and original logo background images; replacing the original logo background image with a target logo background image; according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted; and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame. Automatic replacement of logo in video can be achieved, labor cost is saved, and efficiency is effectively improved.
Other features of the present invention and its advantages will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic diagram of an electronic device to which a logo replacement method in video according to an embodiment of the present invention can be applied;
FIG. 2 is a flow chart of a logo replacement method in video according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an original logo image according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the effect of repairing the color of the region where the original logo text is located according to the method of the embodiment of the invention;
FIG. 5 is a schematic view of the effect of completing color replacement of logo background images according to the method of the embodiment of the invention;
FIG. 6 is a schematic view of the effect of a target logo image obtained by the method according to the embodiment of the invention;
FIG. 7 is a schematic view of the effect of a target logo image after antialiasing according to a method in an embodiment of the invention;
FIG. 8 is a schematic diagram of a logo replacement device in video according to an embodiment of the present invention;
fig. 9 is a schematic structural view of an electronic device according to an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to persons of ordinary skill in the relevant art may not be discussed in detail, but should be considered part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
< hardware configuration >
Fig. 1 is a schematic structural diagram of an electronic device to which a logo replacing method in video according to an embodiment of the present invention can be applied.
As shown in fig. 1, the electronic device 1000 of the present embodiment the electronic device 1000 may include a processor 1010, a memory 1020, an interface device 1030, a communication device 1040, a display device 1050, an input device 1060, a speaker 1070, a microphone 1080, and the like.
The processor 1010 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1020 includes, for example, ROM (read only memory), RAM (random access memory), nonvolatile memory such as a hard disk, and the like. The interface device 1030 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1040 can perform wired or wireless communication, for example. The display device 1050 is, for example, a liquid crystal display, a touch display, or the like. The input device 1060 may include, for example, a touch screen, a keyboard, and the like.
The electronic device 1000 may output audio information through the speaker 1070. The electronic device 1000 may pick up voice information input by a user through the microphone 1080.
In this embodiment, the electronic device 1000 determines image information of an original logo image in a video frame, where the logo image information includes an original logo text and an original logo background image; replacing the original logo background image with a target logo background image; according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted; and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame.
In this embodiment, the memory 1020 of the electronic device 1000 is configured to store instructions for controlling the processor 1010 to operate in support of implementing the logo replacement method in video according to any embodiment of the present invention. The skilled person can design instructions according to the disclosed solution according to an embodiment of the invention. How the instructions control the processor to operate is well known in the art and will not be described in detail here.
It will be appreciated by those skilled in the art that although a plurality of devices of the electronic device 1000 are shown in fig. 1, the electronic device 1000 of an embodiment of the present invention may involve only some of the devices thereof, for example, only the processor 1010, the memory 1020, the display device 1050, the input device 1060, and the like.
< method example >
The present embodiment provides a logo replacing method in video, which may be implemented by an electronic device, for example, the electronic device 1000 shown in fig. 1.
As shown in fig. 2, the method includes the following steps 2100-2400:
in step 2100, image information of an original logo image in a video frame is determined, the image information including original logo text and an original logo background image.
Before this step, the electronic device 1000 needs to identify at least one text region from the video frame, and perform clustering processing on the pixel points in the extension region corresponding to each text region, so as to obtain a clustering result; then, determining a to-be-determined logo area corresponding to each text area according to the clustering result, wherein the to-be-determined logo area comprises the corresponding text area; after the undetermined logo area is determined, marking the undetermined logo area meeting the preset condition as a target logo area in the video frame. The target logo area contains the image information of the original logo image.
Specifically, the original logo text includes information such as an area and a gesture of the original logo text. The original logo background image may include information such as a region and a background color of the original logo background image.
In one example, to preserve information such as illumination and shading in the original logo image, the electronic device 1000 may discard the image information corresponding to the area where the original logo text is located in the image information before replacing the original logo background image with the target logo background image, and directly adjust the color of the area where the original logo text is located to the color of the area where the original logo background image is located.
In another example, in order to preserve information such as illumination and shadow in the original logo image, the electronic device 1000 may discard image information corresponding to an area where the original logo text is located in the image information before replacing the original logo background image with the target logo background image; and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
For example, the image inpainting algorithm may be an inpainting algorithm, mainly comprising deep learning, and complementing the missing area of the image to be repaired according to the image itself or the image library information, wherein the repaired image looks very natural. After discarding the image information corresponding to the area where the original logo text is located in the original logo image, changing the color of the area where the original logo text is located into a first color through an inpaint algorithm, wherein the first color is the color of the area where the original logo background image is located, as shown in fig. 4.
After determining the original logo text and the original logo background image, the electronic device 1000 enters:
step 2200, replacing the original logo background image with the target logo background image.
In this embodiment, in order to preserve brightness information in the original logo image, the original logo background image and the target logo background image need to be converted into YUV format for representation.
YUV is also a representation of color, like RGB, where "Y" represents brightness, i.e., gray values, and "U" and "V" represent chromaticity, which are used to describe color and saturation. Thus, in this step, only the UV value is replaced, the Y value remains unchanged.
Specifically, after converting the formats of the original logo background image and the target logo background image into YUV formats, the electronic device 1000 obtains YUV values of the original logo image and YUV values of the target logo image respectively; and replacing the UV value of the original logo image with the UV value of the target logo image, so that the operation of replacing the original logo background image with the target logo background image is completed.
As shown in fig. 5, after converting the formats of the original logo background image and the target logo background image into YUV format, replacing the UV value of the original logo image with the UV value of the target logo image, so as to complete the replacement operation of the colors of the original logo background image and the target logo background image.
Step 2300, adjusting the gesture of the target logo word to be added according to the gesture of the original logo word.
Affine transformation algorithms are capable of preserving the "flatness" of the image, including rotation, scaling, translation, miscut operations. In general, correction of a distorted image by an affine transformation algorithm requires taking the coordinates of a set of 3 points of the distorted image and the coordinates of a set of 3 points of the target image, from which a transformation matrix of 2*3 size for perspective transformation can be calculated.
In this step, the electronic device 1000 may adjust the gesture of the target logo text to be added through an affine transformation algorithm, that is, obtain the coordinates of a group of 3 points of the original logo text and the coordinates of a group of 3 points of the target logo text to be added, calculate a transformation matrix through the two groups of coordinate points, and complete the adjustment of the gesture of the target logo text to be added.
And 2400, adding the target logo characters after the gesture adjustment to the logo background image to obtain a transformed target logo image in the video frame.
For example, the electronic device 1000 can add the target logo text after the gesture adjustment to the center of the logo background image, as shown in fig. 6. Or, the target logo text after the gesture adjustment can be added to the appointed position of the logo background image. The present embodiment is not particularly limited thereto.
In practical application, due to the restriction of resolution, the image edge always presents more or less triangular saw teeth, and anti-saw teeth refer to objects which are subjected to softening treatment on the image edge, so that the image edge looks smoother and is closer to a real object. It is a method for improving the image quality to make it soft.
Thus, the method of the present embodiment may further include: and performing edge antialiasing processing on the target logo image through an antialiasing algorithm. As shown in fig. 7, the edge of the target logo image after being processed by the antialiasing algorithm is smoother.
The logo replacing method in the video of the embodiment has been described above with reference to the accompanying drawings, in this embodiment, by determining the image information of the original logo image in the video frame, the logo image information includes the original logo text and the original logo background image; replacing the original logo background image with a target logo background image; according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted; and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame. Automatic replacement of logo in video can be achieved, labor cost is saved, and efficiency is effectively improved.
< device example >
The present embodiment provides a logo replacing device in video, for example, a logo replacing device 8000 in video shown in fig. 8.
As shown in fig. 8, the logo replacing apparatus 8000 in video includes a determining module 8100, a replacing module 8200, an adjusting module 8300 and an adding module 8400.
The determining module 8100 is configured to determine image information of an original logo image in a video frame, where the logo image information includes an original logo text and an original logo background image.
The replacing module 8200 is configured to replace the original logo background image with the target logo background image.
The adjustment module 8300 is configured to adjust the gesture of the target logo text to be added according to the gesture of the original logo text.
The adding module 8400 is configured to add the target logo text after the gesture adjustment to the logo background image, so as to obtain a transformed target logo image in the video frame.
In one embodiment, the replacement module 8200 is specifically configured to: converting the formats of the original logo background image and the target logo background image into YUV formats to obtain YUV values of the original logo image and YUV values of the target logo image respectively; and replacing the UV value of the original logo image with the UV value of the target logo image so as to replace the original logo background image with the target logo background image.
Optionally, the device may further include a repair module, configured to discard image information corresponding to an area where the original logo text is located; and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
In one embodiment, the adjusting module 8300 may be specifically configured to adjust the pose of the target logo text to be added according to the pose of the original logo text by using an affine transformation algorithm.
Optionally, the apparatus may further comprise an antialiasing processing module, configured to perform edge antialiasing processing on the target logo image through an antialiasing algorithm.
The logo replacing device in the video of the embodiment can be used for executing the technical scheme of the method embodiment, and the implementation principle and the technical effect are similar, and are not repeated here.
< device example >
In this embodiment, an electronic device is further provided, where the electronic device includes a logo replacing device 8000 in video described in the embodiment of the device of the present invention; alternatively, the electronic device is an electronic device 9000 shown in fig. 9, including:
memory 9100 for storing executable commands.
Processor 9200 for executing the method described in any of the method embodiments of the present invention under the control of executable commands stored in memory 9100.
The implementation subject of the electronic device according to the executed method embodiment may be a server or a terminal device.
< computer-readable storage Medium embodiment >
This embodiment provides a computer readable storage medium having stored therein executable commands which, when executed by a processor, perform the method described in any of the method embodiments of the present invention.
The present invention may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A method for logo replacement in video, the method comprising:
identifying at least one text region in a video frame, and respectively clustering pixel points in an expansion region corresponding to each text region to obtain a clustering result; determining a to-be-determined logo area corresponding to each text area according to a clustering result, wherein the to-be-determined logo area comprises a corresponding text area; after determining the undetermined logo area, marking the undetermined logo area meeting the preset condition as a target logo area in the video frame; the target logo region comprises image information of an original logo image;
determining image information of an original logo image in a video frame, wherein the image information comprises original logo characters and original logo background images;
replacing the original logo background image with a target logo background image;
according to the gesture of the original logo characters, the gesture of the target logo characters to be added is adjusted;
and adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame.
2. The method of claim 1, wherein said replacing the original logo background image with a target logo background image comprises:
converting the formats of the original logo background image and the target logo background image into YUV formats to obtain YUV values of the original logo image and YUV values of the target logo image respectively;
and replacing the UV value of the original logo image with the UV value of the target logo image so as to replace the original logo background image with the target logo background image.
3. The method of claim 2, wherein the replacing the original logo background image with the target logo background image is preceded by:
discarding image information corresponding to the area where the original logo characters are located;
and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
4. The method of claim 1, wherein the adjusting the pose of the target logo text to be added according to the pose of the original logo text comprises:
and adjusting the gesture of the target logo character to be added according to the gesture of the original logo character through an affine transformation algorithm.
5. The method according to claim 1, wherein the method further comprises:
and performing edge antialiasing treatment on the target logo image through an antialiasing algorithm.
6. A logo replacement device in video, the device comprising:
the determining module is used for identifying at least one text region in the video frame, and respectively clustering pixel points in the expansion region corresponding to each text region to obtain a clustering result; determining a to-be-determined logo area corresponding to each text area according to a clustering result, wherein the to-be-determined logo area comprises a corresponding text area; after determining the undetermined logo area, marking the undetermined logo area meeting the preset condition as a target logo area in the video frame; the target logo region comprises image information of an original logo image;
determining image information of an original logo image in a video frame, wherein the image information comprises original logo characters and original logo background images;
the replacing module is used for replacing the original logo background image with a target logo background image;
the adjusting module is used for adjusting the gesture of the target logo word to be added according to the gesture of the original logo word;
and the adding module is used for adding the target logo characters after the gesture adjustment to the logo background image to obtain a target logo image after transformation in the video frame.
7. The apparatus of claim 6, wherein the replacement module is specifically configured to:
converting the formats of the original logo background image and the target logo background image into YUV formats to obtain YUV values of the original logo image and YUV values of the target logo image respectively;
and replacing the UV value of the original logo image with the UV value of the target logo image so as to replace the original logo background image with the target logo background image.
8. The apparatus of claim 7, wherein the apparatus further comprises: the restoration module is used for discarding the image information corresponding to the area where the original logo characters are located; and changing the color of the area where the original logo characters are located into a first color through an image patching algorithm, wherein the first color is the color of the area where the original logo background image is located.
9. An electronic device comprising the logo replacement apparatus in video as claimed in any one of claims 6-8, or the electronic device comprising:
a memory for storing executable commands;
a processor for executing the logo replacement method in video according to any one of claims 1-5 under the control of the executable command.
10. A computer readable storage medium storing executable instructions which, when executed by a processor, perform the in-video logo replacement method as claimed in any one of claims 1-5.
CN201911203376.1A 2019-11-29 2019-11-29 Logo replacing method and device in video and electronic equipment Active CN110992251B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911203376.1A CN110992251B (en) 2019-11-29 2019-11-29 Logo replacing method and device in video and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911203376.1A CN110992251B (en) 2019-11-29 2019-11-29 Logo replacing method and device in video and electronic equipment

Publications (2)

Publication Number Publication Date
CN110992251A CN110992251A (en) 2020-04-10
CN110992251B true CN110992251B (en) 2023-11-10

Family

ID=70088515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911203376.1A Active CN110992251B (en) 2019-11-29 2019-11-29 Logo replacing method and device in video and electronic equipment

Country Status (1)

Country Link
CN (1) CN110992251B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286471B (en) * 2020-09-27 2023-04-21 通彩视听科技(上海)有限公司 Conference whiteboard image printing method, printing equipment and storage medium
CN112634382B (en) * 2020-11-27 2024-03-19 国家电网有限公司大数据中心 Method and device for identifying and replacing images of unnatural objects

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040110112A (en) * 2003-06-18 2004-12-31 엘지전자 주식회사 Method for controling display rotate in portable computer
CN101620731A (en) * 2008-06-30 2010-01-06 汤姆森许可贸易公司 Method for detecting layout areas in a video image and method for generating a reduced size image using the detection method
CN102013107A (en) * 2010-09-06 2011-04-13 浙江大学 Selective image stylizing method based on nonlinear filtering
CN102833625A (en) * 2012-08-21 2012-12-19 李友林 Device and method for dynamically embedding advertisement into video
CN104735466A (en) * 2015-03-31 2015-06-24 北京奇艺世纪科技有限公司 Method and device for replacing pictorial trade mark in video
CN108076373A (en) * 2017-02-14 2018-05-25 北京市商汤科技开发有限公司 Processing method, device and the electronic equipment of video image
US10007863B1 (en) * 2015-06-05 2018-06-26 Gracenote, Inc. Logo recognition in images and videos
CN108288249A (en) * 2018-01-25 2018-07-17 北京览科技有限公司 A kind of method and apparatus for replacing the object in video
CN108419115A (en) * 2018-02-13 2018-08-17 杭州炫映科技有限公司 A kind of advertisement method for implantation
CN109961068A (en) * 2017-12-26 2019-07-02 阿里巴巴集团控股有限公司 Image recognition, training, searching method and device and equipment, medium
CN110490660A (en) * 2019-08-23 2019-11-22 三星电子(中国)研发中心 The method and apparatus of real-time update advertisement

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120011454A1 (en) * 2008-04-30 2012-01-12 Microsoft Corporation Method and system for intelligently mining data during communication streams to present context-sensitive advertisements using background substitution
JP2010224145A (en) * 2009-03-23 2010-10-07 Seiko Epson Corp Information processing apparatus, control device, and program
JP6525617B2 (en) * 2015-02-03 2019-06-05 キヤノン株式会社 Image processing apparatus and control method thereof
US10728510B2 (en) * 2018-04-04 2020-07-28 Motorola Mobility Llc Dynamic chroma key for video background replacement

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040110112A (en) * 2003-06-18 2004-12-31 엘지전자 주식회사 Method for controling display rotate in portable computer
CN101620731A (en) * 2008-06-30 2010-01-06 汤姆森许可贸易公司 Method for detecting layout areas in a video image and method for generating a reduced size image using the detection method
CN102013107A (en) * 2010-09-06 2011-04-13 浙江大学 Selective image stylizing method based on nonlinear filtering
CN102833625A (en) * 2012-08-21 2012-12-19 李友林 Device and method for dynamically embedding advertisement into video
CN104735466A (en) * 2015-03-31 2015-06-24 北京奇艺世纪科技有限公司 Method and device for replacing pictorial trade mark in video
US10007863B1 (en) * 2015-06-05 2018-06-26 Gracenote, Inc. Logo recognition in images and videos
CN108076373A (en) * 2017-02-14 2018-05-25 北京市商汤科技开发有限公司 Processing method, device and the electronic equipment of video image
CN109961068A (en) * 2017-12-26 2019-07-02 阿里巴巴集团控股有限公司 Image recognition, training, searching method and device and equipment, medium
CN108288249A (en) * 2018-01-25 2018-07-17 北京览科技有限公司 A kind of method and apparatus for replacing the object in video
CN108419115A (en) * 2018-02-13 2018-08-17 杭州炫映科技有限公司 A kind of advertisement method for implantation
CN110490660A (en) * 2019-08-23 2019-11-22 三星电子(中国)研发中心 The method and apparatus of real-time update advertisement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于分块DCT的视频文字检测算法;刘凌霞;牛红惠;崔洲涓;;计算机工程与科学(06);全文 *

Also Published As

Publication number Publication date
CN110992251A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US20200007602A1 (en) Remote desktop video streaming alpha-channel
US20150222814A1 (en) Image Acquisition Method and Apparatus
CN111105375B (en) Image generation method, model training method and device thereof, and electronic equipment
JP2010161762A (en) Variable scaling of image data for aspect ratio conversion
CN111126108B (en) Training and image detection method and device for image detection model
CN110992251B (en) Logo replacing method and device in video and electronic equipment
CN111192190B (en) Method and device for eliminating image watermark and electronic equipment
US9836456B2 (en) Techniques for providing user image capture feedback for improved machine language translation
CN111489322B (en) Method and device for adding sky filter to static picture
CN111179159B (en) Method and device for eliminating target image in video, electronic equipment and storage medium
CN112714357A (en) Video playing method, video playing device, electronic equipment and storage medium
CN110263301B (en) Method and device for determining color of text
CN111126372B (en) Logo region marking method and device in video and electronic equipment
US10049425B2 (en) Merging filters for a graphic processing unit
CN111105440B (en) Tracking method, device, equipment and storage medium for target object in video
CN110582021B (en) Information processing method and device, electronic equipment and storage medium
CN116962813A (en) YUV data rendering system and method, electronic equipment and storage medium
CN113127058B (en) Data labeling method, related device and computer program product
CN112929562B (en) Video jitter processing method, device, equipment and storage medium
CN111010606B (en) Video processing method and device
CN114511445A (en) Image processing method and device, electronic equipment and storage medium
CN109062645B (en) Method and apparatus for processing information for terminal
CN111860214A (en) Face detection method, training method and device of model thereof and electronic equipment
CN111131857A (en) Image compression method and device and electronic equipment
CN114842485B (en) Subtitle removing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant