A video segmentation method and storage medium based on picture features
Through the video segmentation method based on picture features, artificial intelligence models are used to identify and crop configuration features in the video, which solves the problem of the inability to automatically extract video points of interest in the existing technology, and realizes the automation of video editing and the reduction of redundant information. , improving user experience.
Patent Information
- Application Number
- CN202110585144.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-05-27
AI Technical Summary
Existing video recording equipment cannot automatically extract points of interest in videos, resulting in lengthy and boring video recordings that are difficult to discover and edit by users.
Using a video segmentation method based on picture characteristics, the artificial intelligence model identifies the configuration characteristics of specific frames in the video image, retains the pictures with configuration characteristics, deletes the pictures without configuration characteristics, and deletes the pictures with configuration characteristics. Crop and encode to generate videos in characteristic formats.
It realizes the automatic extraction of points of interest in videos, generates more enjoyable and compact video clips, reduces redundant information, and improves the efficiency of extracting points of interest in videos for users.
Smart Images

Figure CN113256655B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing, and in particular to a video segmentation method based on picture features. Background Art
[0002] Sports cameras, dashcams and IP network cameras generally record the captured video images objectively. Video recording devices have powerful video encoding capabilities, but they cannot understand the video content and can only record the original video and then store it. For lengthy and boring recorded videos, ordinary users have basically no motivation or interest to discover and edit interesting video clips in such videos. Summary of the invention
[0003] Therefore, it is necessary to provide a method that can automatically process videos to solve the problem that the video stream has a lot of redundant information and cannot automatically extract points of interest in the existing environment;
[0004] To achieve the above object, the inventor provides a video segmentation method based on picture features, comprising the following steps: loading a video image and sending it to a video intelligent analysis module, wherein the video intelligent analysis module loads an artificial intelligence model, wherein the artificial intelligence model is trained to recognize configuration features of specific frames in the video image,
[0005] In the steps, the artificial intelligence model recognizes the loaded video images, retains the pictures with configuration features, deletes the pictures without configuration features, segments the pictures with configuration features, crops the pictures of interest, enlarges them to a uniform size, and encodes them into a video in a feature format in the original order.
[0006] Furthermore, the configuration features include one or more of single-protagonist features, dual-protagonist features, close-up features, strong correlation features, motion enhancement features and animal enhancement features, and the configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
[0007] Specifically, the steps are further performed, in which the artificial intelligence model performs feature matching on the picture with the configuration features, outputs the content area with the configuration features, and integrates the content area of the picture with the configuration features to obtain the cropped area.
[0008] Specifically, the method also includes the steps of calculating the weighted interest value of the content area of the picture with the configuration features, retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; and matching the content areas with the highest weighted interest value and the content area with the second highest weighted interest value to obtain the cropped area.
[0009] Furthermore, the weighted interest value of the content area is calculated as follows:
[0010] Weighted interest value = initial weight * distance factor * video stream correlation factor
[0011] The initial weight is determined by the configuration feature type of the content area, and the initial weight ratio of single protagonist feature: dual protagonist feature: close-up feature: strong correlation feature: motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1; the distance factor is the distance between the center point of the content area and the center of the picture; the video stream related factor is determined according to the video type or according to the content of the previous and next frames.
[0012] A video segmentation storage medium based on picture features stores a computer program, wherein the computer program, when executed, performs the following steps: loading a video image, loading an artificial intelligence model, wherein the artificial intelligence model is trained to recognize configuration features of a specific frame in the video image,
[0013] The computer program also continues to execute steps, and the artificial intelligence model recognizes the loaded video images, retains the pictures with configuration features, and deletes the pictures without configuration features.
[0014] Specifically, the configuration features include one or more of single-protagonist features, dual-protagonist features, close-up features, strong correlation features, motion enhancement features and animal enhancement features, and the configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
[0015] Furthermore, when the computer program is run, the steps are also performed, wherein the artificial intelligence model performs feature matching on the picture with the configuration features, outputs the content area with the configuration features, and integrates the content area of the picture with the configuration features to obtain the cropped area.
[0016] Furthermore, when the computer program is run, it also executes the steps of calculating the weighted interest value of the content area of the picture with the configuration characteristics, retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; and matching the content areas according to the content area with the highest weighted interest value and the content area with the second highest weighted interest value to obtain the cropped area.
[0017] Furthermore, the weighted interest value of the content area is calculated as follows:
[0018] Weighted interest value = initial weight * distance factor * video stream correlation factor
[0019] The initial weight is determined by the configuration feature type of the content area, and the initial weight ratio of single protagonist feature: dual protagonist feature: close-up feature: strong correlation feature: motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1; the distance factor is the distance between the center point of the content area and the center of the picture; the video stream related factor is determined according to the video type or according to the content of the previous and next frames.
[0020] A video segmentation electronic device based on picture features includes the above-mentioned storage medium, and also includes a CPU unit, a GPU unit, an OpenCL unit, an NPU unit, and a hardware video Codec unit; wherein the CPU unit is used to execute software and logic control type load tasks; the GPU unit is responsible for accelerating graphics rendering type load tasks; the OpenCL unit is responsible for accelerating computing type load tasks; the NPU unit is responsible for accelerating deep learning type load tasks; and the hardware video Codec unit is responsible for accelerating video encoding and decoding type load tasks.
[0021] Furthermore, it also includes a memory and a memory; the memory is responsible for the dynamic writing and reading of data and programs, and the memory can store operating systems, applications, address books, instant messages, digital images, or digital videos.
[0022] The memory is used to temporarily store the calculation data in the CPU and the data exchanged with the external memory such as the hard disk.
[0023] Specifically, it also includes a communication component, an I / O interface, a power component, a sensor component, a video component, an audio component, a display component, and a security component. The communication component is used to access a standard data communication network or a near field communication network;
[0024] The I / O interface is programmable and is used as a physical channel for exchanging information between devices or components outside the processor;
[0025] The power supply component is used to provide external power to other components or parts;
[0026] The sensor assembly may also include one or more of an image sensor, a pressure sensor, a gyroscope sensor, an acceleration sensor, a magnetic sensor, a proximity sensor, or a temperature sensor;
[0027] The video component is used for hardware encoding and decoding of video data;
[0028] The audio component is used for hardware audio acquisition and output, and the hardware audio acquisition requires 3A audio processing of the original audio data;
[0029] The display component is used for display output and display output switching and management;
[0030] The security component is used to securely access identity information, fingerprint information or account information.
[0031] Through the above technical solution, artificial intelligence can recognize specific configurations in image frames. In order to present certain configurations, it can also identify the size of configuration features and perform more intelligent cropping to generate new video clips, thereby achieving the effect of easily extracting video elements. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a flow chart of a video segmentation method based on picture features according to an embodiment of the present invention.
[0033] Figure 2 A schematic diagram of an electronic device for video segmentation based on picture features according to an embodiment of the present invention.
[0034] Figure 3 This is a content area integration screen diagram according to an embodiment of the present invention.
[0035] Description of Reference Numerals
[0036] 301. Content area A; 302. Content area B; 303. Content area C; 3. Cropped area. DETAILED DESCRIPTION
[0037] In order to explain the technical content, structural features, achieved objectives and effects of the technical solution in detail, the following is a detailed description in conjunction with specific embodiments and accompanying drawings.
[0038] See also Figure 1 , a video segmentation method based on picture features is introduced, comprising the following steps, S100 loading a video image and sending it to a video intelligent analysis module, the video intelligent analysis module loading an artificial intelligence model, the artificial intelligence model being trained to recognize configuration features of specific frames in the video image,
[0039] Step S102 is performed, the artificial intelligence model identifies the loaded video image, retains the screen with configuration features, deletes the screen without configuration features, and performs S104 to segment the screen with configuration features, cuts out the screen of interest, and S106 is enlarged to a uniform size and encoded into a video in a feature format in the original order. The feature format here can be a user-defined format, which is a container for encapsulating audio and video data packets. Common media formats include ts, mp4, mkv, mov, hls, etc. It enables artificial intelligence to recognize specific configurations in image frames. In order to present certain configurations, it can also identify the size of configuration features and perform more intelligent cutting to generate new video clips, so as to achieve the effect of conveniently extracting video elements.
[0040] In a further embodiment, the configuration features include one or more of single protagonist features, dual protagonist features, close-up features, strong correlation features, motion enhancement features, and animal enhancement features. In our embodiment, the single protagonist feature refers to the image feature when a single character occupies a large proportion in the picture. The dual protagonist feature refers to the image feature when two characters occupy a large proportion in the picture. The close-up feature refers to the image feature when the details of the characters (such as face / kissing / fighting, etc.) occupy a large proportion in the picture. Strong correlation features include strong correlation in the time dimension and strong correlation in the motion dimension. Motion enhancement features refer to image features when the motion action picture occupies a large proportion in the picture. Animal enhancement features refer to image features when the animal occupies a large proportion in the picture. When judging, the combined area of people and actions is preferred. The recognition of configuration features is judged and identified by an artificial intelligence model. Specifically, only the video material needs to be used as the training material, and the training material can be annotated with specific configuration features by manual annotation or automatic annotation, and then input into the artificial intelligence model for training. The training process can refer to the prior art and will not be repeated here. In some other embodiments, the configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
[0041] Exemplarily, the specific multi-layer convolutional neural network can be fine-tuned according to actual conditions. For example, in this example, the continuous picture feature model is a five-layer convolutional neural network model with a series classification layer. Among them, the first layer is the input layer, and the obtained image pyramid can be used as the input of the input layer; the second layer is a 12*12 convolution layer, the convolution kernel is 12*12*8, and the number of parameters is (12x12+1)x8*w*h, which is used to extract image features; the third layer is an 8*8 convolution layer, the convolution kernel is 8*8*12, and the number of parameters is (8x8+1)x12*w*h. Based on the extraction results of the second layer, image features are extracted again; the fourth layer is a 5*5 convolution layer, the convolution kernel is 5*5*16, and the number of parameters is (5x5+1)x16*w*h. Based on the extraction results of the third layer, image features are extracted again; the fifth layer is a 3*3 convolution layer, the convolution kernel is 3*3*20, and the number of parameters is (3x3+1)x20*w*h. Based on the extraction results of the fourth layer, image features are extracted again; the first five layers constitute a five-layer convolutional neural network model. The latter stage of the convolutional neural network model is the classification layer; the classification layer contains several fully connected layers, and finally outputs the image feature type and feature area, which can reflect the following results: 1. The type and rectangular area of the image feature; 2. The score of the image feature. It should be noted that in practical applications, it is not limited to the above-mentioned convolutional neural network model structure, and those skilled in the art can also adopt a model structure with more layers according to actual needs. The model input layer can also be configured with an image preprocessing module, which can complete digital image transformations such as image size, angle, color space, and cropping.
[0042] In a further specific embodiment, a step is also performed in which the artificial intelligence model performs feature matching on the picture with configuration features, outputs the content area with configuration features, and integrates the content area of the picture with configuration features. The content area integration step here can be to obtain the cropped area through the following constraints: the cropped area needs to include all content areas with configuration features in the picture; or it can be necessary to integrate the content areas with configuration features in several previous and next frames as the size of the cropped area, thereby improving the smoothness of the transition between frames.
[0043] In some other specific embodiments, the steps are also included, calculating the weighted interest value of the content area of the picture with the configuration characteristics, retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; matching the content area according to the content area with the highest weighted interest value and the content area with the second highest weighted interest value to obtain the cropped area. In this embodiment, the weighted interest value of the content area is calculated, and only the content areas with the top two highest weighted interest values are retained, which helps to improve the efficiency of displaying effective information in the cropped picture. We found that the video spliced by cropping the area in this way is smoother, the content is compact, and there is less redundant information. In some preferred embodiments, the weighted interest value calculation of the content area is specifically:
[0044] Weighted interest value = initial weight * distance factor * video stream correlation factor
[0045] The initial weight is determined by the configuration feature type of the content area. The initial weight ratio of single protagonist feature, dual protagonist feature, close-up feature, strong correlation feature, motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1. The above initial weights can also be normalized as: 0.0833:0.1667:0.25:0.25:0.1667:0.0833;
[0047] The distance factor is the distance between the center point of the content area and the center of the screen; the video stream correlation factor is determined according to the video type or the content of the previous and next frames. For example, if the previous and next frames of the video stream have the same configuration features, the correlation factor is larger. The configuration features of the previous and next frames are of the same type as the configuration features of the current frame and the coordinates of the regions are closer, the correlation factor is also larger. The video stream correlation factor is positively correlated with the degree of proximity between the configuration features of the previous and next frames and the content area of the current frame and the degree of similarity of the configuration types. By designing a weighted interest value, we can quantify the information intensity of the content configuration area in each frame, so as to better select the cropped area in the frame. At the same time, the video stream correlation factor is considered, and the selection of the cropped area is optimized based on the data characteristics and correlation degree in the video stream, so as to avoid large changes in the cropped areas of the previous and next frames, thereby affecting the viewing experience.
[0048] Meanwhile, in some other further embodiments, we also provide a video segmentation storage medium based on picture features, storing a computer program, wherein the computer program, when executed, performs the following steps: loading a video image, loading an artificial intelligence model, wherein the artificial intelligence model is trained to recognize configuration features of a specific frame in a video image,
[0049] The computer program also continues to execute steps, and the artificial intelligence model recognizes the loaded video images, retains the pictures with configuration features, and deletes the pictures without configuration features.
[0050] Specifically, the configuration features include one or more of single-protagonist features, dual-protagonist features, close-up features, strong correlation features, motion enhancement features and animal enhancement features, and the configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
[0051] Furthermore, when the computer program is run, the steps are also performed, wherein the artificial intelligence model performs feature matching on the picture with the configuration features, outputs the content area with the configuration features, and integrates the content area of the picture with the configuration features to obtain the cropped area.
[0052] Furthermore, when the computer program is run, it also executes the steps of calculating the weighted interest value of the content area of the picture with the configuration characteristics, retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; and matching the content areas according to the content area with the highest weighted interest value and the content area with the second highest weighted interest value to obtain the cropped area.
[0053] Furthermore, the weighted interest value of the content area is calculated as follows:
[0054] Weighted interest value = initial weight * distance factor * video stream correlation factor
[0055] The initial weight is determined by the configuration feature type of the content area, and the initial weight ratio of single protagonist feature: dual protagonist feature: close-up feature: strong correlation feature: motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1; the distance factor is the distance between the center point of the content area and the center of the picture; the video stream related factor is determined according to the video type or according to the content of the previous and next frames.
[0056] exist Figure 3 In the embodiment shown, we provide an example of content region integration, the thick frame indicates the range of the original picture frame, wherein the content region 301 with configuration features, a large area, and a medium distance from the center of the original picture frame, the content region 302 with configuration features, a small area, and a close distance from the center of the original picture frame, and the content region 303 with configuration features, a small area, and a far distance from the center of the original picture frame are intelligently identified. In this example, assuming that the content region 303 does not have a high weight such as a close-up feature or a strongly associated feature, after measurement, the weighted interest value of the content region 301 and the weighted interest value of the content region 302 rank first and second. Finally, the cropped region 3 is generated by integration.
[0057] See also Figure 2 , an electronic device for video segmentation based on picture features is introduced. The electronic device can be a smart phone, a personal computer, a tablet computer, a drone gimbal / controller, a game console, a handheld medical terminal, a digital set-top box, a sports camera, an intelligent sports device, etc. Referring to FIG-2 , the electronic device has one or more of the following components: a processor, a memory, a communication component, an I / O interface, a power component, a sensor component, a video component, an audio component, a display component, and a security component, etc.
[0058] The processor of the electronic device based on continuous points of interest generally establishes a bidirectional connection with other components for bidirectional data and control interaction. The processor preferably has a heterogeneous multiprocessor including a CPU unit, a GPU unit, an OpenCL unit, an NPU unit, and a hardware video Codec unit. The CPU unit is responsible for executing software and logic control type load tasks; the GPU unit is responsible for accelerating graphics rendering type load tasks; the OpenCL unit is responsible for accelerating computing type load tasks; the NPU unit is responsible for accelerating deep learning type load tasks; and the hardware video Codec unit is responsible for accelerating video encoding and decoding type load tasks.
[0059] The memory is responsible for the dynamic writing and reading of data and programs. The memory can store operating systems, applications, address books, instant messages, digital images, digital videos, etc. The physical electronic devices of the memory can be static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), etc.
[0060] Memory is used to temporarily store the calculation data in the CPU and the data exchanged with external storage such as hard disk. Memory generally uses semiconductor storage units, including random access memory (RAM), read-only memory (ROM), and cache (CACHE).
[0061] The communication component can access a standard data communication network, such as WiFi, 2G / 3G / 4G / 5G, or a combination thereof. The communication component can also access a near field communication network, such as Bluetooth, near field communication (NFC), or a combination thereof.
[0062] The I / O interface is a physical channel for processors to exchange information with external devices or components. The I / O interface is programmable and its working mode is controlled by the program.
[0063] The power supply assembly provides external power to various components. The power supply assembly may include a power management unit (PMU), a single or multiple power supplies. The processor unit can manage the power supply assembly and manage the power distribution and power consumption control of the system.
[0064] The sensor assembly may also include an image sensor, such as a CMOS / CCD image sensor, for camera applications. In some embodiments, the sensor assembly may also include a pressure sensor, a gyroscope sensor, an acceleration sensor, a magnetic sensor, a proximity sensor, or a temperature sensor.
[0065] The video component is used for hardware encoding and decoding of video data. The video component generally has hardware codecs such as H263 / H264 / H265 / VP8 / VP9.
[0066] The audio component is used for hardware audio acquisition and output. Hardware audio acquisition requires 3A audio processing of the raw audio data.
[0067] The display component is used for display output and display output switching and management. The display component provides a screen with an output interface, and the screen may include a liquid crystal display (LCD) and a touch panel (TP).
[0068] The security component is used to protect sensitive user information and can be used to securely access sensitive user information such as identity information, fingerprint information, and account information.
[0069] It should be noted that, although the above embodiments have been described in this article, the patent protection scope of the present invention is not limited thereby. Therefore, based on the innovative concept of the present invention, changes and modifications made to the embodiments described herein, or equivalent structures or equivalent process changes made using the contents of the present invention specification and drawings, directly or indirectly applying the above technical solutions to other related technical fields, are all included in the patent protection scope of the present invention.
Claims
1. A video segmentation method based on picture features, characterized in that: The steps include: Load the video image and send it to the video intelligent analysis module; The video intelligent analysis module loads an artificial intelligence model, wherein the artificial intelligence model is trained to recognize configuration features of specific frames in a video image; The loaded video images are identified by the artificial intelligence model, the pictures with configuration features are retained, and the pictures without configuration features are deleted; Segment the screen with configuration features and cut out the screen of interest; as well as The images of interest are enlarged to a uniform size and encoded into a video in a feature format in the original order; Also includes the steps: Calculating the weighted interest value of the content area of the screen with the configuration feature, and retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; Matching the content regions according to the content region with the highest weighted interest value and the content region with the second highest weighted interest value to obtain a cropped region; The weighted interest value of the content area is calculated specifically as follows: Weighted interest value = initial weight * distance factor * video stream correlation factor; The initial weight is determined by the configuration feature type of the content area, and the configuration features include single protagonist feature, dual protagonist feature, close-up feature, strong correlation feature, motion enhancement feature and animal enhancement feature. The initial weight ratio of single protagonist feature: dual protagonist feature: close-up feature: strong correlation feature: motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1; The distance factor is the distance between the center point of the content area and the center of the picture; The video stream related factor is determined according to the video type or according to the content of the previous and next frames.
2. The video segmentation method based on picture features according to claim 1, characterized in that: The configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
3. The video segmentation method based on picture features according to claim 1, characterized in that: Also includes the steps: The artificial intelligence model is used to perform feature matching on the picture with the configuration features, output the content area with the configuration features, and integrate the content area of the picture with the configuration features to obtain the cropped area.
4. A video segmentation storage medium based on picture features, characterized in that: A computer program is stored, and when the computer program is run, the following steps are performed: Load video images; Loading an artificial intelligence model, wherein the artificial intelligence model is trained to recognize configuration features of a specific frame in a video image; The loaded video images are identified by the artificial intelligence model, the pictures with configuration features are retained, and the pictures without configuration features are deleted; Segment the screen with configuration features and cut out the screen of interest; and The images of interest are enlarged to a uniform size and encoded into a video in a feature format in the original order; The computer program, when executed, further performs the steps of: Calculating the weighted interest value of the content area of the screen with the configuration feature, and retaining the content area with the highest weighted interest value and the content area with the second highest weighted interest value; Matching the content regions according to the content region with the highest weighted interest value and the content region with the second highest weighted interest value to obtain a cropped region; The weighted interest value of the content area is calculated as follows: Weighted interest value = initial weight * distance factor * video stream correlation factor; The initial weight is determined by the configuration feature type of the content area, and the configuration features include single protagonist feature, dual protagonist feature, close-up feature, strong correlation feature, motion enhancement feature and animal enhancement feature. The initial weight ratio of single protagonist feature: dual protagonist feature: close-up feature: strong correlation feature: motion enhancement feature: animal enhancement feature is 1:2:3:3:2:1; The distance factor is the distance between the center point of the content area and the center of the picture; The video stream related factor is determined according to the video type or according to the content of the previous and next frames.
5. The video segmentation storage medium based on picture features according to claim 4 is characterized in that: The configuration features are stored in the artificial intelligence model file in the form of multi-layer vector weight parameters.
6. The video segmentation storage medium based on picture features according to claim 4, characterized in that: The computer program, when executed, further performs the steps of: The artificial intelligence model is used to perform feature matching on the picture with the configuration features, output the content area with the configuration features, and integrate the content area of the picture with the configuration features to obtain the cropped area.
