Intra-frame tampered video generation method and system
By slicing the original video, pre-processing the background layer, obtaining mask sequences, computing foreground layer and copying mask area attributes, the problems of high cost and low quality of intra-frame tampered video reference samples in the existing technology are solved, and efficient and low-cost tampered video generation is achieved, which has important application value.
Patent Information
- Application Number
- CN202411574227.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-06
AI Technical Summary
In the prior art, the production cost of intra-tampered video reference samples is high and the quality is low, making it difficult to meet the demand for video tampered detection.
By slicing the original video into video clips, the background layer of each clip is obtained and preprocessed; the mask sequence of the tampered target is obtained from each clip; the foreground layer is obtained based on the mask sequence, and the brightness value and contrast difference is calculated; the mask area attribute is obtained using the automatic tracking tool and copied it to the original video layer; the brightness and contrast adjustment of the original video layer is performed to generate post-processed tampered video.
It greatly reduces labor and time costs, provides rich high-quality data, and has important application value in video tampering and positioning for evidence collection.
Smart Images

Figure CN119603434A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video tampering, and in particular to a method and system for generating intra-frame tampered video. Background Art
[0002] Video plays an important role in public security, social media, data transmission and other fields. With the development of video editing technology, the problem of video tampering has become increasingly prominent. With the help of video editing software, ordinary people can also tamper with videos at a low learning cost, and Adobe Effect is the most widely used video special effects production software. And under the premise of sufficient time, the tamperer can modify and post-process the video frame by frame, and the tampered video will not leave obvious visual tampering traces. In the era of self-media, such tampered videos can be easily spread to the public through the Internet, and those who are not aware of it will inevitably be misled, and even cause serious social impact.
[0003] Intra-frame tampering refers to modifying the content of a frame in a video, adding or removing an object in a frame, changing the color or texture of an object, etc. However, in the actual task of detecting intra-frame tampering in a video, since a large number of tampered videos are needed as reference samples, it is necessary not only to modify the content frame by frame and perform post-processing, but also to pay attention to the quality of the tampering, which requires a lot of manpower and time costs.
[0004] Therefore, the prior art needs to be improved. Summary of the invention
[0005] The technical problem to be solved by the present invention is that, in view of the defects of the prior art, the present invention provides a method and system for generating intra-frame tampered video to solve the problems of high production cost and low quality of existing tampered video reference samples.
[0006] The technical solution adopted by the present invention to solve the technical problem is as follows: In a first aspect, the present invention provides a method for generating an intra-frame tampered video, comprising: Slice the given original video into original video segments, obtain the background layer of each segment, and perform preprocessing; Obtaining a mask sequence of the tampered target from each fragment; Acquire a foreground layer corresponding to each segment according to the mask sequence, and calculate a brightness value and a contrast difference according to the foreground layer and the background layer to obtain a brightness value and a contrast difference value of each frame of video in each segment; Using an automatic tracking tool to obtain mask area attributes corresponding to the mask sequence, and completely copying the mask area attributes from the adjustment layer to the original video layer; The brightness and contrast of the mask area of the original video layer are adjusted to obtain the post-processed tampered video.
[0007] In one implementation, slicing a given original video into original video segments, obtaining a background layer of each segment, and performing preprocessing includes: Slice a given original video into original video segments; wherein the original video segment includes a plurality of targets of divisible regions; the targets are moving or stationary targets, and each frame in which the target appears continuously in the original video segment is a frame to be tampered with in the video; Get the background layer of each clip and perform preprocessing to adjust the video frame rate, video resolution, and video duration to the same value.
[0008] In one implementation, obtaining the background layer of each segment includes: Selecting a video frame of the same length as the original video after removing the original video clip as the first background layer; or selecting another video with the same number of frames, the same resolution, and similar content as the original video as the first background layer; Select a video with a longer time span that is the same or similar to the original video scene, randomly sample all frames of each segment of the video after segmentation, and randomly recombine to obtain a background frame sequence of N segments with the same number of frames as the original video as the second background layer; The first background layer and the second background layer are packaged into a background layer corresponding to each fragment.
[0009] In one implementation, obtaining a mask sequence of the tampered target from each segment includes: Use the region segmentation model to extract n target mask regions from a frame where the target appears completely; The n target mask regions of the obtained video are taken one by one together with the original video as inputs of the target segmentation model to obtain mask sequences corresponding to the n target mask regions.
[0010] In one implementation, the mask sequence is a sequence of masks of binary images; wherein the number of frames and image resolution corresponding to the mask sequence are the same as the number of frames and image resolution corresponding to the original video, the area where the value of the mask sequence is 0 is the background area, and the area where the value of the mask sequence is 1 is the foreground area.
[0011] In one implementation, acquiring the foreground layer corresponding to each segment according to the mask sequence, and calculating the brightness value and contrast difference according to the foreground layer and the background layer, includes: Loading the original video, the obtained background layer and the mask sequence, dilating the mask sequence one by one, and performing boundary extraction to obtain the inner and outer boundaries of the mask area; Selecting a first pixel point set and a second pixel point set equidistantly from the inner and outer boundaries respectively; Calculate the brightness value and contrast difference of the closest points in the first pixel point set and the second pixel point set to generate a difference value set; Analyzing the difference value set using a clustering algorithm to determine the brightness value and contrast difference value of each frame; Smoothing filtering adjusts the brightness value and contrast difference to ensure the visual continuity of the tampered video, and saves the result as a brightness contrast list for adjusting the background layer in the video processing software.
[0012] In one implementation, the step of adjusting the brightness and contrast of the mask area of the original video layer to obtain a post-processed tampered video includes: Selecting the original video layer, calling the automatic tracking tool to convert the video target segmentation mask into a mask attribute; Modifying the mask area in the original video layer and adjusting the mask feather and mask expansion values; According to the calculated brightness value and contrast difference, the brightness and contrast of the background layer are adjusted using a brightness and contrast adjustment tool, and the background layer is placed at the bottom of the layer of the original video to generate the tampered video.
[0013] In a second aspect, the present invention provides a system for generating an intra-frame tampered video, comprising: The original video segment module is used to slice the given original video into original video segments, obtain the background layer of each segment, and perform preprocessing; A mask sequence acquisition module is used to acquire a mask sequence of a tampered target from each fragment; A brightness and contrast difference calculation module, used to obtain the foreground layer corresponding to each segment according to the mask sequence, and calculate the brightness value and contrast difference according to the foreground layer and the background layer to obtain the brightness value and contrast difference value of each frame of video in each segment; A mask area attribute acquisition module, used for acquiring the mask area attributes corresponding to the mask sequence using an automatic tracking tool, and completely copying the mask area attributes from the adjustment layer to the original video layer; The brightness and contrast adjustment module is used to adjust the brightness and contrast of the mask area of the original video layer to obtain a post-processed tampered video.
[0014] In a third aspect, the present invention provides a terminal, comprising: a processor and a memory, wherein the memory stores an intra-frame tampered video generation program, and when the intra-frame tampered video generation program is executed by the processor, it is used to implement the operation of the intra-frame tampered video generation method as described in the first aspect.
[0015] In a fourth aspect, the present invention further provides a medium, which is a computer-readable storage medium, and which stores an intra-frame tampered video generation program. When the intra-frame tampered video generation program is executed by a processor, it is used to implement the operation of the intra-frame tampered video generation method as described in the first aspect.
[0016] The present invention adopts the above technical solution to achieve the following effects: The present invention obtains the background layer of each original video clip and performs preprocessing; obtains the mask sequence of the tampered target from each clip; and obtains the foreground layer corresponding to each clip according to the mask sequence, calculates the brightness value and contrast difference used for background layer adjustment in Adobe Effect; and obtains the mask area attribute corresponding to the mask sequence by using an automatic tracking tool, and completely copies the mask area attribute from the adjustment layer to the original video layer; and performs brightness and contrast adjustment processing on the mask area of the original video layer to obtain the post-processed tampered video. The present invention can provide rich high-quality data for the pre-training of the video tampering positioning model, greatly reduces the labor and time costs, and has important application value in video tampering positioning forensics. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0018] Figure 1 It is a flow chart of the method for generating intra-frame tampered video in the present invention.
[0019] Figure 2 It is a flowchart of the specific implementation of the Adobe Effect tampering video generation method in the present invention.
[0020] Figure 3 It is a flow chart of the steps of obtaining the video target segmentation mask in the present invention.
[0021] Figure 4 The Adobe Effect tampered video generation method of the present invention automatically generates a comparison chart of the tampered video frame and the original video frame.
[0022] Figure 5 The Adobe Effect tampered video generation method of the present invention automatically generates a tampered video frame and a tampered area mask comparison chart.
[0023] Figure 6It is a functional principle diagram of a terminal in one implementation of the present invention.
[0024] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. 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.
[0026] Exemplary Methods Existing video frame tampering detection models require a large amount of frame tampering sample data for training, so that they can quickly and accurately detect the tampered parts in the video in the actual video frame tampering detection task; frame tampering refers to the modification of the content of the frame in the video, adding or removing objects in a frame image, changing the color or texture of the object, etc. However, in the actual video frame tampering detection task, since a large number of tampered videos are needed as reference samples, not only the content needs to be modified frame by frame and post-processed, but also attention needs to be paid to the tampering quality, which requires a lot of manpower and time costs.
[0027] In view of the above technical problems, an embodiment of the present invention provides a method for generating intra-frame tampered videos, which obtains the background layer of each original video clip and performs preprocessing; obtains the mask sequence of the tampered target from each clip; and obtains the foreground layer corresponding to each clip according to the mask sequence, and calculates the brightness value and contrast difference used for adjusting the background layer in Adobe Effect (graphic video processing software); and obtains the mask area attributes corresponding to the mask sequence by using an automatic tracking tool, and completely copies the mask area attributes from the adjustment layer to the original video layer; and performs brightness and contrast adjustment processing on the mask area of the original video layer to obtain a post-processed tampered video. Therefore, the method provided in the embodiment of the present invention can provide rich high-quality data for the pre-training of the video tampering positioning model, greatly reducing the labor and time costs, and has important application value in video tampering positioning forensics.
[0028] like Figure 1 As shown, an embodiment of the present invention provides a method for generating an intra-frame tampered video, comprising the following steps: Step S100, slicing a given original video into original video segments, obtaining a background layer of each segment, and performing preprocessing.
[0029] In this embodiment, the intra-frame tampering video generation method obtains a tampering target mask sequence by automatically processing the original video, and then imports the original video, the mask sequence and the background layer into the Adobe Effect software to generate a post-processed tampered video. The whole process is implemented using the Adobe Effect script program. The tampered video dataset generated in this embodiment can be used for pre-training of a video frame intra-frame tampering detection deep model.
[0030] like Figure 2 As shown, as an example, in the actual application scenario, the method in this embodiment first needs to prepare the original video, select the tampering target, and select the method for obtaining the mask sequence; then, select the background layer according to the need to select the method for obtaining the background layer, and calculate the brightness and contrast differences based on the original video and the background layer; finally, use the video target segmentation mask to convert the mask sequence into the AE mask property of the original video layer, construct the tampered video, and post-process and export the modified video.
[0031] Specifically, in an implementation of this embodiment, step S100 includes the following steps: Step S101, slicing a given original video into original video segments; wherein the original video segments include multiple divisible region targets; In this embodiment, the original video clip needs to include targets with N (N>2) divisible areas. These targets can be moving or stationary targets such as people, wall hangings or doors. Each frame in which the target appears in the original video clip can be used as a frame to be tampered with in the video. The tampered targets should appear continuously in time to provide inter-frame features of the tampering behavior.
[0032] Step S102, obtaining the background layer of each segment, and performing preprocessing to adjust the video frame rate, video resolution and video duration to the same value.
[0033] Specifically, in an implementation of this embodiment, obtaining the background layer of each segment in step S102 includes the following steps: Step S102a, selecting a video frame of the same length as the original video after removing the original video segment as the first background layer; or selecting another video with the same number of frames, the same resolution, and similar content as the original video as the first background layer; Step S102b, selecting a video with a longer time span that is the same or similar to the original video scene, randomly sampling all frames of each segment of the video after segmentation, and randomly reorganizing to obtain N background frame sequences (i.e., background PNG sequences) with the same number of frames as the original video as the second background layer; Step S102c: Packing the first background layer and the second background layer into a background layer corresponding to each segment.
[0034] As an example, in this embodiment, the tampered video generated based on the video target segmentation mask is as follows: Step 1: Prepare the tampered video containing the tampered target in advance; Figure 5 As shown, Figure 5 Take the video surveillance scene shown in as an example, assuming that a person is selected as the tampering target, the following two background layers need to be generated: Background layer 1 (i.e. the first background layer): select an image frame where the person does not appear in the scene; a video clip with the same number of frames as the original video where the person does not appear in the scene is used as background layer 1; Background layer 2 (i.e., the second background layer): Since background layer 1 is relatively simple and is captured from the original video scene, and a background image needs to be post-processed before it can be applied to each frame, the pixel similarity of the tampered area of each frame is very high. Especially when different target masks have intersecting areas, after repeated tampering of the same original video, the pixels in most areas show the same statistical characteristics, which is not conducive to model pre-training. In order to increase the generalization ability of the pre-training dataset, the background layer is constructed in the following way: select a video with a longer time span that is the same or similar to the original video scene, randomly sample all frames of each video after segmentation, and obtain N background PNG sequences with the same number of frames as the original video after random recombination, as background layer 2; It is worth mentioning that when generating the above two background layers, if the background layer is a video, the video frame rate, video resolution, and video duration of the background layer need to be adjusted to be consistent with the original video; if the background layer is an image, the image resolution needs to be adjusted to be consistent with the original video.
[0035] The traditional manual video tampering method cannot generate tampered videos on a large scale. Under the premise of focusing on the tampering quality, it is often necessary to select the tampered area frame by frame and perform post-processing adjustments, which is inefficient and consumes a lot of time and energy. In this embodiment, an automated process is realized by combining the Adobe Effect tool. By generating the above two background layers, the mask sequence of the tampered target can be obtained from each clip, and the generated background layer and the obtained mask sequence can be used for subsequent tampering, so that a large number of tampered videos can be generated in a relatively short time, which greatly saves time and labor costs.
[0036] like Figure 1 As shown, an embodiment of the present invention provides a method for generating an intra-frame tampered video, comprising the following steps: Step S200, obtaining a mask sequence of the tampered target from each segment.
[0037] In this embodiment, the SAM large model and the XMem model are used to obtain the mask sequence of the tampered target from each fragment; by using the SAM large model and the XMem model to assist in the segmentation of the video target, it is possible to tamper with specific targets in the video. Compared with the traditional method of tampering with random areas, the method of obtaining the mask sequence in this embodiment is, on the one hand, richer in semantic information and high-quality visual effects, and on the other hand, more similar to the steps and ideas of actual video tampering, and can provide more features of actual tampered videos.
[0038] Specifically, in an implementation of this embodiment, step S200 includes the following steps: Step S201, using a region segmentation model (i.e., SAM model) to extract n target mask regions from a frame where the target appears completely; In step S202, the n target mask regions of the obtained video are taken one by one together with the original video as inputs of a target segmentation model (i.e., an XMem model, where the XMem model is a video object segmentation architecture for long videos) to obtain mask sequences corresponding to the n target mask regions.
[0039] It can be understood that the mask sequence in this embodiment is a sequence composed of masks of binary images; wherein the number of frames and image resolution corresponding to the mask sequence are the same as the number of frames and image resolution corresponding to the original video, the area where the value of the mask sequence is 0 is the background area, and the area where the value of the mask sequence is 1 is the foreground area.
[0040] As an example, the tampered video generation method based on the video target segmentation mask also includes the following: Step 2: The flow chart of this step is as follows Figure 3 As shown in the figure, first, initialize the SAM model and XMem model, select the video file to be processed through the GUI interface, use the set code to extract all frames from the video and initialize the video state. Then, according to the initial frame selected by the video, perform target segmentation to generate the initial object masks mask_1 to mask_k. Finally, after preliminary screening, the streamlined mask_1 to mask_n are obtained.
[0041] The initial screening is based on the center of gravity of the mask and the size of the mask area. Under the premise of the range, the scores are sorted in descending order and the first n scores are selected.
[0042]
[0043]
[0044] The target object to be tracked is determined according to the above n masks, and the object in the video is tracked to generate mask tracking results masks_1 to masks_n.
[0045] Finally, the tracking results are saved, including the mask binary image of each frame, and a YAML file is generated to record metadata such as video information and mask duration frame interval; It is worth mentioning that the mask generated by the above scheme is a binary image with the same size as the original video. Each frame of the video will correspond to a mask, and finally stored in the form of a PNG sequence. Assuming that an initial video is selected Targets are tracked and obtained after screening targets, the number of video frames is , then the original video can generate a total of A tampered mask sequence.
[0046] like Figure 1 As shown, an embodiment of the present invention provides a method for generating an intra-frame tampered video, comprising the following steps: Step S300, obtaining the foreground layer corresponding to each segment according to the mask sequence, and calculating the brightness value and contrast difference according to the foreground layer and the background layer to obtain the brightness value and contrast difference value of each frame of video in each segment.
[0047] Specifically, in an implementation of this embodiment, step S300 includes the following steps: Step S301, loading the original video, the obtained background layer and the mask sequence, and performing ( The default value is 3, and the dilation kernel size can be customized) dilation processing and boundary extraction are performed to obtain the inner and outer boundaries of the mask area; Step S302, a first pixel point set of N 3×3 pixels and a second pixel point set of N 3×3 pixels are equidistantly selected from the inner and outer boundaries respectively; wherein N is the number of pixels on the inner boundary divided by , The value of can be defined as needed; the first pixel point set and the second pixel point set are used for brightness contrast calculation; Step S303, calculating the brightness value and contrast difference of the closest points in the first pixel point set and the second pixel point set to generate a difference value set; Step S304, using a clustering algorithm (i.e., K-means clustering algorithm) to analyze the difference value set to determine the brightness value and contrast difference value of each frame; Step S305, smoothing filtering adjusts the brightness value and contrast difference to ensure visual continuity of the tampered video, and saves the result as a brightness contrast list; the brightness contrast list is used for adjusting the background layer in the video processing software (ie, Adobe Effect).
[0048] As an example, the tampered video generation method based on the video target segmentation mask also includes the following: Step 3: Calculate the brightness and contrast adjustment values of the background layer and the original video frame by frame. The steps are as follows: 1) Load the original video and background layer, and then loop through k layers of length The following processing is performed on each mask sequence: 2) Perform the mask sequence one by one ( The default value is 3, and the dilation kernel size can be customized) dilation processing, and then boundary extraction is performed to obtain the inner and outer boundaries of the mask area; 3) Select N 3×3 pixel point sets A and N 3×3 pixel point sets B from the inner and outer boundaries at equal distances (N is the number of inner boundary pixels divided by , The value can be defined as needed) and is used for brightness contrast calculation; 4) Calculate the brightness and contrast difference between the closest points in A and B to generate a difference set Delta; 5) Use K-Means clustering to analyze Delta and determine the brightness and contrast differences of each frame; 6) Smoothing filter adjusts the brightness and contrast difference to ensure the visual coherence of the tampered video, and saves the result as a brightness contrast list for adjusting the background layer in Adobe Effect and saves it to i.txt n txt files, which record the brightness and contrast adjustment values (d_brightness, d_contrast) of each video frame where the character appears.
[0049] like Figure 1 As shown, an embodiment of the present invention provides a method for generating an intra-frame tampered video, comprising the following steps: Step S400, using an automatic tracking tool to obtain mask area attributes corresponding to the mask sequence, and completely copying the mask area attributes from the adjustment layer to the original video layer; Step S500, performing brightness and contrast adjustment processing on the mask area of the original video layer to obtain a post-processed tampered video.
[0050] In this embodiment, the Auto Trace tool of Adobe Effect is used as an automatic tracing tool to analyze the mask sequence, obtain the mask area properties of Adobe Effect, and then completely copy the mask area properties of Adobe Effect from the adjustment layer to the original video layer; after the tampered video is formed, the mask area of the original video layer is post-processed, that is, the brightness and contrast of the background layer are processed to obtain the tampered video after Adobe Effect post-processing.
[0051] Specifically, in an implementation of this embodiment, step S500 includes the following steps: Step S501, selecting the original video layer, calling the automatic tracking tool (ie, Auto Trace tool) to convert the video target segmentation mask into the mask attribute of Adobe Effect; Step S502, tampering with the Adobe Effect mask area in the original video layer, and adjusting the mask feathering and mask expansion values; Step S503, according to the calculated brightness value and contrast difference, use the brightness and contrast adjustment tool to adjust the brightness and contrast of the background layer, and place the background layer at the bottom of the layer of the original video to generate the tampered video.
[0052] As an example, the tampered video generation method based on the video target segmentation mask also includes the following: Step 4: Open Adobe Effect, import the original video, import background layer 1 for the first time to tamper with the video, and import background layer 2 for the second time to tamper with the video. The subsequent steps are as follows: 1) In the original video layer, according to the read txt file, create n compositions in a loop. If it is background layer 1, import the background layer directly; if it is background layer 2, import the i-th background layer into the i-th composition. .
[0053] For the i The mask sequence uses the Auto trace tool to create mask properties frame by frame, and copies the mask to the original layer frame by frame, thereby tampering with the Adobe Effect mask area in the original video layer and adjusting the mask feather and mask expansion values. Call the brightness and contrast adjustment tool to adjust the background layer, that is, according to i.txt Each pair of (d_brightness, d_contrast) adjustment values obtained from the file is adjusted, and the background layer is placed at the bottom of the original video layer, and the tampered video is exported and generated.
[0054] like Figure 4 As shown, Figure 4 The middle is a visual comparison of the tampered video frame (left) and the original video frame (right). After post-processing of brightness contrast adjustment, mask feathering and mask expansion, it is difficult to accurately find the tampered pixel area visually. Figure 5 As shown, Figure 5 The middle left column shows the binary images of the tampered areas, and the right column shows the corresponding tampered video frames.
[0055] In order to illustrate that the tampered video automatically generated in this embodiment can play an important role in the video forensics method. This embodiment builds a deep model MVSS-Net applied in the field of forensics, and then uses the tampered video in the form of PNG sequence as a training image sample, trains on the MVSS-Net model, and then tests the performance of the trained model on the artificial tampering database.
[0056] Table 1
[0057] It can be seen from Table 1 that using the dataset generated by this method as a pre-training dataset for the image tampering detection model can enable the MVSS-Net model to learn actual manual tampering features to a certain extent, thereby improving the video tampering detection capability for the Adobe Effect software.
[0058] Existing automated generation methods usually rely on ordinary video frame processing or simple AI technology, which cannot simulate video frame characteristics similar to the Adobe Effect tampering process, resulting in significant differences in the statistical properties of the generated video from the real Adobe Effect tampered video. In this embodiment, Adobe Effect is still fundamentally used for tampering, and other tools only provide auxiliary functions, so the generated tampered video is closer to the real tampered video in statistical characteristics. In addition, this embodiment also provides a UI for adjusting the tampered area in an interactive form, which can provide a high-quality video target segmentation mask after adjustment, and then use Adobe Effect for automated video tampering to generate a video that is similar to manual high-quality tampering. Therefore, this embodiment can provide rich high-quality data for the pre-training of the video tampering positioning model, greatly reducing labor and time costs, and has important application value in video tampering positioning forensics.
[0059] This embodiment achieves the following technical effects through the above technical solution: This embodiment obtains the background layer of each original video clip and performs preprocessing; obtains the mask sequence of the tampered target from each clip; and obtains the foreground layer corresponding to each clip according to the mask sequence, and calculates the brightness value and contrast difference used for background layer adjustment in Adobe Effect; and obtains the mask area attributes corresponding to the mask sequence by using the automatic tracking tool, and completely copies the mask area attributes from the adjustment layer to the original video layer; and performs brightness and contrast adjustment processing on the mask area of the original video layer to obtain the post-processed tampered video. This embodiment can provide rich high-quality data for the pre-training of the video tampering positioning model, greatly reducing the labor and time costs, and has important application value in video tampering positioning forensics.
[0060] Exemplary Devices Based on the above embodiment, the present invention further provides a system for generating an intra-frame tampered video, comprising: The original video segment module is used to slice the given original video into original video segments, obtain the background layer of each segment, and perform preprocessing; A mask sequence acquisition module is used to acquire a mask sequence of a tampered target from each fragment; A brightness and contrast difference calculation module, used to obtain the foreground layer corresponding to each segment according to the mask sequence, and calculate the brightness value and contrast difference according to the foreground layer and the background layer to obtain the brightness value and contrast difference value of each frame of video in each segment; A mask area attribute acquisition module, used for acquiring the mask area attributes corresponding to the mask sequence using an automatic tracking tool, and completely copying the mask area attributes from the adjustment layer to the original video layer; The brightness and contrast adjustment module is used to adjust the brightness and contrast of the mask area of the original video layer to obtain a post-processed tampered video.
[0061] This embodiment achieves the following technical effects through the above technical solution: This embodiment obtains the background layer of each original video clip and performs preprocessing; obtains the mask sequence of the tampered target from each clip; and obtains the foreground layer corresponding to each clip according to the mask sequence, and calculates the brightness value and contrast difference used for background layer adjustment in Adobe Effect; and obtains the mask area attributes corresponding to the mask sequence by using the automatic tracking tool, and completely copies the mask area attributes from the adjustment layer to the original video layer; and performs brightness and contrast adjustment processing on the mask area of the original video layer to obtain the post-processed tampered video. This embodiment can provide rich high-quality data for the pre-training of the video tampering positioning model, greatly reducing the labor and time costs, and has important application value in video tampering positioning forensics.
[0062] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be as follows: Figure 6 shown.
[0063] The terminal includes: a processor, a memory, an interface, a display screen and a communication module connected through a system bus; wherein the processor of the terminal is used to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is used to connect to external devices; the display screen is used to display corresponding information; and the communication module is used to communicate with a cloud server or other devices.
[0064] When the computer program is executed by a processor, it is used to implement the operation of the intra-frame tampering video generation method.
[0065] It can be understood by those skilled in the art that Figure 6 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0066] In one embodiment, a terminal is provided, which includes: a processor and a memory, wherein the memory stores an intra-frame tampered video generation program, and when the intra-frame tampered video generation program is executed by the processor, it is used to implement the operation of the above intra-frame tampered video generation method.
[0067] In one embodiment, a storage medium is provided, wherein the storage medium stores an intra-frame tampered video generation program, and when the intra-frame tampered video generation program is executed by a processor, it is used to implement the operation of the intra-frame tampered video generation method as described above.
[0068] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and volatile memory.
[0069] In summary, the present invention provides a method and system for generating intra-frame tampered videos, including: slicing a given original video into original video segments, obtaining the background layer of each segment, and performing preprocessing; obtaining a mask sequence of the tampered target from each segment; obtaining the foreground layer corresponding to each segment according to the mask sequence, and calculating the brightness value and contrast difference according to the foreground layer and the background layer, and obtaining the brightness value and contrast difference value of each frame of video in each segment; using an automatic tracking tool to obtain the mask area attributes corresponding to the mask sequence, and completely copying the mask area attributes from the adjustment layer to the original video layer; performing brightness and contrast adjustment processing on the mask area of the original video layer, and obtaining a post-processed tampered video. The present invention can provide rich high-quality data for pre-training of a video tampering positioning model, greatly reducing labor and time costs, and has important application value in video tampering positioning forensics.
[0070] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for generating an intra-frame tampered video, characterized in that: include: Slice the given original video into original video segments, obtain the background layer of each segment, and perform preprocessing; Obtaining a mask sequence of the tampered target from each fragment; Acquire a foreground layer corresponding to each segment according to the mask sequence, and calculate a brightness value and a contrast difference according to the foreground layer and the background layer to obtain a brightness value and a contrast difference value of each frame of video in each segment; Using an automatic tracking tool to obtain mask area attributes corresponding to the mask sequence, and completely copying the mask area attributes from the adjustment layer to the original video layer; The brightness and contrast of the mask area of the original video layer are adjusted to obtain the post-processed tampered video.
2. The method for generating an intra-frame tampered video according to claim 1, characterized in that: The step of slicing a given original video into original video segments, obtaining a background layer of each segment, and performing preprocessing includes: Slice a given original video into original video segments; wherein the original video segment includes a plurality of targets of divisible regions; the targets are moving or stationary targets, and each frame in which the target appears continuously in the original video segment is a frame to be tampered with in the video; Get the background layer of each clip and perform preprocessing to adjust the video frame rate, video resolution, and video duration to the same value.
3. The method for generating an intra-frame tampered video according to claim 2, characterized in that: The step of obtaining the background layer of each fragment includes: Selecting a video frame of the same length as the original video after removing the original video clip as the first background layer; or selecting another video with the same number of frames, the same resolution, and similar content as the original video as the first background layer; Select a video with a longer time span that is the same or similar to the original video scene, randomly sample all frames of each segment of the video after segmentation, and randomly recombine to obtain a background frame sequence of N segments with the same number of frames as the original video as the second background layer; The first background layer and the second background layer are packaged into a background layer corresponding to each fragment.
4. The method for generating an intra-frame tampered video according to claim 1, characterized in that: The step of obtaining a mask sequence of the tampered target from each fragment includes: Use the region segmentation model to extract n target mask regions from a frame where the target appears completely; The n target mask regions of the obtained video are taken one by one together with the original video as inputs of the target segmentation model to obtain mask sequences corresponding to the n target mask regions.
5. The method for generating an intra-frame tampered video according to claim 1 or 4, characterized in that: The mask sequence is a sequence of masks of binary images; wherein the number of frames and image resolution corresponding to the mask sequence are the same as the number of frames and image resolution corresponding to the original video, the area where the value of the mask sequence is 0 is the background area, and the area where the value of the mask sequence is 1 is the foreground area.
6. The method for generating an intra-frame tampered video according to claim 1, characterized in that: The step of obtaining a foreground layer corresponding to each segment according to the mask sequence, and calculating a brightness value and a contrast difference according to the foreground layer and the background layer includes: Loading the original video, the obtained background layer and the mask sequence, dilating the mask sequence one by one, and performing boundary extraction to obtain the inner and outer boundaries of the mask area; Selecting a first pixel point set and a second pixel point set equidistantly from the inner and outer boundaries respectively; Calculate the brightness value and contrast difference of the closest points in the first pixel point set and the second pixel point set to generate a difference value set; Analyzing the difference value set using a clustering algorithm to determine the brightness value and contrast difference value of each frame; Smoothing filtering adjusts the brightness value and contrast difference to ensure the visual continuity of the tampered video, and saves the result as a brightness contrast list for adjusting the background layer in the video processing software.
7. The method for generating an intra-frame tampered video according to claim 1, characterized in that: The step of adjusting the brightness and contrast of the mask area of the original video layer to obtain a post-processed tampered video includes: Selecting the original video layer, calling the automatic tracking tool to convert the video target segmentation mask into a mask attribute; Modifying the mask area in the original video layer and adjusting the mask feather and mask expansion values; According to the calculated brightness value and contrast difference, the brightness and contrast of the background layer are adjusted using a brightness and contrast adjustment tool, and the background layer is placed at the bottom of the layer of the original video to generate the tampered video.
8. A system for generating intra-frame tampered video, characterized in that: include: The original video segment module is used to slice the given original video into original video segments, obtain the background layer of each segment, and perform preprocessing; A mask sequence acquisition module is used to acquire a mask sequence of a tampered target from each fragment; A brightness and contrast difference calculation module, used to obtain the foreground layer corresponding to each segment according to the mask sequence, and calculate the brightness value and contrast difference according to the foreground layer and the background layer to obtain the brightness value and contrast difference value of each frame of video in each segment; A mask area attribute acquisition module, used for acquiring the mask area attributes corresponding to the mask sequence using an automatic tracking tool, and completely copying the mask area attributes from the adjustment layer to the original video layer; The brightness and contrast adjustment module is used to adjust the brightness and contrast of the mask area of the original video layer to obtain a post-processed tampered video.
9. A terminal, characterized in that: include: A processor and a memory, wherein the memory stores an intra-frame tampered video generation program, and when the intra-frame tampered video generation program is executed by the processor, it is used to implement the operation of the intra-frame tampered video generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an intra-frame tampered video generation program, and when the intra-frame tampered video generation program is executed by a processor, it is used to implement the operation of the intra-frame tampered video generation method as described in any one of claims 1-7.
Citation Information
Patent Citations
Video coding and decoding, searching method and device
CN109495749A
Intelligent video character replacement method and system
CN114627404A
Tampered video generation method and system based on semantic guidance
CN117201839A
Feature- and classifier-based vehicle headlight / shadow removal in video
US20150278616A1
Preparation systems for efficiently generating alpha mattes and modified digital videos utilizing polarized light
US20240296612A1