Video frame classification method and system based on SVM and motion extraction

Through the combination of support vector machine and motion feature extraction, the problems of inefficiency and limited accuracy in video classification are solved, high-precision automatic classification of video frames is realized, the level of automation of video processing is improved, and the video content analysis is provided. Strong technical support.

CN118887585APending Publication Date: 2024-11-01SHI-CHENG LABORATORY FOR INFORMATION DISPLAY & VISUALIZATION
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411018735.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The prior art is inefficient and limited in video classification and analysis, making it difficult to effectively identify and classify different motion patterns in videos.

Method used

Support vector machine (SVM) is used to combine motion feature extraction, and through video preprocessing, motion feature extraction, feature vector construction and SVM model training, high-precision automatic classification of lens fixation, lens switching, lens follow-up and large-scale motion scenes are achieved.

Benefits of technology

It improves the efficiency and accuracy of video processing, realizes the fast and accurate classification of new video frames, and is suitable for video content analysis and monitoring systems and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887585A_ABST
    Figure CN118887585A_ABST
Patent Text Reader

Abstract

The invention discloses a video frame classification method and system based on SVM and motion feature extraction, and aims to efficiently and accurately carry out automatic analysis and classification on video contents. According to the method, video frames are divided into four categories: lens fixing, lens switching, lens following and large-amplitude movement, and classification of the video frames is realized through integrated application of motion feature vector construction and an SVM model. Firstly, a current frame image and a previous frame image are extracted and preprocessed, and then inter-frame motion features such as motion intensity, direction change and continuity are extracted by using motion analysis technologies such as inter-frame difference detection and an optical flow method. And organizing the features into feature vectors as input of support vector machine classification. Through the SVM model training process, the category of the model can be quickly and accurately judged. According to the method, the automation level and the classification precision of video processing are improved, and powerful technical support is provided for the fields of video content analysis, monitoring systems, intelligent editing and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to an intelligent classification algorithm applied to video content analysis. By combining the efficient classification capability of support vector machines (SVM) and the precise extraction of motion features, the automatic classification of video frames is realized, mainly targeting four typical scenes: fixed lens, lens switching, lens following and large motion. Background Art

[0002] With the explosive growth of video content, how to efficiently and accurately classify and analyze videos has become an urgent problem to be solved. Traditional methods often rely on manual annotation or simple image feature matching, which is inefficient and has limited accuracy. Therefore, it is particularly important to develop an algorithm that can automatically identify and classify different motion patterns in videos.

[0003] Support Vector Machine (SVM) is a commonly used classification algorithm. Its basic idea is to map data into a high-dimensional feature space and find an optimal hyperplane in the space so that samples of different categories can be separated as much as possible. SVM determines the optimal hyperplane by finding support vectors (sample points on the hyperplane) and uses these support vectors for classification. It performs well in high-dimensional feature spaces. SVM can still maintain good classification performance when processing a small number of support vectors and has high efficiency for large-scale data sets. Summary of the invention

[0004] The present invention aims to provide a video frame classification method based on SVM and motion extraction, which can realize high-precision automatic classification of scenes such as lens fixation, lens switching, lens following and large-scale motion by intelligently analyzing the motion features in video frames, thereby improving the efficiency and accuracy of video processing.

[0005] The present invention provides a video frame classification method based on SVM and motion extraction, and the specific steps are as follows:

[0006] S1: Video preprocessing: First, the original video and the previous frame image are preprocessed, including denoising and conversion to grayscale.

[0007] S2: Motion feature extraction: For each key frame, the motion vector is extracted using frame difference method, optical flow method and other technologies, and the motion intensity, direction and other features are calculated to provide a basis for the classification of lens fixation, lens switching, lens following and large motion. Its physical meaning is: the motion amplitude is small in the lens fixation scene; when the lens switches, the pixel changes suddenly, the motion amplitude is large and the direction consistency is weak. The direction consistency of the lens following motion is strong; and the motion distribution of large motion is relatively concentrated.

[0008] S3: Feature vector construction: Based on the extracted motion features, a feature vector for classification is constructed.

[0009] S4: Support vector machine model training: Use the labeled video frame dataset to train the SVM classifier based on the constructed feature vector. Through the selection of kernel functions and parameter optimization, ensure that the model can effectively divide the boundaries of different categories;

[0010] S5: New frame classification: For the new video frame input, repeat the above feature extraction process, and then input the obtained feature vector into the trained SVM model to realize automatic classification of the scene type to which it belongs.

[0011] Furthermore, the video preprocessing and key frame extraction of step S1 specifically includes the following steps:

[0012] S1.1: Firstly, the video frame input to the program and the previous frame image are processed for noise;

[0013] S1.2: Convert the video frame into grayscale image.

[0014] Furthermore, the motion feature extraction in step S2 specifically includes the following steps:

[0015] S2.1: Motion feature extraction: For each key frame, frame difference method, optical flow method, etc. are used to calculate the frame difference map and optical flow map;

[0016] S2.2: Divide the frame difference map into several sub-blocks, count the frame difference strength in each block, and normalize it to obtain the motion amplitude vector;

[0017] S2.3: Divide the optical flow map into several sub-blocks, count the main direction of the optical flow in each block, and encode it as 0-15 to obtain the motion direction vector.

[0018] Furthermore, the feature vector construction in step S3 specifically includes the following steps:

[0019] S3.1: Based on the extracted motion features, construct a feature vector for classification.

[0020] Furthermore, the support vector machine model training in step S4 specifically includes the following steps:

[0021] S4.1: Support vector machine model training: Use the labeled video frame dataset to train the SVM classifier based on the constructed feature vector;

[0022] S4.2 ensures that the model can effectively divide the boundaries of different categories through the selection of kernel functions and parameter optimization.

[0023] Furthermore, the step S5 of new frame classification specifically includes the following steps:

[0024] S5.1: For the new video frame input, repeat the above feature extraction process, and then input the obtained feature vector into the trained SVM model to achieve automatic classification of the scene type to which it belongs.

[0025] The present invention provides a video frame classification system based on SVM and motion extraction, comprising:

[0026] The preprocessing module is used to convert the current frame and the previous frame of the video into grayscale images, and calculate the frame difference image and the optical flow image;

[0027] A motion vector calculation module is used to calculate the motion amplitude vector from the frame difference image and the motion direction vector from the optical flow image;

[0028] A motion vector construction module is used to concatenate the motion amplitude vector and the motion direction vector to obtain a motion feature vector, and to construct a feature vector for classification;

[0029] The SVM model training module is used to use the video frame dataset with labeled frame categories as training samples and the constructed feature vector as input to train the SVM model;

[0030] The video frame classification module is used to automatically classify the scene type to which the video frame belongs using the trained SVM model.

[0031] The present invention also provides a video frame classification device based on SVM and motion extraction, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned video frame classification method based on SVM and motion extraction when executed by the processor.

[0032] Beneficial effects: The present invention innovatively divides video frames into four categories: fixed lens, lens switching, lens following and large motion, and realizes the classification of new video frames through the integrated application of complex motion feature vector construction and SVM model. First, the video is preprocessed, and then advanced motion analysis techniques, such as inter-frame difference detection and optical flow detection, are used to extract features reflecting the dynamic characteristics of the lens from the key frames, such as motion intensity, direction change and continuity. These features are organized into feature vectors as input for support vector machine classification. Through the SVM model training process, the category to which it belongs can be quickly and accurately determined. The present invention improves the automation level and classification accuracy of video processing, and provides strong technical support for video content analysis, monitoring systems, intelligent editing and other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1It is a general flow chart of a specific embodiment of the present invention;

[0034] Figure 2 It is a detailed implementation diagram of a specific embodiment of the present invention;

[0035] Figure 3 This is a specific operation flow chart of Example 1. DETAILED DESCRIPTION

[0036] The specific implementation of the present invention will be described in detail below with reference to the accompanying drawings.

[0037] Example 1

[0038] A video frame classification method based on SVM and support vector regression, the specific steps are as follows:

[0039] S1: Video preprocessing: First, the original video and the previous frame image are preprocessed, including denoising and conversion to grayscale.

[0040] S2: Motion feature extraction: For each key frame, the motion vector is extracted using frame difference method, optical flow method and other technologies, and the motion intensity, direction and other features are calculated to provide a basis for the classification of lens fixation, lens switching, lens following and large motion. Its physical meaning is: the motion amplitude is small in the lens fixation scene; when the lens switches, the pixel changes suddenly, the motion amplitude is large and the direction consistency is weak. The direction consistency of the lens following motion is strong; and the motion distribution of large motion is relatively concentrated.

[0041] S3: Feature vector construction: Based on the extracted motion features, a feature vector for classification is constructed.

[0042] S4: Support vector machine model training: Use the labeled video frame dataset to train the SVM classifier based on the constructed feature vector. Through the selection of kernel function and parameter optimization, ensure that the model can effectively divide the boundaries of different categories.

[0043] S5: New frame classification: For the new video frame input, repeat the above feature extraction process, and then input the obtained feature vector into the trained SVM model to realize automatic classification of the scene type to which it belongs.

[0044] Furthermore, the video preprocessing and key frame extraction of step S1 specifically includes the following steps:

[0045] S1.1: After receiving the original video data, the pre-processing stage is first entered. This stage involves multiple steps of processing, the first of which is video denoising, which processes the video noise and crops the upper and lower fifths of the video frame to prevent non-important factors from affecting the video analysis, so as to maintain the accuracy and consistency of the picture.

[0046] S1.2: Subsequently, the video frame is processed by grayscale conversion to convert the color image into a grayscale image, thereby simplifying the complexity of subsequent processing.

[0047] Furthermore, the motion feature extraction in step S2 specifically includes the following steps:

[0048] S2.1: Motion feature extraction: For each key frame, frame difference method, optical flow method, etc. are used to calculate the frame difference map and optical flow map;

[0049] S2.2: Divide the frame difference map into several sub-blocks, count the frame difference strength in each block, and normalize it to obtain the motion amplitude vector;

[0050] S2.3: Divide the optical flow map into several sub-blocks, count the main direction of the optical flow in each block, and encode it as 0-15 to obtain the motion direction vector.

[0051] Furthermore, the feature vector construction in step S3 specifically includes the following steps:

[0052] S3.1: Based on the extracted motion features, such as motion intensity and direction, a preliminary feature vector is constructed to give each frame a feature representation.

[0053] Furthermore, the support vector machine model training in step S4 specifically includes the following steps:

[0054] S4.1: Use the existing, manually annotated video frame dataset as training samples and the constructed feature vector as input to train the SVM classifier. SVM is suitable for this type of nonlinear classification problem due to its powerful classification and generalization capabilities.

[0055] S4.2: During the model training process, parameter tuning is performed to ensure that the SVM model can effectively divide the optimal decision boundary between different categories and improve the accuracy and robustness of classification.

[0056] Furthermore, the new frame classification in step S5 specifically includes the following steps:

[0057] S5.1: For any new input video frame, the system first repeats the preprocessing, feature extraction and feature vector construction steps from S1 to S3. Then, the constructed feature vector is input into the optimized and trained SVM model, which automatically analyzes and outputs the classification result of whether the frame belongs to fixed lens, lens switching, lens following or large motion, so as to achieve fast and accurate automatic classification of video frames.

[0058] Specific steps are as follows: Figure 3As shown: First, the image is preprocessed, including converting BGR image to grayscale image, median filtering wave, etc., to reduce noise and color interference. Then, the frame difference image and optical flow field image are calculated using adjacent frames, wherein the frame difference image is used to reflect the degree of content change in the image, and the direction of the optical flow field represents the movement direction of the pixels in the image. At the same time, in order to improve the calculation efficiency, the present invention adopts sparse optical flow method instead of dense optical flow method. On this basis, the original image is divided into blocks according to the coordinates, and the image can be decomposed into m×n independent sub-blocks. In each sub-block, the sum of the frame difference map is calculated to characterize the motion amplitude and location of the target in the image; the main direction of the optical flow in each area is calculated and digitized clockwise to 0-15 to characterize the motion direction of the target in each block. As a result, there are a motion amplitude vector with a length of m×n and a motion direction vector with a length of m×n. Finally, the motion amplitude vector is normalized and spliced ​​with the motion direction vector to obtain a feature vector with a length of 2×m×n, which contains the motion intensity and motion direction of the target in the image. Finally, through a set of calibrated data, the feature vector is extracted and trained using the SVM algorithm to obtain the final classifier and realize the classification of video images frame by frame.

[0059] Example 2

[0060] This embodiment provides a video frame classification system based on SVM and motion extraction, including:

[0061] The preprocessing module is used to convert the current frame and the previous frame of the video into grayscale images, and calculate the frame difference image and the optical flow image;

[0062] A motion vector calculation module is used to calculate the motion amplitude vector from the frame difference image and the motion direction vector from the optical flow image;

[0063] A motion vector construction module is used to concatenate the motion amplitude vector and the motion direction vector to obtain a motion feature vector, and to construct a feature vector for classification;

[0064] The SVM model training module is used to use the video frame dataset with labeled frame categories as training samples and the constructed feature vector as input to train the SVM model;

[0065] The video frame classification module is used to automatically classify the scene type to which the video frame belongs using the trained SVM model.

[0066] Example 3

[0067] This embodiment provides a video frame classification device based on SVM and motion extraction, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned video frame classification method based on SVM and motion extraction (S1-S5) are implemented.

Claims

1. A video frame classification method based on SVM and motion extraction, characterized in that: The steps include: S1: Convert the current frame and the previous frame of the video into grayscale images, and calculate the frame difference map and optical flow map; S2: Calculate the motion magnitude vector from the frame difference image and the motion direction vector from the optical flow image; S3: concatenate the motion amplitude vector and the motion direction vector to obtain a motion feature vector, and construct a feature vector for classification; S4: Use the video frame dataset with labeled frame categories as training samples and the constructed feature vector as input to train the SVM model; S5: For the input new video frame, feature extraction is performed according to steps S1-S3, and the obtained feature vector is input into the trained SVM model to realize automatic classification of the scene type to which it belongs.

2. The video frame classification method based on SVM and motion extraction according to claim 1 is characterized in that: The frame difference method is used to calculate the frame difference between adjacent frames, and the image is divided into several sub-blocks according to the coordinates. The sum of the frame difference in each sub-block is counted to form a motion amplitude vector, which is then normalized.

3. The video frame classification method based on SVM and motion extraction according to claim 1 is characterized in that: The optical flow method is used to calculate the optical flow maps of adjacent frame images, and the image is divided into several sub-blocks according to the coordinates. The optical flow direction histogram in each sub-block is counted, and the main direction of the optical flow of each sub-block is determined. It is encoded as 0-15 to obtain the motion direction vector.

4. The video frame classification method based on SVM and motion extraction according to claim 1 is characterized in that: The motion amplitude vector and the motion direction vector are concatenated into a one-dimensional vector, namely the motion feature vector used for SVM classification.

5. The video frame classification method based on SVM and motion extraction according to claim 1 is characterized in that: Frame categories include fixed shots, shot cuts, camera tracking, and large movements.

6. The video frame classification method based on SVM and motion extraction according to claim 1 is characterized in that: Constructing the feature vector for classification in step S3 specifically includes: assigning a feature representation to each video frame; dividing the image into blocks, and calculating the features in each block to obtain a one-dimensional vector.

7. A video frame classification system based on SVM and motion extraction, characterized in that: include: The preprocessing module is used to convert the current frame and the previous frame of the video into grayscale images, and calculate the frame difference image and the optical flow image; A motion vector calculation module is used to calculate the motion amplitude vector from the frame difference image and the motion direction vector from the optical flow image; A motion vector construction module is used to concatenate the motion amplitude vector and the motion direction vector to obtain a motion feature vector, and to construct a feature vector for classification; The SVM model training module is used to use the video frame dataset with labeled frame categories as training samples and the constructed feature vector as input to train the SVM model; The video frame classification module is used to automatically classify the scene type to which the video frame belongs using the trained SVM model.

8. The video frame classification system based on SVM and motion extraction according to claim 7, characterized in that: The motion vector calculation module calculates the frame difference of adjacent frames through the frame difference method, divides the image into several sub-blocks according to the coordinates, counts the sum of the frame difference in each sub-block, forms a motion amplitude vector, and normalizes it.

9. The video frame classification system based on SVM and motion extraction according to claim 7, characterized in that: The motion vector calculation module calculates the optical flow map of adjacent frame images by the optical flow method, divides the image into several sub-blocks according to the coordinates, counts the optical flow direction histogram in each sub-block, determines the main direction of the optical flow of each sub-block, encodes it in 0-15, and obtains the motion direction vector.

10. A video frame classification device based on SVM and motion extraction, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method implements the steps of a video frame classification method based on SVM and motion extraction as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Layered processing system for edge device video data

    CN119832466A