Image generation method and device, image distribution method and device, equipment, and medium
By predicting, expressing, intercepting, comparing and feature extraction methods of the original video and image data, the problem of omissions caused by large numbers of photos is solved, and the effect of accurately generating albums is achieved.
Patent Information
- Application Number
- CN202210408890.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In the prior art, due to the large number of photos, it is easy to miss when processing albums, so how to accurately generate albums has become a problem for technicians.
By acquiring the original video data and image data, prediction processing, expression recognition processing, interception processing, face comparison, information extraction and feature extraction are performed to generate an accurate image data set.
It realizes that the accurate image data set is automatically generated without teachers taking photos at all times, improving the accuracy of the image data set.
Smart Images

Figure CN114926874B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an image generation method and apparatus, an image distribution method and apparatus, equipment, and medium. Background Art
[0002] Nowadays, users often use mobile phones, cameras and other video equipment to take photos. For example, in order to help parents understand the growth of students in school, schools will take photos of students. In addition, users will make albums of photos. In the related art, due to the large number of photos, it is easy to miss them when processing. Therefore, how to accurately generate albums has become a technical problem that technicians in this field need to solve. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an image generation method and apparatus, an image distribution method and apparatus, a device, and a medium, aiming to accurately generate an image data set.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides an image generation method, the image generation method comprising:
[0005] Acquire original data; wherein the original data includes original video data and original image data, and the original video data includes multiple video frames obtained by shooting a preset target;
[0006] Performing prediction processing on the preset target according to the original video data to obtain target trajectory data;
[0007] Performing expression recognition processing on each of the video frames to obtain target expression data;
[0008] The original video data is intercepted and processed according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, and the image set includes a plurality of user images, and each of the user images includes at least one of the preset targets;
[0009] Performing face comparison processing on the plurality of user images and a preset face database to obtain a target image of each preset target; wherein the target image is an image containing the preset target;
[0010] Performing information extraction processing on the target image to obtain key point data;
[0011] Calculate the target posture angle according to the key point data;
[0012] Feature extraction is performed based on the target posture angle and the target image to obtain an image data set of the preset target.
[0013] In some embodiments, the intercepting and processing the original video data according to the target trajectory data and the target expression data to obtain preliminary image data includes:
[0014] Get a preset collection of wonderful emoticons;
[0015] If the target expression data belongs to one of the wonderful expression sets, obtaining the position corresponding to the target expression data to obtain the wonderful expression position;
[0016] The original video data is extracted frame by frame according to the wonderful expression position and the target trajectory data to obtain the preliminary image data.
[0017] In some embodiments, the key point data includes two-dimensional key point data and three-dimensional key point data, and the step of calculating the target posture angle according to the key point data includes:
[0018] Obtaining a preset two-dimensional weight coefficient, obtaining a preset three-dimensional weight coefficient;
[0019] Calculating a first posture angle according to the two-dimensional key point data and a preset two-dimensional angle calculation function;
[0020] Calculating a second posture angle according to the three-dimensional key point data and a preset three-dimensional angle calculation function;
[0021] Calculating a two-dimensional weight angle according to the first posture angle and the two-dimensional weight coefficient;
[0022] Calculating a three-dimensional weight angle according to the second posture angle and the three-dimensional weight coefficient;
[0023] The target posture angle is calculated based on the two-dimensional weight angle and the three-dimensional weight angle.
[0024] In some embodiments, the step of extracting features based on the target posture angle and the target image to obtain an image dataset of the preset target includes:
[0025] Get the preset posture threshold;
[0026] If the target posture angle is greater than or equal to the posture threshold, extracting and processing the target image to obtain the image data set of the preset target;
[0027] If the target posture angle is less than the posture threshold, simulate the target image to obtain a preliminary simulated image;
[0028] Performing calculation processing on the preliminary simulation image to obtain a simulation posture angle;
[0029] If the simulated posture angle is greater than or equal to the posture threshold, the preliminary simulated image is extracted and processed to obtain the image data set of the preset target.
[0030] To achieve the above purpose, a second aspect of an embodiment of the present application further proposes an image distribution method, the image distribution method comprising:
[0031] Acquire an image data set; wherein the image data set is generated according to the image generation method described in any one of the embodiments of the first aspect;
[0032] Performing recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data;
[0033] Classify the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image;
[0034] Perform matching processing based on the preliminary classification image and a preset face database to obtain a target classification image;
[0035] Performing compression processing on the target classified image to obtain a target compressed image;
[0036] The target compressed image is sent according to the face database.
[0037] In some embodiments, the preliminary classified images include: individual images and group images;
[0038] The classifying the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image includes:
[0039] If the face quantity data is greater than or equal to the face quantity threshold, the image data set is the group image;
[0040] If the face quantity data is less than the face quantity threshold, the image data set is the personal image.
[0041] To achieve the above object, the present application also provides an image generating device, which includes:
[0042] A data acquisition module, used to acquire original data; wherein the original data includes original video data and original image data, and the original video data includes a plurality of video frames obtained by shooting a preset target;
[0043] A prediction processing module, used for performing prediction processing on the preset target according to the original video data to obtain target trajectory data;
[0044] An expression recognition module, used to perform expression recognition processing on each of the video frames to obtain target expression data;
[0045] An interception processing module, configured to intercept the original video data according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, the image set includes a plurality of user images, each of the user images includes at least one of the preset targets;
[0046] A face comparison module, used for performing face comparison processing on the plurality of user images and a preset face library to obtain a target image of each preset target; wherein the target image is an image containing the preset target himself;
[0047] A data extraction module, used to perform information extraction processing on the preliminary image data to obtain key point data;
[0048] A calculation processing module, used for calculating the target posture angle according to the key point data;
[0049] The feature extraction module is used to extract features according to the target posture angle and the target image to obtain the image data set of the preset target.
[0050] To achieve the above-mentioned purpose, a fourth aspect of the embodiments of the present application further proposes an image distribution device, the image distribution device comprising:
[0051] An image acquisition module, used to acquire an image data set; wherein the image data set is generated according to the image generation method described in any one of the embodiments of the first aspect;
[0052] A face recognition module, used to perform recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data;
[0053] A classification processing module, used for classifying the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image;
[0054] A matching processing module, used for performing matching processing based on the preliminary classification image and a preset face database to obtain a target classification image;
[0055] A compression processing module, used for compressing the target classification image to obtain a target compressed image;
[0056] A sending module is used to send the target compressed image according to the face database.
[0057] To achieve the above-mentioned purpose, a fifth aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the program is executed by the processor, the method described in the first aspect is implemented; or,
[0058] A method as described in the second aspect.
[0059] To achieve the above-mentioned purpose, the sixth aspect of the embodiments of the present application proposes a storage medium, wherein the storage medium is a computer-readable storage medium, which is used for computer-readable storage, and 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 described in the first aspect above; or,
[0060] A method as described in the second aspect.
[0061] The image generation method and device, image distribution method and device, equipment, and medium proposed in the present application obtain original data, which includes original video data and original image data, and the original video data includes multiple video frames obtained by shooting a preset target, then predicting the preset target according to the original video data to obtain target trajectory data, then performing expression recognition processing on each video frame to obtain target expression data, and then intercepting the original video data according to the target trajectory data and the target expression data to obtain preliminary image data, wherein the original image data and the preliminary image data constitute an image set, and the image set includes multiple user images, and each user image includes at least one preset target; multiple user images are compared with a preset face library to obtain a target image of each preset target, and then information is extracted from the target image to obtain key point data, and then the target posture angle is calculated according to the key point data, and finally feature extraction is performed according to the target posture angle and the target image to obtain an image data set of the preset target. Through such a setting, the image data set can be automatically generated without the teacher taking pictures of the students at all times, and the preliminary image data of the embodiment of the present application is intercepted from the original video data, so the obtained image data set is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 is a flow chart of an image generation method provided in an embodiment of the present application;
[0063] Figure 2 yes Figure 1 Flow chart of the specific method of step S400;
[0064] Figure 3 yes Figure 1A flowchart of the specific method of step S700;
[0065] Figure 4 yes Figure 1 A flowchart of the specific method of step S800 in FIG.
[0066] Figure 5 is a flowchart of an image distribution method provided by an embodiment of the present application;
[0067] Figure 6 yes Figure 5 A flowchart of the specific method of step S1100 in FIG.
[0068] Figure 7 is a schematic diagram of the structure of an image generating device provided in an embodiment of the present application;
[0069] Figure 8 is a structural diagram of an image distribution device provided in an embodiment of the present application;
[0070] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0072] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0074] First, some nouns involved in this application are analyzed:
[0075] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0076] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0077] Nowadays, users often use mobile phones, cameras and other video equipment to take photos. For example, in order to help parents understand the growth of students in school, schools will take photos of students. In addition, users will make albums of photos. In the related art, due to the large number of photos, it is easy to miss them when processing. Therefore, how to accurately generate albums has become a technical problem that technicians in this field need to solve.
[0078] Based on this, the embodiments of the present application provide an image generation method and apparatus, an image distribution method and apparatus, a device, and a medium, which aim to accurately generate an image data set.
[0079] The image generation method and apparatus, image distribution method and apparatus, equipment, and medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the image generation method in the embodiments of the present application is described.
[0080] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0081] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0082] The image generation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The image generation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the image generation method, etc., but is not limited to the above forms.
[0083] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0084] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0085] The technical solution of the embodiment of the present application is further described below in conjunction with the accompanying drawings.
[0086] Figure 1 is an optional flowchart of the image generation method provided in an embodiment of the present application. Figure 1 The method may include steps S100 to S800. It should be understood that the image generation method of the embodiment of the present application includes but is not limited to steps S100 to S800. Figure 1 These 8 steps are introduced in detail.
[0087] Step S100, obtaining original data; wherein the original data includes original video data and original image data, and the original video data includes a plurality of video frames obtained by shooting a preset target;
[0088] Step S200, predicting a preset target based on the original video data to obtain target trajectory data;
[0089] Step S300, performing expression recognition processing on each video frame to obtain target expression data;
[0090] Step S400, intercepting and processing the original video data according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, the image set includes a plurality of user images, and each user image includes at least one preset target;
[0091] Step S500, performing face comparison processing on multiple user images and a preset face database to obtain a target image of each preset target; wherein the target image is an image containing the preset target himself;
[0092] Step S600, extracting information from the target image to obtain key point data;
[0093] Step S700, calculating the target posture angle according to the key point data;
[0094] Step S800, performing feature extraction according to the target posture angle and the target image to obtain an image data set of a preset target.
[0095] The image generation method of the embodiment of the present application obtains raw data, which includes raw video data and raw image data, and the raw video data includes multiple video frames obtained by shooting a preset target, then predicts the preset target according to the raw video data to obtain target trajectory data, then performs expression recognition processing on each video frame to obtain target expression data, and then intercepts the raw video data according to the target trajectory data and the target expression data to obtain preliminary image data, wherein the raw image data and the preliminary image data constitute an image set, and the image set includes multiple user images, and each user image includes at least one preset target; compares the multiple user images with the preset face library to obtain the target image of each preset target, and then extracts information from the target image to obtain key point data, and then calculates the target posture angle according to the key point data, and finally extracts features according to the target posture angle and the target image to obtain the image data set of the preset target. Through such a setting, the teacher does not need to shoot the students at all times, and the image data set can be automatically generated, and the preliminary image data of the embodiment of the present application is intercepted from the raw video data, so the obtained image data set is more accurate.
[0096] It should be noted that the technical solution of the embodiment of the present application is applicable to various image generation scenarios. In this embodiment, only the generation of wonderful images of students on campus is taken as an example for explanation. The generation of wonderful images of teachers or other people on campus, or the generation of images in other fields are similar to the generation of wonderful images of students on campus, and will not be repeated in this embodiment.
[0097] In step S100 of some embodiments, students are photographed by cameras installed in the campus to obtain raw video data, which consists of multiple video frames. The raw image data can be obtained by photographing the wonderful moments of students by cameras installed in the campus, or by teachers manually photographing the wonderful moments of students, and this application does not make any specific restrictions on this.
[0098] In step S200 of some embodiments, Kalman filtering is used to predict the preset target and obtain the target trajectory data. Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the system input and output observation data. And because the observation includes the influence of system noise and interference, the optimal estimation can also be regarded as a filtering process. The process is described by the following formula:
[0099] X(k)=A*X(k-1)+B*U(k)+W(k) (1)
[0100] Z(k)=H*X(k)+V(k) (2)
[0101] X(k|k-1)=A*X(k-1|k-1)+B*U(k) (3)
[0102] P(k|k-1)=A*P(k|k-1)*A T +Q (4)
[0103] X(k|k)=A*P(k|k-1)+K(k)*Z(k)-H*X(k|k-1) (5)
[0104] Kg(k)=P*(K|k-1)*H T / (H*P*(K|k-1)*H T +R) (6)
[0105] P(k|k)=(I-Kg(k)*H)*P(k|k-1) (7)
[0106] If the original video data is regarded as a discrete system, then in formulas (1) to (7), X(k) represents the state of the system at time k, and U(k) is the control amount of the system at time k. A and B are system parameters, Z(k) is the measurement value at time k, and H is the parameter of the measurement system. In formula (3), X(k|k-1) is the result predicted using the previous state, X(k-1|k-1) is the optimal result of the previous state, and U(k) is the control amount of the current state. If there is no control amount, it can be 0. In formula (2), P(k|k-1) is the covariance corresponding to X(k|k-1), P(k-1|k-1) is the covariance corresponding to X(k-1|k-1), and A T represents the transposed matrix of A, Q is the covariance of the system process, and formula (4) is equivalent to the prediction of the preset target in the original video data. In formula (6), Kg is the Kalman gain, and in formula (7), I is a matrix of 1.
[0107] The trajectory prediction process of the preset target in the original video data is performed through formula (2) to formula (7) to obtain the target trajectory data.
[0108] In step S300 of some embodiments, expression recognition processing is performed on each video frame through machine vision to obtain target expression data of each video frame of each preset target.
[0109] Please refer to Figure 2 In some embodiments of the present application, step S400 includes but is not limited to steps S410 to S430. Figure 2These two steps are introduced in detail.
[0110] Step S410, obtaining a preset wonderful expression set;
[0111] Step S420, if the target expression data belongs to one of the wonderful expression sets, then obtain the position corresponding to the target expression data to obtain the wonderful expression position;
[0112] Step S430, extracting the original video data frame by frame according to the wonderful expression position and the target trajectory data to obtain preliminary image data.
[0113] Specifically, in this embodiment, the wonderful expression set includes but is not limited to happiness, anger, sadness, excitement, touching, etc. If the target expression data identified in the above step S300 belongs to one of the above wonderful expression sets, the position corresponding to the target expression data is obtained to obtain the wonderful expression position, and then the original video data is extracted frame by frame according to the wonderful expression position and the target trajectory data to obtain preliminary image data. For example, the preset target is student A, and the original video data is a plurality of video frames obtained by shooting the student A, and then the trajectory of student A in the original video data is predicted by Kalman filtering to obtain the target trajectory data, and the video frame is subjected to expression recognition processing to obtain the target expression data. If the target expression data is one of the wonderful expression sets, the position of the target expression data in the original video data is obtained, and the original video data is extracted frame by frame according to the target trajectory data of student A to obtain preliminary image data. If the target expression data does not belong to one of the above wonderful expression sets, the original video data of the student A is not intercepted, and other original video data related to the student A are found for expression recognition processing to obtain preliminary image data of the student A.
[0114] Similarly, the above method is adopted to process multiple preset targets to obtain preliminary image data of multiple preset targets, and the aforementioned original image data and preliminary highlighted data are constructed to obtain an image set, which includes multiple user images, and each user image includes at least one preset target.
[0115] In step S500 of some embodiments, the preset face library is pre-established and stores multiple faces of preset targets, and if a face of a preset target that is not in the preset face library appears, the face of the preset target is added to the preset face library. By performing face comparison between multiple user images and the preset face library to obtain a target image, identity comparison can be performed on each student (preset target) for subsequent classification and distribution.
[0116] In step S600 of some embodiments, information is extracted from the target image to obtain key point data.
[0117] Please refer to Figure 3 In some embodiments of the present application, the key point data includes two-dimensional key point data and range key point data, and step S700 includes but is not limited to steps S710 to S760. Figure 3 These six steps are introduced in detail.
[0118] Step S710, obtaining a preset two-dimensional weight coefficient, obtaining a preset three-dimensional weight coefficient;
[0119] Step S720, calculating a first posture angle according to the two-dimensional key point data and a preset two-dimensional angle calculation function;
[0120] Step S730, calculating a second posture angle according to the three-dimensional key point data and a preset three-dimensional angle calculation function;
[0121] Step S740, calculating a two-dimensional weight angle according to the first posture angle and the two-dimensional weight coefficient;
[0122] Step S750, calculating a three-dimensional weight angle according to the second posture angle and the three-dimensional weight coefficient;
[0123] Step S760, calculating the target posture angle according to the two-dimensional weight angle and the three-dimensional weight angle.
[0124] Specifically, in this embodiment, formula (8) is used to calculate the target posture angle, and formula (8) is specifically:
[0125] θ=F2(dlibN)*α+F3(DANM)*β (8)
[0126] In formula (8), θ represents the target posture angle, dlibN represents the set of coordinate values of N two-dimensional face key point data, F2 represents the two-dimensional face calculation function, DANM represents the set of coordinate values of M three-dimensional face key point data, F3 represents the three-dimensional angle calculation function, α is the two-dimensional weight coefficient, and β is the three-dimensional weight coefficient. The target posture angle can be calculated by formula (8) to facilitate the judgment of the posture angle of the face in the preliminary image data, which is convenient for the subsequent selection of the preliminary image data.
[0127] Please refer to Figure 4 In some embodiments of the present application, step S800 includes but is not limited to step S810 to step S850. Figure 4 These five steps are introduced in detail.
[0128] Step S810, obtaining a preset posture threshold;
[0129] Step S820, if the target posture angle is greater than or equal to the posture threshold, extract the target image to obtain an image data set of the preset target;
[0130] Step S830, if the target posture angle is less than the posture threshold, simulate the target image to obtain a preliminary simulated image;
[0131] Step S840, performing calculation processing on the preliminary simulation image to obtain a simulation posture angle;
[0132] Step S850: If the simulated posture angle is greater than or equal to the posture threshold, the preliminary simulated image is extracted and processed to obtain an image data set of a preset target.
[0133] Specifically, in this embodiment, the posture threshold is used to characterize the degree of the posture angle of the face. The posture threshold is pre-set and can be adjusted according to the specific situation. The target image less than the posture threshold is considered to be unable to determine the face, or even if the face can be determined, the corresponding target image is not perfect and is not suitable as a wonderful image. If the target posture angle is greater than or equal to the posture threshold, the face image area in the target image of each preset target is extracted to obtain an image data set; if the target posture angle is less than the posture threshold, the target image is simulated and changed to obtain a preliminary simulation image to simulate the partial posture shown, and the preliminary simulation image is calculated again to obtain a simulation posture angle. If the simulation posture angle is greater than or equal to the posture threshold, the face image area in the preliminary simulation image is extracted and processed to obtain an image data set of the preset target. If the simulation posture angle is still less than the posture threshold after multiple simulation changes, the corresponding target image is discarded and the target image is reselected according to the above steps.
[0134] Please refer to Figure 5 In the second aspect, the present application also proposes an image distribution method, including but not limited to steps S900 to S1400. Figure 5 These six steps are introduced in detail.
[0135] Step S900, obtaining an image data set; wherein the image data set is generated according to the image generation method of the embodiment of the first aspect;
[0136] Step S1000, performing recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data;
[0137] Step S1100, classifying the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image;
[0138] Step S1200, performing matching processing based on the preliminary classification image and a preset face database to obtain a target classification image;
[0139] Step S1300, compressing the target classified image to obtain a target compressed image;
[0140] Step S1400: sending a target compressed image according to a face database.
[0141] The photo distribution method of the embodiment of the present application obtains the aforementioned image data set, and performs recognition processing on the image data set to obtain face image data, which includes face quantity data, and then classifies the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classification image, and then matches the face image data, the preliminary classification image, and a preset face database to obtain a target classification image, and then compresses the target classification image to obtain a target compressed image, and then sends the target compressed image according to the face database. Through such a setting, automatic classification and distribution of image data sets can be achieved, thereby reducing labor costs and labor workload, and also improving the accuracy of classification and distribution of image data sets.
[0142] In step S1000 of some embodiments, each image in the image data set is processed by face recognition technology to obtain face image data, which at least includes face quantity data and may also include gender data and the like.
[0143] Please refer to Figure 6 In some embodiments of the present application, the preliminary classified images include individual images and group images, and step S1100 includes step S1110 and step S1120. It should be understood that step S1100 includes but is not limited to step S1110 and step S1120. Figure 6 These two steps are introduced in detail.
[0144] Step S1110, if the face quantity data is greater than or equal to the face quantity threshold, the image data set is a group image;
[0145] Step S1120: If the face quantity data is less than the face quantity threshold, the image data set is a personal image.
[0146] Specifically, in this embodiment, if the face quantity data of the image in the image data set is greater than or equal to the face quantity threshold, the image is judged to be a group image, and if the face quantity data of the image in the image data set is less than the face quantity threshold, the image is an individual image. For example, the face quantity threshold is set to 2 (the face quantity threshold is preset and can be changed according to actual conditions), when the face quantity data of the image in the image data set is less than 2, it is judged to be an individual image, otherwise, it is judged to be a group image.
[0147] In step S1200 of some embodiments, the face database contains the associated person or associated group corresponding to each preset target. Taking the preset target as a student as an example, the face database reports the class, class teacher, parents or other guardians corresponding to the student, etc. If the preliminary classification image is a personal image, the personal image is matched to the class teacher and parents to obtain the target classification image, and if the preliminary classification image is a group image, the group image is matched to the class teacher, class, and parents. Of course, other matching and classification methods can also be used, which will not be repeated here.
[0148] In step S1300 of some embodiments, the target classification image is compressed to obtain a target compressed image while ensuring that the target classification image is not distorted and the image quality is guaranteed, so as to reduce the size of the target classification image and facilitate the subsequent distribution of the target compressed image.
[0149] In step S1400 of some embodiments, the face database also stores contact information and methods of associated persons and associated groups. For example, the parent's mobile phone number, WeChat, etc. are stored, and the target compressed image is automatically sent to the parent's mobile phone through the face database. Through this setting, parents can grasp their children's learning situation and development in school in real time.
[0150] The technical solution of this solution is described in detail below by taking application in a school as a specific embodiment.
[0151] Step 1: First, establish a campus face identity database, which includes a preset face library and a face database. The campus face identity database is used to match the preliminary classified images and to identify the preliminary image data.
[0152] Step 2: Use the video acquisition system installed on campus (cameras installed on campus) to shoot and process students to obtain original video data. Use the teacher's mobile phone or camera to manually shoot students' wonderful moments to obtain original image data.
[0153] Step 3: Use Kalman filtering to predict the student's trajectory in the original video data to obtain the target trajectory data.
[0154] Step 4: Use computer vision recognition technology to identify the student's expression in the original video data, obtain the target expression data, and determine whether the target expression data belongs to the expression in the wonderful expression set, which includes touching, happy, sad, excited, angry, etc. If the target expression data belongs to one of the wonderful expressions, obtain the position corresponding to the target expression data, obtain the wonderful expression position, and extract the original video data frame by frame according to the wonderful expression position and the target trajectory data to obtain preliminary image data. An image set is constructed based on the preliminary image data and the original image data, and the image set includes multiple user images.
[0155] Step 5: Perform face comparison processing on multiple user images and the preset face library to obtain a target image of each student, which contains the image of the student himself.
[0156] Step 6: Extract information from the target image to obtain key point data, which includes two-dimensional key point data and three-dimensional key point data, and calculate the target posture angle according to formula (8). If the target posture angle is greater than or equal to the preset posture threshold, extract features from the face area in the target image to obtain the student's image data set. If the target posture angle is less than the posture threshold, simulate the target image to obtain a preliminary simulation image, and calculate the preliminary image data to obtain the simulated posture angle. If the simulated posture angle is less than the posture threshold, perform simulation again. After a certain number of repetitions, if the simulated posture angle is still less than the posture threshold, discard the preliminary classified image. If the simulated posture angle is greater than or equal to the posture threshold, extract the face area in the preliminary image data to obtain the image data set.
[0157] Step 8: Classify the face quantity data in the image data set to obtain a preliminary classification image, which includes individual images and group images.
[0158] Step 9: Perform matching processing based on the face database and the preliminary classified image to obtain the target classified image, compress the target classified image to obtain the target compressed image, and send the target compressed image according to the face database, so as to send the target compressed image corresponding to the personal image to parents and class teachers, etc., and send the group image to parents, class teachers and classes, etc.
[0159] Please refer to Figure 7Some embodiments of the present application also propose an image generating device, which includes a data acquisition module 1500, a prediction processing module 1600, an expression recognition module 1700, a capture processing module 1800, a face comparison module 1900, a data extraction module 2000, a calculation processing module 2100, and a feature extraction module 2200.
[0160] The data acquisition module 1500 is used to acquire original data; wherein the original data includes original video data and original image data, and the original video data includes multiple video frames obtained by shooting a preset target.
[0161] The prediction processing module 1600 is used to perform prediction processing on a preset target according to the original video data to obtain target trajectory data.
[0162] The expression recognition module 1700 is used to perform expression recognition processing on each video frame to obtain target expression data.
[0163] The interception processing module 1800 is used to intercept and process the original video data according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, and the image set includes multiple user images, and each user image includes at least one preset target.
[0164] The face comparison module 1900 is used to perform face comparison processing on multiple user images and a preset face library to obtain a target image of each preset target; wherein the target image is an image containing the preset target himself.
[0165] The data extraction module 2000 is used to perform information extraction processing on the preliminary image data to obtain key point data.
[0166] The calculation processing module 2100 is used to calculate the target posture angle according to the key point data.
[0167] The feature extraction module 2200 is used to extract features according to the target posture angle and the target image to obtain an image data set of a preset target.
[0168] The image generation device of the embodiment of the present application obtains raw data, which includes raw video data and raw image data, and the raw video data includes multiple video frames obtained by shooting a preset target, then predicts the preset target according to the raw video data to obtain target trajectory data, then performs expression recognition processing on each video frame to obtain target expression data, and then intercepts the raw video data according to the target trajectory data and the target expression data to obtain preliminary image data, wherein the raw image data and the preliminary image data constitute an image set, and the image set includes multiple user images, and each user image includes at least one preset target; compares the multiple user images with the preset face library to obtain the target image of each preset target, and then extracts information from the target image to obtain key point data, and then calculates the target posture angle according to the key point data, and finally extracts features according to the target posture angle and the target image to obtain the image data set of the preset target. Through such a setting, the image data set can be automatically generated without the teacher taking pictures of the students at all times, and the preliminary image data of the embodiment of the present application is intercepted from the raw video data, so the obtained image data set is more accurate.
[0169] It should be noted that the image generating device of the embodiment of the present application corresponds to the aforementioned image generating method. For the specific processing flow, please refer to the aforementioned image generating method, which will not be repeated here.
[0170] Please refer to Figure 8 Some embodiments of the present application also propose an image distribution device, which includes an image acquisition module 2300, a face recognition module 2400, a classification processing module 2500, a matching processing module 2600, a compression processing module 2700 and a sending module 2800.
[0171] The image acquisition module 2300 is used to acquire an image data set; wherein the image data set is generated according to the image generation method of any one of the embodiments of the first aspect.
[0172] The face recognition module 2400 is used to perform recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data.
[0173] The classification processing module 2500 is used to classify the image data set according to the face quantity data and the preset face quantity threshold to obtain a preliminary classified image.
[0174] The matching processing module 2600 is used to perform matching processing based on the preliminary classification image and the preset face database to obtain a target classification image.
[0175] The compression processing module 2700 is used to perform compression processing on the target classified image to obtain a target compressed image.
[0176] The sending module 2800 is used to send the target compressed image according to the face database.
[0177] The image distribution device of the embodiment of the present application obtains the aforementioned image data set, and performs recognition processing on the image data set to obtain face image data, which includes face quantity data, and then classifies the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classification image, and then matches the face image data, the preliminary classification image, and a preset face database to obtain a target classification image, and then compresses the target classification image to obtain a target compressed image, and then sends the target compressed image according to the face database. Through such a setting, automatic classification and distribution of image data sets can be achieved, thereby reducing labor costs and labor workload, and also improving the accuracy of classification and distribution of image data sets.
[0178] It should be noted that the image distribution device of the embodiment of the present application corresponds to the aforementioned image distribution method. For the specific processing flow, please refer to the aforementioned image distribution method, which will not be repeated here.
[0179] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned image generation method or image distribution method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0180] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0181] The processor 2900 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0182] The memory 3000 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 3000 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 3000, and the processor 2900 calls and executes the image generation method of the embodiment of the present application;
[0183] Input / output interface 3100, used to implement information input and output;
[0184] The communication interface 3200 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0185] Bus 330000 , which transmits information between various components of the device (e.g., processor 2900 , memory 3000 , input / output interface 3100 , and communication interface 3200 );
[0186] The processor 2900 , the memory 3000 , the input / output interface 3100 and the communication interface 3200 are connected to each other in communication within the device via the bus 3300 .
[0187] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. 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 above-mentioned image generation method or image distribution method.
[0188] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0189] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0190] It can be understood by those skilled in the art that Figure 1-6 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0191] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0192] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0193] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0194] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0195] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0196] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0198] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0199] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. An image generation method, characterized in that: The image generation method comprises: Acquire original data; wherein the original data includes original video data and original image data, and the original video data includes multiple video frames obtained by shooting a preset target; Performing prediction processing on the preset target according to the original video data to obtain target trajectory data; Performing expression recognition processing on each of the video frames to obtain target expression data; The original video data is intercepted and processed according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, and the image set includes a plurality of user images, and each of the user images includes at least one of the preset targets; Performing face comparison processing on the plurality of user images and a preset face database to obtain a target image of each preset target; wherein the target image is an image containing the preset target; Performing information extraction processing on the target image to obtain key point data; Calculate the target posture angle according to the key point data; Feature extraction is performed based on the target posture angle and the target image to obtain an image data set of the preset target.
2. The method according to claim 1, characterized in that The process of intercepting the original video data according to the target trajectory data and the target expression data to obtain preliminary image data includes: Get a preset collection of wonderful emoticons; If the target expression data belongs to one of the wonderful expression sets, obtaining the position corresponding to the target expression data to obtain the wonderful expression position; The original video data is extracted frame by frame according to the wonderful expression position and the target trajectory data to obtain the preliminary image data.
3. The method according to claim 1, characterized in that The key point data includes two-dimensional key point data and three-dimensional key point data, and the target posture angle is calculated according to the key point data, including: Obtaining a preset two-dimensional weight coefficient, obtaining a preset three-dimensional weight coefficient; Calculating a first posture angle according to the two-dimensional key point data and a preset two-dimensional angle calculation function; Calculating a second posture angle according to the three-dimensional key point data and a preset three-dimensional angle calculation function; Calculating a two-dimensional weight angle according to the first posture angle and the two-dimensional weight coefficient; Calculating a three-dimensional weight angle according to the second posture angle and the three-dimensional weight coefficient; The target posture angle is calculated based on the two-dimensional weight angle and the three-dimensional weight angle.
4. The method according to any one of claims 1 to 3, characterized in that: The step of extracting features according to the target posture angle and the target image to obtain an image data set of the preset target includes: Get the preset posture threshold; If the target posture angle is greater than or equal to the posture threshold, extracting and processing the target image to obtain the image data set of the preset target; If the target posture angle is less than the posture threshold, simulate the target image to obtain a preliminary simulated image; Performing calculation processing on the preliminary simulation image to obtain a simulation posture angle; If the simulated posture angle is greater than or equal to the posture threshold, the preliminary simulated image is extracted and processed to obtain the image data set of the preset target.
5. An image distribution method, characterized in that: The image distribution method comprises: Acquire an image data set; wherein the image data set is generated according to the image generation method according to any one of claims 1 to 4; Performing recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data; Classify the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image; Perform matching processing based on the preliminary classification image and a preset face database to obtain a target classification image; Performing compression processing on the target classified image to obtain a target compressed image; The target compressed image is sent according to the face database.
6. The method according to claim 5, characterized in that The preliminary classified images include: individual images and group images; The classifying the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image includes: If the face quantity data is greater than or equal to the face quantity threshold, the image data set is the group image; If the face quantity data is less than the face quantity threshold, the image data set is the personal image.
7. An image generating device, characterized in that: The image generating device comprises: A data acquisition module, used to acquire original data; wherein the original data includes original video data and original image data, and the original video data includes a plurality of video frames obtained by shooting a preset target; A prediction processing module, used for performing prediction processing on the preset target according to the original video data to obtain target trajectory data; An expression recognition module, used to perform expression recognition processing on each of the video frames to obtain target expression data; An interception processing module, configured to intercept the original video data according to the target trajectory data and the target expression data to obtain preliminary image data; wherein the original image data and the preliminary image data constitute an image set, the image set includes a plurality of user images, each of the user images includes at least one of the preset targets; A face comparison module, used for performing face comparison processing on the plurality of user images and a preset face library to obtain a target image of each preset target; wherein the target image is an image containing the preset target himself; A data extraction module, used to perform information extraction processing on the preliminary image data to obtain key point data; A calculation processing module, used for calculating the target posture angle according to the key point data; The feature extraction module is used to extract features according to the target posture angle and the target image to obtain the image data set of the preset target.
8. An image distribution device, characterized in that: The image distribution device comprises: An image acquisition module, used to acquire an image data set; wherein the image data set is generated according to the image generation method according to any one of claims 1 to 4; A face recognition module, used to perform recognition processing on the image data set to obtain face image data; wherein the face image data includes face quantity data; A classification processing module, used for classifying the image data set according to the face quantity data and a preset face quantity threshold to obtain a preliminary classified image; A matching processing module, used for performing matching processing based on the preliminary classification image and a preset face database to obtain a target classification image; A compression processing module, used for compressing the target classification image to obtain a target compressed image; A sending module is used to send the target compressed image according to the face database.
9. An electronic device, characterized in that: The electronic device comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the program is executed by the processor, the steps of the image generating method according to any one of claims 1 to 4 are realized; or, The steps of the image distribution method according to any one of claims 5 to 6.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, 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 steps of the image generation method according to any one of claims 1 to 4; or, The steps of the image distribution method according to any one of claims 5 to 6.
Citation Information
Patent Citations
Character image video generation method and device, computer equipment and storage medium
CN113920230A
Neural network transfer of the facial expression and position of the head using hidden position descriptors
RU2755396C1