Weight reducing system and method based on AI video and storage medium
Through multi-threaded processing and automatic optimization modules, the existing AI video slimming system has been solved, the video quality and processing speed are improved, and the video slimming and optimization effect is achieved efficient video slimming and optimization effects.
Patent Information
- Application Number
- CN202411080458.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The existing AI video slimming system has cumbersome steps when processing videos, which easily changes the original video parameters, resulting in low quality of generated videos, slow single-thread processing speed and long processing time.
The video slimming process is decomposed into three subtasks: object detection, image processing and editing, and is executed in parallel, combining automatic optimization and active enhancement modules to improve video quality through video frame extraction and optimization processing.
It greatly reduces the complexity of manual operations, improves the speed and quality of video processing, ensures the clarity and fluency of generated videos, and the system has the ability to self-optimize to adapt to different video types.
Smart Images

Figure CN119071567A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video weight loss technology, and more specifically, to a weight loss system, method and storage medium based on AI video. Background Art
[0002] AI video slimming is a technology that uses AI technology to optimize and compress videos. It mainly recognizes scenes and objects in the video, performs intelligent analysis and processing, and achieves video slimming and optimization. This technology can remove irrelevant people, props, and overly lengthy plots, making the entire video more compact and improving the viewing quality.
[0003] At present, the existing AI video slimming system generally adopts a single-threaded method when processing video content. The process is frame image extraction, frame image detection and recognition, target area marking, image processing and editing, and then synthesis to finally obtain the slimmed-down video. Although this method can achieve video slimming processing, it still has certain shortcomings. For example, when processing the video, due to the cumbersome processing steps, it is easy to change the parameters of the original video, resulting in the quality of the final generated video being lower than the quality of the original video, and subsequent manual optimization and adjustment are required; in addition, when the video data to be processed is large, it adopts a single-threaded processing method, so that the processor only performs one task unit at a time, resulting in slow processing speed of the system and long processing time. Summary of the invention
[0004] In view of the deficiencies in the prior art, the object of the present invention is to provide a weight loss system, method and storage medium based on AI video.
[0005] To achieve the above object, the present invention provides the following technical solutions, including:
[0006] The video import module is used to import the video to be processed into the system and perform preprocessing;
[0007] A video frame extraction module, which is used to extract representative frame images from the imported video;
[0008] The frame image processing module is used to perform target detection and recognition on the extracted frame image, and mark, process and edit the target area that needs to be deleted or modified according to the results of the target detection and recognition;
[0009] A video generation module, which is used to synthesize the processed and edited video frames together to generate the final video output;
[0010] The video optimization module is used to check and optimize the generated video to improve the video quality. The optimization process includes automatic optimization and active enhancement.
[0011] The adjustment module is used to obtain the generated video quality assessment result, and optimize and adjust the functional modules corresponding to the abnormal parameters.
[0012] Preferably, the automatic optimization is as follows: importing the generated video data, obtaining the resolution, color reproduction, clarity, and smoothness parameter values of the video, marking these parameter values as original parameters Bk, and comparing them with the original video parameters Gm for quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered to be a non-damaged first-level video and is directly output; if one parameter value in Bk is lower than that in Gm, the video is considered to be a low-damage second-level video, and a repair operation is performed or it is directly output according to the manually input instructions; if two or more parameter values in Bk are lower than those in Gm, the video is considered to be a high-damage third-level video, and the multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired, and the video is output after the repair is completed;
[0013] Active enhancement: After the quality is assessed as a first-level video, optimization instructions are continued based on manual input to adjust and optimize video parameters including contrast, brightness, and hue to further improve the quality and viewing experience of the video, and then the video is output.
[0014] Preferably, the working process of the adjustment module is: obtaining the generated video quality assessment result, according to the quality assessment result, the adjustment module will count the number of times the abnormal parameters appear, and set the standard number of the system according to actual needs. When the statistical results find that the number of abnormal parameters exceeds the preset standard number, the adjustment module will trigger the optimization adjustment function. According to the functional module corresponding to the abnormal parameter, the adjustment module will optimize and adjust the module. After the optimization and adjustment, the adjustment module will feed back the results to the system.
[0015] Preferably, the specific processing process of the frame image processing module is:
[0016] Target detection and recognition: Use computer vision technology to classify and locate the extracted features; classify and recognize the identified targets based on the target detection results; perform post-processing on the target detection and recognition results to remove redundant detection results and merge adjacent target areas to improve the accuracy and reliability of target detection and recognition;
[0017] Target area marking: based on the results of target detection and recognition, mark the target area that needs to be deleted or modified;
[0018] Image processing and editing: Use image processing technology and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations to achieve a slimming effect.
[0019] Preferably, the frame image processing module uses a multi-threaded approach to implement video slimming processing, and the specific process is: decomposing the video slimming process into three subtasks: target detection and recognition, image processing, and editing; creating a thread for each subtask; allocating data to be processed to each thread according to the thread type, including a collection of video frames and intermediate results in the processing process; using a synchronization mechanism of conditional variables to ensure coordination and data consistency between threads; starting all threads and letting them execute their respective tasks in parallel; and merging all results when all threads complete their respective tasks.
[0020] Preferably, the specific process of generating a video by the video generation module is: selecting frame images to be synthesized from the processed and edited frame images, and selecting frame images according to changes in video content; then sorting the frame images according to the selection order or time order, and using video editing software or special synthesis software to synthesize the sorted frame images together to generate the final video output.
[0021] Preferably, the video frame extraction module includes two methods of extracting frame images, namely, according to time intervals and according to changes in video content. The time interval method extracts frame images based on a uniform distribution of time, mainly extracting one frame image per second, to ensure that there are representative frame images throughout the entire length of the video.
[0022] Preferably, the method for extracting the video content is to determine whether the content has changed by analyzing the difference or similarity between each frame image of the video, and when a content change is detected, the frame image is extracted.
[0023] A weight loss method based on AI video, comprising the following steps:
[0024] S1. Import the video to be processed and perform preprocessing on the imported video;
[0025] S2, extract representative frame images from the video;
[0026] S3, performing target detection and recognition on the extracted frame image;
[0027] S3. Mark the target area that needs to be deleted or modified according to the results of target detection and recognition;
[0028] S4, performing image processing and editing on the marked target area;
[0029] S5. Synthesize the processed and edited video frames together to generate a final video output.
[0030] A computer-readable storage medium, when the program is executed by a processor, implements the steps of the weight loss method based on AI video.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] The AI-based video slimming system provided by the present invention can automatically import videos, extract frame images, perform target detection and recognition, process and edit images, synthesize videos, optimize videos, and automatically adjust modules when abnormal parameters are found, greatly reducing the complexity of manual operations;
[0033] Among them, by setting up a video frame extraction module and a frame image processing module, and using an AI algorithm, the system can accurately extract frame images, detect and identify targets in video frames, so as to accurately mark and edit areas that need to be slimmed down or modified, effectively slim down the video, and optimize the video quality; in addition, the frame image processing module adopts a multi-threaded method to divide the video slimming process into multiple subtasks that are carried out simultaneously, so that each subtask can be processed independently, and multiple core processors of the computer can be fully utilized, which is conducive to speeding up the processing speed;
[0034] By setting up a video optimization module, which includes automatic optimization and active enhancement, the quality of the generated video can be evaluated, and optimization processing can be automatically or actively performed according to the quality evaluation results, which is conducive to improving the video quality and providing a clearer and smoother visual experience;
[0035] By setting up the adjustment module, the system can automatically adjust and optimize the abnormal functional modules according to the generated video quality evaluation results, so that the system has the ability to self-improve to adapt to the processing requirements of different video types. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A structural block diagram of a weight loss system based on AI video provided by the present invention;
[0037] Figure 2 A flow chart of a weight loss method based on AI video provided by the present invention. DETAILED DESCRIPTION
[0038] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.
[0039] Reference Figure 1 , a weight loss system, method and storage medium embodiment based on AI video of the present invention are further described.
[0040] A weight loss system based on AI video, comprising: a video import module, a video frame extraction module, a frame image processing module, a video generation module, a video optimization module and an adjustment module.
[0041] The video import module is used to import the video to be processed into the system and perform preprocessing.
[0042] A video frame extraction module is used to extract representative frame images from an imported video; the video frame extraction module includes two frame image extraction methods, namely, according to a time interval and according to changes in video content, wherein the time interval method extracts frame images based on a uniform distribution of time, mainly extracting one frame image per second, ensuring that there are representative frame images throughout the entire length of the video; the advantages of this method are that it is simple and easy to use, suitable for processing long-term videos, and can ensure a uniform distribution of frame images, but this method may miss some important moments or rapidly changing content because it does not take into account changes in video content, so the present invention also adopts another implementation method, namely, extraction based on video content;
[0043] The method of extracting according to the video content is to determine whether the content has changed by analyzing the difference or similarity between each frame of the video. When a content change is detected, this frame of image is extracted; the advantage of this method is that it can capture important moments and changes in the video. For example, in Python, use the VideoCapture class in the OpenCV library to read the video file, and use the read() method to read the video frame by frame. By setting a timer or counter, a frame of image is extracted at a certain time interval. As for the method of extracting frame images according to changes in video content, the following is the implementation method:
[0044] (1) Use the VideoCapture class to read the video file and read the video frame by frame;
[0045] (2) For each frame of the image, use a feature extraction algorithm (such as SIFT, SURF, etc.) to extract the feature vector of the image;
[0046] (3) using a feature matching algorithm (e.g., Brute-Force matcher) to compare the feature vectors of the current frame image and the previous frame image to detect the similarity or difference between them;
[0047] (4) When the feature matching degree is detected to be lower than a certain threshold, it is considered that the content has changed and the current frame image is extracted;
[0048] (5) Repeat steps 2-4 until the entire video is processed.
[0049] The frame image processing module is used to perform target detection and recognition on the extracted frame image, and mark, process and edit the target area to be deleted or modified according to the results of the target detection and recognition; wherein the specific processing process of the frame image processing module is as follows:
[0050] Target detection and recognition: Use computer vision technology to classify and locate the extracted features; classify and recognize the identified targets based on the target detection results; perform post-processing on the target detection and recognition results to remove redundant detection results and merge adjacent target areas to improve the accuracy and reliability of target detection and recognition;
[0051] Target area marking: based on the results of target detection and recognition, mark the target area that needs to be deleted or modified;
[0052] Image processing and editing: Use image processing technology and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations to achieve a slimming effect.
[0053] In addition, in the present invention, the frame image processing module adopts a multi-threaded method to implement video slimming processing, and the specific process is: decomposing the video slimming process into three subtasks of target detection and recognition, image processing and editing, creating a thread for each subtask, and allocating data to be processed to each thread according to the thread type, including a collection of video frames and intermediate results in the processing process, using the synchronization mechanism of conditional variables to ensure coordination and data consistency between threads, starting all threads, and allowing them to execute their respective tasks in parallel, when all threads complete their respective tasks, all results are merged; however, in a multi-threaded environment, error handling is essential, so the frame image processing module set in the present invention also has the function of capturing and processing exceptions and errors that may occur in the thread, and taking appropriate measures to recover or retry, and can optimize multi-threaded processing according to actual conditions; by adopting the above method, the multiple core processors of the computer can be fully utilized to speed up the processing speed.
[0054] A video generation module is used to synthesize the processed and edited video frames together to generate a final video output; the specific process of the video generation module generating a video is: selecting frame images to be synthesized from the processed and edited frame images, and selecting frame images according to changes in video content; then sorting the frame images according to the selection order or time order, and using video editing software or special synthesis software to synthesize the sorted frame images together to generate a final video output;
[0055] It should also be noted that during the synthesis and output process, you need to pay attention to choosing the appropriate output format and quality to ensure that the output video can meet the needs of users; common output formats include MP4, AVI, WMV, etc., which can be selected according to actual needs; at the same time, you also need to adjust the quality of the video according to actual needs, such as resolution, bit rate, etc.
[0056] The video optimization module is used to check and optimize the generated video to improve the video quality. The optimization process includes automatic optimization and active enhancement. Among them, the automatic optimization is: importing the generated video data, obtaining the resolution, color reproduction, clarity, and smoothness parameter values of the video, marking these parameter values as original parameters Bk, and comparing them with the original video parameters Gm for quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered to be a damage-free first-level video and is directly output; if one parameter value in Bk is lower than the parameter in Gm, the video is considered to be a low-damage second-level video, and a repair operation is performed or it is directly output according to the manually input instructions; if two or more parameter values in Bk are lower than the parameters in Gm, the video is considered to be a high-damage third-level video, and the multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired, and the video is output after the repair is completed;
[0057] Active enhancement: After the quality is assessed as a first-level video, optimization instructions are continued based on manual input to adjust and optimize video parameters including contrast, brightness, and hue to further improve the quality and viewing experience of the video, and then the video is output.
[0058] The adjustment module is used to obtain the generated video quality evaluation results, count the number of times abnormal parameters appear, and after the system runs for a set time, optimize and adjust the functional modules corresponding to the abnormal parameters whose number exceeds the preset standard number. The specific working process is: obtain the generated video quality evaluation results, which can be achieved by calling the interface of the video optimization module or other related modules; according to the quality evaluation results, the adjustment module will count the number of times abnormal parameters appear, and these abnormal parameters may include problems in resolution, color reproduction, clarity, fluency, etc.; according to actual needs, the system can set a standard number of times to determine whether the number of times abnormal parameters appear exceeds the preset standard range. For example, the standard number of times is 3 times. When it is detected that the number of abnormalities exceeds 3 times, adjustments are required. When the statistical results find that the number of abnormal parameters exceeds the preset standard number, the adjustment module will trigger the optimization adjustment function;
[0059] According to the functional module corresponding to the abnormal parameters, the adjustment module will optimize and adjust the module, including adjusting parameter settings, improving algorithms, updating models and other operations to solve the problems caused by abnormal parameters; after the optimization and adjustment, the adjustment module will feed back the results to the system for subsequent processing or for users to understand the optimization status.
[0060] Second embodiment
[0061] Please refer to Figure 2 , a weight loss method based on AI video, applied to the weight loss system based on AI video, comprises the following steps:
[0062] S1. Import the video to be processed and perform preprocessing on the imported video;
[0063] S2, extract representative frame images from the video;
[0064] S3, performing target detection and recognition on the extracted frame image;
[0065] S3. Mark the target area that needs to be deleted or modified according to the results of target detection and recognition;
[0066] S4, performing image processing and editing on the marked target area;
[0067] S5. Synthesize the processed and edited video frames together to generate a final video output.
[0068] As a preferred embodiment of the present invention, a computer-readable storage medium is stored thereon
[0069] Computer program. When the program is executed by a processor, the steps of the weight loss method based on AI video are implemented. When the weight loss method based on AI video is applied, it can be applied in the form of software, such as a program designed to be independently run on a computer-readable storage medium, and the computer-readable storage medium can be a USB flash drive.
[0070] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0071] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0072] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A weight loss system based on AI video, characterized in that: include: The video import module is used to import the video to be processed into the system and perform preprocessing; A video frame extraction module, which is used to extract representative frame images from the imported video; The frame image processing module is used to perform target detection and recognition on the extracted frame image, and mark, process and edit the target area that needs to be deleted or modified according to the results of the target detection and recognition; A video generation module, which is used to synthesize the processed and edited video frames together to generate the final video output; The video optimization module is used to check and optimize the generated video to improve the video quality. The optimization process includes automatic optimization and active enhancement. The adjustment module is used to obtain the generated video quality assessment results and optimize the functional modules corresponding to the abnormal parameters.
2. The AI video-based weight loss system according to claim 1, characterized in that: Automatic optimization is as follows: import the generated video data, obtain the resolution, color restoration, clarity, and smoothness parameter values of the video, mark these parameter values as original parameters Bk, and compare them with the original video parameters Gm for quality assessment. If all parameter values in Bk are the same as those in Gm, the video is considered to be a non-damaged first-level video and is directly output; if one parameter value in Bk is lower than that in Gm, the video is considered to be a low-damage second-level video, and a repair operation or direct output is performed according to the manually input instructions; if two or more parameter values in Bk are lower than those in Gm, the video is considered to be a highly damaged third-level video, and the multiple parameter values are marked as abnormal parameters, and the abnormal parameters are repaired, and the video is output after the repair is completed; Active enhancement: After the quality is assessed as a first-level video, optimization instructions are continued based on manual input to adjust and optimize video parameters including contrast, brightness, and hue to further improve the quality and viewing experience of the video, and then the video is output.
3. The AI video-based weight loss system according to claim 1, characterized in that: The working process of the adjustment module is: obtaining the generated video quality assessment results, according to the quality assessment results, the adjustment module will count the number of times abnormal parameters appear, and set the standard number of the system according to actual needs. When the statistical results find that the number of abnormal parameters exceeds the preset standard number, the adjustment module will trigger the optimization adjustment function. According to the functional module corresponding to the abnormal parameter, the adjustment module will optimize and adjust the module. After the optimization and adjustment, the adjustment module will feed back the results to the system.
4. The AI video-based weight loss system according to claim 1, characterized in that: The specific processing process of the frame image processing module is as follows: Target detection and recognition: Use computer vision technology to classify and locate the extracted features; Based on the results of target detection, classify and recognize the identified targets; Post-process the target detection and recognition results to remove redundant detection results and merge adjacent target areas to improve the accuracy and reliability of target detection and recognition; Target area marking: based on the results of target detection and recognition, mark the target area that needs to be deleted or modified; Image processing and editing: Use image processing technology and editing tools to process and edit the marked target area, including deletion, replacement, and blurring operations to achieve a slimming effect.
5. The AI video-based weight loss system according to claim 1, characterized in that: The frame image processing module uses a multi-threaded approach to implement video slimming processing. The specific process is: decomposing the video slimming process into three subtasks: target detection and recognition, image processing, and editing; creating a thread for each subtask; allocating data to be processed to each thread according to the thread type, including a collection of video frames and intermediate results in the processing process; using a synchronization mechanism of conditional variables to ensure coordination and data consistency between threads; starting all threads and letting them execute their respective tasks in parallel; and merging all results when all threads complete their respective tasks.
6. The AI video-based weight loss system according to claim 1, characterized in that: The specific process of generating a video by the video generation module is as follows: selecting the frame images to be synthesized from the processed and edited frame images, and selecting the frame images according to the changes in the video content; then sorting the frame images according to the selection order or time order, and using video editing software or special synthesis software to synthesize the sorted frame images together to generate the final video output.
7. The AI video-based weight loss system according to claim 1, characterized in that: The video frame extraction module includes two methods of extracting frame images: according to time intervals and according to changes in video content. Among them, the time interval method extracts frame images based on the uniform distribution of time, mainly extracting one frame image per second, to ensure that there are representative frame images throughout the entire length of the video.
8. The AI video-based weight loss system according to claim 7, characterized in that: The method of extracting the video content is to determine whether the content has changed by analyzing the difference or similarity between each frame of the video. When a content change is detected, this frame of image is extracted.
9. A weight loss method based on AI video, applied to the weight loss system based on AI video as claimed in any one of claims 1 to 8, characterized in that: The steps include: S1. Import the video to be processed and perform preprocessing on the imported video; S2, extract representative frame images from the video; S3, performing target detection and recognition on the extracted frame image; S3. Mark the target area that needs to be deleted or modified according to the results of target detection and recognition; S4, performing image processing and editing on the marked target area; S5. Synthesize the processed and edited video frames together to generate a final video output.
10. A computer-readable storage medium, characterized in that: When the program is executed by the processor, the steps of the AI video-based weight loss method described in claim 7 are implemented.
Citation Information
Patent Citations
Foreground target key frame processing-based video abstract generation method
CN107943837A
Dynamic target recognition tracking image data optimization transmission method and system
CN108765354A
Thumbnail movie generation method based on key frame processing technology, medium and computing device
CN108875692A
Video processing method and device, equipment and storage medium
CN112118483A
Damage identification technology based on video semantic segmentation algorithm
CN114155474A
