Video watermark removal system and method based on image processing
Through the video watermark removal system based on image processing, the video area is divided and the watermark information and path are identified, which solves the problem of inability to accurately remove video watermarks in the existing technology, achieves efficient removal of video watermarks, and improves the video appreciation effect.
Patent Information
- Application Number
- CN202410431175.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-11
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-04-11
AI Technical Summary
Existing technology cannot accurately remove watermarks in videos, especially dynamic watermarks, and cannot completely remove watermark traces, which affects the video viewing effect.
A video watermark removal system based on image processing is used to divide the video into several areas through the video frame capture module. The watermark recognition module identifies the watermark information and path. The watermark removal module removes the watermark based on the recognition results, and adjusts the area division and frame through the detection module. number to improve the removal effect.
It achieves precise removal of video watermarks, especially dynamic watermarks, which improves video appreciation and ensures clear display of important information.
Smart Images

Figure CN118250527B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of watermark removal, and in particular to a video watermark removal system based on image processing. Background Art
[0002] With the development of digital media technology and computer technology, various digital media such as videos are spread through the Internet, and people can download and watch them online. In order to protect the copyright of videos, watermarks are often embedded in the video when it is produced, and the video watermarks are played at the same time when the video is played. However, these watermarks often affect the viewing effect or block important information. When the video is played, since the video watermark and the original image content of the video are compressed together, the watermark itself is an image, and the watermark will be displayed while the original video is played. The watermark synthesized into the video file cannot be completely removed. At present, most of them use blur or mosaic to mask the watermark part. After processing, there will still be some traces, and it still cannot change the problem of blocking important information.
[0003] Chinese patent CN 108550099 B discloses a method and device for removing watermarks from images, which removes all watermarks from the original image by erasing pixels at all watermark positions in the area to be processed based on a binary watermark image obtained in advance according to the watermark in the original image, and finally uses a pixel filling method to fill new pixels at the positions of the erased pixels, so that the filled new pixels are connected to the pixels around the positions of the erased pixels. However, the technical problem of how to accurately remove watermarks from videos and remove dynamic watermarks has not yet been solved. Summary of the invention
[0004] To this end, the present invention provides a video watermark removal system based on image processing, which can solve the technical problem that it is impossible to accurately divide the area according to the video information to be processed, and remove the target watermark information and watermark path by dividing the main video frame and the auxiliary video frame in the area.
[0005] To achieve the above object, on the one hand, the present invention provides a video watermark removal system based on image processing, comprising:
[0006] A video frame capture module, which is used to divide the video into several areas according to the video playback time and frame rate of the video to be processed, wherein the video frame capture module sets a captured video frame in a region as the main video frame of the current region, and sets the captured video frame with a corresponding number of frames interval with the main video frame of the current region as the auxiliary video frame for the region;
[0007] a watermark identification module, which is connected to the video frame capture module and is used to identify the watermark information of the video to be processed, including a watermark region determination unit for determining the watermark region according to the main video frame of the current region after binarization, a watermark state determination unit for determining the watermark state according to the watermark positions of the main video frame and the auxiliary video frame of the current region, and a watermark path determination unit for determining the watermark path according to the watermark position changes of each video frame in the current region;
[0008] A watermark removal module, which is connected to the watermark identification module and is used to remove the watermark in the video to be processed according to the watermark information and the watermark path;
[0009] A detection module is connected to the video frame capture module and the watermark removal module, and is used to obtain the removal rate of the video watermark in any area captured by the video frame capture module, and to adjust the number of areas preset by the video frame capture module according to the detection result so that the watermark removal effect meets the standard.
[0010] Furthermore, the video frame capture module is also used to determine the number of region divisions for the video to be processed based on the acquired playback time m of the video to be processed.
[0011] Furthermore, the video frame capture module is also used to set a number of adjustment methods for the determined area division number based on the acquired frame rate f of the video to be processed, and the adjustment range of each adjustment method for the area division number is different.
[0012] Furthermore, the watermark area determination unit is also used to perform binarization processing on the main video frame of the current area captured by the video frame capture module to determine the contour of the target of interest, and determine the position of the target watermark based on the number of similar contour distributions within the determined contour of the target of interest.
[0013] Furthermore, when the main video frame includes only one target watermark, the video frame capture module is also used to determine the state of the watermark based on the target watermark position in the selected main video frame and the target watermark position in the secondary video frame that has a first preset number of frame intervals y1 with the main video frame. The state of the watermark includes a static watermark and a dynamic watermark.
[0014] Furthermore, the video frame capture module is also used to determine a reference watermark based on a selected main video frame when the main video frame only includes multiple target watermarks, and to determine the status of each target watermark in turn based on the relative position of the reference watermark and each target watermark in the selected main video frame and the position of the reference watermark and each target watermark in a number of sub-video frames that have a second preset frame number y2 interval frames with the main video frame.
[0015] Furthermore, the video frame capture module is also used to determine the number of acquired sub-video frames based on the number of frames in the current area, and to determine the state of the watermark based on the target watermark position in the selected main video frame and the target watermark position in a number of sub-video frames determined to have a third preset frame number y3 interval frames with the main video frame.
[0016] Furthermore, the watermark path determination unit is also used to draw a path diagram based on the target watermark position in each video frame of the current area when the target watermark state is a dynamic watermark, and the watermark removal module is also used to remove the target watermark of each video frame by using a pixel filling method according to the watermark path and the watermark cycle frame number obtained based on the path diagram.
[0017] Furthermore, the detection module is also used to detect any area video after removing the watermark, and, based on the obtained area removal rate b, determine the preset number of areas for accurately identifying the watermark when the watermark removal effect of the video to be processed does not meet the standard, or determine the preset number of frames for obtaining the secondary video frame.
[0018] On the other hand, the present invention provides a video watermark removal method based on image processing, comprising:
[0019] Step S1, the video frame capture module divides the video to be processed into several regions according to the video playback time and frame rate of the video to be processed, and captures a video frame in each region as a main video frame, and sets a video frame with a preset interval frame number from the main video frame as a sub-video frame;
[0020] Step S2, the watermark region determination unit performs binarization processing on the main video frame to determine the watermark region and determine the target watermark information, the watermark state determination unit compares the watermark position of the main video frame with the watermark position of the auxiliary video frame to determine the watermark state, the watermark path determination unit obtains the watermark path according to the watermark position of each video frame in the current region, and the watermark removal module removes the target watermark according to the target watermark information and the watermark path;
[0021] Step S3, the detection module detects the watermark removal status of any area, and adjusts the preset area number of the video frame capture module if the removal rate does not meet the standard.
[0022] Compared with the prior art, the beneficial effect of the present invention lies in that the present invention divides the video to be processed into several areas according to the attributes of the video to be processed, and selects a video frame in the video of each area as the main video frame, identifies the watermark area of the main video frame, and determines whether the watermark state is static or dynamic according to the video frame with an adjacent playback time to the main video frame. When the watermark is determined to be dynamic, the watermark position is identified frame by frame for the video to be processed to determine the watermark path. At the same time, the present invention is also provided with a detection module, which evaluates the watermark removal effect of the video of one of the areas divided by the video frame capture module according to the watermark information obtained by the watermark recognition module. When the detection result is unqualified, the preset number of areas is adjusted to make the watermark removal effect meet the standard.
[0023] In particular, the present invention divides the playback time into two standards, compares the playback time of the video to be processed with the two standards of preset playback time respectively, selects the best number of areas from the number of areas preset by the video frame capture module to divide the video to be processed into regions, the longer the playback time, the more areas are selected, so that the video to be processed is divided into more areas, and the watermark of the video to be processed is more accurately identified. At the same time, the present invention adjusts the selected number of divided areas according to the frame rate of the video to be processed, wherein, if the frame rate of the video to be processed is less than or equal to the first preset frame rate, the video frame capture module selects the first preset adjustment parameter set by it to adjust the number of divided areas, if the frame rate of the video to be processed is between the first preset frame rate and the second preset frame rate, the video frame capture module selects the second preset adjustment parameter set by it to adjust the number of divided areas, if the frame rate of the video to be processed is greater than or equal to the second preset frame rate, the video frame capture module selects the third preset adjustment parameter set by it to adjust the number of divided areas.
[0024] In particular, after the video frame capture module of the present invention divides the processed video into regions, the watermark region determination unit binarizes the main video frame of one of the regions, binarizes the main video frame according to the binarization threshold, and presents the main video frame with an obvious visual effect of only black and white, highlighting the outline of the target of interest. The watermark region determination unit analyzes the acquired target outline of interest. If the target outline of interest does not have a similar structure, it means that there are no repeated graphics in the target outline of interest. At the same time, when it is determined that the width and height of the target outline of interest are both greater than the width and height of the video frame to be processed, the target outline of interest is determined to be a single target outline and is set as the target watermark. If the target outline of interest has a similar structure, and at the same time, any one of the width and height of the similar structure is less than the width and height of the video frame to be processed, it means that the watermark of the main video frame is repeated multiple, that is, the similar structure in the target outline of interest is determined to be the target watermark.
[0025] In particular, the present invention sets different watermark status determination methods according to different preset conditions. When the number of target watermarks in the main video is one, it means that the current watermark information is relatively simple. The video frame capture module obtains a video frame with a larger preset frame number and sets it as a sub-video frame, and determines the watermark state according to the positional relationship between the target watermark of the sub-video frame and the target watermark of the main video frame to determine the path for watermark removal. When the number of video frames in the current area is less than the second preset video frame number, and the number of main video watermarks is multiple, it means that the current watermark information is relatively complex, and the video frame capture module selects a smaller frame number as the interval frame number. The captured video frame is the secondary video frame. If the number of video frames in the current area is less than or equal to the first preset number of video frames, a video frame is selected as the secondary video frame. If the number of video frames in the current area is between the first preset number of video frames and the second preset number of video frames, two video frames are selected as secondary video frames to accurately determine the watermark status. Furthermore, when there are multiple watermarks, one of the watermarks in the main video frame is selected as the reference watermark, and the watermark position of the secondary video frame within the set radius with the reference watermark position as the center is obtained. The watermark status is determined by the positional relationship between the reference watermark of the main video frame and the watermark of the secondary video frame.
[0026] In particular, when the present invention determines that the watermark state of the video to be processed is dynamic, the target watermark position of each video frame in the current area is identified according to the watermark path determination unit to obtain the path of the target watermark, and the cycle frame number of the target watermark is obtained from the path of the target watermark, so that the watermark removal module can efficiently determine the target watermark position of each video frame according to the path diagram and the watermark cycle frame number, thereby reducing the number of watermark identification times and improving the watermark removal efficiency.
[0027] In particular, the present invention is provided with a detection module for detecting the watermark removal effect of any area of the video to be processed. The detection module obtains the watermark removal rate of any area divided by the video frame capture module and compares it with the preset removal rate to evaluate the watermark removal effect. If the obtained removal rate is less than or equal to the first preset removal rate, it is determined that the current watermark removal effect is not good. The detection module divides the video area to be processed more clearly by increasing the preset number of areas, and the processing amount of each area is less, which is beneficial to the watermark recognition module to recognize the watermark in each area and avoid recognition errors. If the obtained removal rate is between the first preset removal rate and the second preset removal rate, it is determined that the current watermark removal effect is not good. The detection module reduces the distance between the auxiliary video frame and the main video frame by reducing the preset number of frames, so as to make the watermark information clearer. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a schematic diagram of a video watermark removal structure based on image processing according to an embodiment of the present invention;
[0029] Figure 2 This is a route diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0031] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0032] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0033] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0034] See also Figure 1 As shown, it is a schematic diagram of a video watermark removal system based on image processing according to an embodiment of the present invention. The video watermark removal system based on image processing according to an embodiment of the present invention includes:
[0035] A video frame capture module is used to divide the video into several areas according to the video playback time and frame rate of the video to be processed, capture a video frame in an area and set it as the main video frame of the current area, and capture the video frame with the interval frame number of the main video frame of the current area as the auxiliary video frame for the area;
[0036] a watermark identification module, which is connected to the video frame capture module and is used to identify the watermark information of the video to be processed, the watermark identification module comprising a watermark region determination unit for determining the watermark region by binarization processing of the main video frame of the current region, a watermark state determination unit for determining the watermark state according to the watermark positions of the main video frame and the auxiliary video frame of the current region, and a watermark path determination unit for determining the watermark path according to the watermark position changes of each video frame of the current region;
[0037] A watermark removal module, which is connected to the watermark identification module and is used to remove the watermark in the video to be processed according to the watermark information and the watermark path;
[0038] A detection module is connected to the video frame capture module and the watermark removal module, and is used to obtain the removal rate of the video watermark in any area captured by the video frame capture module, and adjust the number of areas preset by the video frame capture module according to the detection result so that the watermark removal effect meets the standard.
[0039] Specifically, the present invention divides the video into several areas according to the attributes of the video to be processed, and selects a video frame in the video of each area as the main video frame, identifies the watermark area of the main video frame, and determines whether the watermark state is static or dynamic according to the video frame with an adjacent playback time to the main video frame. When the watermark is determined to be dynamic, the watermark position is identified frame by frame for the video to be processed to determine the watermark path. At the same time, the present invention is also provided with a detection module, which evaluates the watermark removal effect of the video of one of the areas divided by the video frame capture module according to the watermark information obtained by the watermark recognition module. When the detection result is unqualified, the preset number of areas is adjusted to make the watermark removal effect meet the standard.
[0040] The video frame capture module compares the acquired playback time m of the video to be processed with the preset playback time, and selects the number of division regions to divide the video to be processed into regions, wherein:
[0041] When m≤M1, the video frame capture module selects a first preset number of regions N1 to divide the video to be processed into regions;
[0042] When M1<m<M2, the video frame capture module selects a second preset number of regions N2 to divide the video to be processed into regions;
[0043] When m≥M2, the video frame capture module selects a third preset number of regions N3 to divide the video to be processed into regions;
[0044] The video frame capture module presets a playback time group M, including a first preset playback time M1 and a second preset playback time M2; the video frame capture module also presets a first preset area number N1, a second preset area number N2 and a third preset area number N3.
[0045] The video frame capture module obtains the frame rate f of the video to be processed and compares it with the preset frame rate to adjust the number of selected areas, wherein:
[0046] When f≤F1, the video frame capture module selects the first preset adjustment parameter h1 to adjust the number of selected regions Ni to Ni1, and sets Ni1=Ni×[1+h1×(F1-f) / F1];
[0047] When F1<f<F2, the video frame capture module selects the second preset adjustment parameter h2 to adjust the number of selected areas Ni to Ni2, and sets Ni2=Ni×[1+h2×(f-F1)×(F2-f) / (F1×F2)];
[0048] When f≥F2, the video frame capture module selects the third preset adjustment parameter h3 to adjust the number of selected regions Ni to Ni3, and sets Ni3=Ni×[1+h3×(f-F2) / F2];
[0049] The video frame capture module presets a frame rate F, sets a first preset frame rate F1, a second preset frame rate F2, and i=1, 2, 3.
[0050] Specifically, the preset playback time, frame rate and number of areas of the video frame capture module in the embodiment of the present invention are not limited, as long as it can reasonably divide the video to be processed. The playback time and frame rate need to be considered in the division process to avoid the problem of inaccurate watermark recognition caused by excessive amount of video data to be processed. The embodiment of the present invention provides a preferred implementation scheme. The video frame capture module presets a frame rate of 15-25 frames / second, a first preset playback time of 15-20 frames / second, a second preset playback time of 20-25 frames / second, and a preset number of areas of 6-10, with the first preset number of areas being 6, the second preset number of areas being 8, and the third preset number of areas being 10.
[0051] Specifically, the embodiment of the present invention sets the adjustment parameters to 1.2-1.6, wherein the first preset adjustment parameter is 1.2, the second preset adjustment parameter is 1.4, and the third preset adjustment parameter is 1.6.
[0052] Among them, the present invention divides the playback time into two standards, compares the playback time of the video to be processed with the two standards of preset playback time respectively, selects the best number of areas from the number of areas preset by the video frame capture module to divide the video to be processed into regions, the longer the playback time, the more areas are selected, so that the video to be processed is divided into more areas, and the watermark of the video to be processed is more accurately identified. At the same time, the present invention adjusts the selected number of divided areas again according to the frame rate of the video to be processed, wherein, if the frame rate of the video to be processed is less than or equal to the first preset frame rate, the video frame capture module selects the first preset adjustment parameter set by it to adjust the number of divided areas, if the frame rate of the video to be processed is between the first preset frame rate and the second preset frame rate, the video frame capture module selects the second preset adjustment parameter set by it to adjust the number of divided areas, if the frame rate of the video to be processed is greater than or equal to the second preset frame rate, the video frame capture module selects the third preset adjustment parameter set by it to adjust the number of divided areas.
[0053] Specifically, after the video frame capture module divides the video to be processed into regions, the watermark recognition module starts the watermark region determination unit to perform binarization processing on the main video frame of the current region captured by the video frame capture module to determine the target contour of interest. When there is no similar contour in the target contour of interest, the width of the target contour of interest is greater than the difference between the width of the video frame to be processed and the preset width error, and the height of the target contour of interest is greater than the difference between the height of the video frame to be processed and the preset height error, the watermark region determination unit sets the target contour of interest as the target watermark; when there are several similar contours in the target contour of interest, the width of each similar contour of the target contour of interest is less than the difference between the width of the video frame to be processed and the preset width error, or the height of each similar contour of the target contour of interest is less than the difference between the height of the video frame to be processed and the preset height error, the watermark region determination unit sets each similar contour in the target contour of interest as the target watermark, and obtains the position of each target watermark.
[0054] Among them, after the video frame capture module of the present invention divides the processed video into regions, the watermark region determination unit binarizes the main video frame of one of the regions, and binarizes the main video frame according to the binarization threshold, so that the main video frame presents an obvious visual effect of only black and white, and highlights the outline of the target of interest. The watermark region determination unit analyzes the acquired target outline of interest. If the target outline of interest does not have a similar structure, it means that there is no repeated graphics in the target outline of interest. At the same time, when it is determined that the width and height of the target outline of interest are both greater than the width and height of the video frame to be processed, the target outline of interest is determined to be a single target outline, which is set as the target watermark. If the target outline of interest has a similar structure, and at the same time, any one of the width and height of the similar structure is less than the width and height of the video frame to be processed, it means that the watermark of the main video frame is repeated multiple, that is, the similar structure in the target outline of interest is determined to be the target watermark.
[0055] Specifically, after the watermark area determination unit obtains the target watermark and the target watermark position, under the first preset condition, the video frame capture module selects the first preset frame number y1 as the interval frame number to obtain a sub-video frame, and the watermark state determination unit determines the watermark state as static based on the obtained sub-video frame target watermark position. If the sub-video frame target watermark position is the same as the main video frame target watermark position, if the sub-video frame target watermark position is different from the main video frame target watermark position, then the watermark state is dynamic, wherein the first preset condition is that the number of target watermarks for the main video frame is one.
[0056] The video frame capture module selects a second preset frame number y2 as the interval frame number to obtain at least one sub-video frame under a second preset condition, and the watermark state determination unit determines the watermark state according to the acquired sub-video frame target watermark position and the main video frame watermark position. The watermark state determination unit selects any target watermark of the main video as the reference watermark, and the watermark state determination unit obtains the sub-video frame with the reference watermark position as the center and the target watermark position within a radius of r, and sets r=r0×(f / F0), where r0 is the preset radius standard value, and F0 is the preset frame rate standard value. If the target watermark position of any sub-video frame is the same as the reference watermark position of the main video frame, the watermark state determination unit determines that the watermark state is static, and if there is a sub-video frame whose target watermark position is different from the reference watermark position of the main video frame, the watermark state determination unit determines that the watermark state is static.
[0057] Among them, the second preset condition is that the target watermark water volume of the main video frame is multiple, and the number of video frames in the current area is less than the second preset number of video frames. If the number of video frames in the current area is less than or equal to the first preset number of video frames, the video frame capture module selects the number of sub-video frames as one. If the number of video frames in the current area is less than the second preset number of video frames and greater than or equal to the first preset number of video frames, the video frame capture module selects the number of sub-video frames as two.
[0058] Specifically, the present invention sets different watermark status determination methods according to different preset conditions. When the number of target watermarks in the main video is one, it means that the current watermark information is relatively simple. The video frame capture module obtains a video frame with a larger preset frame number and sets it as a sub-video frame, and determines the watermark state according to the position relationship between the target watermark of the sub-video frame and the target watermark of the main video frame to determine the path for watermark removal. When the number of video frames in the current area is less than the second preset video frame number, and the number of main video watermarks is multiple, it means that the current watermark information is relatively complex. The video frame capture module selects a smaller frame number as the interval frame. The captured video frames are sub-video frames. If the number of video frames in the current area is less than or equal to the first preset number of video frames, one video frame is selected as the sub-video frame. If the number of video frames in the current area is between the first preset number of video frames and the second preset number of video frames, two video frames are selected as sub-video frames to accurately determine the watermark status. Furthermore, when there are multiple watermarks, one of the watermarks in the main video frame is selected as the reference watermark, and the watermark position of the sub-video frame within the set radius with the reference watermark position as the center is obtained. The watermark status is determined according to the positional relationship between the reference watermark of the main video frame and the watermark of the sub-video frame.
[0059] Wherein, the video frame capture module selects a third preset frame number y3 as the interval frame number to obtain a number of sub-video frames under a third preset condition, and the watermark state determination unit determines the watermark state according to the target watermark position of the main video frame and the target watermark position of each sub-video frame, wherein, if the target watermark position of the main video frame is the same as the target watermark position of each sub-video frame, the watermark state determination unit determines that the watermark state is static, and if the target watermark position of the main video frame is different from the target watermark position of any sub-video frame, the watermark state determination unit determines that the watermark state is dynamic;
[0060] Among them, the third preset condition is that the number of video frames in the current area is greater than or equal to the second preset number of video frames. If the number of video frames in the current area is less than 2 times the second preset number of video frames, 2 sub-video frames are obtained. If the number of video frames in the current area is greater than 2 times the second preset number of video frames, 4 sub-video frames are obtained.
[0061] Specifically, the embodiment of the present invention does not limit the acquisition of the auxiliary video frame. The interval frame number with the preset frame number on one side of the main video frame can be used as the first auxiliary video frame, the interval frame number with the preset frame number on the other side of the main video frame can be used as the second auxiliary video frame, the interval frame number with the preset frame number of the first auxiliary video frame can be used as the third auxiliary video frame, and the interval frame number with the preset frame number of the second auxiliary video frame can be used as the fourth auxiliary video frame. The interval frame number with the preset frame number on one side of the main video frame can also be set to be the first auxiliary video frame, the interval frame number with the preset frame number of the first auxiliary video frame can be used as the second auxiliary video frame, the interval frame number with the preset frame number of the second auxiliary video frame can be used as the third auxiliary video frame, and the interval frame number with the preset frame number of the third auxiliary video frame can be used as the fourth auxiliary video frame.
[0062] Specifically, when the watermark path determination unit in the embodiment of the present invention obtains the target watermark state as static, the watermark path determination unit obtains the watermark path as the target watermark position, and the watermark removal module uses a pixel filling method to fill the watermark at the target watermark position with pixels to remove the watermark.
[0063] The width of the video frame to be processed is the x-axis, the frame height is the y-axis, and the target watermark center position of each video frame is the target watermark position coordinate. Figure 2As shown, it is a path diagram of an embodiment of the present invention. In the current area, the target watermark position coordinates of the first video frame 1 are (100, 500), the target watermark position coordinates of the second video frame 2 are (200, 400), the target watermark position coordinates of the third video frame 3 are (300, 300), the target watermark position coordinates of the fourth video frame 4 are (400, 200), the target watermark position coordinates of the fifth video frame 5 are (500, 300), the target watermark position coordinates of the sixth video frame 6 are (600, 400), and the target watermark position coordinates of the seventh video frame 7 are (700, 500). The watermark path is (100, 500) to (200, 400) to (300, 300) to (400, 200) to (500, 300) to (600, 400) to (700, 500), which is a path cycle.
[0064] When the target watermark state obtained by the watermark path determination unit is dynamic, the watermark path determination unit draws a path diagram according to the obtained target watermark position of each video frame in the current area, and obtains the watermark path and the number of watermark cycle frames according to the path diagram. The watermark removal module removes the target watermark of each video frame by using a pixel filling method according to the watermark information obtained by the watermark area determination unit and the watermark path obtained by the watermark path determination unit.
[0065] Among them, when the present invention determines that the state of the video watermark to be processed is dynamic, the target watermark watermark position of each video frame in the current area is identified according to the watermark path determination unit to obtain the path of the target watermark, and the cycle frame number of the target watermark is obtained from the path of the target watermark, so that the watermark removal module can efficiently determine the target watermark position of each video frame according to the path line diagram and the watermark cycle frame number, reduce the number of watermark identification times, and improve the watermark removal efficiency.
[0066] The detection module detects any area video after watermark removal, obtains the area removal rate b and the preset removal rate B to evaluate the watermark removal effect of the processed video, wherein:
[0067] When b≤B1, the detection module determines that the watermark removal effect of the processed video does not meet the standard, and the detection module adjusts the number of preset areas for accurately identifying the watermark, increases the number of each preset area Ni to Ni', and sets Ni'=Ni×[1+(B1-b) / B1];
[0068] When B1<b<B2, the detection module determines that the watermark removal effect of the processed video does not meet the standard, and the detection module adjusts the preset frame number used to obtain the auxiliary video frame, reduces each preset frame number yj to yj1, and sets yj1=yj×[1-(b-B1)×(B2-b) / (B1×B2)];
[0069] When b≥B2, the detection module determines that the watermark removal effect of the video to be processed meets the standard;
[0070] Wherein, the detection module presets a removal rate B, sets a first preset removal rate B1, a second preset removal rate B2, and j=1, 2, 3.
[0071] Specifically, the embodiment of the present invention does not limit the method for obtaining the removal rate. The removal rate can be obtained by taking the ratio of the number of successful watermark removals of each video frame in the current area to the total number of video frames in the current area, or by randomly selecting samples and setting the removal rate as the ratio of the number of successful watermark removals of the samples to the total number of samples.
[0072] Among them, the present invention is provided with a detection module for detecting the watermark removal effect of any area of the video to be processed. The detection module obtains the watermark removal rate of any area divided by the video frame capture module and compares it with the preset removal rate to evaluate the watermark removal effect. If the obtained removal rate is less than or equal to the first preset removal rate, it is determined that the current watermark removal effect is not good. The detection module divides the video area to be processed more clearly by increasing the preset number of areas, and the processing amount of each area is less, which is beneficial to the watermark recognition module to recognize the watermark in each area and avoid recognition errors. If the obtained removal rate is between the first preset removal rate and the second preset removal rate, it is determined that the current watermark removal effect is not good. The detection module reduces the distance between the auxiliary video frame and the main video frame by reducing the preset number of frames, so as to make the watermark information clearer.
[0073] Specifically, the video watermark removal method based on image processing in the embodiment of the present invention includes:
[0074] Step S1, the video frame capture module divides the video to be processed into several regions according to the video playback time and frame rate of the video to be processed, and captures a video frame in each region as a main video frame, and sets a video frame with a preset interval frame number from the main video frame as a sub-video frame;
[0075] Step S2, the watermark region determination unit performs binarization processing on the main video frame to determine the watermark region and determine the target watermark information, the watermark state determination unit compares the watermark position of the main video frame with the watermark position of the auxiliary video frame to determine the watermark state, the watermark path determination unit obtains the watermark path according to the watermark position of each video frame in the current region, and the watermark removal module removes the target watermark according to the target watermark information and the watermark path;
[0076] Step S3, the detection module detects the watermark removal status of any area, and adjusts the preset area number of the video frame capture module if the removal rate does not meet the standard.
[0077] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A video watermark removal system based on image processing, characterized in that: include: A video frame capture module, which is used to divide the video into several areas according to the video playback time and frame rate of the video to be processed, wherein the video frame capture module sets a captured video frame in a region as the main video frame of the current region, and sets the captured video frame with a corresponding number of frames interval with the main video frame of the current region as the auxiliary video frame for the region; a watermark identification module, which is connected to the video frame capture module and is used to identify the watermark information of the video to be processed, including a watermark region determination unit for determining the watermark region according to the main video frame of the current region after binarization, a watermark state determination unit for determining the watermark state according to the watermark positions of the main video frame and the auxiliary video frame of the current region, and a watermark path determination unit for determining the watermark path according to the watermark position changes of each video frame in the current region; The watermark state judgment unit is further used to determine the state of the watermark based on the selected target watermark position in the main video frame and the target watermark position in the auxiliary video frame having a first preset frame number y1 interval frame from the main video frame when the main video frame includes only one target watermark, and the state of the watermark includes a static watermark and a dynamic watermark; The watermark state judgment unit is further used to determine a reference watermark based on any target watermark in the selected main video frame when the main video frame includes multiple target watermarks, and to compare the reference watermark position in the selected main video frame with the target watermark positions in a plurality of auxiliary video frames having a second preset frame number y2 interval frames with the main video frame, and determine the state of the watermark based on the comparison result, wherein any of the target watermark positions is a corresponding watermark position within a radius r of any auxiliary video frame with the reference watermark position as the center; A watermark removal module, which is connected to the watermark identification module and is used to remove the watermark in the video to be processed according to the watermark path; A detection module is connected to the video frame capture module and the watermark removal module, and is used to detect the removal rate of the video watermark in any area captured by the video frame capture module, and to adjust the preset number of areas of the video frame capture module according to the detection result, or to adjust the preset number of frames for obtaining the auxiliary video frame, so that the watermark removal effect meets the standard.
2. The video watermark removal system based on image processing according to claim 1 is characterized in that: The video frame capture module is also used to determine the number of region divisions for the video to be processed based on the acquired playback time m of the video to be processed.
3. The video watermark removal system based on image processing according to claim 2 is characterized in that: The video frame capture module is also used to set a number of adjustment methods for the determined area division number based on the acquired frame rate f of the video to be processed, and the adjustment range of each adjustment method for the area division number is different.
4. The video watermark removal system based on image processing according to claim 3 is characterized in that: The watermark region determination unit is also used to perform binarization processing on the main video frame of the current region captured by the video frame capture module to determine the contour of the target of interest, and to determine the position of the target watermark based on the number of similar contour distributions within the determined contour of the target of interest.
5. The video watermark removal system based on image processing according to claim 4 is characterized in that: The watermark path determination unit is also used to draw a path diagram based on the target watermark position in each video frame of the current area when the watermark state is a dynamic watermark. The watermark removal module is also used to remove the watermark of each video frame by using a pixel filling method according to the watermark path and the watermark cycle frame number obtained based on the path diagram.
6. The video watermark removal system based on image processing according to claim 5 is characterized in that: The detection module is also used to detect any area video after watermark removal, and to determine the preset number of areas for accurately identifying watermarks when it is determined that the watermark removal effect of the video to be processed does not meet the standard based on the removal rate b of the area, or to determine the preset number of frames for obtaining the secondary video frame.
7. A video watermark removal method based on image processing using the system according to any one of claims 1 to 6, characterized in that: include, Step S1, the video frame capture module divides the video to be processed into several areas according to the video playback time and frame rate of the video to be processed, and captures a video frame in each area as a main video frame, and sets a video frame with a preset number of frames interval from the main video frame as a sub-video frame; Step S2, the watermark region determination unit determines the watermark region after binarization of the main video frame, determines the target watermark information, the watermark state determination unit compares the watermark position of the main video frame with the watermark position of the auxiliary video frame to determine the watermark state, the watermark path determination unit obtains the watermark path according to the watermark position of each video frame in the current region, and the watermark removal module removes the watermark according to the watermark path; Step S3, the detection module detects the watermark removal status of any area, and if the removal rate does not meet the standard, adjusts the preset number of areas of the video frame capture module, or adjusts the preset number of frames for obtaining the auxiliary video frame, so that the watermark removal effect meets the standard.
Citation Information
Patent Citations
A method and apparatus for removing watermarks from images
CN108550099B
Watermark removing algorithm based on inter-frame prediction
CN110278439A
Method for removing visible watermark in short video and computer readable storage medium
CN114862642A
Video watermark processing method, device, storage medium and system
CN114862643A
Video processing method and device, terminal, medium and program product
CN115988259A
