Video processing method, device, computer equipment and storage medium
By performing three-level wavelet decomposition, visual sensitivity calculation and region segmentation, feature extraction and fusion on video data, combined with watermark information encryption and embedding strength adjustment, the image distortion problem caused by traditional watermark embedding methods is solved, achieving high-quality watermark embedding and improved image management efficiency.
Patent Information
- Application Number
- CN202411626665.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-13
AI Technical Summary
Traditional watermark embedding methods are prone to causing image distortion, affecting critical aspects such as disease diagnosis and insurance claims, and cannot maximize the watermark embedding capacity while ensuring image integrity.
By performing three-level wavelet decomposition, visual sensitivity calculation, and region segmentation on video data, and combining feature extraction and fusion with watermark information encryption and embedding strength adjustment, high-quality watermark embedding is achieved.
While ensuring video quality, the watermark embedding capacity is maximized to achieve tamper-proof and traceable images, improve storage and management efficiency, and provide a reliable basis for disease diagnosis and insurance claims.
Smart Images

Figure CN119629436B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to the field of digital healthcare, and particularly to a video processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In the fields of digital healthcare and finance, the archiving and management of images are receiving increasing attention. To ensure the authenticity and integrity of images and prevent them from being illegally tampered with or misused, a common method is to embed watermarks on the images. This watermarking technology not only helps to identify the authenticity of images but also traces the source and circulation process of images, providing strong protection for the privacy and security of images.
[0003] However, traditional watermarking methods often cause some distortion to the original image. This distortion may affect critical aspects such as disease diagnosis, treatment, and insurance claims. Therefore, any technology that may impair image quality should be used with caution.
[0004] Maximizing watermark embedding capacity while ensuring image integrity has become a pressing technical challenge in the digital healthcare and financial sectors. Solving this problem will not only improve image storage and management efficiency but also provide more reliable evidence for accurate disease diagnosis, treatment, and insurance claims. In the future, with continuous technological advancements, this challenge is expected to be resolved more effectively. Summary of the Invention
[0005] The purpose of this application is to provide a video processing method, apparatus, computer device, and storage medium to solve the problem of not being able to embed watermark information into the initial video data in order to obtain high-quality and effective video data.
[0006] To address the aforementioned technical problems, this application provides a video processing method, employing the following technical solution:
[0007] Acquire the video data to be processed, and preprocess the video data to obtain initial video data;
[0008] The initial video data is subjected to three-level wavelet decomposition to obtain the watermark embedding location information;
[0009] Visual sensitivity is calculated on the initial video data, and the initial video data is divided into regions based on the visual sensitivity to obtain video region information;
[0010] Feature extraction and feature fusion are performed on the initial video data to obtain comprehensive video features;
[0011] The preset watermark information is obtained based on the initial video data, and the preset watermark information is encrypted to obtain encrypted watermark information.
[0012] The watermark embedding strength is determined based on the video region information, and the initial video data is watermarked based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data.
[0013] Furthermore, the step of performing three-level wavelet decomposition on the initial video data to obtain the watermark embedding location information specifically includes:
[0014] Three-level wavelet analysis was performed on the initial video data to obtain low-frequency sub-band, mid-frequency sub-band, and high-frequency sub-band;
[0015] Energy distribution calculations are performed on the low-frequency sub-band, the mid-frequency sub-band, and the high-frequency sub-band respectively to obtain sub-band energy distribution information;
[0016] The watermark embedding location information is generated based on the subband energy distribution information.
[0017] Furthermore, the video region information includes complex video regions and smooth video regions. The step of calculating visual sensitivity of the initial video data and dividing the initial video data into regions based on the visual sensitivity to obtain video region information specifically includes:
[0018] The initial video data is divided into image frames to obtain video image blocks;
[0019] Calculate the variance value of the video image block, and use the variance value as a visual sensitivity index of the video image block;
[0020] Determine whether the video sensitivity index is greater than or equal to a preset sensitivity threshold;
[0021] If the video sensitivity index is greater than or equal to the preset sensitivity threshold, then the video image block is marked as the video complex region;
[0022] If the video sensitivity index is less than the preset sensitivity threshold, then the video image block is marked as the video smoothing region.
[0023] Furthermore, the step of extracting and fusing features from the initial video data to obtain comprehensive video features specifically includes:
[0024] Based on the preset Sobel operator, feature extraction is performed on the initial video data to obtain video edge features;
[0025] Based on preset gray-level co-occurrence matrix parameters, feature extraction is performed on the initial video data to obtain video texture features;
[0026] The video edge features and the video texture features are fused to obtain the comprehensive video features.
[0027] Furthermore, the step of obtaining preset watermark information based on the initial video data and encrypting the preset watermark information to obtain encrypted watermark information specifically includes:
[0028] Obtain the video data identifier corresponding to the initial video data, and extract the preset watermark information from the database based on the video data identifier;
[0029] The preset watermark information is processed into binary encoding to obtain encoded watermark information;
[0030] The encoded watermark information is encrypted using a preset symmetric encryption algorithm to obtain the encrypted watermark information.
[0031] Furthermore, the video region information includes complex video regions and smooth video regions. The step of determining the watermark embedding strength based on the video region information, and embedding the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data specifically includes:
[0032] Identify whether the video region information is a complex region or a smooth region in the video;
[0033] If the video region information is a complex video region, then the watermark embedding strength is determined as the first watermark embedding strength, and the first embedding strength coefficient is extracted based on the first watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the first embedding strength coefficient are combined to obtain the first combined watermark information. The initial video data is then watermarked based on the first combined watermark information to obtain the effective video data.
[0034] If the video region information is a smooth video region, then the watermark embedding strength is determined as the second watermark embedding strength, and the second embedding strength coefficient is extracted based on the second watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the second embedding strength coefficient are combined to obtain the second combined watermark information. The initial video data is then watermarked based on the second combined watermark information to obtain the effective video data.
[0035] Furthermore, after the steps of determining the watermark embedding strength based on the video region information, and embedding the watermark into the initial video data according to the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data, the following steps are also included:
[0036] Peak signal-to-noise ratio (PSNR) is calculated on the initial video data and the effective video data to obtain the video signal-to-noise ratio (SNR).
[0037] Determine whether the video signal-to-noise ratio is greater than or equal to a preset signal-to-noise ratio threshold;
[0038] If the video signal-to-noise ratio is greater than or equal to the preset signal-to-noise ratio threshold, then the video quality of the valid video data is determined to be qualified.
[0039] To address the aforementioned technical problems, this application also provides a video processing apparatus, which employs the following technical solution:
[0040] The video processing module is used to acquire video data to be processed, preprocess the video data to be processed, and obtain initial video data.
[0041] The video decomposition module is used to perform three-level wavelet decomposition on the initial video data to obtain watermark embedding location information.
[0042] The region segmentation module is used to calculate the visual sensitivity of the initial video data and segment the initial video data into regions based on the visual sensitivity to obtain video region information.
[0043] The feature acquisition module is used to extract and fuse features from the initial video data to obtain comprehensive video features;
[0044] The watermark acquisition module is used to acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information.
[0045] The watermark embedding module is used to determine the watermark embedding strength based on the video region information, and to embed the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data.
[0046] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0047] A computer device includes a memory and a processor, the memory storing computer-readable instructions, the processor executing the computer-readable instructions to implement the steps of the video processing method as described in any of the preceding claims.
[0048] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0049] A computer-readable storage medium storing computer-readable instructions that, when executed by a processor, implement the steps of the video processing method as described in any of the preceding claims.
[0050] Compared with existing technologies, the embodiments of this application have the following main advantages: This embodiment acquires video data to be processed, preprocesses the video data to obtain initial video data; performs three-layer wavelet decomposition on the initial video data to obtain watermark embedding location information; calculates visual sensitivity of the initial video data, and divides the initial video data into regions based on the visual sensitivity to obtain video region information; extracts and fuses features from the initial video data to obtain comprehensive video features; acquires preset watermark information based on the initial video data, and encrypts the preset watermark information to obtain encrypted watermark information; determines the watermark embedding strength based on the video region information, and embeds the watermark into the initial video data based on the comprehensive video features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain effective video data. This effectively achieves watermark embedding of the initial video data to obtain high-quality effective video data. Attached Figure Description
[0051] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0053] Figure 2 A flowchart of an embodiment of the video processing method according to this application;
[0054] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S20;
[0055] Figure 4yes Figure 2 A flowchart of a specific implementation of step S30;
[0056] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S40;
[0057] Figure 6 yes Figure 2 A flowchart of a specific implementation of step S50;
[0058] Figure 7 yes Figure 2 A flowchart of a specific implementation of step S60;
[0059] Figure 8 This is a schematic diagram of the structure of an embodiment of the video processing apparatus according to this application;
[0060] Figure 9 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0062] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a non-related or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0063] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0064] like Figure 1As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Terminal device 101 may be a laptop 1011, tablet 1012, or mobile phone 1013. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables.
[0065] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0066] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers.
[0067] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.
[0068] It should be noted that the video processing method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the video processing device is generally located in the server / terminal device.
[0069] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0070] Continue to refer Figure 2 A flowchart of an embodiment of a video processing method according to this application is shown. The video processing method includes the following steps:
[0071] Step S10: Obtain the video data to be processed, and preprocess the video data to be processed to obtain the initial video data;
[0072] In this embodiment, the corresponding video data to be processed can be retrieved by traversing and querying the database using the video data extraction identifier corresponding to the video data to be processed. The video data extraction identifier is a unique identifier associated with the video data to be processed. Preprocessing includes denoising, contrast enhancement, and brightness adjustment. Denoising can be performed using techniques such as median filtering and Gaussian filtering. Contrast enhancement can be achieved through linear changes, and brightness adjustment can be achieved using image processing tools or by directly adjusting the grayscale value.
[0073] Step S20: Perform three-level wavelet decomposition on the initial video data to obtain watermark embedding location information;
[0074] In this embodiment, three-layer wavelet decomposition is a signal processing technique that uses wavelet functions as basis functions to decompose a signal into a series of wavelet coefficients. Wavelet coefficients reflect the characteristics of the signal at different frequencies and time scales. Three-layer wavelet decomposition decomposes the initial video data into multiple sub-bands of different frequencies by performing three wavelet transformations on the initial video data signal. Then, based on these sub-bands of different frequencies, the energy distribution of the initial video data is effectively determined, and the watermark embedding location information that can be embedded is determined based on the energy distribution.
[0075] Step S30: Calculate the visual sensitivity of the initial video data, and divide the initial video data into regions based on the visual sensitivity to obtain video region information;
[0076] In this embodiment, visual sensitivity refers to the variance value between video image blocks in the initial video data. The variance value reflects the degree of difference between video image blocks in terms of pixel value or brightness, etc. In this embodiment, this degree of difference is used to evaluate the video's sharpness, contrast, and image quality stability, thereby effectively dividing the initial video data into image regions and obtaining video region information.
[0077] Step S40: Perform feature extraction and feature fusion on the initial video data to obtain comprehensive video features;
[0078] In this embodiment, the video synthesis feature is a fusion of video edge features and video texture features. The video edge features are obtained by extracting features from the initial video data based on preset Sobel operator parameters, and the video texture features are extracted from the initial video data based on preset gray-level co-occurrence matrix parameters. The preset Sobel operator parameters are the parameter information of the Sobel operator, an edge detection algorithm used to effectively extract edge features from the initial video data. The gray-level co-occurrence matrix is a texture analysis method used to effectively extract texture features from the initial video data.
[0079] Step S50: Obtain preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information;
[0080] In this embodiment, the initial video data can be medical image data. The preset watermark information is information pre-set based on the medical image data. This preset watermark information includes the model of the medical imaging equipment, the shooting date and time, the patient identification number, etc. The preset watermark information can be extracted from the database using the image identifier corresponding to the medical image data. Encryption of the preset watermark information can be achieved using a symmetric encryption algorithm. A symmetric encryption algorithm is an algorithm that uses the same key for both encryption and decryption. In a symmetric encryption algorithm, the same key is used for both encryption and decryption, and encryption and decryption are performed using forward and directional algorithms.
[0081] Step S60: Determine the watermark embedding strength based on the video region information, and embed the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data.
[0082] In this embodiment, watermark embedding strength refers to the size or intensity of the digital watermark image contained in the target image (or digital media such as video and audio) with embedded watermark in the digital watermarking system. Video region information includes complex video regions and smooth video regions. Different watermark embedding strengths are set for complex and smooth video regions, with stronger watermark embedding strengths corresponding to complex video regions and weaker watermark embedding strengths corresponding to smooth video regions. By combining video comprehensive features, encrypted watermark information, watermark embedding location information, and watermark embedding strength, combined watermark information is obtained. This combined watermark information is then used to embed the watermark into the initial video data, thereby obtaining effective video data.
[0083] In this embodiment, the above method can be applied to a medical service system. By embedding watermarks into the medical videos to be processed within the medical service system, tamper-proofing and traceability of the videos are achieved. Specifically, in this embodiment, the medical service system can be one or more of a medical insurance system and a disease insurance system. The video data to be processed is medical image video captured by a mobile device or image acquisition device. The video data to be processed is stored in the medical insurance system or the disease insurance system and retrieved from the database of the aforementioned systems. Valid video data is generated by the aforementioned systems through the method of this embodiment and stored in the system database for preservation.
[0084] This embodiment acquires video data to be processed, preprocesses the video data to obtain initial video data, performs three-layer wavelet decomposition on the initial video data to obtain watermark embedding location information, calculates visual sensitivity of the initial video data, and divides the initial video data into regions based on the visual sensitivity to obtain video region information, extracts and fuses features from the initial video data to obtain comprehensive video features, obtains preset watermark information based on the initial video data, and encrypts the preset watermark information to obtain encrypted watermark information, determines the watermark embedding strength based on the video region information, and embeds the watermark into the initial video data based on the comprehensive video features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain effective video data. This effectively achieves watermark embedding of the initial video data to obtain high-quality effective video data.
[0085] refer to Figure 3 In some optional implementations of this embodiment, step S20 includes the following steps:
[0086] Step S201: Perform three-level wavelet analysis on the initial video data to obtain low-frequency sub-band, mid-frequency sub-band, and high-frequency sub-band;
[0087] In this embodiment, wavelet analysis is a signal processing method used to decompose the video signal corresponding to the initial video data into different frequency components, namely, low-frequency sub-band, mid-frequency sub-band, and high-frequency sub-band. The low-frequency sub-band contains the main structural information of the initial video data image, such as edges and contours, and is where the main energy of the initial video data image is located. The mid-frequency sub-band contains the detailed information of the initial video data image, and the high-frequency sub-band contains the noise and minor details of the initial video data image.
[0088] Step S202: Perform energy distribution calculations on the low-frequency sub-band, the mid-frequency sub-band, and the high-frequency sub-band respectively to obtain sub-band energy distribution information;
[0089] In this embodiment, energy distribution refers to the distribution of energy in different frequency sub-bands. This energy can be obtained by calculating the sum of squares of pixel values in each sub-band (or other similar measures). The energy distribution information of each sub-band is used to describe the relative intensity of energy in different frequency components of the image of the initial video data.
[0090] Step S203: Generate the watermark embedding position information based on the sub-band energy distribution information.
[0091] In this embodiment, the watermark embedding location information generated based on the subband energy distribution information can be generated by selecting a region with low or medium energy to embed the watermark. In this embodiment, a region with medium energy is selected as the optional region for watermark embedding location based on the subband energy distribution information. This optional region for watermark embedding location is the watermark embedding location information.
[0092] This embodiment performs three-layer wavelet analysis on the initial video data to obtain low-frequency, mid-frequency, and high-frequency sub-bands. Energy distribution calculations are then performed on each of these sub-bands to obtain sub-band energy distribution information. The watermark embedding position information is then generated based on this sub-band energy distribution information. This effectively determines a suitable watermark embedding position based on the energy distribution of the initial video data, facilitating subsequent watermark embedding based on the watermark embedding position information.
[0093] refer to Figure 4 In some optional implementations of this embodiment, step S30 includes the following steps:
[0094] Step S301: Divide the initial video data into image frames to obtain video image blocks;
[0095] In this embodiment, the initial video data is processed into frames to obtain corresponding image frames. These image frames are then divided into image blocks to obtain video image blocks. Frame processing can be achieved by reading the video's frame rate (the number of frames displayed per second) and then decomposing the continuous initial video data into individual image frames. The image block division of the image frames can be based on a preset image block size. This preset image block size can be set according to the watermark size in the preset watermark information. For example, the preset image block size can be set to 1.5 times the preset watermark size to reserve sufficient space for watermark setting.
[0096] Step S302: Calculate the variance value of the video image block and use the variance value as the visual sensitivity index of the video image block;
[0097] In this embodiment, the step of calculating the variance value of a video image block includes: calculating the average pixel value of each video image block, calculating the difference between the pixel value of each pixel in the video image block and the average value, adding the average differences of all video image blocks, and then dividing by the number of pixels in the video image block to obtain the variance value of the video image block.
[0098] Step S303: Determine whether the video sensitivity index is greater than or equal to a preset sensitivity threshold;
[0099] In this embodiment, the video sensitivity index corresponds to the preset sensitivity threshold. The video sensitivity index is the variance value of the video image block, and the unit of the video sensitivity index is the pixel value. The unit of the preset sensitivity threshold is also the pixel value. By comparing the video sensitivity index and the preset sensitivity threshold, it is effectively determined whether the video sensitivity index is greater than or equal to the preset sensitivity threshold.
[0100] Step S304: If the video sensitivity index is greater than or equal to the preset sensitivity threshold, then the video image block is marked as the video complex region;
[0101] In this embodiment, video image blocks with a video sensitivity index greater than or equal to a preset sensitivity threshold can be marked as complex video regions by adding specific markers (such as "1" or "complex").
[0102] Step S305: If the video sensitivity index is less than the preset sensitivity threshold, then the video image block is marked as the video smoothing region.
[0103] In this embodiment, video image blocks with a video sensitivity index less than a preset sensitivity threshold can be marked as smooth video regions by adding specific markers (such as "0" or "smooth").
[0104] This embodiment divides the initial video data into image frames to obtain video image blocks; calculates the variance value of each video image block and uses the variance value as a visual sensitivity index; determines whether the video sensitivity index is greater than or equal to a preset sensitivity threshold; if the video sensitivity index is greater than or equal to the preset sensitivity threshold, the video image block is marked as a complex region of the video; if the video sensitivity index is less than the preset sensitivity threshold, the video image block is marked as a smooth region of the video. This effectively divides the image frames of the initial video data into regions, facilitating the control of watermark embedding intensity for different video regions in each frame.
[0105] refer to Figure 5 In some optional implementations of this embodiment, step S40 includes the following steps:
[0106] Step S401: Extract features from the initial video data based on the preset Sobel operator to obtain video edge features;
[0107] In this embodiment, the Sobel operator is a discrete differential operator used for edge detection, combining Gaussian smoothing and differential differentiation. The steps for feature extraction from the initial video data based on the preset Sobel operator include: applying convolution operations to the horizontal and vertical templates of the Sobel operator for each frame of the initial video data, calculating the gradient magnitude and direction of each pixel, determining edge points in the image based on the gradient magnitude, and generating an edge feature map. Edge features of the video are extracted from the edge feature map; these edge features can represent information such as the position, intensity, or direction of edge points.
[0108] Step S402: Based on the preset gray-level co-occurrence matrix parameters, feature extraction is performed on the initial video data to obtain video texture features;
[0109] In this embodiment, the gray-level co-occurrence matrix (GLCM) is a statistical method for describing the spatial relationship between gray levels in an image. The GLCM reflects the texture features of an image by analyzing the gray-level relationships between pixel pairs. The steps for feature extraction from the initial video data based on preset GLCM parameters include: calculating the GLCM for each frame of the initial video data; by setting parameters of the GLCM, such as distance, angle, and number of gray levels, and then extracting various texture features from the GLCM, such as contrast, energy, homogeneity (uniformity), and correlation, to obtain video texture features reflecting the texture coarseness, brightness, uniformity, and directionality of the image in the initial video data.
[0110] Step S403: The video edge features and the video texture features are fused to obtain the comprehensive video features.
[0111] In this embodiment, video edge features and video texture features are fused by feature concatenation to obtain a comprehensive video feature that includes both video edge features containing video edge information and video texture features containing video texture information.
[0112] This embodiment extracts features from the initial video data based on a preset Sobel operator to obtain video edge features; it also extracts features from the initial video data based on preset gray-level co-occurrence matrix parameters to obtain video texture features; and finally, it fuses the video edge features and the video texture features to effectively obtain comprehensive video features that characterize the initial video data, facilitating subsequent watermark embedding processing.
[0113] Continue to refer Figure 6In some optional implementations of this embodiment, step S50 includes the following steps:
[0114] Step S501: Obtain the video data identifier corresponding to the initial video data, and extract the preset watermark information from the database according to the video data identifier;
[0115] In this embodiment, the video data identifier can be the video number or video category of the initial video data. The corresponding preset watermark information is obtained by matching and querying the database based on the video number.
[0116] Step S502: Perform binary encoding processing on the preset watermark information to obtain encoded watermark information;
[0117] In this embodiment, the preset watermark information includes the model of the medical imaging equipment, the date and time of the shooting, and the patient identification number. By performing binary encoding processing on the preset watermark information, a binary code containing the model of the medical imaging equipment, the date and time of the shooting, and the patient identification number is obtained. This binary code is the encoded watermark information.
[0118] Step S503: Encrypt the encoded watermark information according to a preset symmetric encryption algorithm to obtain the encrypted watermark information.
[0119] In this embodiment, the symmetric encryption algorithm uses AES (Advanced Encryption Standard) to encrypt the encoded watermark information. The AES encryption process includes multiple rounds of nonlinear transformations and key expansion. The nonlinear transformations include byte substitution, row shifting, column mixing, and round key addition. Byte substitution is the only nonlinear transformation step in the AES encryption process. It maps each byte in the state matrix to another byte using a nonlinear substitution function (i.e., an S-box). Row shifting is a permutation operation between bytes within a 4×4 state matrix to provide diffusion for the algorithm. Column mixing is a linear transformation operation on each column of the state matrix using the arithmetic properties of the GF(2^8) field. Round key addition is a bitwise XOR operation between the key matrix and the data in the state matrix for each round. By processing the encoded watermark information using the above symmetric encryption algorithm, encrypted watermark information is obtained. In this embodiment, when removing the watermark from the effective video data later, the key of this symmetric encryption algorithm can be used for decryption to effectively decrypt the encrypted watermark information.
[0120] This embodiment obtains the video data identifier corresponding to the initial video data, extracts the preset watermark information from the database based on the video data identifier, performs binary encoding processing on the preset watermark information to obtain encoded watermark information, and encrypts the encoded watermark information according to a preset symmetric encryption algorithm, thereby effectively obtaining encrypted watermark information that has been effectively encrypted, so as to effectively improve the security of the video data after embedding the watermark.
[0121] Continue to refer Figure 7 In some optional implementations of this embodiment, step S60 includes the following steps:
[0122] Step S601: Identify whether the video region information is a complex region or a smooth region of the video;
[0123] In this embodiment, the region is determined to be a complex region or a smooth region by identifying the region marker corresponding to the video region information. For example, when the video region information is marked as "1" or "complex", the corresponding region is determined to be a complex region, and when the video region information is marked as "0" or "smooth", the corresponding region is determined to be a smooth region.
[0124] Step S602: If the video region information is a complex video region, the watermark embedding strength is determined as the first watermark embedding strength, and the first embedding strength coefficient is extracted according to the first watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the first embedding strength coefficient are combined to obtain the first combined watermark information. The initial video data is watermarked according to the first combined watermark information to obtain the effective video data.
[0125] In this embodiment, the first watermark embedding strength is a relatively low watermark embedding intensity. The first watermark embedding strength corresponds to a first embedding strength coefficient, which can be a numerical value used to adjust the "strength" of the watermark embedding. This first embedding strength coefficient guides the watermark embedding of encrypted watermark information. Video synthesis features are used to ensure that the watermark embedding is adapted to the video content, improving the robustness and invisibility of the watermark. Encrypted watermark information effectively protects the security of the watermark information during embedding and transmission. Watermark embedding position information is used to indicate the position of the watermark embedding in the initial video data. The first embedding strength coefficient is used to adjust the amplitude or intensity of the watermark embedding to ensure a balance between the invisibility and robustness of the watermark. By combining the video synthesis features, encrypted watermark information, watermark embedding position information, and the first embedding strength coefficient, a first combined watermark information is effectively obtained. Watermark embedding is then performed on the initial video data based on this first combined watermark information to obtain valid video data.
[0126] Step S603: If the video region information is a smooth video region, then the watermark embedding strength is determined as the second watermark embedding strength, and the second embedding strength coefficient is extracted according to the second watermark embedding strength. The video comprehensive feature, the encrypted watermark information, the watermark embedding position information, and the second embedding strength coefficient are combined to obtain the second combined watermark information. The initial video data is watermarked according to the second combined watermark information to obtain the effective video data.
[0127] In this embodiment, the second watermark embedding strength is a relatively low watermark embedding intensity. The second watermark embedding strength corresponds to a second embedding strength coefficient, which can be a numerical value used to adjust the "strength" of the watermark embedding. This second embedding strength coefficient guides the watermark embedding of encrypted watermark information. Video synthesis features are used to ensure that the watermark embedding is adapted to the video content, improving the robustness and invisibility of the watermark. Encrypted watermark information effectively protects the security of the watermark information during embedding and transmission. Watermark embedding position information is used to indicate the position of the watermark embedding in the initial video data. The second embedding strength coefficient is used to adjust the amplitude or intensity of the watermark embedding to ensure a balance between the invisibility and robustness of the watermark. By combining the video synthesis features, encrypted watermark information, watermark embedding position information, and the second embedding strength coefficient, a second combined watermark information is effectively obtained. Watermark embedding is then performed on the initial video data according to this second combined watermark information to obtain valid video data.
[0128] This embodiment identifies whether the video region information is a complex or smooth region. If the video region information is a complex region, the watermark embedding strength is determined as a first watermark embedding strength, and a first embedding strength coefficient is extracted based on the first watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the first embedding strength coefficient are combined to obtain a first combined watermark information. The initial video data is then watermarked based on the first combined watermark information to obtain the effective video data. If the video region information is a smooth region, the watermark embedding strength is determined as a second watermark embedding strength, and a second embedding strength coefficient is extracted based on the second watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the second embedding strength coefficient are combined to obtain a second combined watermark information. The initial video data is then watermarked based on the second combined watermark information to obtain the effective video data. This effectively achieves fast and efficient watermark embedding of initial video data to obtain effective video data with high security and high video quality.
[0129] In some optional implementations of this embodiment, after step S60, the following steps are further included:
[0130] Peak signal-to-noise ratio (PSNR) is calculated on the initial video data and the effective video data to obtain the video signal-to-noise ratio (SNR).
[0131] In this embodiment, the peak signal-to-noise ratio (PSNR) can be calculated by comparing the initial video data and the effective video data using the peak signal-to-noise ratio (PSNR) calculation formula. For a selected video frame, the square of the difference between each pixel value is calculated, and then averaged to obtain the mean square error (MSE). Then, the peak pixel value (MAX) of the initial video data and the effective video data is calculated. Based on the mean square error and the peak pixel value, the peak SNR is calculated using the following formula:
[0132]
[0133] Where PSNR is the Peak Signal-to-Noise Ratio, MAX is the maximum peak value of pixels in the initial video data and the effective video data, and MSE is the average of the squared differences in pixel values between the initial video data and the effective video data. The peak signal-to-noise ratio calculated using the above formula is the video signal-to-noise ratio.
[0134] Determine whether the video signal-to-noise ratio is greater than or equal to a preset signal-to-noise ratio threshold;
[0135] In this embodiment, the video signal-to-noise ratio (SNR) is compared with a preset SNR threshold to effectively determine whether the video SNR is greater than or equal to the preset SNR threshold. In this embodiment, the preset SNR threshold is initially set to 40 dB, and can be set and adjusted accordingly based on actual conditions.
[0136] If the video signal-to-noise ratio is greater than or equal to the preset signal-to-noise ratio threshold, then the video quality of the valid video data is determined to be qualified.
[0137] In this embodiment, valid video data can be identified as having acceptable video quality by adding a flag indicating that the video quality is acceptable.
[0138] If the video signal-to-noise ratio is less than the preset signal-to-noise ratio threshold, the video quality of the valid video data is determined to be unqualified. The video comprehensive features are then reacquired, and the valid video data is generated based on the newly acquired video comprehensive features. This iterative process of generating valid video data is repeated until the video signal-to-noise ratio of the newly generated valid video data is greater than or equal to the preset signal-to-noise ratio threshold.
[0139] In this embodiment, valid video data can be identified as having substandard video quality by adding a flag indicating that the video quality is substandard.
[0140] This embodiment calculates the peak signal-to-noise ratio (PSNR) of the initial video data and the valid video data to obtain the video SNR; it then determines whether the video SNR is greater than or equal to a preset SNR threshold. If the video SNR is greater than or equal to the preset SNR threshold, the video quality of the valid video data is determined to be acceptable. If the video SNR is less than the preset SNR threshold, the video quality of the valid video data is determined to be unacceptable, and video comprehensive features are reacquired. The valid video data is then generated based on the newly acquired video comprehensive features. This iterative process of generating valid video data is repeated until the video SNR of the newly generated valid video data is greater than or equal to the preset SNR threshold. This effectively ensures the video quality of the valid video data.
[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0142] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0143] Further reference Figure 8 As a response to the above Figure 1 To implement the method shown, this application provides an embodiment of a video processing apparatus, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0144] like Figure 8As shown, the video processing device 700 described in this embodiment includes: a video processing module 701, a video decomposition module 702, a region division module 703, a feature acquisition module 704, a watermark acquisition module 705, and a watermark embedding module 706. Wherein:
[0145] Video processing module 701 is used to acquire video data to be processed and preprocess the video data to be processed to obtain initial video data;
[0146] The video decomposition module 702 is used to perform three-level wavelet decomposition processing on the initial video data to obtain watermark embedding location information;
[0147] The region division module 703 is used to calculate the visual sensitivity of the initial video data and divide the initial video data into regions according to the visual sensitivity to obtain video region information.
[0148] The feature acquisition module 704 is used to extract and fuse features from the initial video data to obtain comprehensive video features.
[0149] The watermark acquisition module 705 is used to acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information.
[0150] The watermark embedding module 706 is used to determine the watermark embedding strength based on the video region information, and to embed the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain effective video data.
[0151] This embodiment, by employing the aforementioned video processing device, can acquire video data to be processed, preprocess the video data to obtain initial video data, perform three-layer wavelet decomposition on the initial video data to obtain watermark embedding location information, calculate the visual sensitivity of the initial video data, and divide the initial video data into regions based on the visual sensitivity to obtain video region information, extract and fuse features from the initial video data to obtain comprehensive video features, acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information, determine the watermark embedding strength based on the video region information, and embed the watermark into the initial video data based on the comprehensive video features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain effective video data. This effectively achieves watermark embedding of the initial video data to obtain high-quality effective video data.
[0152] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 9 , Figure 9 This is a basic structural block diagram of the computer device in this embodiment.
[0153] The computer device 8 includes a memory 81, a processor 82, and a network interface 83 that are interconnected via a system bus. It should be noted that only the computer device 8 with components 81-83 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0154] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0155] The memory 81 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 81 may be an internal storage unit of the computer device 8, such as the hard disk or memory of the computer device 8. In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 8. Of course, the memory 81 may include both the internal storage unit and its external storage device of the computer device 8. In this embodiment, the memory 81 is typically used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions for video processing methods. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or will be output.
[0156] In some embodiments, the processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 82 is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is used to execute computer-readable instructions stored in the memory 81 or to process data, such as executing computer-readable instructions for the video processing method.
[0157] The network interface 83 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 8 and other electronic devices.
[0158] This embodiment, by employing the aforementioned computer equipment, can acquire video data to be processed, preprocess the video data to obtain initial video data, perform three-layer wavelet decomposition on the initial video data to obtain watermark embedding location information, calculate the visual sensitivity of the initial video data, and divide the initial video data into regions based on the visual sensitivity to obtain video region information, extract and fuse features from the initial video data to obtain comprehensive video features, acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information, determine the watermark embedding strength based on the video region information, and embed the watermark into the initial video data based on the comprehensive video features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain effective video data. This effectively achieves watermark embedding of the initial video data to obtain high-quality effective video data.
[0159] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the video processing method described above.
[0160] This embodiment, by employing the aforementioned computer-readable storage medium, can acquire video data to be processed, preprocess the video data to obtain initial video data, perform three-level wavelet decomposition on the initial video data to obtain watermark embedding location information, calculate the visual sensitivity of the initial video data, and divide the initial video data into regions based on the visual sensitivity to obtain video region information, extract and fuse features from the initial video data to obtain comprehensive video features, acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information, determine the watermark embedding strength based on the video region information, and embed the watermark into the initial video data based on the comprehensive video features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain effective video data. This effectively achieves watermark embedding of the initial video data to obtain high-quality effective video data.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0162] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
[0163] The software tools or components not belonging to our company that appear in the embodiments of this application are merely examples and do not represent actual use.
Claims
1. A video processing method, characterized in that, Includes the following steps: Acquire the video data to be processed, and preprocess the video data to obtain initial video data; The initial video data is subjected to three-level wavelet decomposition to obtain the watermark embedding location information; Visual sensitivity is calculated on the initial video data, and the initial video data is divided into regions based on the visual sensitivity to obtain video region information; Feature extraction and feature fusion are performed on the initial video data to obtain comprehensive video features; The preset watermark information is obtained based on the initial video data, and the preset watermark information is encrypted to obtain encrypted watermark information. The watermark embedding strength is determined based on the video region information, and the initial video data is watermarked based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data.
2. The video processing method according to claim 1, characterized in that, The step of performing three-level wavelet decomposition on the initial video data to obtain the watermark embedding location information specifically includes: Three-level wavelet analysis was performed on the initial video data to obtain low-frequency sub-band, mid-frequency sub-band, and high-frequency sub-band; Energy distribution calculations are performed on the low-frequency sub-band, the mid-frequency sub-band, and the high-frequency sub-band respectively to obtain sub-band energy distribution information; The watermark embedding location information is generated based on the subband energy distribution information.
3. The video processing method according to claim 1, characterized in that, The video region information includes complex video regions and smooth video regions. The step of calculating visual sensitivity of the initial video data and dividing the initial video data into regions based on the visual sensitivity to obtain video region information specifically includes: The initial video data is divided into image frames to obtain video image blocks; Calculate the variance value of the video image block, and use the variance value as a visual sensitivity index of the video image block; Determine whether the video sensitivity index is greater than or equal to a preset sensitivity threshold; If the video sensitivity index is greater than or equal to the preset sensitivity threshold, then the video image block is marked as the video complex region; If the video sensitivity index is less than the preset sensitivity threshold, then the video image block is marked as the video smoothing region.
4. The video processing method according to claim 1, characterized in that, The step of extracting and fusing features from the initial video data to obtain comprehensive video features specifically includes: Based on the preset Sobel operator, feature extraction is performed on the initial video data to obtain video edge features; Based on preset gray-level co-occurrence matrix parameters, feature extraction is performed on the initial video data to obtain video texture features; The video edge features and the video texture features are fused to obtain the comprehensive video features.
5. The video processing method according to claim 1, characterized in that, The step of obtaining preset watermark information based on the initial video data and encrypting the preset watermark information to obtain encrypted watermark information specifically includes: Obtain the video data identifier corresponding to the initial video data, and extract the preset watermark information from the database based on the video data identifier; The preset watermark information is processed into binary encoding to obtain encoded watermark information; The encoded watermark information is encrypted using a preset symmetric encryption algorithm to obtain the encrypted watermark information.
6. The video processing method according to claim 1, characterized in that, The video region information includes complex video regions and smooth video regions. The steps of determining the watermark embedding strength based on the video region information, and embedding the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data specifically include: Identify whether the video region information is a complex region or a smooth region in the video; If the video region information is a complex video region, then the watermark embedding strength is determined as the first watermark embedding strength, and the first embedding strength coefficient is extracted based on the first watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the first embedding strength coefficient are combined to obtain the first combined watermark information. The initial video data is then watermarked based on the first combined watermark information to obtain the effective video data. If the video region information is a smooth video region, then the watermark embedding strength is determined as the second watermark embedding strength, and the second embedding strength coefficient is extracted based on the second watermark embedding strength. The video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the second embedding strength coefficient are combined to obtain the second combined watermark information. The initial video data is then watermarked based on the second combined watermark information to obtain the effective video data.
7. The video processing method according to claim 1, characterized in that, After the steps of determining the watermark embedding strength based on the video region information, and embedding the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding location information, and the watermark embedding strength to obtain valid video data, the following steps are further included: Peak signal-to-noise ratio (PSNR) is calculated on the initial video data and the effective video data to obtain the video signal-to-noise ratio (SNR). Determine whether the video signal-to-noise ratio is greater than or equal to a preset signal-to-noise ratio threshold; If the video signal-to-noise ratio is greater than or equal to the preset signal-to-noise ratio threshold, then the video quality of the valid video data is determined to be qualified.
8. A video processing apparatus, characterized in that, include: The video processing module is used to acquire video data to be processed, preprocess the video data to be processed, and obtain initial video data. The video decomposition module is used to perform three-level wavelet decomposition on the initial video data to obtain watermark embedding location information. The region segmentation module is used to calculate the visual sensitivity of the initial video data and segment the initial video data into regions based on the visual sensitivity to obtain video region information. The feature acquisition module is used to extract and fuse features from the initial video data to obtain comprehensive video features; The watermark acquisition module is used to acquire preset watermark information based on the initial video data, and encrypt the preset watermark information to obtain encrypted watermark information. The watermark embedding module is used to determine the watermark embedding strength based on the video region information, and to embed the watermark into the initial video data based on the video comprehensive features, the encrypted watermark information, the watermark embedding position information, and the watermark embedding strength to obtain valid video data.
9. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the video processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the video processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Wavelet transform and Arnold based adaptive gray-scale watermark embedded method
CN102142258A
Video watermark processing method and device, electronic equipment and storage medium
CN117061768A