Dynamic poster generation method and device, electronic equipment and storage medium
By disassembly processing, character detection and distance calculation of the target video, dynamic posters are generated, and the problems of low efficiency and poor dynamic results are solved, achieving more efficient and attractive dynamic poster generation.
Patent Information
- Application Number
- CN202411609327.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
The generation efficiency of dynamic posters is low, and the dynamic effect of the generated dynamic posters is not attractive enough.
By obtaining the target video, defragmenting the frames to obtain the image frame set, character detection is performed, continuous and identical image frame sets of characters are determined, character distance sets are calculated, and dynamic posters are generated based on this information.
The generation efficiency of dynamic posters is improved, and the generated dynamic posters are more attractive and representative, and can capture the audience's attention more effectively.
Smart Images

Figure CN119478142A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a method, device, electronic device and storage medium for generating a dynamic poster. Background Art
[0002] Some video websites need to display posters of TV series or movies. In addition to static posters, dynamic posters are often needed. By generating dynamic posters, users' attention can be more effectively attracted through movement and change. Compared with static posters, dynamic posters can better catch the audience's sight, thereby increasing the viewers' attention to the content. In addition, by generating dynamic posters, the climax of the plot or the characteristics of the characters can be shown to the audience, which helps to increase the audience's interest and expectations for the work. However, at present, the generation efficiency of dynamic posters is low, and the dynamic effect of the generated dynamic posters is not attractive enough. Summary of the invention
[0003] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present application provide a method, device, electronic device and storage medium for generating a dynamic poster.
[0004] In a first aspect, the present application provides a method for generating a dynamic poster, comprising:
[0005] Acquire a target video, and perform frame splitting processing on the target video to obtain a first image frame set corresponding to the target video;
[0006] For each image frame in the first image frame set, performing person detection on the image frame to obtain person detection information corresponding to the image frame;
[0007] Determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set, wherein all the image frames in the second image frame set include the same person and are continuous in time;
[0008] Determining the person distances between all the persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set;
[0009] A target dynamic poster corresponding to the target video is generated according to the character distance set and the second image frame set.
[0010] In an optional implementation, generating a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set includes:
[0011] According to the person distance set, all persons included in all the image frames in the second image frame set are screened to obtain a person screening result corresponding to the second image frame set;
[0012] According to the character screening result, processing each of the image frames in the second image frame set to obtain a processed second image frame set;
[0013] A target dynamic poster corresponding to the target video is generated according to the processed second image frame set.
[0014] In an optional implementation, screening all persons included in all the image frames in the second image frame set according to the person distance set to obtain a person screening result corresponding to the second image frame set includes:
[0015] According to the person distance set, a target person is determined from all persons included in all the image frames in the second image frame set, and all person distances corresponding to the target person are greater than a preset distance threshold;
[0016] Screening out the target person from all persons included in all the image frames in the second image frame set to obtain a person screening result corresponding to the second image frame set;
[0017] The step of processing each of the image frames in the second image frame set according to the character screening result to obtain the processed second image frame set includes:
[0018] According to the person screening result, the target person included in each of the image frames in the second image frame set is processed to obtain a processed second image frame set.
[0019] In an optional implementation, the person detection information includes a person position corresponding to each person in the image frame;
[0020] The determining of the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set includes:
[0021] Determine all the person positions corresponding to the same person in the second image frame set according to the person detection information corresponding to all the image frames in the second image frame set;
[0022] For each identical person in the second image frame set, determining an average person position corresponding to the person according to all the person positions corresponding to the person;
[0023] According to the average position of the characters corresponding to each identical character in the second image frame set, the character distances between all the characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0024] In an optional implementation, the person detection information includes a person position corresponding to each person in the image frame;
[0025] The determining of the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set includes:
[0026] Determining a first image evaluation value corresponding to each of the image frames in the second image frame set;
[0027] Determine a target image frame from the second image frame set, wherein the first image evaluation value corresponding to the target image frame is the maximum value among the first image evaluation values corresponding to all the image frames in the second image frame set;
[0028] Determine the distances between all the persons in the target image frame according to the person positions corresponding to the respective persons included in the person detection information corresponding to the target image frame;
[0029] The person distances between all persons in the target image frame are determined as a person distance set corresponding to the second image frame set.
[0030] In an optional implementation, before performing the step of determining the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set, the method further includes:
[0031] Determining a second image evaluation value corresponding to each of the image frames in the second image frame set;
[0032] When the second image evaluation values corresponding to all the image frames in the second image frame set are greater than the preset image evaluation threshold, the step of determining the character distances between all the characters included in all the image frames in the second image frame set is performed to obtain a character distance set corresponding to the second image frame set.
[0033] In an optional implementation, before performing the step of determining the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set, the method further includes:
[0034] Determining the number of all the image frames in the second image frame set to obtain a target frame number;
[0035] When the target frame number is greater than a preset frame number threshold, the step of determining the character distances between all characters included in all the image frames in the second image frame set is performed to obtain a character distance set corresponding to the second image frame set.
[0036] In a second aspect, the present application provides a device for generating a dynamic poster, comprising:
[0037] A processing module, used for acquiring a target video and performing frame splitting processing on the target video to obtain a first image frame set corresponding to the target video;
[0038] A detection module, configured to perform person detection on each image frame in the first image frame set to obtain person detection information corresponding to the image frame;
[0039] a determination module, configured to determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set, wherein all the image frames in the second image frame set include the same person and are continuous in time;
[0040] The determination module is further used to determine the character distances between all characters included in all the image frames in the second image frame set, so as to obtain a character distance set corresponding to the second image frame set;
[0041] A generation module is used to generate a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set.
[0042] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used to execute a dynamic poster generation program stored in the memory to implement the dynamic poster generation method as described above.
[0043] In a fourth aspect, the present application also provides a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating a dynamic poster as described above.
[0044] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages compared with the prior art. The method provided by the embodiment of the present application includes: acquiring a target video, and performing frame decomposition processing on the target video to obtain a first image frame set corresponding to the target video; for each image frame in the first image frame set, performing character detection on the image frame to obtain character detection information corresponding to the image frame; according to the character detection information corresponding to all image frames in the first image frame set, determining a second image frame set from the first image frame set, and all image frames in the second image frame set include the same characters and are continuous in time; determining the character distances between all characters included in all image frames in the second image frame set to obtain a character distance set corresponding to the second image frame set; and generating a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set. Through the above method, the embodiment of the present application determines continuous image frames with the same character from the first image frame set corresponding to the target video to extract key shots with storytelling and continuity from the target video, thereby determining the character distances between all the characters included in all the determined image frames, and automatically generating a target dynamic poster corresponding to the target video that can attract people based on all the determined character distances and continuous image frames, and improving the generation efficiency of the target dynamic poster. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0048] Figure 1 A schematic diagram of a flow chart of a method for generating a dynamic poster provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a flow chart of another method for generating a dynamic poster provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the structure of a dynamic poster generation device provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0052] In the above attached figure:
[0053] 10. Processing module; 20. Detection module; 30. Determination module; 40. Generation module;
[0054] 400, electronic device; 401, processor; 402, memory; 4021, operating system; 4022, application; 403, user interface; 404, network interface; 405, bus system. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0056] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0057] refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a method for generating a dynamic poster provided in an embodiment of the present application. A method for generating a dynamic poster provided in the present application comprises the following steps:
[0058] S101: Acquire a target video, and perform frame splitting processing on the target video to obtain a first image frame set corresponding to the target video.
[0059] In this embodiment, performing frame splitting processing on the target video can be understood as performing frame splitting processing on the target video in a time sequence to obtain a first image frame set corresponding to the target video, and the first image frame set includes multiple image frames in a time sequence. The target video can be understood as a video for which a dynamic poster needs to be generated. The target video can be selected according to actual needs, and the target video is not described in detail in this embodiment.
[0060] S102: For each image frame in the first image frame set, perform person detection on the image frame to obtain person detection information corresponding to the image frame.
[0061] In this embodiment, performing person detection on an image frame can actually be understood as performing face detection on an image frame according to a preset face detection algorithm. The preset face algorithm can be selected according to actual needs, and the preset face algorithm is not specifically limited in this embodiment. The person detection information includes the person position corresponding to each person in the image frame and the person features corresponding to each person.
[0062] S103: Determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set.
[0063] In this embodiment, the second image frame set includes a plurality of image frames, and all image frames in the second image frame set include the same person and are continuous in time. After obtaining the person detection information corresponding to all image frames in the first image frame set, in order to extract key shots with storytelling and coherence, the image frames in the first image frame set are detected in sequence according to the person detection information corresponding to all image frames in the first image frame set in accordance with the time sequence, so as to detect all image frames that are continuous in time and include the same person from the first image frame set, thereby obtaining the second image frame set.
[0064] Specifically, the second image frame set includes image frames img1, img2 and img3, and img1, img2 and img3 are continuous in time. If img1 includes person A, person B and person C, then img2 and img3 should also include person A, person B and person C.
[0065] S104: Determine the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set.
[0066] In this embodiment, after determining the second image frame set from the first image frame set, in order to determine the most attractive and representative character combination, the character distances between all characters included in all image frames in the second image frame set are determined, thereby obtaining a character distance set corresponding to the second image frame set, and then processing the characters in each image frame in the second image frame set according to the character distance set, so that the dynamic poster finally generated has a strong appeal.
[0067] Specifically, if the characters included in each image frame in the second image frame set are character A, character B and character C, when determining the character distances between all the characters included in all the image frames in the second image frame set, the character distance d1 between character A and character B, the character distance d2 between character A and character C, and the character distance d3 between character B and character C should be determined, and the combination of character distance d1, character distance d2 and character distance d3 is determined as the character distance set corresponding to the second image frame set.
[0068] S105: Generate a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set.
[0069] In this embodiment, after obtaining the character distance set corresponding to the second image frame set, all characters included in all image frames in the second image frame set can be screened according to the character distance set to screen out character combinations with closer distances, which helps to determine the most attractive and representative character combinations, and then the characters in each image frame in the second image frame set are processed according to the screened character combinations to obtain a processed second image frame set, and then the target dynamic poster corresponding to the target video is generated according to the processed second image frame set to determine the attractiveness and information transmission effect of the dynamic poster.
[0070] The present embodiment provides a method for generating a dynamic poster, which determines continuous image frames with the same character from a first image frame set corresponding to a target video to extract key shots with storytelling and continuity from the target video, thereby determining the character distances between all characters included in all the determined image frames, and automatically generating a target dynamic poster corresponding to the target video that is attractive based on all the determined character distances and continuous image frames, thereby improving the generation efficiency of the target dynamic poster.
[0071] refer to Figure 2 , Figure 2 A flow chart of another method for generating a dynamic poster provided in an embodiment of the present application. A method for generating a dynamic poster provided in the present application comprises the following steps:
[0072] S201: Acquire a target video, and perform frame splitting processing on the target video to obtain a first image frame set corresponding to the target video.
[0073] S202: For each image frame in the first image frame set, perform person detection on the image frame to obtain person detection information corresponding to the image frame.
[0074] S203: Determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set.
[0075] Regarding the above-mentioned steps S201 to S203, step S201 is consistent with the above-mentioned step S101, step S202 is consistent with the above-mentioned step S201, and step S203 is consistent with the above-mentioned step S103. For details, please refer to the above-mentioned step S101, step S102 and step S103.
[0076] S204: Determine the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set.
[0077] In this embodiment, in order to ensure that the length of the determined second image frame set is moderate and the dynamic effect of the target dynamic poster finally generated is ensured, before executing step S204, a method for generating a dynamic poster provided in this embodiment further includes the following steps:
[0078] Determining the number of all image frames in the second image frame set to obtain a target frame number;
[0079] When the target frame number is greater than a preset frame number threshold, determining the character distances between all characters included in all image frames in the second image frame set is performed to obtain a character distance set corresponding to the second image frame set.
[0080] The preset frame number threshold can be set according to actual needs, and the specific value of the preset frame number threshold is not limited in this embodiment. After obtaining the second image frame set, the sum of the frame numbers between all image frames in the second image frame set is determined to obtain the target frame number. Only when the target frame number is greater than the preset frame number threshold can the dynamic effect of the target dynamic poster finally generated be guaranteed. Therefore, when the target frame number is greater than the preset frame number threshold, step S204 is executed to generate the final target dynamic poster.
[0081] In this embodiment, in order to ensure the quality of the target dynamic poster finally generated, before executing step S204, a method for generating a dynamic poster provided by this embodiment further includes the following steps:
[0082] Determining a second image evaluation value corresponding to each image frame in the second image frame set;
[0083] When the second image evaluation values corresponding to all image frames in the second image frame set are greater than the preset image evaluation threshold, the character distances between all characters included in all image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0084] Among them, the preset image evaluation threshold can be set according to actual needs, and the specific value of the preset image evaluation threshold is not limited in this embodiment. After obtaining the second image frame set, the image quality of each image frame in the second image frame set is evaluated to obtain the second image evaluation value corresponding to each image frame in the second image frame set. When the second image evaluation values corresponding to all image frames in the second image frame set are greater than the preset image evaluation threshold, it indicates that the image quality of each image frame in the second image frame set meets expectations. At this time, step S204 can be executed to generate the final target dynamic poster.
[0085] It should be noted that in order to ensure both the dynamic effect and the image quality of the generated target dynamic poster, when the target number of frames corresponding to the second image frame set is greater than the preset frame number threshold, the second image evaluation value corresponding to each image frame in the second image frame set can be determined, and when the second image evaluation values corresponding to all image frames in the second image frame set are greater than the preset image evaluation threshold, step S204 is executed to generate the target dynamic poster.
[0086] In this embodiment, the person detection information includes the person positions corresponding to each person in the image frame. In step S204, the person distances between all the persons included in all the image frames in the second image frame set are determined to obtain a person distance set corresponding to the second image frame set, specifically including:
[0087] Determine all person positions corresponding to the same person in the second image frame set according to person detection information corresponding to all image frames in the second image frame set;
[0088] For each identical person in the second image frame set, determining an average person position corresponding to the person based on all person positions corresponding to the person;
[0089] According to the average position of the characters corresponding to the same characters in the second image frame set, the character distances between all the characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0090] Among them, since the person positions of the same person in each image frame in the second image frame set may be biased, in order to improve the accuracy of determining the person distances between each person in all image frames in the subsequent second image frame set, for the same person, the average value between all person positions corresponding to the person is determined to obtain the person average position. Thus, for each of the same person, the person distances between all the persons included in all image frames in the second image frame set can be determined using the person average position corresponding to the person, to obtain a person distance set corresponding to the second image frame set.
[0091] Specifically, if all image frames in the second image frame set include person A, person B and person C, the second image frame set includes image frame img1, image frame img2 and image frame img3, the person position corresponding to person A in image frame img1 is dA1, the person position corresponding to person B is dB1 and the person position corresponding to person C is dC1, the person position corresponding to person A in image frame img2 is dA2, the person position corresponding to person B is dB2 and the person position corresponding to person C is dC2, the person position corresponding to person A in image frame img3 is dA3, the person position corresponding to person B is dB3 and the person position corresponding to person C is dC3. Determine the average value between the person position dA1 corresponding to person A, the person position dA2 and the person position dA3, so as to obtain the person average position davg1 corresponding to person A, the person average position davg2 corresponding to person B and the person average position davg3 corresponding to person C. Determine the character distance between the average character position davg1 corresponding to character A and the average character position davg2 corresponding to character B, the character distance between the average character position davg1 corresponding to character A and the average character position davg3 corresponding to character C, and the character distance between the average character position davg2 corresponding to character B and the average character position davg3 corresponding to character C, so as to obtain the character distance set corresponding to the second image frame set.
[0092] In this embodiment, determining the person distances between all persons included in all image frames in the second image frame set in step S204 to obtain a person distance set corresponding to the second image frame set includes:
[0093] Determining a first image evaluation value corresponding to each image frame in the second image frame set;
[0094] Determine a target image frame from the second image frame set, wherein the first image evaluation value corresponding to the target image frame is the maximum value among the first image evaluation values corresponding to all the image frames in the second image frame set;
[0095] Determine the distances between all the persons in the target image frame according to the person positions corresponding to the respective persons included in the person detection information corresponding to the target image frame;
[0096] The person distances between all persons in the target image frame are determined as a person distance set corresponding to the second image frame set.
[0097] Among them, since the positions of the same person included in all the image frames in the second image frame set are similar, in order to quickly determine the character distance set corresponding to the second image frame set and ensure that the subsequent target dynamic poster has an attractive effect, image quality evaluation is performed on each image frame in the second image frame set to obtain a first image evaluation value corresponding to each image frame in the second image frame set, and according to the second image evaluation values corresponding to all the image frames in the second image frame set, a target image frame for determining the character distance set corresponding to the second image frame set is determined from the second image frame set, thereby determining the character distance between each character in the target image frame according to the character position corresponding to each character in the target image frame, and then determining the character distance between each character in the target image frame as the character distance set corresponding to the second image frame set.
[0098] Specifically, if the second image frame set includes image frame img1, image frame img2 and image frame img3, the first image evaluation value corresponding to image frame img2 is the maximum value among the first image evaluation values corresponding to image frame img1, image frame img2 and image frame img3, and image frame img2 includes person A, person B and person C, then the person distance d1 between person A and person B in image frame img2, the person distance d2 between person A and person C in image frame img2, and the person distance d3 between person B and person C in image frame img2 are determined, and the person distance d1, the person distance d2 and the person distance d3 are determined as the person distance set corresponding to the second image frame set.
[0099] S205: Screening all persons included in all image frames in the second image frame set according to the person distance set to obtain a person screening result corresponding to the second image frame set.
[0100] S206: Processing each image frame in the second image frame set according to the person screening result to obtain a processed second image frame set.
[0101] S207: Generate a target dynamic poster corresponding to the target video according to the processed second image frame set.
[0102] With respect to the above-mentioned steps S205 to S207, in order to ensure that the target dynamic poster generated according to the second image frame set has the most attractive and representative character combination, so as to ensure the attractiveness and information transmission effect of the target dynamic poster, after obtaining the character distance set corresponding to the second image frame set, the character combination with a closer distance can be screened out from all the characters included in all the image frames in the second image frame set according to the character distance set, and then the characters in each image frame in the second image frame set are processed using the screened character combination, so that the character combination included in each processed image frame is attractive and representative, and then the target dynamic poster corresponding to the target video is generated according to each processed image frame, thereby ensuring the attractiveness and information transmission effect of the generated target dynamic poster.
[0103] With respect to the above-mentioned step S205, in step S205, all persons included in all image frames in the second image frame set are screened according to the person distance set to obtain a person screening result corresponding to the second image frame set, including:
[0104] According to the person distance set, a target person is determined from all persons included in all image frames in the second image frame set, and all person distances corresponding to the target person are greater than a preset distance threshold;
[0105] The target person is screened out from all persons included in all image frames in the second image frame set to obtain a person screening result corresponding to the second image frame set.
[0106] In this embodiment, the preset distance threshold can be set according to actual needs, and the specific value of the preset distance threshold is not limited in this embodiment. After obtaining the character distance set corresponding to the second image frame set, the distances of each character in the character distance set can be compared with the preset distance threshold one by one, so that the target character that is far away from other characters can be obtained, and the target character can be filtered out to obtain a character combination with a closer distance, and the character combination is determined as the character screening result.
[0107] Specifically, if the characters included in each image frame in the second image frame set are character A, character B, character C, and character D, the character distance between character A and character B is d1, the character distance between character A and character C is d2, the character distance between character A and character D is d3, the character distance between character B and character C is d4, the character distance between character B and character D is d5, and the character distance between character C and character D is d6. Among them, character distance d3, character distance d5, and character distance d6 are all greater than the preset distance threshold, then character D can be determined as the target character, and characters A, character B, and character C are determined as character screening results.
[0108] With respect to the above-mentioned step S206, in step S205, each image frame in the second image frame set is processed according to the character screening result to obtain a processed second image frame set, including:
[0109] According to the person screening result, the target person included in each image frame in the second image frame set is processed to obtain a processed second image frame set.
[0110] In this embodiment, after obtaining the character screening result, each character included in the character screening result in each image frame in the second image frame set can be retained, so that the target character is processed from each image frame in the second image frame set to obtain each processed image frame, and then the processed second image frame set is obtained. After the target character is processed from each image frame, only a combination of characters with a relatively close distance can be retained in each image frame, which helps to determine the most attractive and representative character combination, thereby ensuring the attractiveness and information transmission effect of the target dynamic image.
[0111] The present embodiment provides a method for generating a dynamic poster, which determines continuous image frames with the same character from a first image frame set corresponding to a target video to extract key shots with storytelling and continuity from the target video, thereby determining the character distances between all characters included in all the determined image frames, and automatically generating a target dynamic poster corresponding to the target video that is attractive based on all the determined character distances and continuous image frames, thereby improving the generation efficiency of the target dynamic poster.
[0112] refer to Figure 3 , Figure 3A schematic diagram of the structure of a dynamic poster generation device provided in an embodiment of the present application. A dynamic poster generation device provided in an embodiment of the present application includes: a processing module 10, a detection module 20, a determination module 30 and a generation module 40. The processing module 10 is used to obtain a target video and perform frame decomposition processing on the target video to obtain a first image frame set corresponding to the target video; the detection module 20 is used to perform character detection on each image frame in the first image frame set to obtain character detection information corresponding to the image frame; the determination module 30 is used to determine a second image frame set from the first image frame set based on the character detection information corresponding to all the image frames in the first image frame set, and the characters included in all the image frames in the second image frame set are the same and continuous in time; the determination module 30 is also used to determine the character distances between all the characters included in all the image frames in the second image frame set to obtain a character distance set corresponding to the second image frame set; the generation module 40 is used to generate a target dynamic poster corresponding to the target video based on the character distance set and the second image frame set.
[0113] In this embodiment, the generating module 40 is further used for:
[0114] According to the person distance set, all persons included in all the image frames in the second image frame set are screened to obtain a person screening result corresponding to the second image frame set;
[0115] According to the character screening result, processing each of the image frames in the second image frame set to obtain a processed second image frame set;
[0116] A target dynamic poster corresponding to the target video is generated according to the processed second image frame set.
[0117] In this embodiment, the generating module 40 is further used for:
[0118] According to the person distance set, a target person is determined from all persons included in all the image frames in the second image frame set, and all person distances corresponding to the target person are greater than a preset distance threshold;
[0119] Screening out the target person from all persons included in all the image frames in the second image frame set to obtain a person screening result corresponding to the second image frame set;
[0120] According to the person screening result, the target person included in each of the image frames in the second image frame set is processed to obtain a processed second image frame set.
[0121] In this embodiment, the person detection information includes the person position corresponding to each person in the image frame, and the determination module 30 is further used to:
[0122] Determine all the person positions corresponding to the same person in the second image frame set according to the person detection information corresponding to all the image frames in the second image frame set;
[0123] For each identical person in the second image frame set, determining an average person position corresponding to the person according to all the person positions corresponding to the person;
[0124] According to the average position of the characters corresponding to each identical character in the second image frame set, the character distances between all the characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0125] In this embodiment, the determination module 30 is further configured to:
[0126] Determining a first image evaluation value corresponding to each of the image frames in the second image frame set;
[0127] Determine a target image frame from the second image frame set, wherein the first image evaluation value corresponding to the target image frame is the maximum value among the first image evaluation values corresponding to all the image frames in the second image frame set;
[0128] Determine the distances between all the persons in the target image frame according to the person positions corresponding to the respective persons included in the person detection information corresponding to the target image frame;
[0129] The person distances between all persons in the target image frame are determined as a person distance set corresponding to the second image frame set.
[0130] In this embodiment, the determination module 30 is further configured to:
[0131] Determining a second image evaluation value corresponding to each of the image frames in the second image frame set;
[0132] When the second image evaluation values corresponding to all the image frames in the second image frame set are greater than a preset image evaluation threshold, the character distances between all the characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0133] In this embodiment, the determination module 30 is further configured to:
[0134] Determining the number of all the image frames in the second image frame set to obtain a target frame number;
[0135] When the target frame number is greater than a preset frame number threshold, the character distances between all characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
[0136] The present embodiment provides a device for generating a dynamic poster, which determines continuous image frames with the same character from a first image frame set corresponding to a target video to extract key shots with storytelling and continuity from the target video, thereby determining the character distances between all characters included in all the determined image frames, and automatically generating a target dynamic poster corresponding to the target video that is attractive based on all the determined character distances and continuous image frames, thereby improving the generation efficiency of the target dynamic poster.
[0137] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 The electronic device 400 shown includes: at least one processor 401, a memory 402, at least one network interface 404 and other user interfaces 403. The various components in the electronic device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 405 is not shown in FIG. Figure 4 Various buses are labeled as bus system 405 .
[0138] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0139] It can be understood that the memory 402 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0140] In some implementations, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and application programs 4022 .
[0141] Among them, the operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 4022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 4022.
[0142] In the embodiment of the present application, by calling the program or instructions stored in the memory 402, specifically, the program or instructions stored in the application 4022, the processor 401 is used to execute the method steps provided by each method embodiment.
[0143] The method disclosed in the above embodiment of the present application can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware.
[0144] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0145] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0146] The electronic device provided in this embodiment may be Figure 4 The electronic device shown in FIG. 1 may perform the following steps: Figure 1 and Figure 2 All steps of the method for generating dynamic posters in Figure 1 and Figure 2 For details on the technical effects of the method for generating dynamic posters shown, please refer to Figure 1 and Figure 2 For the sake of brevity, the relevant description is not repeated here.
[0147] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0148] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned method for generating a dynamic poster executed on the side of the dynamic poster generation device can be implemented.
[0149] The processor is used to execute the dynamic poster generation program stored in the memory to implement the following steps of the dynamic poster generation method performed on the dynamic poster generation device side.
[0150] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0151] It should be noted that the phrases "one implementation", "an embodiment", "an exemplary embodiment", "some embodiments", etc. mentioned in the specification indicate that the described embodiments may include certain features, structures or characteristics, but not every embodiment may include the certain features, structures or characteristics. In addition, such phrases do not necessarily refer to the same embodiment. In addition, when describing certain features, structures or characteristics in conjunction with an embodiment, it is within the knowledge of those skilled in the art to implement such features, structures or characteristics in conjunction with other embodiments, whether explicitly or not explicitly described.
[0152] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a dynamic poster, characterized in that: include: Acquire a target video, and perform frame splitting processing on the target video to obtain a first image frame set corresponding to the target video; For each image frame in the first image frame set, performing person detection on the image frame to obtain person detection information corresponding to the image frame; Determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set, wherein all the image frames in the second image frame set include the same person and are continuous in time; Determining the person distances between all the persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set; A target dynamic poster corresponding to the target video is generated according to the character distance set and the second image frame set.
2. The method according to claim 1, characterized in that The step of generating a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set includes: According to the person distance set, all persons included in all the image frames in the second image frame set are screened to obtain a person screening result corresponding to the second image frame set; According to the character screening result, processing each of the image frames in the second image frame set to obtain a processed second image frame set; A target dynamic poster corresponding to the target video is generated according to the processed second image frame set.
3. The method according to claim 2, characterized in that The step of screening all the persons included in all the image frames in the second image frame set according to the person distance set to obtain a person screening result corresponding to the second image frame set includes: According to the person distance set, a target person is determined from all persons included in all the image frames in the second image frame set, and all person distances corresponding to the target person are greater than a preset distance threshold; Screening out the target person from all persons included in all the image frames in the second image frame set to obtain a person screening result corresponding to the second image frame set; The step of processing each of the image frames in the second image frame set according to the character screening result to obtain the processed second image frame set includes: According to the person screening result, the target person included in each of the image frames in the second image frame set is processed to obtain a processed second image frame set.
4. The method according to claim 1, characterized in that: The person detection information includes person positions corresponding to each person in the image frame; The determining of the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set includes: Determine all the person positions corresponding to the same person in the second image frame set according to the person detection information corresponding to all the image frames in the second image frame set; For each identical person in the second image frame set, determining an average person position corresponding to the person according to all the person positions corresponding to the person; According to the average position of the characters corresponding to each identical character in the second image frame set, the character distances between all the characters included in all the image frames in the second image frame set are determined to obtain a character distance set corresponding to the second image frame set.
5. The method according to claim 1, characterized in that The person detection information includes person positions corresponding to each person in the image frame; The determining of the person distances between all persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set includes: Determining a first image evaluation value corresponding to each of the image frames in the second image frame set; Determine a target image frame from the second image frame set, wherein the first image evaluation value corresponding to the target image frame is the maximum value among the first image evaluation values corresponding to all the image frames in the second image frame set; Determine the distances between all the persons in the target image frame according to the person positions corresponding to the respective persons included in the person detection information corresponding to the target image frame; The person distances between all persons in the target image frame are determined as a person distance set corresponding to the second image frame set.
6. The method according to claim 1, characterized in that Before performing the step of determining the person distances between all the persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set, the method further includes: Determining a second image evaluation value corresponding to each of the image frames in the second image frame set; When the second image evaluation values corresponding to all the image frames in the second image frame set are greater than the preset image evaluation threshold, the step of determining the character distances between all the characters included in all the image frames in the second image frame set is performed to obtain a character distance set corresponding to the second image frame set.
7. The method according to claim 1, characterized in that Before performing the step of determining the person distances between all the persons included in all the image frames in the second image frame set to obtain a person distance set corresponding to the second image frame set, the method further includes: Determining the number of all the image frames in the second image frame set to obtain a target frame number; When the target frame number is greater than a preset frame number threshold, the step of determining the character distances between all characters included in all the image frames in the second image frame set is performed to obtain a character distance set corresponding to the second image frame set.
8. A device for generating a dynamic poster, characterized in that: include: A processing module, used for acquiring a target video and performing frame splitting processing on the target video to obtain a first image frame set corresponding to the target video; A detection module, configured to perform person detection on each image frame in the first image frame set to obtain person detection information corresponding to the image frame; a determination module, configured to determine a second image frame set from the first image frame set according to the person detection information corresponding to all the image frames in the first image frame set, wherein all the image frames in the second image frame set include the same person and are continuous in time; The determination module is further used to determine the character distances between all characters included in all the image frames in the second image frame set, so as to obtain a character distance set corresponding to the second image frame set; A generation module is used to generate a target dynamic poster corresponding to the target video according to the character distance set and the second image frame set.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a dynamic poster generation program stored in the memory to implement the dynamic poster generation method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating a dynamic poster according to any one of claims 1 to 7.