Video preview animated image generation method, device, equipment and readable storage medium
By filtering the image frames of the video to be processed, target image frames with similarity below the preset threshold are obtained, which solves the problem of poor quality of preview animations in the prior art, and achieves the effect of more accurate expression of video content.
Patent Information
- Application Number
- CN202011295278.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-18
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-11-18
AI Technical Summary
The prior art may lead to poor quality of preview animation when generating video preview animations, especially when the content is similar or the content jumps quickly, the video changes cannot be accurately captured, resulting in a large number of similar image frames in the animations. .
By obtaining all the to-select image frames of the to-process video and filtering them, multiple target image frames with similarity below the preset threshold are obtained, and a preview animation is generated.
The quality of the generated preview animation is improved, so that it can express the video content more accurately, and overcome the problem of inability to capture video changes in the prior art.
Smart Images

Figure CN113761275B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, equipment and readable storage medium for generating a video preview animation. Background Art
[0002] Video content is increasingly used. When faced with a lot of video content, in order to enable users to quickly understand the video content, a preview animated image can be generated based on the video content and played. Thus, users can quickly understand the video content by viewing the preview animated image.
[0003] In order to realize the production of preview animated images, the prior art generally extracts multiple image frames of a video file and generates the preview animated images according to the multiple image frames.
[0004] In the process of realizing the present disclosure, the inventors found that there are at least the following problems in the prior art: in the process of using the above method to produce preview animations, the preview animations may be poor in quality because the preview animations are produced directly based on the extracted multiple image frames. For example, for video content with partially identical content, the preview animation produced using the above method cannot perceive the changes in the video content, and the obtained preview animation contains a large number of identical image frames. Summary of the invention
[0005] The embodiments of the present disclosure provide a method, device, equipment and readable storage medium for generating a video preview animation, so as to solve the technical problem that a large number of identical image frames exist in the preview animation generated by the existing preview animation generation method, and the animation quality is poor.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a video preview animation, comprising:
[0007] Obtain all the image frames to be selected corresponding to the video to be processed;
[0008] Performing a screening operation on all the image frames to be selected to obtain a plurality of target image frames, wherein the similarity between any two target image frames is lower than a preset threshold;
[0009] Generate a preview animation based on the multiple target image frames.
[0010] In a second aspect, an embodiment of the present disclosure provides a video preview animation generation device, comprising:
[0011] An acquisition module is used to acquire all the image frames to be selected corresponding to the video to be processed;
[0012] A screening module, used for screening all the image frames to be selected to obtain a plurality of target image frames, wherein the similarity between any two target image frames is lower than a preset threshold;
[0013] A generation module is used to generate a preview animation based on the multiple target image frames.
[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a memory, a processor;
[0015] Memory; Memory for storing instructions executable by the processor;
[0016] The processor is used to call the program instructions in the memory to execute the video preview animation generation method as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the video preview animation generation method as described in the first aspect.
[0018] The video preview dynamic image generation method, device, equipment and readable storage medium provided by the embodiments of the present disclosure, after obtaining all the candidate image frames corresponding to the video to be processed, firstly filter the candidate image frames to obtain multiple target image frames. Since the similarity between any two target image frames is lower than the preset threshold, the preview dynamic image produced based on the multiple target image frames can more accurately express the content of the video to be processed. The technical problem that the dynamic images produced by the existing dynamic image production method cannot capture the changes in the video is overcome. In addition, the quality of the generated preview dynamic image can be improved, allowing users to understand the video content more intuitively. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0020] Figure 1 A schematic diagram of an application scenario based on which the present disclosure is based;
[0021] Figure 2 A schematic diagram of a process for generating a video preview animation provided in the first embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of a flow chart of a method for generating a video preview animation provided in the second embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of a flow chart of a method for generating a video preview animation provided in Embodiment 3 of the present disclosure;
[0024] Figure 5 A schematic diagram of a flow chart of a method for generating a video preview animation provided in Embodiment 4 of the present disclosure;
[0025] Figure 6 A schematic diagram of target image frame selection provided by an embodiment of the present disclosure;
[0026] Figure 7 A further target image frame selection schematic diagram provided for an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of the structure of a video preview animation generation device provided in Embodiment 5 of the present disclosure;
[0028] Fig. 9 It is a structural diagram of an electronic device provided for Embodiment 6 of the present disclosure.
[0029] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0031] In response to the technical problem that a large number of identical image frames exist in the preview animated images generated by the existing preview animated image generation method mentioned above, and the animated image quality is poor, the present disclosure provides a video preview animated image generation method, device, equipment and readable storage medium.
[0032] It should be noted that the method, device, equipment and readable storage medium for generating video preview dynamic images provided by the present disclosure can be used in various scenarios of generating preview dynamic images based on videos.
[0033] In order to make users understand the video content more intuitively, a preview animated image can be generated based on the video content, so that users do not need to click on the video to view it, but can directly view the preview animated image. The existing animated image generation method generally randomly extracts frames from the video and generates a preview animated image based on the extracted image frames. However, the processing of animated images using the above method often results in poor quality of the animated image. When there is a large amount of similar content in the video, the animated image generated using the above method often also has a large number of similar image frames. Or when the content in the video jumps quickly, the animated image generated using the above method may not be able to accurately capture enough jump image frames, resulting in the preview animated image being unable to accurately express the content of the video.
[0034] In the process of solving the above technical problems, the inventors discovered through research that in order to improve the quality of the generated preview animation and avoid the existence of too many useless image frames in the animation, the image frames corresponding to the video can be filtered in advance so that the filtered image frames do not include similar image frames, and the preview animation is produced based on the filtered image frames.
[0035] The inventor further discovered that after obtaining all the candidate image frames corresponding to the video to be processed, the candidate image frames can first be screened to obtain multiple target image frames. Since the similarity between any two target image frames is lower than a preset threshold, the preview animation produced based on the multiple target image frames can more accurately express the content of the video to be processed.
[0036] Figure 1 This is a schematic diagram of the application scenario based on which the present disclosure is based. Figure 1 As shown, the application scenario of the present disclosure at least includes a memory 1, a processor 2 and a display screen 3. Specifically, the processor 2 can obtain a video to be processed from the memory 1, and determine all the image frames to be selected based on the video to be processed. A screening operation is performed on all the image frames to be selected to obtain multiple target image frames, wherein the similarity between any two target image frames is lower than a preset threshold. A preview animation is generated based on the multiple target image frames. The preview animation is sent to the display screen 3 for display.
[0037] The following specific embodiments are used to describe in detail the technical solution of the present invention and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0038] Figure 2 A schematic diagram of a process for generating a video preview animation provided in the first embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:
[0039] Step 101: Obtain all the image frames to be selected corresponding to the video to be processed.
[0040] The execution subject of this embodiment is a video preview dynamic image generation device, which can be coupled to a server or a terminal device. When it is coupled to a server, it can generate a preview dynamic image with the user's terminal device according to the dynamic image generation instruction sent by the terminal device. When it is coupled to a terminal device, it can generate a preview dynamic image for the video stored in the terminal device according to the user's trigger operation or automatically.
[0041] In this embodiment, in order to realize the generation of the preview animation corresponding to the video to be processed, it is first necessary to obtain multiple image frames to be selected corresponding to the video to be processed. The multiple image frames to be selected may be all image frames corresponding to the video to be processed, or may be image frames obtained after preliminary screening of all image frames.
[0042] When the video preview dynamic image generation device is coupled to a server, it can obtain the video to be processed from a preset database, and further obtain all the image frames to be selected corresponding to the video to be processed. When the video preview dynamic image generation device is coupled to a terminal device, it can obtain the video to be processed from a preset memory, and further obtain all the image frames to be selected corresponding to the video to be processed.
[0043] Step 102: screening all the candidate image frames to obtain a plurality of target image frames, wherein the similarity between any two target image frames is lower than a preset threshold.
[0044] In this embodiment, in order to improve the quality of the generated preview animation and avoid too many useless image frames in the animation, all the candidate image frames corresponding to the video to be processed can be screened to obtain multiple target image frames.
[0045] It should be noted that the similarity between any two target image frames is lower than a preset threshold.
[0046] Step 103: Generate a preview animation according to the multiple target image frames.
[0047] In this embodiment, a preview animated image may be generated according to the plurality of target image frames. Specifically, the preview animated image may be generated in any animated image generation method, and the present disclosure does not limit this.
[0048] The video preview dynamic image generation method provided in this embodiment obtains multiple target image frames by first filtering the selected image frames after obtaining all the selected image frames corresponding to the video to be processed. Since the similarity between any two target image frames is lower than the preset threshold, the preview dynamic image produced based on the multiple target image frames can more accurately express the content of the video to be processed. The technical problem that the dynamic images produced by the existing dynamic image production method cannot capture the changes in the video is overcome. In addition, the quality of the generated preview dynamic image can be improved, allowing users to understand the video content more intuitively.
[0049] Figure 3 This is a flow chart of a method for generating a video preview animation provided in the second embodiment of the present disclosure. Based on the first embodiment, step 101 specifically includes:
[0050] Step 201: extract all image frames corresponding to the video to be processed, and arrange the image frames according to the time sequence of the image frames in the video to be processed.
[0051] Step 202: for each of the image frames, use a plurality of preset recognition rules in sequence to perform recognition operations on the image frame to obtain a recognition result.
[0052] Step 203: Determine weight information corresponding to each of the image frames according to the recognition result.
[0053] Step 204: Use multiple image frames whose weight information is not zero as the image frames to be selected.
[0054] In this embodiment, the entire image frames may be image frames obtained after preliminary screening of all image frames corresponding to the video to be processed. Specifically, all image frames corresponding to the video to be processed may be extracted and sorted according to the time sequence of each image frame in the video to be processed, so as to ensure that the preview animation subsequently generated based on the selected image frames can accurately express the content of the video to be processed.
[0055] For each image frame, a plurality of preset recognition rules can be used in sequence to perform recognition operations on the image frame to obtain a recognition result. The recognition rule is specifically used to identify whether the image frame includes a valid recognition target. Each recognition rule corresponds to a different weight. Therefore, after obtaining the recognition result, the weight information corresponding to each image frame can be determined according to the recognition result.
[0056] In order to include effective recognition targets in the subsequently generated preview animated image, after determining the weight information corresponding to each image frame, a plurality of image frames whose values are not zero may be obtained from all the image frames as candidate image frames.
[0057] Further, based on the first embodiment, step 202 specifically includes:
[0058] sequentially using a plurality of preset recognition models to perform recognition operations on the image frame to determine whether the image frame includes a preset recognition object, and obtain a recognition result;
[0059] Accordingly, step 203 specifically includes:
[0060] For each recognition model, if the recognition result is that the image frame includes the recognition object corresponding to the recognition model, the weight of the image frame is updated according to the weight corresponding to the recognition model.
[0061] In this embodiment, the preset recognition rule may be a plurality of preset recognition models, including but not limited to a person recognition model, a building recognition model, an animal recognition model, and the like.
[0062] Accordingly, after acquiring a plurality of image frames, a plurality of recognition models may be used in sequence to perform recognition operations on the image frames to determine whether the image frames include a preset recognition object and obtain a recognition result.
[0063] Since each recognition rule has a preset weight value, after obtaining the recognition result, the weight information corresponding to each image frame can be determined according to the recognition result. Specifically, for each recognition model, if the recognition result is that the image frame includes the recognition object corresponding to the recognition model, the weight of the image frame is updated according to the weight corresponding to the recognition model. The update operation can specifically be to add the weight corresponding to the recognition model to the weight corresponding to the image frame.
[0064] For example, in practical applications, the weight corresponding to the image frame is 2, the weight corresponding to the person recognition model is 5, the weight corresponding to the building recognition model is 1, and the weight corresponding to the animal recognition model is 3. The recognition result indicates that the image frame includes people and buildings. The weight of the image frame can be updated based on the weight corresponding to the person recognition model is 5 and the weight corresponding to the building recognition model is 1. That is, the weight corresponding to the image frame is 2+5+1=8.
[0065] The video preview animation generation method provided in this embodiment, by first using preset recognition rules to perform recognition operations on image frames corresponding to the video to be processed before generating the preview animation, can ensure that the selected image frames used to generate the preview animation contain valid recognition targets, and further ensure that the generated preview animation can more effectively express the content of the video to be processed.
[0066] Figure 4 The flowchart of the method for generating a video preview dynamic image provided in the third embodiment of the present disclosure is based on any of the above embodiments. Figure 4 As shown, step 102 specifically includes:
[0067] Step 301: acquiring the first candidate image frame among all the candidate image frames as the current image frame according to the time sequence of the candidate image frames in the video to be processed, and calculating the similarity between the current image frame and each candidate image frame after the current image frame in sequence.
[0068] Step 302: If the similarity between the current image frame and any candidate image frame is greater than a preset threshold, the weight of the candidate image frame whose similarity with the current image frame is greater than the preset threshold is updated to zero, and the current image frame is used as the target image frame.
[0069] Step 303: Determine whether there are other image frames to be selected after the current image frame among the image frames to be selected whose current weight is not zero.
[0070] Step 304: if it exists, then take the candidate image frame after the current image frame as the current image frame, and return to the step of sequentially calculating the similarity between the current image frame and each candidate image frame after the current image frame, until the updated candidate image frame does not include the candidate image frame after the current image frame, thereby obtaining the multiple target image frames;
[0071] If it does not exist, multiple target image frames are obtained.
[0072] In this embodiment, in order to improve the quality of the generated preview animated image and avoid too many useless image frames in the animated image, all the candidate image frames corresponding to the video to be processed can be screened to obtain multiple target image frames.
[0073] Specifically, the first image frame to be selected among all the image frames to be selected can be obtained as the current image frame according to the time sequence of the image frames to be selected in the video to be processed, and the similarity between the current image frame and each image frame to be selected after the current image frame is calculated in turn. If it is detected that the similarity between a certain image frame to be selected and the current image frame exceeds a preset threshold, it can be characterized that the image frame to be selected is likely to be an image frame that is similar to the current image frame. Among them, the preset threshold can be 90%, or it can be a value set by the user according to actual needs, and the present disclosure does not impose any restrictions on this. At this time, in order to improve the quality of the preview animation, the weight of the candidate image frame can be set to 0, so that the corresponding data processing operation can no longer be performed on the image frame subsequently. On the basis of improving the quality of the preview animation, the calculation amount of the video preview animation generation device is reduced. The current image frame is used as the target image frame.
[0074] After completing the screening process of the current image frame, it can be determined whether there are other candidate image frames with non-zero weights after the current image frame. If there are, the candidate image frame can be used as the current image frame, and the steps of calculating the similarity between the current image frame and each candidate image frame after the current image frame are returned to be executed in sequence, until the candidate image frame after the current image frame is not included in the updated candidate image frame, and multiple target image frames are obtained. On the contrary, if there are no other candidate image frames with non-zero weights, the screening operation of the candidate image frames is completed, and multiple target image frames are obtained.
[0075] The video preview dynamic image generation method provided in this embodiment obtains multiple target image frames by screening all the candidate image frames corresponding to the video to be processed. Since the similarity between any two target image frames is lower than a preset threshold, the preview dynamic image generated based on the multiple target image frames can more accurately express the content of the video to be processed. This overcomes the technical problem that the dynamic images generated by the existing dynamic image generation method cannot capture the changes in the video.
[0076] Figure 5 A schematic diagram of a flow chart of a method for generating a video preview animation provided in the fourth embodiment of the present disclosure, based on any of the above embodiments, as Figure 5 As shown, step 103 specifically includes:
[0077] Step 401: Acquire a preset number of target image frames from the plurality of target image frames.
[0078] Step 402: Generate a preview animation according to the preset number of target image frames.
[0079] In this embodiment, the user can customize the number of image frames in the preview animation according to personalized needs. Specifically, a preset number of target image frames can be obtained from multiple target image frames. Then, a preview animation can be generated according to the preset number of target image frames.
[0080] Further, based on any of the above embodiments, step 401 specifically includes:
[0081] Determine a target image frame with the largest weight among the multiple target image frames.
[0082] It is determined whether the number of the target image frame with the largest weight and all image frames after the target image frame with the largest weight meets the preset number.
[0083] If the condition is satisfied, a preset number of target image frames are acquired backwards starting from the target image frame with the largest weight.
[0084] If it is not satisfied, then obtain all the target image frames after the target image frame with the largest weight, and determine the difference between the number of all target image frames after the target image frame with the largest weight and the preset number; based on the difference, obtain some target image frames before the target image frame with the largest weight, and obtain the preset number of target image frames.
[0085] Figure 6 A schematic diagram of target image frame selection provided by an embodiment of the present disclosure, Figure 7 Another target image frame selection schematic diagram provided by the embodiment of the present disclosure is as follows: Figure 6 As shown, first, the target image frame with the largest weight among the multiple target image frames can be determined. Taking the target image frame with the largest weight as the starting point, determine whether the number of the target image frame with the largest weight and all image frames after the target image frame with the largest weight meets the preset number. If satisfied, the preset number of target image frames can be obtained from the target image frame with the largest weight. If not satisfied, such as Figure 7 As shown, all target image frames after the target image frame with the largest weight are obtained, and the difference between the number of all target image frames after the target image frame with the largest weight and a preset number is determined. Based on the difference, some target image frames before the target image frame with the largest weight are obtained to obtain a preset number of target image frames.
[0086] Further, based on any of the above embodiments, step 402 specifically includes:
[0087] The preset number of target image frames are reversely sorted to obtain the preset number of target image frames after reverse sorting.
[0088] The preset number of target image frames and the preset number of target image frames after reverse sorting are added together to obtain an image frame list.
[0089] Generate a preview animation according to the image frames in the image frame list.
[0090] In this embodiment, after a preset number of target image frames are acquired, the preset number of target image frames may be reversely sorted to obtain the preset number of target image frames after reverse sorting.
[0091] A preset number of target image frames and a preset number of target image frames after reverse sorting are added together to obtain an image frame list, so that a preview animation can be generated according to the image frames in the image frame list later.
[0092] The video preview animation generation method provided in the present embodiment obtains an image frame list by adding a preset number of target image frames and a preset number of target image frames after reverse sorting, and generates a preview animation based on the image frames in the image frame list, so that the subsequently generated preview animation will have an effect of moving forward and then returning to the initial state to be played again, thereby further improving the quality of the generated preview animation.
[0093] Figure 8 This is a schematic diagram of the structure of the video preview dynamic image generation device provided in the fifth embodiment of the present disclosure, such as Figure 8 As shown, the device includes: an acquisition module 51, a screening module 52 and a generation module 53. The acquisition module 51 is used to acquire all the image frames to be selected corresponding to the video to be processed. The screening module 52 is used to perform a screening operation on all the image frames to be selected to obtain multiple target image frames, wherein the similarity between any two target image frames is lower than a preset threshold. The generation module 53 is used to generate a preview animation based on the multiple target image frames.
[0094] The video preview dynamic image generation device provided in this embodiment obtains multiple target image frames by first filtering the selected image frames after obtaining all the selected image frames corresponding to the video to be processed. Since the similarity between any two target image frames is lower than the preset threshold, the preview dynamic image produced based on the multiple target image frames can more accurately express the content of the video to be processed. The technical problem that the dynamic images produced by the existing dynamic image production method cannot capture the changes in the video is overcome. In addition, the quality of the generated preview dynamic image can be improved, allowing users to understand the video content more intuitively.
[0095] Further, based on the fifth embodiment, the acquisition module 51 is used to: extract all image frames corresponding to the video to be processed, and arrange the image frames according to the time sequence of the image frames in the video to be processed. For each of the image frames, a plurality of preset recognition rules are sequentially used to perform recognition operations on the image frames to obtain recognition results. The weight information corresponding to each of the image frames is determined according to the recognition results. Multiple image frames whose weight information is not zero are used as the image frames to be selected.
[0096] Further, on the basis of the fifth embodiment, the acquisition module 51 is used to: sequentially use a plurality of preset recognition models to perform recognition operations on the image frame to determine whether the image frame includes a preset recognition object and obtain a recognition result. The weight information corresponding to each image frame is determined according to the recognition result, including: for each recognition model, if the recognition result is that the image frame includes the recognition object corresponding to the recognition model, then the weight of the image frame is updated according to the weight corresponding to the recognition model.
[0097] Further, on the basis of any of the above embodiments, the screening module 52 is used to: obtain the first image frame to be selected from all the image frames to be selected as the current image frame according to the time sequence of the image frames to be selected in the video to be processed, and calculate the similarity between the current image frame and each image frame to be selected after the current image frame in sequence. If the similarity between the current image frame and any image frame to be selected is greater than a preset threshold, the weight of the image frame to be selected whose similarity with the current image frame is greater than the preset threshold is updated to zero, and the current image frame is used as the target image frame. It is determined whether there are any image frames to be selected after the current image frame in the image frames to be selected whose current weight is not zero. If there are, the image frame to be selected after the current image frame is used as the current image frame, and the step of calculating the similarity between the current image frame and each image frame to be selected after the current image frame is returned to perform in sequence, until the updated image frames to be selected do not include any image frames to be selected after the current image frame, and the multiple target image frames are obtained.
[0098] Further, based on any of the above embodiments, the generating module 53 is used to: obtain a preset number of target image frames from the plurality of target image frames, and generate a preview animation according to the preset number of target image frames.
[0099] Further, based on any of the above embodiments, the generation module 53 is used to: determine the target image frame with the largest weight among the multiple target image frames. Determine whether the number of the target image frame with the largest weight and all the image frames after the target image frame with the largest weight meets the preset number. If satisfied, then starting from the target image frame with the largest weight, obtain the preset number of target image frames backward. If not satisfied, then obtain all the target image frames after the target image frame with the largest weight, and determine the difference between the number of all the target image frames after the target image frame with the largest weight and the preset number, and according to the difference, obtain part of the target image frames before the target image frame with the largest weight to obtain the preset number of target image frames.
[0100] Further, based on any of the above embodiments, the generating module 53 is used to: reversely sort the preset number of target image frames to obtain the preset number of target image frames after reverse sorting, add the preset number of target image frames and the preset number of target image frames after reverse sorting to obtain an image frame list, and generate a preview animation according to the image frames in the image frame list.
[0101] Fig. 9 is a structural diagram of an electronic device provided in Embodiment 6 of the present disclosure, such as Fig. 9As shown, the device may be a mobile phone, a computer, a messaging device, a gaming console, a tablet device, a medical device, a personal digital assistant, or the like.
[0102] The device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0103] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0104] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as 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), magnetic memory, flash memory, magnetic disk or optical disk.
[0105] The power supply component 606 provides power to the various components of the device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.
[0106] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0107] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the device 600 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0108] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0109] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, and the sensor assembly 614 can also detect the position change of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600, and the temperature change of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0110] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0111] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0112] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of the device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0113] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to execute the above-mentioned method for generating a split video preview animated image of the terminal device.
[0114] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0115] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for generating a video preview animated image, characterized in that: include: Extracting image frames obtained after preliminary screening of all image frames corresponding to the video to be processed, and arranging the image frames according to the time sequence of the image frames in the video to be processed; For each of the image frames, a plurality of preset recognition rules are sequentially used to perform recognition operations on the image frames to obtain recognition results; wherein the recognition rules are used to identify whether the image frames include valid recognition targets; and each recognition rule corresponds to a different weight; Determine weight information corresponding to each of the image frames according to the recognition result; Taking multiple image frames whose weight information is not zero as candidate image frames; Performing a screening operation on all the candidate image frames to obtain multiple target image frames, wherein the similarity between any two target image frames is lower than a preset threshold; Determine a target image frame with the largest weight among the multiple target image frames; Determine whether the number of the target image frame with the largest weight and all image frames after the target image frame with the largest weight meets a preset number; If the condition is satisfied, starting from the target image frame with the largest weight, a preset number of target image frames are acquired backwards; If not satisfied, then all target image frames after the target image frame with the largest weight are obtained, and the difference between the number of all target image frames after the target image frame with the largest weight and the preset number is determined, and according to the difference, part of the target image frames before the target image frame with the largest weight are obtained to obtain the preset number of target image frames; A preview animation is generated according to the preset number of target image frames.
2. The method according to claim 1, characterized in that The sequentially using a plurality of preset recognition rules to perform recognition operations on the image frames to obtain recognition results includes: sequentially using a plurality of preset recognition models to perform recognition operations on the image frame to determine whether the image frame includes a preset recognition object, and obtain a recognition result; The determining weight information corresponding to each image frame according to the recognition result includes: For each recognition model, if the recognition result is that the image frame includes the recognition object corresponding to the recognition model, the weight of the image frame is updated according to the weight corresponding to the recognition model.
3. The method according to any one of claims 1 to 2, characterized in that: The screening operation is performed on all the image frames to be selected to obtain a plurality of target image frames, including: According to the time sequence of the candidate image frames in the video to be processed, the first candidate image frame among all the candidate image frames is obtained as the current image frame, and the similarity between the current image frame and each candidate image frame after the current image frame is calculated in sequence; If the similarity between the current image frame and any candidate image frame is greater than a preset threshold, the weight of the candidate image frame whose similarity with the current image frame is greater than the preset threshold is updated to zero, and the current image frame is used as the target image frame; Determine whether there is another image frame to be selected after the current image frame among the image frames to be selected whose current weight is not zero; If it exists, the candidate image frame after the current image frame is taken as the current image frame, and the step of sequentially calculating the similarity between the current image frame and each candidate image frame after the current image frame is returned to, until the updated candidate image frame does not include the candidate image frame after the current image frame, and the multiple target image frames are obtained.
4. The method according to claim 3, characterized in that Generating a preview animated image according to the preset number of target image frames includes: Reversely sorting the preset number of target image frames to obtain the preset number of target image frames after reverse sorting; Adding the preset number of target image frames and the preset number of target image frames after reverse sorting to obtain an image frame list; Generate a preview animation according to the image frames in the image frame list.
5. A video preview animation generation device, characterized in that: include: An acquisition module is used to acquire all the image frames to be selected corresponding to the video to be processed; A screening module, used for screening all the image frames to be selected to obtain a plurality of target image frames, wherein the similarity between any two target image frames is lower than a preset threshold; A generating module, used for generating a preview animated image according to the plurality of target image frames; The acquisition module is used for: Extracting image frames obtained after preliminary screening of all image frames corresponding to the video to be processed, and arranging the image frames according to the time sequence of the image frames in the video to be processed; For each of the image frames, a plurality of preset recognition rules are sequentially used to perform recognition operations on the image frames to obtain recognition results; wherein the recognition rules are used to identify whether the image frames include valid recognition targets; and each recognition rule corresponds to a different weight; Determine weight information corresponding to each of the image frames according to the recognition result; Using a plurality of image frames whose weight information is not zero as the image frames to be selected; The generation module is used for: Acquire a preset number of target image frames from the plurality of target image frames; Generate a preview animation according to the preset number of target image frames; The generation module is used for: Determine a target image frame with the largest weight among the multiple target image frames; Determine whether the number of the target image frame with the largest weight and all image frames after the target image frame with the largest weight meets the preset number; If the condition is satisfied, starting from the target image frame with the largest weight, a preset number of target image frames are acquired backwards; If it is not satisfied, then obtain all the target image frames after the target image frame with the largest weight, and determine the difference between the number of all target image frames after the target image frame with the largest weight and the preset number; based on the difference, obtain some target image frames before the target image frame with the largest weight, and obtain the preset number of target image frames.
6. The device according to claim 5, characterized in that The acquisition module is used for: sequentially using a plurality of preset recognition models to perform recognition operations on the image frame to determine whether the image frame includes a preset recognition object, and obtain a recognition result; The determining weight information corresponding to each image frame according to the recognition result includes: For each recognition model, if the recognition result is that the image frame includes the recognition object corresponding to the recognition model, the weight of the image frame is updated according to the weight corresponding to the recognition model.
7. The device according to any one of claims 5 to 6, characterized in that: The screening module is used to: According to the time sequence of the candidate image frames in the video to be processed, the first candidate image frame among all the candidate image frames is obtained as the current image frame, and the similarity between the current image frame and each candidate image frame after the current image frame is calculated in sequence; If the similarity between the current image frame and any candidate image frame is greater than a preset threshold, the weight of the candidate image frame whose similarity with the current image frame is greater than the preset threshold is updated to zero, and the current image frame is used as the target image frame; Determine whether there is another image frame to be selected after the current image frame among the image frames to be selected whose current weight is not zero; If it exists, the candidate image frame after the current image frame is taken as the current image frame, and the step of sequentially calculating the similarity between the current image frame and each candidate image frame after the current image frame is returned to, until the updated candidate image frame does not include the candidate image frame after the current image frame, and the multiple target image frames are obtained.
8. The device according to claim 7, characterized in that The generation module is used for: Reversely sorting the preset number of target image frames to obtain the preset number of target image frames after reverse sorting; Adding the preset number of target image frames and the preset number of target image frames after reverse sorting to obtain an image frame list; Generate a preview animation according to the image frames in the image frame list.
9. An electronic device, comprising: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is used to call the program instructions in the memory to execute the video preview animation generation method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the video preview animation generation method as described in any one of claims 1 to 4.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the video preview animation generation method as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Video preview method, video frame extraction method, video processing device and storage medium
CN111182359A
Providing relevant video scenes in response to a video search query
US20180089203A1