A method and device for transplanting subtitles
A technology of subtitles and colors, applied in the field of subtitle transplantation methods and devices, can solve the problems of transplantation and unable to extract subtitle lyrics
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0044] figure 1 It is a schematic flow chart of a subtitle transplantation method in this embodiment, as shown in the figure, including:
[0045] Step 101, divide the original video into frames, and take a screenshot of its current frame according to a preset range;
[0046] The subtitles are generally in the lower part of the video, and the position is basically fixed, so it is enough to capture the picture of the range where the subtitles are located.
[0047] In this embodiment, preferably, the target video is divided into frames at the same time, and each frame of the original video after frame division and the target video can be corresponded one by one. That is, in this embodiment, subtitle transplantation is performed frame by frame.
[0048] Step 102, performing color extraction on the screenshot according to the HSV range values of a plurality of preset colors to obtain a mask of at least one color;
[0049] HSV (Hue, Saturation, Value) is a color space created b...
Embodiment 2
[0072] figure 2 It is a structural block diagram of a subtitle transplantation device in this embodiment, as shown in the figure, including:
[0073] A screenshot unit 201, configured to divide the original video into frames, and take a screenshot of its current frame according to a preset range;
[0074] The subtitles are generally in the lower part of the video, and the position is basically fixed, so it is enough to capture the picture of the range where the subtitles are located.
[0075] In this embodiment, preferably, the target video is divided into frames at the same time, and each frame of the original video after frame division and the target video can be corresponded one by one. That is, in this embodiment, subtitle transplantation is performed frame by frame.
[0076] A color extraction unit 202, configured to perform color extraction on the screenshot according to HSV range values of a plurality of preset colors to obtain a mask of at least one color;
[007...
Embodiment 3
[0101] image 3 It is a schematic flow chart of a subtitle transplantation method in this embodiment, as shown in the figure, including:
[0102] Step 301, iterate each frame of the original video and the target video.
[0103] First iterate each frame of the original video and the target video that needs to be transplanted. Since the position of each MV subtitle is basically fixed, the range of the original MV subtitle is intercepted to reduce the error of recognition;
[0104] Step 302, intercepting the subtitle picture of the current frame;
[0105] like Figure 5 Shown is the schematic diagram of subtitles before extraction; it can be seen that Figure 5 The range of interception is shown.
[0106] The coordinates of two points of the picture intercepted in this embodiment are (0, 1.45) (length, width-20px) to obtain the subtitle part.
[0107] Step 303, extract subtitles;
[0108] Then use opencv to extract the subtitle color.
[0109] OpenCV is a cross-platform co...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


