CN114257762A - Video conversion method, device, equipment and storage medium - Google Patents

Video conversion method, device, equipment and storage medium Download PDF

Info

Publication number
CN114257762A
CN114257762A CN202111567590.2A CN202111567590A CN114257762A CN 114257762 A CN114257762 A CN 114257762A CN 202111567590 A CN202111567590 A CN 202111567590A CN 114257762 A CN114257762 A CN 114257762A
Authority
CN
China
Prior art keywords
video
pixel
target
pixel block
area
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.)
Pending
Application number
CN202111567590.2A
Other languages
Chinese (zh)
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.)
Migu Cultural Technology Co Ltd
China Mobile Communications Group Co Ltd
MIGU Music Co Ltd
Original Assignee
Migu Cultural Technology Co Ltd
China Mobile Communications Group Co Ltd
MIGU Music 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 Migu Cultural Technology Co Ltd, China Mobile Communications Group Co Ltd, MIGU Music Co Ltd filed Critical Migu Cultural Technology Co Ltd
Priority to CN202111567590.2A priority Critical patent/CN114257762A/en
Publication of CN114257762A publication Critical patent/CN114257762A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/272Means for inserting a foreground image in a background image, i.e. inlay, outlay
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2628Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/268Signal distribution or switching

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a video conversion method, a video conversion device, video conversion equipment and a storage medium, and belongs to the technical field of video processing. According to the method, a target object in an original video is identified, and the original video is cut based on the target object to obtain a reference video; identifying an original background region in the original video; determining a region to be expanded according to the reference video; and performing video background filling on the area to be expanded based on the original background area, reserving the texture structure and color distribution of the original video, integrating the texture structure and the color distribution with the original video, simultaneously, not amplifying characters or targets, and enabling the video to be clearer, so that the video watching experience of a user is improved.

Description

Video conversion method, device, equipment and storage medium
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a video conversion method, apparatus, device, and storage medium.
Background
The prior art converts the horizontal screen video into the vertical screen video generally by cutting the horizontal screen video in the middle, cutting the middle part of the horizontal screen content into a vertical screen proportion, and then encoding to generate the corresponding vertical screen video. However, after the cut video is amplified to a full screen, the characters or objects can be obviously amplified, for example, the whole mobile phone screen may be covered by the face area, so that the details of the video are blurred, and the user experience of watching the video is seriously influenced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a video conversion method, a video conversion device, video conversion equipment and a storage medium, and aims to solve the technical problems that video details are blurred due to video conversion in the prior art, and the experience of watching videos of users is seriously influenced.
In order to achieve the above object, the present invention provides a video conversion method, including the steps of:
identifying a target object in an original video, and cutting the original video based on the target object to obtain a reference video;
identifying an original background region in the original video;
determining a region to be expanded according to the reference video;
and performing video background filling on the area to be expanded on the basis of the original background area.
Optionally, the video background filling the to-be-expanded area based on the original background area includes:
selecting a reference image area and a reference pixel block from the reference video based on the original background area, wherein the reference pixel block is positioned in the reference image area;
screening out a target pixel block from the reference image area according to the reference pixel block;
and performing video background filling on the area to be expanded according to the reference pixel block and the target pixel block to obtain a target video.
Optionally, the screening out a target pixel block from the reference image region according to the reference pixel block includes:
acquiring reference pixel point coordinates corresponding to each pixel point in the reference pixel block and coordinates of pixel points to be matched corresponding to other pixel points except the reference pixel block in the reference image region;
calculating a coordinate difference value between each pixel point in the reference pixel block and other pixel points in the reference image area based on the reference pixel point coordinates and the pixel point coordinates to be matched;
determining the similarity between each pixel point in the reference pixel block and other pixel points in the reference image area according to the coordinate difference;
and screening out a target pixel block from the reference image area according to the similarity.
Optionally, the performing video background filling on the region to be expanded according to the reference pixel block and the target pixel block to obtain a target video includes:
splicing the obtained reference pixel block and the target pixel block;
obtaining a pixel overlapping area between the reference pixel block and the target pixel block based on the pixel block splicing result;
determining a reference video background according to the pixel overlapping area;
and filling the reference video background into the area to be expanded to obtain a target video.
Optionally, the determining a reference video background according to the pixel overlapping region includes:
determining a target boundary between the reference pixel block and the target pixel block according to the pixel overlap region;
dividing the pixel overlap area into a first overlap area and a second overlap area based on the target boundary;
taking the pixel point of the reference pixel block as the pixel point of the first overlapping area, and taking the pixel point of the target pixel block as the pixel point of the second overlapping area;
and taking the pixel overlapping area which finishes the classification of the pixel points as a reference video background.
Optionally, the determining a target boundary between the reference pixel block and the target pixel block according to the pixel overlap region includes:
determining a first pixel region belonging to the reference pixel block and a second pixel region belonging to the target pixel block in the pixel overlapping region;
acquiring pixel errors between each pixel point in the first pixel area and each pixel point in the second pixel area;
determining a target boundary between the reference pixel block and the target pixel block based on the pixel error.
Optionally, the determining a target boundary between the reference pixel block and the target pixel block according to the pixel error includes:
determining an initial pixel point according to the pixel error;
screening out target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors;
taking the target pixel points as new initial pixel points, and returning to the step of screening out the target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors to obtain a plurality of target pixel points;
and constructing a target boundary between the reference pixel block and the target pixel block according to the initial pixel points and the plurality of target pixel points.
Further, to achieve the above object, the present invention also proposes a video conversion apparatus comprising:
the cutting module is used for identifying a target object in an original video and cutting the original video based on the target object to obtain a reference video;
the identification module is used for identifying an original background area in the original video;
the determining module is used for determining a region to be expanded according to the reference video;
and the conversion module is used for carrying out video background filling on the area to be expanded on the basis of the original background area.
Further, to achieve the above object, the present invention also proposes a video conversion apparatus including: a memory, a processor, and a video conversion program stored on the memory and executable on the processor, the video conversion program configured to implement a video conversion method as described above.
Furthermore, to achieve the above object, the present invention also provides a storage medium having a video conversion program stored thereon, which when executed by a processor implements the video conversion method as described above.
According to the method, a target object in an original video is identified, and the original video is cut based on the target object to obtain a reference video; identifying an original background region in the original video; determining a region to be expanded according to the reference video; and performing video background filling on the area to be expanded based on the original background area, reserving the texture structure and color distribution of the original video, integrating the texture structure and the color distribution with the original video, simultaneously, not amplifying characters or targets, and enabling the video to be clearer, so that the video watching experience of a user is improved.
Drawings
Fig. 1 is a schematic structural diagram of a video conversion device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a video conversion method according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating background filling according to an embodiment of the video conversion method of the present invention;
FIG. 4 is a flowchart illustrating a video conversion method according to a second embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating the selection of reference regions and reference pixel blocks according to an embodiment of the video conversion method of the present invention;
FIG. 6 is a flowchart illustrating a video conversion method according to a third embodiment of the present invention;
FIG. 7 is a schematic diagram of a pixel overlap region according to an embodiment of a video conversion method of the invention;
FIG. 8 is a schematic diagram of a pixel difference array according to an embodiment of a video conversion method of the invention;
FIG. 9 is a schematic diagram illustrating a target pixel point screening process according to an embodiment of the video conversion method of the present invention;
FIG. 10 is a diagram illustrating new overlap region boundary lines in an embodiment of a video conversion method according to the present invention;
fig. 11 is a block diagram of a video conversion device according to a first embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a video conversion device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the video conversion apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the video conversion device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a video conversion program.
In the video conversion apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the video conversion apparatus of the present invention may be provided in the video conversion apparatus which calls the video conversion program stored in the memory 1005 through the processor 1001 and executes the video conversion method provided by the embodiment of the present invention.
An embodiment of the present invention provides a video conversion method, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a video conversion method according to the present invention.
In this embodiment, the video conversion method includes the following steps:
step S10: and identifying a target object in the original video, and cutting the original video based on the target object to obtain a reference video.
In this embodiment, the execution main body of this embodiment may be a video conversion device, and the video conversion device may be an electronic device such as a personal computer or a vehicle-mounted terminal, and may also be other terminal devices or servers that can implement the same or similar functions.
It should be noted that the horizontal screen video refers to a video with a video width greater than a video height, the full vertical screen video refers to a video with a video width less than a video height, and the full vertical screen video refers to a video with a video width less than a video height. The mode that prior art took with horizontal screen video conversion to vertical screen video is through the mode of tailorring placed in the middle, tailors the horizontal screen video that needs to carry out vertical screen conversion, specifically, tailors the mid portion of horizontal screen video content into the vertical screen proportion, still need emphasize that, it is on the comprehensive screen to enlarge the video after tailorring among the prior art, can make the video after tailorring stretch from top to bottom like this, can make personage or the target in the original video obviously enlargied for video detail is fuzzy.
In order to solve the above problem, the present embodiment can be implemented as follows.
In a specific implementation, a video is composed of one frame of video image, and the video image is divided into a background image and a foreground image, wherein a person is a foreground part, namely the foreground image, and other objects such as mountains, trees, buildings and the like belong to the background part, namely the background image. In order to ensure that the video does not lack important information, the clipped video needs to include people or other target objects, so in this embodiment, before the video is clipped, the target objects in the original video are identified, where the original video is a video that is not clipped or converted, and the target objects include objects such as people, animals, and automobiles. For example, when a horizontal screen video is converted into a vertical screen video, the horizontal screen video needing video conversion is an original video, when the horizontal screen video is a vehicle publishing propaganda video, a vehicle in the horizontal screen video is a target object, and after the horizontal screen video is converted into the vertical screen video, it is required to ensure that the vertical screen video contains a complete vehicle.
Furthermore, after the target object is determined, the original video is cut based on the target object, the video obtained after cutting is the reference video, the target object in the reference video is consistent with that in the original video, scaling is not performed, and distortion of the video can be avoided.
Further, in the cropping process, the number of people or objects in the original video may be only half of the number of the original video, which may cause loss of important information of the video.
In a specific implementation, in this embodiment, the size of the original video is detected first, and then video cropping is performed based on the original size corresponding to the original video, and it needs to be emphasized that the video height of the cropped reference video is consistent with the video height of the original video, and the video width of the reference video is smaller than the video width of the original video.
Further, a target cropping size may be determined based on the original size of the original video, where the target cropping size is used for performing video cropping, and the target cropping size is the video size of the reference video, and on the premise that the target object is ensured to be complete, the target cropping size in this embodiment may be correspondingly adjusted according to actual requirements, which is not limited in this embodiment. After the target cropping size is determined, in order to ensure the integrity of the target object, the present embodiment uses the target object as the center of the reference video, and then crops according to the target cropping size, so as to obtain the reference video.
Step S20: an original background region in the original video is identified.
It should be noted that, in this embodiment, the original video and the reference video are consistent in video height and consistent in video width, and the process of converting a wide screen video into a vertical screen video is described by taking the original video as the wide screen video as an example. In this case, the mode adopted in this embodiment is to extend and expand the missing part of the vertical screen video.
It should be emphasized that the reference video may be converted into the vertical screen video by an extension expansion method, in this embodiment, background filling is adopted for the reference video, that is, a part of the vertical screen video extended and expanded is a background part, and in order to ensure that a texture structure and color distribution of the video obtained after conversion is consistent with those of the original video, in this embodiment, the reference video is subjected to background filling based on an original background area in the original video.
Step S30: and determining a region to be expanded according to the reference video.
Step S40: and performing video background filling on the area to be expanded on the basis of the original background area.
In a specific implementation, after an original background area is determined, a background portion missing from a video is added to a reference video based on the original background area, for example, as shown in fig. 3, a cropping is performed on the basis of an original video a, a reference video B is obtained after the cropping, a video height of the obtained reference video B is consistent with a video height of the original video a and is not a vertical screen video, in order to obtain a complete vertical screen video based on the reference video B, a missing portion of the reference video B, that is, two portions C and D shown in fig. 3, need to be complemented, where the two portions C and D shown in fig. 3 are regions to be expanded corresponding to the reference video. The specific mode is to select the video background which is the same as the original video A, and fill the video background in the C part and the D part to complete the filling of the video background, and finally obtain the target video.
In the embodiment, a reference video is obtained by identifying a target object in an original video and cutting the original video based on the target object; identifying an original background region in the original video; determining a region to be expanded according to the reference video; and performing video background filling on the area to be expanded based on the original background area, reserving the texture structure and color distribution of the original video, integrating the texture structure and the color distribution with the original video, simultaneously, not amplifying characters or targets, and enabling the video to be clearer, so that the video watching experience of a user is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a video conversion method according to a second embodiment of the present invention.
Based on the first embodiment, in the video conversion method according to this embodiment, the step S40 specifically includes:
step S401: and selecting a reference image area and a reference pixel block from the reference video based on the original background area, wherein the reference pixel block is positioned in the reference image area.
In the detailed description, reference is made toThe texture, color, and the like of the foreground region and the background region of the overlapping portion between the video and the original video are consistent, and in this embodiment, the reference image region and the reference pixel block may be selected from the original background region. As shown in FIG. 5, the original video A is taken2After cropping, a reference video B can be obtained2S is the slave reference video B2X is a reference pixel block selected from the reference video, and it is emphasized that, in the present embodiment, the reference pixel block is selected from the reference image area, and the reference pixel block is located in the reference image area.
It should be noted that, in this embodiment, the size of the reference image region may be selected accordingly according to actual requirements, the size of the reference pixel block may be set to 32 × 32, and of course, the reference pixel block may also be set to other sizes, and the specific size setting may be adjusted accordingly based on video conversion requirements, which is not limited in this embodiment. It should be further noted that when the background filling is required for the area below the reference video, i.e. C shown in fig. 52Region, bottom boundary and C of reference image region S in this embodiment2The top boundary of the region coincides with the bottom boundary of the reference pixel block X also coinciding with C2The top boundaries of the regions coincide.
Step S402: and screening out a target pixel block from the reference image area according to the reference pixel block.
In a specific implementation, after the reference pixel block is selected, the target pixel block is selected from the reference image region based on the reference pixel block in the embodiment. The reference pixel block is substantially a region formed by a pixel point set, the reference pixel block is similar to the pixel points in the target pixel block, namely, the pixel difference between each pixel point in the target pixel block and each pixel point in the reference pixel block is minimum relative to other regions in the reference image region.
Further, in order to accurately screen out the target pixel block in the present embodiment, the following manner may be implemented.
In a specific implementation, in this embodiment, the reference pixel block is selected firstA predetermined region of the reference pixel block as X shown in FIG. 51Region, X1The area may be set to 1/6 of the whole reference pixel block, and of course, may also be set to other proportions, and may be set accordingly according to actual requirements, which is not limited in this embodiment.
Further, reference pixel point coordinates corresponding to each pixel point are obtained from the preset area, and then coordinates of each pixel point in the reference image area except the reference pixel block are selected, namely the coordinates of the pixel points to be matched. And then calculating the coordinate difference between each pixel point in the reference pixel block and each other pixel point except the reference pixel block in the reference image area based on a pixel difference calculation formula. The coordinate difference value calculation formula is as follows:
Figure BDA0003422174770000091
wherein S (X, Y) represents a pixel difference value, Xi,jThe pixel coordinates of the predetermined area selected for the reference module, i.e. the coordinates of the reference pixel points, Yi,jThe coordinates of each pixel point in the reference image region except the reference pixel block, namely the coordinates of the pixel points to be matched.
Further, the coordinate difference reflects pixel errors between the pixel points, the smaller the coordinate difference, the smaller the corresponding pixel error, and the similarity between the pixel points corresponding to the pixel errors, the smaller the coordinate difference, the greater the similarity between the two pixel points, i.e., the greater the similarity, in this embodiment, the coordinate difference between the reference pixel point and the reference pixel point is the smallest, i.e., the pixel point with the largest similarity is the target pixel point, and the region formed by the target pixel point is the target pixel block.
Step S403: and performing video background filling on the area to be expanded according to the reference pixel block and the target pixel block to obtain a target video.
In specific implementation, after the target pixel block is obtained, the background filling of the reference video is realized in the embodiment by splicing the target pixel block and the reference pixel block, and the target video can be obtained after the background filling is finally completed.
In the embodiment, a reference image area and a reference pixel block are selected from the reference video based on the original background area, and the reference pixel block is located in the reference image area; screening out a target pixel block from the reference image area according to the reference pixel block; and performing video background filling on the area to be expanded according to the reference pixel block and the target pixel block to obtain a target video, and realizing background filling through the reference pixel block and the target pixel block, so that the characteristics of the target video, such as texture, color and the like, are consistent with those of the original video, and the watching experience of a user is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a video conversion method according to a third embodiment of the present invention.
Based on the second embodiment, a third embodiment of the video conversion method according to the present invention is provided.
In this embodiment, the step S403 specifically includes:
step S4031: and splicing the acquired reference pixel block and the target pixel block.
It should be noted that, when the background filling is required to the area below the reference video, i.e. C shown in fig. 52Region, bottom boundary and C of reference image region S in this embodiment2The top boundary of the region coincides with the bottom boundary of the reference pixel block X also coinciding with C2The top boundaries of the regions coincide to complete the stitching of the pixel blocks.
Step S4032: and obtaining a pixel overlapping area between the reference pixel block and the target pixel block based on the pixel block splicing result.
In a specific implementation, there is a pixel overlap region between the reference pixel block and the target pixel block, and as shown in fig. 7, the pixel overlap region between the reference pixel block X2 (the region shown by the dotted line portion) and the target pixel block Y2 (the region shown by the solid line portion) is O.
Step S4033: and determining a reference video background according to the pixel overlapping area.
It should be noted that the pixel overlapping region is the reference video background, but in order to ensure that the reference video background retains the texture structure and the color distribution of the original video in this embodiment, it is necessary to divide the pixel points in the pixel overlapping region, that is, to determine whether the pixel points in the pixel overlapping region adopt the pixel points of the reference pixel block or the pixel points of the target pixel block, where the specific division standard is based on the boundary of the pixel overlapping region.
In specific implementation, a first overlapping region and a second overlapping region of a pixel overlapping region can be determined based on a target boundary, and the overlapping region has both pixel points of a reference pixel block and pixel points of a target pixel block. The essence of pixel point division in this embodiment is to adopt the pixel point of the reference pixel block as the pixel point of the first overlapping area, and adopt the pixel point of the target pixel block as the pixel point of the second overlapping area.
It should be noted that after the pixel overlap area is determined, the pixel overlap area has a corresponding boundary line, as shown by a boundary line Z in fig. 7, which is used for splicing between the reference pixel block and the target pixel block.
Further, in order to more accurately obtain the target boundary line in the pixel overlap region in the present embodiment, it may be implemented as follows.
In a specific implementation, a region of the pixel overlap region, that is, the first pixel region and the second pixel region, which respectively belong to the reference pixel block and the target pixel block, is determined based on the pixel overlap region. In the present embodiment, the upper half of the pixel overlapping region (P shown in fig. 7) is divided equally1Region) as a first pixel region, the lower half region (P shown in fig. 7) of the pixel overlap region2Region) as the second pixel region.
Further, after the first pixel region and the second pixel region are determined, the error between each pixel point of the first pixel region and the second pixel region is calculated based on a pixel error formula, and a target boundary between the reference pixel block and the target pixel block can be determined based on the error between each pixel point. The pixel difference calculation formula is as shown above, and is not described here again.
In a specific implementation, a group of pixels with the smallest pixel difference values in the first pixel region and the second pixel region may be determined through the pixel point error, as shown in fig. 8, after the pixel difference value of the entire pixel overlapping region is obtained through calculation, a pixel difference array is constructed, for example, an error between a group of pixels corresponding to (e01, e10) in fig. 8 is constructed, where the group of pixels is composed of the pixels in the first pixel region and the second pixel region. Further, based on the pixel difference array, the position of the minimum pixel difference in the array may be obtained, for example, the pixel difference in the column (e06, e40) of fig. 8 where e06 is the minimum pixel difference, (e) a reference pixel point corresponding to the pixel difference is taken as a target pixel point, and so on, a plurality of target pixel points may be obtained, and a trajectory formed by the plurality of target pixel points is a target boundary line.
Further, a path with the minimum pixel difference is searched from the error array, and if the pixel points corresponding to the minimum pixel difference in each column are directly connected, due to the jump of the pixel difference, the directly connected path may be a discontinuous path, which causes the discontinuity of the local seam of the overlapping area. In order to solve the above problem, the last column of the error array is traced back, and the minimum error value is calculated and found from the three pixel points in the neighborhood of the last column, where the minimum error point is in the current column, and the pixel point is used as the target pixel point. For example, as shown in fig. 9, the target pixel point corresponding to the minimum error value in the last column is esI.e., the original pixel point, and then follows the back direction from the original pixel point (e shown in fig. 9)s) Adjacent pixel (e)1,e2,e3) Selecting target pixel points from the image data, and taking the pixel point with the minimum pixel difference value as the target pixel point, assuming that e is2Then e is added2As the initial pixel point, continue to follow the above-mentioned manner from e2And adjacent pixels screen out target pixels, and finally a plurality of target pixels can be determined. It should be emphasized that, in this embodiment, in order to ensure the continuity, 3 adjacent pixels are selected as shown in fig. 9.
Further, the target score is determined in the above mannerAfter the boundary, the boundary line Z is adjusted on the basis of fig. 7 to obtain the target boundary line Z shown in fig. 101. And further, it is to be noted that the upper part P of the boundary line is based on the target boundary line3The pixel points in the region are selected from the reference pixel block, and the part P below the boundary4And selecting pixel points in the region from the target pixel block. In the above manner, background filling of the reference video is completed.
Step S4034: and filling the reference video background into the area to be expanded to obtain a target video.
In specific implementation, after the reference video background is determined based on the target boundary, the reference video background is filled into the region to be expanded, and the target video is obtained. .
In the embodiment, the obtained reference pixel block and the target pixel block are spliced;
obtaining a pixel overlapping area between the reference pixel block and the target pixel block based on the pixel block splicing result; determining a reference video background according to the pixel overlapping area; and filling the reference video background into the area to be expanded to obtain a target video, so that the target video obtained after conversion has the same color and texture as the original video, and the watching experience of a user is improved.
Furthermore, an embodiment of the present invention further provides a storage medium, where a video conversion program is stored, and the video conversion program, when executed by a processor, implements the steps of the video conversion method as described above.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
Referring to fig. 11, fig. 11 is a block diagram of a video conversion device according to a first embodiment of the present invention.
As shown in fig. 11, the video conversion apparatus according to the embodiment of the present invention includes:
and the cropping module 10 is configured to identify a target object in an original video, and crop the original video based on the target object to obtain a reference video.
An identifying module 20, configured to identify an original background area in the original video.
A determining module 30, configured to determine, according to the reference video, an area to be extended.
A conversion module 40, configured to perform video background filling on the to-be-extended area based on the original background area.
In the embodiment, a reference video is obtained by identifying a target object in an original video and cutting the original video based on the target object; identifying an original background region in the original video; determining a region to be expanded according to the reference video; the video background filling is carried out on the area to be expanded on the basis of the original background area, the texture structure and the color distribution of the original video are reserved, the original video is integrated with the original video, meanwhile, characters or targets are not amplified, the video is clearer, and the experience of watching the video by a user is improved
In an embodiment, the converting module 40 is further configured to select a reference image region and a reference pixel block from the reference video based on the original background region, where the reference pixel block is located in the reference image region; screening out a target pixel block from the reference image area according to the reference pixel block; and performing video background filling on the area to be expanded according to the reference pixel block and the target pixel block to obtain a target video.
In an embodiment, the conversion module 40 is further configured to obtain coordinates of reference pixel points corresponding to each pixel point in the reference pixel block, and coordinates of pixel points to be matched corresponding to other pixel points except the reference pixel block in the reference image region; calculating a coordinate difference value between each pixel point in the reference pixel block and other pixel points in the reference image area based on the reference pixel point coordinates and the pixel point coordinates to be matched; determining the similarity between each pixel point in the reference pixel block and other pixel points in the reference image area according to the coordinate difference; and screening out a target pixel block from the reference image area according to the similarity.
In an embodiment, the conversion module 40 is further configured to splice the obtained reference pixel block and the target pixel block; obtaining a pixel overlapping area between the reference pixel block and the target pixel block based on the pixel block splicing result; determining a reference video background according to the pixel overlapping area; and filling the reference video background into the area to be expanded to obtain a target video.
In an embodiment, the converting module 40 is further configured to determine a target boundary between the reference pixel block and the target pixel block according to the pixel overlapping region; dividing the pixel overlap area into a first overlap area and a second overlap area based on the target boundary; taking the pixel point of the reference pixel block as the pixel point of the first overlapping area, and taking the pixel point of the target pixel block as the pixel point of the second overlapping area; and taking the pixel overlapping area which finishes the classification of the pixel points as a reference video background.
In an embodiment, the converting module 40 is further configured to determine a first pixel region belonging to the reference pixel block and a second pixel region belonging to the target pixel block in the pixel overlapping region; acquiring pixel errors between each pixel point in the first pixel area and each pixel point in the second pixel area; determining a target boundary between the reference pixel block and the target pixel block based on the pixel error.
In an embodiment, the converting module 40 is further configured to determine an initial pixel point according to the pixel error; screening out target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors; taking the target pixel points as new initial pixel points, and returning to the step of screening out the target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors to obtain a plurality of target pixel points; and constructing a target boundary between the reference pixel block and the target pixel block according to the initial pixel points and the plurality of target pixel points.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the video conversion method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A video conversion method, characterized in that the video conversion method comprises:
identifying a target object in an original video, and cutting the original video based on the target object to obtain a reference video;
identifying an original background region in the original video;
determining a region to be expanded according to the reference video;
and performing video background filling on the area to be expanded on the basis of the original background area.
2. The video conversion method according to claim 1, wherein the video background filling the area to be expanded based on the original background area comprises:
selecting a reference image area and a reference pixel block from the reference video based on the original background area, wherein the reference pixel block is positioned in the reference image area;
screening out a target pixel block from the reference image area according to the reference pixel block;
and performing video background filling on the area to be expanded according to the reference pixel block and the target pixel block to obtain a target video.
3. The video conversion method according to claim 2, wherein said filtering out a target pixel block from the reference image region based on the reference pixel block comprises:
acquiring reference pixel point coordinates corresponding to each pixel point in the reference pixel block and coordinates of pixel points to be matched corresponding to other pixel points except the reference pixel block in the reference image region;
calculating a coordinate difference value between each pixel point in the reference pixel block and other pixel points in the reference image area based on the reference pixel point coordinates and the pixel point coordinates to be matched;
determining the similarity between each pixel point in the reference pixel block and other pixel points in the reference image area according to the coordinate difference;
and screening out a target pixel block from the reference image area according to the similarity.
4. The video conversion method according to claim 2, wherein said performing video background filling on the region to be expanded according to the reference pixel block and the target pixel block to obtain a target video, comprises:
splicing the obtained reference pixel block and the target pixel block;
obtaining a pixel overlapping area between the reference pixel block and the target pixel block based on the pixel block splicing result;
determining a reference video background according to the pixel overlapping area;
and filling the reference video background into the area to be expanded to obtain a target video.
5. The video conversion method of claim 4, wherein said determining a reference video background from said pixel overlap region comprises:
determining a target boundary between the reference pixel block and the target pixel block according to the pixel overlap region;
dividing the pixel overlap area into a first overlap area and a second overlap area based on the target boundary;
taking the pixel point of the reference pixel block as the pixel point of the first overlapping area, and taking the pixel point of the target pixel block as the pixel point of the second overlapping area;
and taking the pixel overlapping area which finishes the classification of the pixel points as a reference video background.
6. The video conversion method of claim 5, wherein said determining a target boundary between said reference pixel block and said target pixel block based on said pixel overlap region comprises:
determining a first pixel region belonging to the reference pixel block and a second pixel region belonging to the target pixel block in the pixel overlapping region;
acquiring pixel errors between each pixel point in the first pixel area and each pixel point in the second pixel area;
determining a target boundary between the reference pixel block and the target pixel block based on the pixel error.
7. The video conversion method of claim 6, wherein said determining a target boundary between said reference pixel block and said target pixel block based on said pixel errors comprises:
determining an initial pixel point according to the pixel error;
screening out target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors;
taking the target pixel points as new initial pixel points, and returning to the step of screening out the target pixel points from the adjacent pixel points of the initial pixel points according to the pixel errors to obtain a plurality of target pixel points;
and constructing a target boundary between the reference pixel block and the target pixel block according to the initial pixel points and the plurality of target pixel points.
8. A video conversion apparatus, characterized in that the video conversion apparatus comprises:
the cutting module is used for identifying a target object in an original video and cutting the original video based on the target object to obtain a reference video;
the identification module is used for identifying an original background area in the original video;
the determining module is used for determining a region to be expanded according to the reference video;
and the conversion module is used for carrying out video background filling on the area to be expanded on the basis of the original background area.
9. A video conversion apparatus, characterized in that the video conversion apparatus comprises: a memory, a processor, and a video conversion program stored on the memory and running on the processor, the video conversion program configured to implement the video conversion method of any of claims 1-7.
10. A storage medium having stored thereon a video conversion program which, when executed by a processor, implements the video conversion method according to any one of claims 1 to 7.
CN202111567590.2A 2021-12-20 2021-12-20 Video conversion method, device, equipment and storage medium Pending CN114257762A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111567590.2A CN114257762A (en) 2021-12-20 2021-12-20 Video conversion method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111567590.2A CN114257762A (en) 2021-12-20 2021-12-20 Video conversion method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114257762A true CN114257762A (en) 2022-03-29

Family

ID=80793397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111567590.2A Pending CN114257762A (en) 2021-12-20 2021-12-20 Video conversion method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114257762A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821228A (en) * 2012-07-16 2012-12-12 西安电子科技大学 Low-rank video background reconstructing method
JP2014115459A (en) * 2012-12-10 2014-06-26 Sharp Corp Rotation mechanism for display device
CN103905886A (en) * 2014-03-28 2014-07-02 广州华多网络科技有限公司 Method and device for video coding
CN104978116A (en) * 2014-04-03 2015-10-14 联想移动通信科技有限公司 Video image adjusting method, video image adjusting device and terminal
CN108965711A (en) * 2018-07-27 2018-12-07 广州酷狗计算机科技有限公司 Method for processing video frequency and device
CN110136087A (en) * 2019-05-21 2019-08-16 京东方科技集团股份有限公司 The frame self-adapting regulation method and relevant device of display terminal
CN112132836A (en) * 2020-08-14 2020-12-25 咪咕文化科技有限公司 Video image clipping method and device, electronic equipment and storage medium
CN113077470A (en) * 2021-03-26 2021-07-06 天翼爱音乐文化科技有限公司 Method, system, device and medium for cutting horizontal and vertical screen conversion picture
US20210314520A1 (en) * 2020-03-13 2021-10-07 Hisense Visual Technology Co., Ltd. Display Device And Display Image Rotation Adapting Method
CN113542835A (en) * 2021-07-12 2021-10-22 珠海云迈网络科技有限公司 Method and device for correcting video direction of recorded video and computer equipment
CN113709386A (en) * 2021-03-19 2021-11-26 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer equipment and computer readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821228A (en) * 2012-07-16 2012-12-12 西安电子科技大学 Low-rank video background reconstructing method
JP2014115459A (en) * 2012-12-10 2014-06-26 Sharp Corp Rotation mechanism for display device
CN103905886A (en) * 2014-03-28 2014-07-02 广州华多网络科技有限公司 Method and device for video coding
CN104978116A (en) * 2014-04-03 2015-10-14 联想移动通信科技有限公司 Video image adjusting method, video image adjusting device and terminal
CN108965711A (en) * 2018-07-27 2018-12-07 广州酷狗计算机科技有限公司 Method for processing video frequency and device
CN110136087A (en) * 2019-05-21 2019-08-16 京东方科技集团股份有限公司 The frame self-adapting regulation method and relevant device of display terminal
US20210314520A1 (en) * 2020-03-13 2021-10-07 Hisense Visual Technology Co., Ltd. Display Device And Display Image Rotation Adapting Method
CN112132836A (en) * 2020-08-14 2020-12-25 咪咕文化科技有限公司 Video image clipping method and device, electronic equipment and storage medium
CN113709386A (en) * 2021-03-19 2021-11-26 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer equipment and computer readable storage medium
CN113077470A (en) * 2021-03-26 2021-07-06 天翼爱音乐文化科技有限公司 Method, system, device and medium for cutting horizontal and vertical screen conversion picture
CN113542835A (en) * 2021-07-12 2021-10-22 珠海云迈网络科技有限公司 Method and device for correcting video direction of recorded video and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆天骁: ""一种高效率短视频处理框架的设计与实现"", 中国优秀硕士学位论文全文数据库 *

Similar Documents

Publication Publication Date Title
CN109461199B (en) Picture rendering method and device, storage medium and electronic device
WO2012063594A1 (en) Object display device and object display method
CN110321788B (en) Training data processing method, device, equipment and computer readable storage medium
CN113516666A (en) Image cropping method and device, computer equipment and storage medium
CN114119373A (en) Image cropping method and device and electronic equipment
CN113592720B (en) Image scaling processing method, device, equipment and storage medium
CN113129229A (en) Image processing method, image processing device, computer equipment and storage medium
CN111212246A (en) Video generation method and device, computer equipment and storage medium
CN113255289A (en) Method and system for composing and distributing file
CN111914046B (en) Generation method and device of target seating chart and computer equipment
CN115689882A (en) Image processing method and device and computer readable storage medium
CN114257762A (en) Video conversion method, device, equipment and storage medium
CN111008987A (en) Method and device for extracting edge image based on gray background and readable storage medium
CN113256484B (en) Method and device for performing stylization processing on image
CN115205113A (en) Image splicing method, device, equipment and storage medium
CN113610864B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN115454365A (en) Picture processing method and device, electronic equipment and medium
CN110580274B (en) GIS data rendering method
JP4334981B2 (en) Image processing apparatus and image processing method
CN113129227A (en) Image processing method, image processing device, computer equipment and storage medium
CN112465931A (en) Image text erasing method, related equipment and readable storage medium
CN111768338A (en) Method and device for splicing test question images, electronic equipment and storage medium
CN113810626A (en) Video fusion method, device and equipment based on three-dimensional map and storage medium
CN113506304A (en) Image processing method and device, electronic equipment and readable storage medium
CN113516609A (en) Split screen video detection method and device, computer equipment and storage medium

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