CN110675473B - Method, device, electronic equipment and medium for generating GIF dynamic diagram - Google Patents

Method, device, electronic equipment and medium for generating GIF dynamic diagram Download PDF

Info

Publication number
CN110675473B
CN110675473B CN201910875157.1A CN201910875157A CN110675473B CN 110675473 B CN110675473 B CN 110675473B CN 201910875157 A CN201910875157 A CN 201910875157A CN 110675473 B CN110675473 B CN 110675473B
Authority
CN
China
Prior art keywords
frame data
image frame
image
data
image group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910875157.1A
Other languages
Chinese (zh)
Other versions
CN110675473A (en
Inventor
彭冬炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910875157.1A priority Critical patent/CN110675473B/en
Publication of CN110675473A publication Critical patent/CN110675473A/en
Application granted granted Critical
Publication of CN110675473B publication Critical patent/CN110675473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Abstract

The application discloses a method, a device, electronic equipment and a medium for generating a GIF dynamic diagram. In the application, after the target video data is acquired, the target video data may be further analyzed to obtain a plurality of image frame data, the plurality of image frame data are divided into at least one image based on a preset mode, and corresponding GIF dynamic images are respectively generated according to at least one image group. By applying the technical scheme, all image frame data can be automatically analyzed from video data, and the image frame data are divided into a plurality of image groups in different types, so that a corresponding GIF dynamic image is generated according to each image group. Therefore, the problem of long generation time caused by the need of manually synthesizing the GIF dynamic diagram in the related technology can be avoided.

Description

Method, device, electronic equipment and medium for generating GIF dynamic diagram
Technical Field
The present application relates to image processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for generating a GIF dynamic image.
Background
As the communications age and society rise, smart devices have evolved with the use of more and more users.
With the rapid development of the internet, people watch various videos by using intelligent devices, such as short videos, GIF dynamic images, and the like, has become a normal state. The GIF (Graphics Interchange Format, graphic interchange format) is a file format capable of storing a plurality of pictures, and by circularly reading out the pictures one by one from the plurality of pictures stored in the GIF file and displaying the pictures on a screen, an animation of simple circular play can be formed.
However, in the related art generation of GIF dynamic images, there is often a problem in that the generation efficiency is too low because only one GIF dynamic image can be generated at a time.
Disclosure of Invention
The embodiment of the application provides a method, a device, electronic equipment and a medium for generating a GIF dynamic diagram.
According to an aspect of the embodiment of the present application, a method for generating a GIF dynamic graph is provided, which is characterized by including:
acquiring target video data;
analyzing the target video data to obtain a plurality of image frame data;
dividing a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data;
Based on the at least one image group, corresponding GIF dynamic images are respectively generated.
According to another aspect of the embodiments of the present application, there is provided an apparatus for generating a GIF dynamic map, including:
an acquisition module configured to acquire target video data;
the analysis module is used for analyzing the target video data to obtain a plurality of image frame data;
the dividing module is configured to divide a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data;
and the generation module is used for respectively generating corresponding GIF dynamic graphs based on the at least one image group.
According to still another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
and the display is used for displaying with the memory to execute the executable instructions so as to finish the operation of any one of the methods for generating the GIF dynamic graph.
According to still another aspect of the embodiments of the present application, there is provided a computer-readable storage medium for storing computer-readable instructions that, when executed, perform the operations of any of the above-described methods of generating a GIF dynamic map.
In the application, after the target video data is acquired, the target video data can be further analyzed to obtain a plurality of image frame data, the plurality of image frame data are divided into at least one image based on a preset mode, and corresponding GIF dynamic images are respectively generated according to at least one image group. By applying the technical scheme, all image frame data can be automatically analyzed from video data, and the image frame data are divided into a plurality of image groups in different types, so that a corresponding GIF dynamic image is generated according to each image group. Therefore, the problem of long generation time caused by the need of manually synthesizing the GIF dynamic diagram in the related technology can be avoided.
The technical scheme of the present application is described in further detail below through the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the application.
The present application will be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a method of generating a GIF dynamic map as set forth in the present application;
FIGS. 2 a-2 c are schematic diagrams of image frames in a target video;
fig. 3 is a schematic structural diagram of an apparatus for generating GIF dynamic images according to the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
It should be noted that all directional indicators (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are merely used to explain the relative positional relationship, movement, etc. between the components in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is correspondingly changed.
In addition, the technical solutions of the embodiments of the present application may be combined with each other, but it is necessary to be based on the fact that those skilled in the art can implement the technical solutions, and when the technical solutions are contradictory or cannot be implemented, the combination of the technical solutions should be considered to be absent, and is not within the scope of protection claimed in the present application.
It should be noted at first that the description in this application as relating to "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
A method for performing generation of GIF dynamic images according to an exemplary embodiment of the present application is described below in conjunction with fig. 1-2. It should be noted that the following application scenario is only shown for the convenience of understanding the spirit and principles of the present application, and embodiments of the present application are not limited in any way in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
The application also provides a method, a device, a target terminal and a medium for generating the GIF dynamic diagram.
Fig. 1 schematically shows a flow diagram of a method of generating a GIF dynamic diagram according to an embodiment of the present application. As shown in fig. 1, the method includes:
s101, acquiring target video data.
First, the target video data is not particularly limited in this application, and may be, for example, long video data or short video data. It should be noted that the target video data needs to include at least two image frame data.
In this application, the device for acquiring the target video data is not specifically limited, and may be, for example, an intelligent device or a server. The smart device may be a PC (Personal Computer ), a smart phone, a tablet computer, an electronic book reader, an MP3 (Moving Picture Experts Group AudioLayer III, moving picture experts compression standard audio layer 3) player, an MP4 (Moving Picture ExpertsGroup Audio Layer IV, moving picture experts compression standard audio layer 4) player, a portable computer, or a mobile terminal device with a display function.
S102, analyzing the target video data to obtain a plurality of image frame data.
After the target video data is acquired, the video data can be further analyzed to obtain a plurality of image frame data therein. The video data includes a plurality of image frames. The image frames are the minimum units of the video, and in the application, the video file can be decoded by using decoding tools such as ffmpeg, etc., so as to obtain a plurality of image frames.
Note that the number and order of the extracted image frames are not particularly limited in this application. For example, the image frame of the first 5 frames in the video data may be extracted, the image frame of the last 5 frames in the video data may be extracted, and all the image frames in the video data may be extracted.
S103, dividing the plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data.
Further, in the present application, after extracting a plurality of image frames, the plurality of image frame data may be divided into at least one image group based on a preset policy. The method for generating the image group is not particularly limited, and for example, the image frame data of each category may be grouped according to a plurality of image frame data, so as to generate a plurality of different image groups. The plurality of image groups may be generated by grouping the plurality of image frame data according to the generation time of each image frame data. The plurality of image groups may be generated by grouping the plurality of image frame data according to parameter information corresponding to each image frame data. The change of the preset mode does not affect the protection scope of the application.
In order to automatically generate multiple GIFs according to video content, the present application needs to divide video frames into multiple groups according to image content, such as a short video with a front half of a character self-timer, a middle pet, and a last part of a surrounding landscape. The present application may divide video frames according to these content, and may use a clustering algorithm, so that three corresponding GIF dynamic graphs are automatically generated. The image frames can be divided by using a clustering algorithm, and the clustering is that similar objects are grouped into the same cluster, so that the similarity of the data objects in the same cluster is as large as possible, and the difference of the data objects not in the same cluster is also as large as possible. The data of the same class after clustering are gathered together as much as possible, and different data are separated as much as possible.
It should be noted that each image group in the present application is an image group for generating a GIF dynamic image. So that each image group should contain at least two image frame data. In addition, it should be noted that the preset number is not specifically limited in this application, and may be, for example, 5, 3, or the like.
S104, respectively generating corresponding GIF dynamic graphs based on at least one image group.
In the application, a plurality of image groups can be obtained according to the grouping result of the preset mode, and it can be understood that different image groups have different content subjects. And the video frame content in the same group of images is similar. Therefore, for each image group, the image frames in the image groups can be arranged and displayed according to the original playing time sequence so as to generate a corresponding GIF dynamic image, and finally, a plurality of GIF dynamic images can be automatically generated according to a plurality of image groups.
Alternatively, the present application does not specifically limit the order of the image frame data when generating the GIF dynamic image based on each image group. For example, the target GIF dynamic images may be generated by sequentially arranging the image frames in the order from far to near according to the time sequence order of the image frames. Alternatively, the target GIF dynamic map may be generated from the plurality of frame images in the frame image sequence designated by the user.
In the application, after the target video data is acquired, the target video data can be further analyzed to obtain a plurality of image frame data, the plurality of image frame data are divided into at least one image based on a preset mode, and corresponding GIF dynamic images are respectively generated according to at least one image group. By applying the technical scheme, all image frame data can be automatically analyzed from video data, and the image frame data are divided into a plurality of image groups in different types, so that a corresponding GIF dynamic image is generated according to each image group. Therefore, the problem of long generation time caused by the need of manually synthesizing the GIF dynamic diagram in the related technology can be avoided.
In one possible implementation manner of the present application, in S103 (dividing the plurality of image frame data into at least one image group based on a preset manner), the following manner may be implemented:
based on a convolutional neural network model, extracting characteristic information in each image frame data, and determining characteristic data corresponding to each image frame data;
the plurality of image frame data is divided into at least one image group based on a category of feature data corresponding to each image frame data.
Among them, convolutional neural networks (Convolutional Neural Networks, CNN) are a type of feedforward neural network (Feedforward Neural Networks) that contains convolutional calculation and has a deep structure, and are one of representative algorithms for deep learning. Convolutional neural networks have the ability to characterize learning (representation learning) and can classify input information in a hierarchical structure with no change. Thanks to the strong characteristic characterization capability of CNN (convolutional neural network) on images, the CNN has remarkable effects in the fields of image classification, target detection, semantic segmentation and the like.
Further, the present application may use the extracted feature information in each image frame in the CNN neural network model. The image frames are input into a preset convolutional neural network model, and the output of the last full-connection layer (FC, fully connected layer) of the convolutional neural network model is used as the corresponding characteristic data of the image frames.
In addition, the method for extracting the feature information in each image frame data is not particularly limited, and for example, the feature information in each image frame data may be acquired by using other image detection techniques in addition to the feature information extraction by using the CNN neural network model.
It should be further noted that, before determining the feature data corresponding to each image frame data by using the convolutional neural network model, the present application needs to acquire the convolutional neural network model first:
obtaining a sample image, wherein the sample image comprises at least one sample feature;
training a preset neural network image classification model by using the sample image to obtain a convolutional neural network model meeting preset conditions.
Alternatively, for the neural network image classification model used, in one embodiment, the neural network image classification model may be trained by sample images. Specifically, a sample image can be obtained, and a preset neural network image classification model is trained by using the sample image, so that the neural network image classification model meeting preset conditions is obtained.
In addition, in the process of dividing the plurality of image frame data into the preset number of image groups based on the preset manner in the present application, the image frame data may be obtained in any one of the following two manners:
The first way is:
the plurality of image frame data is divided into a preset number of image groups based on a preset manner.
The second way is:
determining characteristic parameters of a plurality of image frame data;
the plurality of image frame data is divided into at least one image group based on characteristic parameters of the plurality of image frame data.
That is, the plurality of image frame data may be divided into a fixed number of image groups based on a preset number set in advance in the present application. Alternatively, the plurality of image frame data may be divided into at least one image group based on the feature parameter of each image frame data.
Further, in the above-mentioned implementation (dividing the plurality of image frame data into at least one image group based on the category of the feature data corresponding to each image frame data), it may be implemented in three ways:
the first way is:
and determining object information corresponding to each image frame data according to the characteristic data corresponding to each image frame data, wherein the object information is at least one of human information, animal information and landscape information.
Image frame data corresponding to the same object information is divided into the same image group to generate at least one image group.
In the present application, the object information appearing in each image frame may be determined based on the feature data corresponding to each image frame data. The object information can be at least one of man information, animal information and landscape information.
For example, as shown in fig. 2 a-2 c, fig. 2 a-2 c are three of the image frames in a video segment. As can be seen from fig. 2a, the content in the sub-image is a sub-street view. Therefore, according to the characteristic data corresponding to the image frame data, the object information corresponding to the image frame can be determined to be landscape information. Further, as can be seen from fig. 2b, the content in the sub-image is that a person is drawing. Therefore, the object information corresponding to the image frame can be determined according to the characteristic data corresponding to the image frame data. Similarly, as can be seen from fig. 2c, the content in the sub-image is that one person and one cat are looking at each other, so that the object information corresponding to the image frame can be determined to be the human information and the animal information according to the feature data corresponding to the image frame data.
It will be appreciated that, for example, in accordance with the above description, image frame data corresponding to the same object information may be divided into the same image group to generate at least one image group. Further, it is possible to divide the image frame data belonging to the personal information into the first image group, the image frame data belonging to the landscape information into the second image group, and the image frame data belonging to the personal information and the animal information into the third image group.
In another embodiment of the present application, after determining the object information corresponding to each image frame data from the feature data corresponding to each image frame data, the following steps may be further performed:
acquiring generation time of a plurality of image frame data;
the plurality of image frame data is divided into at least one image group based on a generation time of the plurality of image frame data and object information of the plurality of image frame data.
In the present application, after object information corresponding to each image frame data is determined, in order to avoid the problem of display confusion that easily occurs when generating a GIF dynamic image. In the present application, the respective image frames classified into the respective object information may be time-sequentially sorted based on the generation time of the respective image frames. And generating at least one image group based on the ordered image frames. To ensure the quality of the subsequent generation of GIF dynamic images.
The second way is:
determining pixel depth parameters corresponding to the image frame data according to the characteristic data corresponding to the image frame data, wherein the pixel depth parameters are used for representing color information positioned in a preset area in the corresponding image frame data;
image frame data corresponding to the same pixel depth parameter range is divided into the same image group to generate at least one image group.
Where pixel depth information of an image frame refers to the number of bits used to store each pixel, which is also used to measure the resolution of the image. The pixel depth determines the number of colors that each pixel of the color image may have, or the number of gray levels that each pixel of the gray image may have. Further, for example, each pixel of a color image is represented by three components of R, G, and B, and if each component is represented by 8 bits, then one pixel is represented by 24 bits, that is, the depth of the pixel is 24, and each pixel may be one of 24 colors of 2. That is, the more bits representing a pixel, the more colors it can express, and the deeper it is. In the present application, color information located in a preset area in the image frame data may be determined according to the above information.
Optionally, the preset area is not specifically limited in this application, for example, the preset area may be a background area of the image, or may be an area of any size of the image. Taking the background area as an example, the application can determine whether each image frame can be classified into the same image group according to the color of the background area in each image. It will be appreciated that the closer the background color of each image frame, the more likely it is to be divided into the same image group.
Further, the present application may also determine the time when the image is captured (for example, day or night) by the color of the background area in each image frame, and it is understood that each image frame belonging to the day may be divided into the first image group in each image frame. Each image frame belonging to the night is divided into a second image group.
Third mode:
calculating a similarity matching value corresponding to each image frame data according to the characteristic data corresponding to each image frame data;
and dividing the plurality of image frame data into at least one image group based on the magnitude relation between the similarity matching value corresponding to each image frame data and a preset threshold value.
Furthermore, in the process of calculating the similarity matching value corresponding to each image frame data, we can first match each image frame data with each other one by one to determine the matching value of each image frame data and all other image frames. Furthermore, the size of each matching value can be compared with a preset threshold value, so that all image frame data with the matching value larger than the preset threshold value are divided into a first image group, and all image frame data with the matching value not larger than the preset threshold value are divided into a second image group.
It should be noted that the preset threshold is not specifically limited in this application, and may be, for example, 80 or 50.
In another possible embodiment of the present application, after S102 (dividing the plurality of image frame data into at least one image group based on a preset manner), the following steps may be further implemented:
it should be noted that, since the GIF dynamic image is a dynamic video with a small data size, it is not preferable to set it as a too long data video. Further, the method can detect the number of frames in each image group after dividing the plurality of image frame data into at least one image group so as to ensure the generation quality of the GIF dynamic image.
Alternatively, when it is determined that the number of frames in each image group is not greater than the target value, a corresponding GIF dynamic map may be generated using the image group.
Further optionally, when it is determined that the number of frames in each image group is greater than the target value, in order to ensure the generation quality of the GIF dynamic image, further screening is required for the image frames in each image group, so as to ensure that the number of frame images does not exceed the target value. Therefore, the application can further screen out the frame data in each image group according to the standard of the second preset threshold value. Thereby obtaining the screened image group. And when the number of frames in the screened image group is not larger than a second preset threshold value, generating a corresponding GIF dynamic image by using the image group.
It will be appreciated that when the number of frames of the filtered image set is still greater than the second preset threshold, it is necessary to continue to screen each frame of data in the filtered image set with a better criterion. Until an image group is obtained, the number of frames of which meets a second preset threshold.
Similarly, the second preset threshold is not specifically limited in this application, for example, the second preset threshold may be 70 percent, and the second preset threshold may also be 50 percent. In addition, the second preset threshold value should be a value greater than the preset threshold value.
In another embodiment of the present application, as shown in fig. 3, the present application further provides an apparatus for generating a GIF dynamic graph, where the apparatus includes an obtaining module 201, a parsing module 202, a dividing module 203, and a generating module 204, where,
an acquisition module 201 configured as an acquisition module configured to acquire target video data;
a parsing module 202 configured to parse the target video data to obtain a plurality of image frame data;
a dividing module 203, configured to divide a plurality of image frame data into at least one image group based on a preset manner, where each image group includes at least two image frame data;
The generating module 204 is configured to generate the corresponding GIF dynamic images based on the at least one image group, respectively.
In the application, after the target video data is acquired, the target video data can be further analyzed to obtain a plurality of image frame data, the plurality of image frame data are divided into at least one image based on a preset mode, and corresponding GIF dynamic images are respectively generated according to at least one image group. By applying the technical scheme, all image frame data can be automatically analyzed from video data, and the image frame data are divided into a plurality of image groups in different types, so that a corresponding GIF dynamic image is generated according to each image group. Therefore, the problem of long generation time caused by the need of manually synthesizing the GIF dynamic diagram in the related technology can be avoided.
In another embodiment of the present application, the dividing module 203 further includes a detecting unit, and a dividing unit, where:
a detection unit configured to detect feature information in each of the image frame data based on a convolutional neural network model, and determine feature data corresponding to each of the image frame data;
and a dividing unit configured to divide the plurality of image frame data into the at least one image group based on a category of feature data corresponding to each of the image frame data.
In another embodiment of the present application, the dividing module 203 further includes a determining unit, a generating unit, where:
a determining unit configured to determine object information corresponding to each image frame data according to feature data corresponding to each image frame data, the object information being at least one of human information, animal information, and landscape information;
and a generation unit configured to divide image frame data corresponding to the same object information into the same image group to generate the at least one image group.
In another embodiment of the present application, the dividing module 203 further includes an obtaining unit, where:
an acquisition unit configured to acquire generation times of the plurality of image frame data;
a generation unit configured to divide the plurality of image frame data into the at least one image group based on a generation time of the plurality of image frame data and object information of the plurality of image frame data.
In another embodiment of the present application, the partitioning module 203 further includes:
the determining unit is configured to determine pixel depth parameters corresponding to the image frame data according to the feature data corresponding to the image frame data, wherein the pixel depth parameters are used for representing color information located in a preset area in the corresponding image frame data;
And a generation unit configured to divide image frame data corresponding to the same pixel depth parameter range into the same image group to generate the at least one image group.
In another embodiment of the present application, the dividing module 203 further includes a calculating unit, a setting unit, where:
a calculating unit configured to calculate a similarity matching value corresponding to each of the image frame data based on the feature data corresponding to each of the image frame data;
and a setting unit configured to divide the plurality of image frame data into the at least one image group based on a magnitude relation between a similarity matching value corresponding to each of the image frame data and a preset threshold.
In another embodiment of the present application, the partitioning module 203 further includes:
a dividing module 203 configured to divide a plurality of the image frame data into a preset number of image groups based on the preset manner;
or alternatively, the first and second heat exchangers may be,
a dividing module 203 configured to determine characteristic parameters of a plurality of the image frame data;
the dividing module 203 is configured to divide the plurality of image frame data into at least one image group based on the feature parameters of the plurality of image frame data.
In another embodiment of the present application, the method further includes an obtaining module 205, where:
An acquisition module 205 configured to acquire a sample image, wherein the sample image comprises at least one sample feature;
the obtaining module 205 is configured to train a preset neural network image classification model by using the sample image, so as to obtain the convolutional neural network model meeting a preset condition.
Fig. 4 is a block diagram of a logic structure of an electronic device, according to an example embodiment. For example, electronic device 300 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, the electronic device 300 may include one or more of the following components: a processor 301 and a memory 302.
Processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 301 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 301 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 301 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 302 may include one or more computer-readable storage media, which may be non-transitory. Memory 302 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 302 is used to store at least one instruction for execution by processor 301 to implement the interactive special effects calibration method provided by the method embodiments herein.
In some embodiments, the electronic device 300 may further optionally include: a peripheral interface 303, and at least one peripheral. The processor 301, memory 302, and peripheral interface 303 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 303 by buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 304, touch screen 305, camera 306, audio circuitry 307, positioning component 308, and power supply 309.
The peripheral interface 303 may be used to connect at least one Input/Output (I/O) related peripheral to the processor 301 and the memory 302. In some embodiments, processor 301, memory 302, and peripheral interface 303 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 301, the memory 302, and the peripheral interface 303 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 304 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 304 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 304 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 304 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 305 is a touch screen, the display 305 also has the ability to collect touch signals at or above the surface of the display 305. The touch signal may be input as a control signal to the processor 301 for processing. At this point, the display 305 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 305 may be one, providing a front panel of the electronic device 300; in other embodiments, the display screen 305 may be at least two, respectively disposed on different surfaces of the electronic device 300 or in a folded design; in still other embodiments, the display 305 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 300. Even more, the display screen 305 may be arranged in an irregular pattern other than rectangular, i.e., a shaped screen. The display 305 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 306 is used to capture images or video. Optionally, the camera assembly 306 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 306 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 307 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 301 for processing, or inputting the electric signals to the radio frequency circuit 304 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple and separately disposed at different locations of the electronic device 300. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 301 or the radio frequency circuit 304 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 307 may also include a headphone jack.
The location component 308 is used to locate the current geographic location of the electronic device 300 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 308 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
The power supply 309 is used to power the various components in the electronic device 300. The power source 309 may be alternating current, direct current, disposable or rechargeable. When the power source 309 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 300 further includes one or more sensors 310. The one or more sensors 310 include, but are not limited to: acceleration sensor 311, gyroscope sensor 312, pressure sensor 313, fingerprint sensor 314, optical sensor 315, and proximity sensor 316.
The acceleration sensor 311 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the electronic device 300. For example, the acceleration sensor 311 may be used to detect components of gravitational acceleration on three coordinate axes. The processor 301 may control the touch display screen 305 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 311. The acceleration sensor 311 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 312 may detect the body direction and the rotation angle of the electronic device 300, and the gyro sensor 312 may cooperate with the acceleration sensor 311 to collect the 3D motion of the user on the electronic device 300. The processor 301 may implement the following functions according to the data collected by the gyro sensor 312: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 313 may be disposed at a side frame of the electronic device 300 and/or at an underlying layer of the touch screen 305. When the pressure sensor 313 is disposed on the side frame of the electronic device 300, a grip signal of the user on the electronic device 300 may be detected, and the processor 301 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 313. When the pressure sensor 313 is disposed at the lower layer of the touch screen 305, the processor 301 performs control over the operability control on the UI interface according to the pressure operation of the user on the touch screen 305. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 314 is used to collect a fingerprint of a user, and the processor 301 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 314, or the fingerprint sensor 314 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 301 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 314 may be provided on the front, back, or side of the electronic device 300. When a physical key or vendor Logo is provided on the electronic device 300, the fingerprint sensor 314 may be integrated with the physical key or vendor Logo.
The optical sensor 315 is used to collect the ambient light intensity. In one embodiment, processor 301 may control the display brightness of touch screen 305 based on the intensity of ambient light collected by optical sensor 315. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 305 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 305 is turned down. In another embodiment, the processor 301 may also dynamically adjust the shooting parameters of the camera assembly 306 according to the ambient light intensity collected by the optical sensor 315.
The proximity sensor 316, also referred to as a distance sensor, is typically disposed on the front panel of the electronic device 300. The proximity sensor 316 is used to capture the distance between the user and the front of the electronic device 300. In one embodiment, when the proximity sensor 316 detects a gradual decrease in the distance between the user and the front of the electronic device 300, the processor 301 controls the touch display 305 to switch from the on-screen state to the off-screen state; when the proximity sensor 316 detects that the distance between the user and the front of the electronic device 300 gradually increases, the processor 301 controls the touch display screen 305 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 4 is not limiting of the electronic device 300 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 304, comprising instructions executable by processor 320 of electronic device 300 to perform the above-described method of generating a GIF dynamic map, the method comprising: acquiring target video data; analyzing the target video data to obtain a plurality of image frame data; dividing a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data; based on the at least one image group, corresponding GIF dynamic images are respectively generated. Optionally, the above instructions may also be executed by the processor 320 of the electronic device 300 to perform the other steps involved in the above-described exemplary embodiments. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, there is also provided an application/computer program product comprising one or more instructions executable by the processor 320 of the electronic device 300 to perform the above-described method of generating a GIF dynamic map, the method comprising: acquiring target video data; analyzing the target video data to obtain a plurality of image frame data; dividing a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data; based on the at least one image group, corresponding GIF dynamic images are respectively generated. Optionally, the above instructions may also be executed by the processor 320 of the electronic device 300 to perform the other steps involved in the above-described exemplary embodiments.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of generating a GIF dynamic map, comprising:
acquiring target video data;
analyzing the target video data to obtain a plurality of image frame data;
dividing a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data;
generating corresponding GIF dynamic graphs based on the at least one image group respectively;
wherein the dividing the plurality of image frame data into at least one image group based on a preset mode includes:
based on a convolutional neural network model, extracting characteristic information in each image frame data, and determining characteristic data corresponding to each image frame data;
the plurality of image frame data is divided into the at least one image group based on a category of feature data corresponding to each of the image frame data.
2. The method of claim 1, wherein the dividing the plurality of image frame data into the at least one image group based on a category of feature data corresponding to each of the image frame data comprises:
Determining object information corresponding to each image frame data according to the characteristic data corresponding to each image frame data, wherein the object information at least comprises one of character information, animal information and landscape information;
the image frame data corresponding to the same object information is divided into the same image group to generate the at least one image group.
3. The method of claim 2, further comprising, after the determining object information corresponding to each of the image frame data based on the feature data corresponding to each of the image frame data:
acquiring generation time of the plurality of image frame data;
the plurality of image frame data is divided into the at least one image group based on a generation time of the plurality of image frame data and object information of the plurality of image frame data.
4. The method according to claim 1 or 2, wherein the dividing the plurality of image frame data into the at least one image group based on the category of the feature data corresponding to each of the image frame data includes:
determining pixel depth parameters corresponding to the image frame data according to the characteristic data corresponding to the image frame data, wherein the pixel depth parameters are used for representing color information located in a preset area in the corresponding image frame data;
Image frame data corresponding to the same pixel depth parameter range is divided into the same image group to generate the at least one image group.
5. The method of claim 1, wherein dividing the plurality of image frame data into at least one image group based on a preset manner comprises:
dividing a plurality of image frame data into a preset number of image groups based on the preset mode;
or alternatively, the first and second heat exchangers may be,
determining characteristic parameters of a plurality of image frame data;
dividing a plurality of the image frame data into the at least one image group based on characteristic parameters of the plurality of the image frame data.
6. The method of claim 1, wherein the dividing the plurality of image frame data into the at least one image group based on a category of feature data corresponding to each of the image frame data comprises:
calculating a similarity matching value corresponding to each image frame data according to the characteristic data corresponding to each image frame data;
and dividing the plurality of image frame data into at least one image group based on the magnitude relation between the similarity matching value corresponding to each image frame data and a preset threshold value.
7. The method of claim 1, further comprising, prior to detecting feature information in each of the image frame data based on the convolutional neural network model, determining feature data corresponding to each of the image frame data:
obtaining a sample image, wherein the sample image comprises at least one sample feature;
training a preset neural network image classification model by using the sample image to obtain the convolutional neural network model meeting preset conditions.
8. An apparatus for generating a GIF dynamic map, comprising:
an acquisition module configured to acquire target video data;
the analysis module is used for analyzing the target video data to obtain a plurality of image frame data;
the dividing module is configured to divide a plurality of image frame data into at least one image group based on a preset mode, wherein each image group at least comprises two image frame data;
a generation module configured to generate corresponding GIF dynamic graphs based on the at least one image group, respectively;
the dividing module comprises a detecting unit and a dividing unit:
a detection unit configured to detect feature information in each of the image frame data based on a convolutional neural network model, and determine feature data corresponding to each of the image frame data;
And a dividing unit configured to divide the plurality of image frame data into the at least one image group based on a category of feature data corresponding to each of the image frame data.
9. An electronic device, comprising:
a memory for storing executable instructions; the method comprises the steps of,
a processor for displaying with the memory to execute the executable instructions to perform the operations of the method of generating a GIF dynamic map as claimed in any one of claims 1-7.
10. A computer-readable storage medium storing computer-readable instructions that, when executed, perform the operations of the method of generating a GIF dynamic map of any one of claims 1-7.
CN201910875157.1A 2019-09-17 2019-09-17 Method, device, electronic equipment and medium for generating GIF dynamic diagram Active CN110675473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910875157.1A CN110675473B (en) 2019-09-17 2019-09-17 Method, device, electronic equipment and medium for generating GIF dynamic diagram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910875157.1A CN110675473B (en) 2019-09-17 2019-09-17 Method, device, electronic equipment and medium for generating GIF dynamic diagram

Publications (2)

Publication Number Publication Date
CN110675473A CN110675473A (en) 2020-01-10
CN110675473B true CN110675473B (en) 2023-07-14

Family

ID=69077112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910875157.1A Active CN110675473B (en) 2019-09-17 2019-09-17 Method, device, electronic equipment and medium for generating GIF dynamic diagram

Country Status (1)

Country Link
CN (1) CN110675473B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516740A (en) * 2020-04-10 2021-10-19 阿里巴巴集团控股有限公司 Method and device for adding static elements and electronic equipment
CN111711841B (en) * 2020-07-27 2022-09-09 广州酷狗计算机科技有限公司 Image frame playing method, device, terminal and storage medium
CN112419447A (en) * 2020-11-17 2021-02-26 北京达佳互联信息技术有限公司 Method and device for generating dynamic graph, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416825B (en) * 2017-07-25 2021-09-28 平安科技(深圳)有限公司 Dynamic graph generation device, method and computer readable storage medium
CN108647625A (en) * 2018-05-04 2018-10-12 北京邮电大学 A kind of expression recognition method and device

Also Published As

Publication number Publication date
CN110675473A (en) 2020-01-10

Similar Documents

Publication Publication Date Title
CN110502954B (en) Video analysis method and device
CN110807361B (en) Human body identification method, device, computer equipment and storage medium
CN110650379B (en) Video abstract generation method and device, electronic equipment and storage medium
CN110572711A (en) Video cover generation method and device, computer equipment and storage medium
CN111541907A (en) Article display method, apparatus, device and storage medium
CN110933468A (en) Playing method, playing device, electronic equipment and medium
CN110675473B (en) Method, device, electronic equipment and medium for generating GIF dynamic diagram
US11386586B2 (en) Method and electronic device for adding virtual item
CN111027490B (en) Face attribute identification method and device and storage medium
CN111062248A (en) Image detection method, device, electronic equipment and medium
CN111586279B (en) Method, device and equipment for determining shooting state and storage medium
CN109754439B (en) Calibration method, calibration device, electronic equipment and medium
CN110853124B (en) Method, device, electronic equipment and medium for generating GIF dynamic diagram
CN112860046B (en) Method, device, electronic equipment and medium for selecting operation mode
CN110728167A (en) Text detection method and device and computer readable storage medium
CN111327819A (en) Method, device, electronic equipment and medium for selecting image
CN113343709B (en) Method for training intention recognition model, method, device and equipment for intention recognition
CN111723615B (en) Method and device for judging matching of detected objects in detected object image
CN113407774A (en) Cover determining method and device, computer equipment and storage medium
CN115221888A (en) Entity mention identification method, device, equipment and storage medium
CN111797754A (en) Image detection method, device, electronic equipment and medium
CN111445439A (en) Image analysis method, image analysis device, electronic device, and medium
CN112925903B (en) Text classification method, device, electronic equipment and medium
CN110929675B (en) Image processing method, device, computer equipment and computer readable storage medium
CN113763486B (en) Dominant hue extraction method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant