CN112866577A - Image processing method and device, computer readable medium and electronic equipment - Google Patents

Image processing method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN112866577A
CN112866577A CN202110077153.6A CN202110077153A CN112866577A CN 112866577 A CN112866577 A CN 112866577A CN 202110077153 A CN202110077153 A CN 202110077153A CN 112866577 A CN112866577 A CN 112866577A
Authority
CN
China
Prior art keywords
image
recognized
template
shooting interface
real
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.)
Granted
Application number
CN202110077153.6A
Other languages
Chinese (zh)
Other versions
CN112866577B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110077153.6A priority Critical patent/CN112866577B/en
Publication of CN112866577A publication Critical patent/CN112866577A/en
Application granted granted Critical
Publication of CN112866577B publication Critical patent/CN112866577B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition

Abstract

The embodiment of the application provides an image processing method and device, a computer readable medium and electronic equipment. The image processing method comprises the following steps: acquiring at least one image to be recognized according to a real-time picture containing a human face acquired in a shooting interface; determining an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, wherein the expression value is used for describing the matching degree between the human face and various expressions; determining an image template corresponding to the at least one image to be recognized according to the expression value; displaying the image template in the shooting interface; and generating a target image comprising the image template and the human face according to the image template and the real-time picture of the shooting interface. According to the technical scheme, the adaptability between the image template and the current expression state of the user is improved, and the user experience is improved.

Description

Image processing method and device, computer readable medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an image, a computer-readable medium, and an electronic device.
Background
With the development of computer technology, natural expression recognition based on computer vision has been widely applied in human-computer interaction, interactive movie and television and game entertainment. In the current technical solution, generally, according to a static image of a user, a facial expression of the user is recognized and interaction is performed. However, interacting based on the static image makes the interaction result unable to adapt to the current expression state of the user. Therefore, how to improve the adaptability between the interaction result and the current expression state of the user and improve the user experience becomes a technical problem to be solved urgently.
Disclosure of Invention
Embodiments of the present application provide an image processing method and apparatus, a computer-readable medium, and an electronic device, so that the adaptability between an interaction result and a current expression state of a user can be improved at least to a certain extent, and user experience is improved.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a method for processing an image, the method including:
acquiring at least one image to be recognized according to a real-time picture containing a human face acquired in a shooting interface;
determining an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, wherein the expression value is used for describing the matching degree between the human face and various expressions;
determining an image template corresponding to the at least one image to be recognized according to the expression value;
displaying the image template in the shooting interface;
and generating a target image comprising the image template and the human face according to the image template and the real-time picture of the shooting interface.
According to an aspect of an embodiment of the present application, there is provided an apparatus for processing an image, the apparatus including:
the acquisition module is used for acquiring at least one image to be recognized according to the real-time picture containing the face acquired in the shooting interface;
the first determining module is used for determining an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, wherein the expression value is used for describing the matching degree between the face and various expressions;
the second determining module is used for determining an image template corresponding to the at least one image to be recognized according to the expression value;
the display module is used for displaying the image template in the shooting interface;
and the processing module is used for generating a target image containing the image template and the human face according to the image template and the current real-time picture of the shooting interface.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is further configured to: and responding to a generation instruction aiming at the target image, and displaying the shooting interface, wherein the shooting interface contains prompt information used for indicating a shooting area of the human face.
In some embodiments of the present application, based on the foregoing solution, the prompt information is an indication frame located at a predetermined position in the shooting interface; the acquisition module is configured to: and if at least one complete face is detected in the indication frame, acquiring at least one image to be identified according to the real-time picture acquired in the shooting interface.
In some embodiments of the present application, based on the foregoing, the first determining module is configured to: and inputting the at least one image to be recognized into a pre-trained recognition model, and outputting an expression value corresponding to the at least one image to be recognized through the recognition model.
In some embodiments of the present application, based on the foregoing, the second determining module is configured to: determining a threshold interval where the expression value is located according to the expression value; and selecting an image template corresponding to the threshold interval from an image template library according to the threshold interval.
In some embodiments of the present application, based on the foregoing, the second determining module is configured to: determining at least one image template to be selected corresponding to the threshold interval from the image template library according to the threshold interval; displaying the at least one template to be selected in the shooting interface; and determining a target image template in response to a selection instruction for the at least one template to be selected.
In some embodiments of the present application, based on the foregoing scheme, the number of the at least one image to be recognized is greater than or equal to two; the display module is configured to: and replacing the image template determined later with the image template determined earlier according to the time sequence corresponding to the at least one image to be recognized, and displaying the image template in the shooting interface.
In some embodiments of the present application, based on the foregoing solution, the processing module is further configured to: and generating identification information corresponding to the target image according to the target image, wherein the identification information is a certificate for acquiring the target image.
In some embodiments of the present application, based on the foregoing scheme, the identification information is a graphic code; the processing module is further configured to: if receiving a correlation request sent by scanning the graphic code, acquiring user information contained in the correlation request; and establishing an association relationship between the user information and the target image so as to execute printing operation on the target image through the association relationship.
In some embodiments of the present application, based on the foregoing solution, the processing module is further configured to: if an image acquisition request containing the identification information is received, inquiring according to the identification information, and determining a target image corresponding to the identification information; in response to a print request for the target image, a print operation is performed on the target image.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is configured to: acquiring video stream data corresponding to a real-time picture according to the real-time picture containing the face acquired in a shooting interface; according to the video stream data, drawing the video stream data by adopting a drawing tool to obtain an image frame set corresponding to the real-time picture, wherein the image frame set comprises at least one image frame; and determining at least one image to be identified based on the image frames contained in the image frame set.
In some embodiments of the present application, based on the foregoing solution, the obtaining module is further configured to: and responding to a generation instruction for a target image, and displaying the shooting interface in a target webpage.
According to an aspect of embodiments of the present application, there is provided a computer-readable medium on which a computer program is stored, which, when executed by a processor, implements a method of processing an image as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of processing images as described in the above embodiments.
In the technical solutions provided in some embodiments of the present application, at least one image to be recognized is obtained according to a real-time picture containing a face obtained in a shooting interface, an expression value corresponding to the at least one image to be recognized is determined according to the at least one image to be recognized, the expression value is used for describing a matching degree between the face and a plurality of expressions, an image template corresponding to the at least one image to be recognized is determined according to the expression value, the image template is displayed in the shooting interface, and a target image containing the image template and the face is generated according to the image template and the real-time picture of the shooting interface. Therefore, the image template can be matched with the real-time picture acquired by the shooting interface, the adaptability between the image template and the real-time picture is improved, and the user experience is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
Fig. 2 shows a flow diagram of a method of processing an image according to an embodiment of the application.
Fig. 3 shows a schematic flow diagram of step S230 in the method of processing the image of fig. 2 according to an embodiment of the present application.
Fig. 4 shows a schematic flow diagram of step S320 in the processing method of the image of fig. 3 according to an embodiment of the present application.
Fig. 5 shows a schematic flow chart of a printing target image further included in the image processing method according to an embodiment of the present application.
Fig. 6 shows a flowchart illustrating a printing target image further included in the image processing method according to another embodiment of the present application.
Fig. 7 shows a schematic flow diagram of step S210 in the method of processing the image of fig. 2 according to an embodiment of the present application.
Fig. 8 shows a flow diagram of a method of processing an image according to an embodiment of the application.
Fig. 9 illustrates a terminal interface diagram of a processing method of an image applicable to an embodiment of the present application.
Fig. 10 shows a block diagram of an apparatus for processing an image according to an embodiment of the present application.
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture may include a terminal device 110 and a server 120, wherein the terminal device 110 and the server 120 are connected via a network, which may include various connection types, such as a wired communication link, a wireless communication link, and so on.
It should be understood that the number of terminal devices 110 and servers 120 in fig. 1 is merely illustrative. There may be any number of terminal devices and servers, as desired for implementation. For example, the server 120 may be a server cluster composed of a plurality of servers, and the like.
It should be noted that the server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform.
The terminal device 110 may be one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent speaker, and an intelligent watch, the terminal device 110 may also be any other terminal device having an image acquisition function and a data transmission function, and the terminal device 110 may be disposed in a public place, such as a mall, an amusement park, or a street, for use by a user.
In an exemplary embodiment of the present application, the terminal device 110 may display a shooting interface, and transmit a real-time image acquired by the shooting interface to the server 120, where the server 120 may acquire at least one image to be recognized according to the real-time image including a face acquired in the shooting interface, and determine an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, where the expression value is used to describe a matching degree between the face and a plurality of expressions, determine an image template corresponding to the at least one image to be recognized according to the expression value, display the image template in the shooting interface, and generate a target image including the image template and the face according to the image template and the real-time image of the shooting interface.
It should be noted that the image processing method provided in the embodiment of the present application is generally executed by the server 120, and accordingly, the image processing apparatus is generally disposed in the server 120. However, in other embodiments of the present application, the terminal device 110 may also have a similar function as the server 120, so as to execute the scheme of the image processing method provided in the embodiments of the present application.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 shows a flow diagram of a method of processing an image according to an embodiment of the application. Referring to fig. 2, the image processing method at least includes steps S210 to S250, which are described in detail as follows:
in step S210, at least one image to be recognized is acquired according to the real-time picture including the face acquired in the shooting interface.
In an exemplary embodiment of the present application, the shooting interface may be an interface for shooting a user, and the terminal device may display the shooting interface through a display device (e.g., a display screen or a touch display screen) configured by the terminal device. Meanwhile, the terminal equipment can acquire the real-time picture of the user according to an image acquisition device (such as a camera) configured by the terminal equipment, and display the real-time picture in a shooting interface so that the user can know the current state of the user, and posture adjustment and expression management are facilitated.
The server can receive the real-time picture sent by the terminal equipment and acquire at least one image to be identified according to the real-time picture. It should be understood that the image to be recognized should include the face, so as to determine a corresponding expression value according to the expression of the face. Specifically, the server may perform framing processing on the real-time picture, so as to obtain a video frame set corresponding to the real-time picture. The server may select a video frame from the set of video frames as the image to be identified.
In an example, the server may determine each video frame included in the video frame set one by one as an image to be recognized for subsequent recognition, which may ensure that the recognition result matches with the real-time status of the user.
In another example, the server may also select one video frame as the image to be recognized at predetermined intervals from the video frames included in the video frame set, for example, the predetermined intervals may be two, the video frames of the first, fourth, seventh, and … … may be selected as the image to be recognized, and the like. It should be understood that the predetermined interval may be preset, and those skilled in the art may determine the corresponding predetermined interval according to actual implementation needs, and the present application is not limited thereto.
In another example, the server may also randomly select a predetermined number of video frames from the video frame set as the image to be identified, for example, the predetermined number is 5, the server may randomly select 5 video frames from the video frame set as the image to be identified, and so on. It should be understood that the predetermined number may be predetermined, and one skilled in the art can determine the predetermined number of images to be recognized according to actual implementation needs.
In addition, the predetermined number may also be associated with the number of video frames included in the video frame set, for example, the predetermined number may be 20% of the number of video frames included in the video frame set, and if the number of video frames is 100, the predetermined number is 20 (100 × 20%), and so on. Therefore, the preset number can be dynamically corresponding to the number of the video frames contained in the video frame set, the situation that the number of the video frames contained in the video frame set is too small and cannot reach the preset number is avoided, and the situation that the subsequent identification result cannot correspond to the real-time state of the user due to the fact that the number of the video frames contained in the video frame set is too large and the preset number is too small can also be avoided.
In step S220, an expression value corresponding to the at least one image to be recognized is determined according to the at least one image to be recognized, where the expression value is used to describe a matching degree between the face and a plurality of expressions.
The expression value may be information describing a degree of matching between the face and a plurality of expressions. The skilled person can classify the type of expression in advance, for example, the expression may include but is not limited to happy, sad, angry, and so on. The expressions of each type may be further classified according to the degree of expression, for example, happy, smiling, laughing, and the like.
In an example, the expression value may be multiple, the multiple expression values respectively correspond to multiple expressions, the expression value may be between 0 and 1, and the larger the expression value, the higher the matching degree of the expression is.
In another example, the expression value may be single, and the different threshold intervals where the single expression value is located correspond to different types of expressions, for example, if the expression value is between 0 and 1, it corresponds to sadness, if the expression value is between 1 and 3, it corresponds to normal, if the expression value is between 3 and 5, it corresponds to happy, and so on. The above are merely exemplary, and the present application is not limited thereto. It should be understood that, in different threshold intervals, if an expression value is larger, it indicates that the expression value is more matched with the corresponding expression.
In an exemplary embodiment of the present application, a person skilled in the art may determine a threshold interval corresponding to the degree of fun according to the difference of the degree of fun, for example, if the expression value is between 0 and 1, then smile is corresponded, if the expression value is between 1 and 3, then smile is corresponded, if the expression value is between 3 and 5, then smile is corresponded, and the like. Therefore, the type corresponding to the expression of the user can be determined according to the size of the expression value. The expression values corresponding to different types can be realized by a single expression value, a plurality of expression values do not need to be calculated, and the calculation efficiency is improved.
In an exemplary embodiment of the present application, the server may calculate, according to a facial feature of a human face included in the image to be recognized, an expression value corresponding to the facial feature. It should be understood that one image to be recognized corresponds to one expression value, so if the number of the images to be recognized is multiple, each image to be recognized corresponds to one expression value, so as to determine the expression type corresponding to the image to be recognized according to the expression value corresponding to the image to be recognized.
It should be understood that different images to be recognized include facial expressions of the user at different times, so that the corresponding expression values of the different images to be recognized correspond to the facial expressions of the user at different times. Therefore, the images to be recognized are sorted according to the time sequence corresponding to the images to be recognized, and the expression values corresponding to the images to be recognized can correspond to the facial expressions of the user in real time.
Referring to fig. 2, in step S230, an image template corresponding to the at least one image to be recognized is determined according to the expression value.
The image template may be a preset template used for being collocated with an image to generate a personalized image. The image template may include a variety of types, for example, the image template may be a virtual background, a cartoon sticker, or a textual graphic, among others. Therefore, the image template can be matched with other images, so that personalized images are generated, and the interestingness of the images is increased.
In an exemplary embodiment of the present application, a person skilled in the art may determine the corresponding image template in advance according to different expression values. Therefore, the server can determine the image template corresponding to the expression value by inquiring the corresponding relation between the expression value and the image template according to the expression value corresponding to each image to be recognized.
In an example, if one image to be recognized corresponds to a plurality of expression values, and the plurality of expression values are used to represent matching degrees between a face and a plurality of expressions included in the image to be recognized, the server may determine a maximum value of the plurality of expression values, and select an image template corresponding to the type according to an expression type corresponding to the maximum value. For example, if an image to be recognized corresponds to three expression values, where the expression value corresponding to sadness is 0.3, the expression value corresponding to anger is 0.1, and the expression value corresponding to happiness is 0.5, the server may determine that the matching degree between the face included in the image to be recognized and the emotion type corresponding to happiness is the highest according to the maximum value of the three expression values, that is, the expression value corresponding to happiness, and thus, the server may select an image template corresponding to happiness, and so on.
In another example, if an image to be recognized corresponds to an expression value, and different threshold intervals where the expression values are located correspond to different types of expressions, the server may determine, according to the threshold interval where the expression value corresponding to the image to be recognized is located, an expression type corresponding to a face included in the image to be recognized, and select, according to the determined expression type, an image template corresponding to the expression type.
It should be noted that one expression type may correspond to one image template, and one expression type may also correspond to a plurality of image templates. If one expression type corresponds to a plurality of image templates, in an example, the server may randomly select one from the plurality of image templates as a target image template; in another example, the server may also sequentially select one image template from the plurality of image templates as the target image template to avoid the occurrence of random selection with multiple repetitions.
In step S240, the image template is displayed in the shooting interface.
In an exemplary embodiment of the present application, the server may display the image template in the shooting interface according to the determined image template. Specifically, the server may display the image template at a designated location of the capture interface, such as above, to the side, or below the capture interface. If a plurality of image templates are determined, the server may display the corresponding image templates at the designated positions of the shooting interface according to the time sequence of the images to be recognized, for example, the image templates may be displayed above the shooting interface sequentially from left to right according to the time sequence of the images to be recognized corresponding to the image templates, and so on.
The user can select an image template of the heart instrument according to the image template displayed in the shooting interface so as to generate a target image containing the image template subsequently.
In step S250, a target image including the image template and the face is generated according to the image template and the real-time frame of the shooting interface.
In an exemplary embodiment of the present application, the server may synthesize the determined image template with a current real-time picture of the shooting interface, thereby generating a target image including the image template and a face of the user. For example, if the image template is a virtual background, the server may recognize the user area and a background area other than the user area from the live view of the shooting interface, and replace the background area in the live view with the image template, thereby generating a target image including the face of the user and the image template.
If the image template is a cartoon sticker or other types of templates such as character and graphics, the server may display the image template at a predetermined position in the real-time image, for example, the image template is a hat graphic, and the server may recognize the position of the head of the user in the real-time image and display the image template at the position of the head of the user, so as to generate the target image, and so on.
It should be noted that the server may also pre-process the real-time image of the shooting interface, such as denoising and cropping, so that the real-time image may highlight the user and the generated target image may better conform to the viewing habit of the user.
Therefore, in the embodiment shown in fig. 2, at least one image to be recognized is obtained according to the real-time picture containing the face obtained in the shooting interface, an expression value corresponding to the at least one image to be recognized is determined according to the at least one image to be recognized, an image template corresponding to the image to be recognized is determined according to the expression value, and the image template is displayed in the shooting interface, so that the target image is generated according to the image template and the real-time picture of the shooting interface. The image template can be matched with the real-time picture acquired by the shooting interface, the adaptability between the image template and the real-time picture is improved, and the user experience is further improved.
Based on the embodiment shown in fig. 2, in an exemplary embodiment of the present application, before acquiring at least one image to be recognized according to a real-time picture including a human face acquired at a shooting interface, the method further includes:
and responding to a generation instruction aiming at the target image, and displaying the shooting interface, wherein the shooting interface contains prompt information for indicating a shooting area of the human face.
Wherein the generation instruction for the target image may be information for requesting generation of the target image. In an example, a user may click on a specific area (e.g., an "image generation" key, etc.) on a display interface of a terminal device to generate a generation instruction for a target image; in another example, the user may also input a specific instruction through an input device configured by the terminal device (e.g., input a keyboard or a mouse, etc.) or click a specific area on the interface, so as to generate a generation instruction for the target image.
The prompt information may be information for indicating a shooting area of a human face, and the user may adjust the position of the user according to the prompt information to obtain a better shooting effect. It should be noted that the prompt message may be various forms of messages. In one example, the prompt may be a text prompt, for example, the prompt may be "please center the face," or the like. In another example, the prompt message may also be a graphical prompt message, for example, the prompt message may be a directional arrow pointing to a predetermined position of the shooting interface, or the prompt message may be an indication frame located at the predetermined position, or the like. The above are merely exemplary, and the present application is not limited thereto.
In an exemplary embodiment of the present application, after generating the generation instruction, the terminal device may transmit the generation instruction to the server. If the server receives the generation instruction sent by the terminal equipment, a shooting interface can be displayed on a display interface of the terminal equipment, the shooting interface comprises prompt information used for indicating a shooting area of a human face, an image acquisition device configured by the terminal equipment is started to acquire a real-time picture of a user, and the real-time picture is displayed in the shooting interface.
Based on the above embodiment, in an exemplary embodiment of the present application, the prompt information is an indication frame located at a predetermined position in the shooting interface;
the method for acquiring at least one image to be recognized according to the real-time picture containing the face acquired in the shooting interface comprises the following steps:
and if at least one complete face is detected in the indication frame, acquiring at least one image to be identified according to the real-time picture acquired in the shooting interface.
In this embodiment, the server may apply a target detection algorithm to the real-time picture according to the real-time picture acquired by the shooting interface, so as to determine whether the real-time picture has the user face. In an example, the server may obtain an image in the indication frame, and determine a graphic outline of the image in the indication frame according to a pixel value difference of the image in the indication frame, so as to determine whether a complete human face exists in the indication frame; in another example, the server may also perform key point recognition of the face according to the image in the indication frame, and if a predetermined key point is detected, it indicates that a complete face exists in the indication frame, for example, the predetermined key point may include, but is not limited to, an eye key point, a nose key point, a lip key point, and the like. The person skilled in the art may use the above detection method, or may use an existing face detection method other than the above detection method, which is not limited in this application.
When the server detects that at least one complete face exists in the indication frame, at least one image to be recognized can be obtained according to the real-time picture obtained by the shooting interface. It should be understood that at least one of the above-mentioned elements may be one element, or may be any number greater than one element, such as two, three, etc.
In this embodiment, if at least one complete face is detected in the indication frame, it indicates that the face is located at the best shooting position, and the obtained image to be recognized not only includes the face, but also is located at the designated position, so that subsequent recognition is facilitated, and accuracy of the subsequent recognition is ensured. Meanwhile, the phenomenon that the shooting position of the face is excessively deviated can be prevented, and therefore generation of the target image is influenced.
Based on the embodiment shown in fig. 2, in an exemplary embodiment of the present application, the determining, according to the at least one image to be recognized, an expression value corresponding to the at least one image to be recognized includes:
and inputting the at least one image to be recognized into a pre-trained recognition model, and outputting an expression value corresponding to the at least one image to be recognized through the recognition model.
In this embodiment, a person skilled in the art may establish a recognition model based on a convolutional neural network, where the recognition model has a function of recognizing an expression of a face in an image and corresponds to an expression value corresponding to the face in an output image. Those skilled in the art may train the recognition model in advance by using training data (e.g., facial photos of users with different skin colors, different expressions, different sexes, and different ages, etc.), where the training data includes corresponding expression information, and the expression information may be an expression value calibrated manually. And adjusting parameters of the recognition model according to the expression value output by the recognition model and the manually calibrated expression information, so that the expression value output by the recognition model is matched with the manually calibrated expression information to ensure the recognition precision of the recognition model.
The server can call a recognition model which is trained in advance, the acquired image to be recognized is input into the recognition model, and the recognition model can correspondingly output the expression value corresponding to the image to be recognized. If the number of the images to be recognized is multiple (namely two images and any number greater than two images), the server can input the images to be recognized into the recognition model one by one according to the time sequence of the images to be recognized, so that the recognition model outputs the expression value corresponding to the images to be recognized, and the expression value is associated with the images to be recognized.
In an exemplary embodiment of the present application, a person skilled in the art can construct a recognition model based on the TensorFlow and train the recognition model. During training, the recognition model can acquire and store expression characteristic data corresponding to training data. When the server calls the recognition model, the recognition model can acquire expression feature data corresponding to the image to be recognized according to the image to be recognized, and compares the expression feature data with expression feature data of pre-stored training data, so that the expression value corresponding to the image to be recognized is determined according to the similarity between the expression feature data of the image to be recognized and the expression feature data of the pre-stored training data.
Based on the embodiment shown in fig. 2, fig. 3 shows a flowchart of step S230 in the image processing method of fig. 2 according to an embodiment of the present application. Referring to fig. 3, step S230 at least includes steps S310 to S320, which are described in detail as follows:
in step S310, according to the expression value, a threshold interval in which the expression value is located is determined.
In an exemplary embodiment of the application, one image to be recognized corresponds to one expression value, and according to a threshold interval where the expression value is located, an expression type corresponding to the expression value is determined. Those skilled in the art can preset a plurality of threshold intervals, wherein different threshold intervals correspond to different expression types, for example, the threshold interval [0,1) corresponds to smile, [1,3) corresponds to smile, [3,5] corresponds to smile, and the like. The server may compare the expression value corresponding to the image to be recognized with the preset boundary value of each threshold interval, so as to determine the threshold interval in which the expression value is located, that is, determine the expression type corresponding to the expression value.
In step S320, an image template corresponding to the threshold interval is selected from an image template library according to the threshold interval.
The image template library may be a database for storing image templates, and the image template library may store a plurality of image templates. The skilled person in the art can determine the expression type corresponding to each image template in advance, so that the corresponding image template can be obtained according to the expression type of the user in the following, and the adaptability between the image template and the expression state of the user is improved.
In an exemplary embodiment of the application, the server may determine an expression type corresponding to the expression value according to a threshold interval in which the expression value is located, and then select an image template corresponding to the expression type from the image template library according to the determined expression type. It should be noted that one expression type may correspond to one image template, or may correspond to a plurality of image templates. If one expression type corresponds to one image template, directly selecting the image template; if one expression type corresponds to a plurality of image templates, selection (e.g., random selection, sequential selection, etc.) may be performed from the plurality of image templates to determine the target image template.
Therefore, in the embodiment shown in fig. 3, by setting a single expression value and determining the corresponding image template according to the threshold interval where the expression value is located, not only can the calculation efficiency be improved, but also the selected image template can be ensured to be adapted to the expression state of the user, and the user experience is improved.
Based on the embodiments shown in fig. 2 and fig. 3, fig. 4 shows a flowchart of step S320 in the image processing method of fig. 3 according to an embodiment of the present application. Referring to fig. 4, step S320 at least includes steps S410 to S430, which are described in detail as follows:
in step S410, according to the threshold interval, at least one image template to be selected corresponding to the threshold interval is determined from the image template library.
In an exemplary embodiment of the application, an expression type may correspond to a plurality of image templates, and the server may determine, according to a threshold interval in which an expression value is located, an expression type corresponding to the expression value, and select, according to the determined expression type, a plurality of image templates corresponding to the expression type from the image template library as image templates to be selected.
In step S420, the at least one image template to be selected is displayed in the shooting interface.
In an exemplary embodiment of the application, if a plurality of image templates to be selected are determined according to expression types corresponding to expression values, the server may display the plurality of image templates to be selected in a shooting interface, for example, the image templates to be selected are arranged from left to right in the middle of the shooting interface, so that a user can select the image templates, and thus, the image templates of the user's mind are determined.
In step S430, in response to a selection instruction for the at least one to-be-chosen template, a target image template is determined.
In an exemplary embodiment of the application, the user can select the image template of the self-centering device from at least one image template to be selected displayed in the shooting interface. The user can select the corresponding image template through an input device (such as a touch screen, a mouse or an input keyboard) configured by the terminal device to generate a selection instruction and send the selection instruction to the server. It should be understood that the generation instruction may include identification information of the image template selected by the user, such as a template number or the like.
The server can determine the image template to be selected of the user heart apparatus as the target image template according to the received selection instruction. For example, three image templates to be selected are sequentially arranged from left to right in the middle of the shooting interface, the user can click the area corresponding to the image template to be selected in the shooting interface to determine the target image template, the user can also input the number of the corresponding image template to be selected by using the input keyboard to determine the target image template, and the like.
Therefore, in the embodiment shown in fig. 4, the server may select, according to the threshold interval in which the expression value is located, an image template to be selected corresponding to the threshold interval from the image template library, and display the image template to be selected in the shooting interface for the user to select, so as to determine the target image template. The user can select the cardioscope as the target image template from the image templates to be selected according to the preference of the user, so that the interactivity with the user is enhanced, and the user experience is improved.
Based on the embodiment shown in fig. 2, in an exemplary embodiment of the present application, the number of the at least one image to be recognized is greater than or equal to two;
the displaying the image template in the shooting interface includes:
and replacing the image template determined later with the image template determined earlier according to the time sequence corresponding to the at least one image to be recognized, and displaying the image template in the shooting interface.
In this embodiment, when the server acquires a plurality of images to be recognized (i.e., two or more images), the server may replace the image template determined earlier with the image template determined later according to the time sequence corresponding to the plurality of images to be recognized and the image template determined according to the images to be recognized, and display the image template in the shooting interface.
For example, the server acquires three images to be recognized according to a time sequence, namely an image a, an image B and an image C, the server sequentially recognizes the images according to the three images to be recognized, if the corresponding image template is determined to be the template a through recognition according to the image a, the template a is displayed in the shooting interface, then, if the template B is obtained through recognition according to the image B, the template a is stopped being displayed in the shooting interface, the template B is displayed … … in the shooting interface in a mode of replacing the template a, and the like, and the image template determined later replaces the image template determined earlier and is displayed in the shooting interface.
Therefore, only a single image template is displayed in the shooting interface, the single image template corresponds to the real-time expression state of the user, the adaptability between the image template and the real-time expression state of the user is improved, and the user experience is further improved.
It should be noted that, if the server needs to acquire a plurality of images to be recognized, the server may perform subsequent recognition according to the image to be recognized immediately after acquiring the first image to be recognized, without waiting for acquiring a sufficient number of images to be recognized. Therefore, the recognition efficiency of the image template can be improved, and meanwhile, the phenomenon that the image template is intensively displayed in a short time to influence the user experience can be avoided.
Based on the embodiment shown in fig. 2, in an exemplary embodiment of the present application, after generating a target image including the image template and the face according to the image template and a current real-time picture of the shooting interface, the method further includes:
and generating identification information corresponding to the target image according to the target image, wherein the identification information is a certificate for acquiring the target image.
The identification information may be a certificate for acquiring the target image, and the user may acquire the corresponding target image according to the identification information. It should be noted that the identification information may be information in various forms, for example, the identification information may be a graphic code, a digital code, or the like.
In this embodiment, the server may generate identification information corresponding to the target image according to the generated target image, and associate the identification information with the target image, so as to facilitate subsequent searching for a corresponding target image according to the identification information. In an example, the server may establish a correspondence table between the identification information and the target image, and correspond the identification information to the image number of the target image to ensure the accuracy of subsequent searching.
After the server generates the identification information, the identification information may be displayed in a shooting interface for the user to obtain. The identification information may be displayed, for example, in the lower left or lower right corner of the shooting interface, and so on.
Based on the above-described embodiments, fig. 5 shows a flowchart illustrating a print target image further included in the image processing method according to an embodiment of the present application. Referring to fig. 5, the identification information is a graphic code, and the printing target image at least includes steps S510 to S520, which are described in detail as follows:
in step S510, if a correlation request sent by scanning the graphic code is received, user information included in the correlation request is acquired.
The graphic code may include a two-dimensional code, a bar code, and the like. The user may scan the graphic code through a mobile terminal (e.g., one or more of a smart phone, a tablet computer, and a laptop computer), so as to obtain information of a corresponding target image.
The user information may be identity information associated with the user, which may include, but is not limited to, the user's social account number, phone number, and identification card number, among others.
In an exemplary embodiment of the present application, a user may scan identification information displayed in a photographing interface through a mobile terminal to generate an association request, which may be information for requesting association of user information with a target image. The mobile terminal may send the association request to the server, and it should be understood that the association request may include user information, so that the server may obtain the user information and associate the user information with the target image.
In step S520, the user information and the target image are associated, so as to perform a printing operation on the target image through the association.
In an exemplary embodiment of the present application, the server may obtain the user information from the received association request, and establish an association relationship between the obtained user information and the target image. Thus, the user can acquire the target image or perform a printing operation or the like on the target image through the association relationship.
In an exemplary embodiment of the present application, after the user scans the identification information through the mobile terminal, an applet page (e.g., a WeChat applet, etc.) may be pulled up in the social software. The user may complete the association of user information (e.g., social account numbers, etc.) with the target image in the applet page. For example, "whether to log in with a social account" may be displayed in the applet page, and when the user selects "yes," the server may complete the association between the user information and the target image. The user may then log into the applet to obtain the previously generated target image. The user may also click on a particular area (e.g., a "print photo" button, etc.) in the applet page to perform a print operation on the target image.
In the embodiment shown in fig. 5, a user generates a correlation request by scanning identification information and sends the correlation request to a server, and the server acquires user information and correlates the user information with a target image according to the received correlation request, so that the user can conveniently acquire the target image or perform a printing operation on the target image, the user can conveniently perform the operation, and meanwhile, the user can conveniently acquire the target image by correlating the target image with the user information, and the target image is prevented from being lost.
Based on the above-described embodiments, fig. 6 shows a flowchart illustrating a print target image further included in the image processing method according to another embodiment of the present application. Referring to fig. 6, the printing target image includes at least steps S610 to S620, which are described in detail as follows:
in step S610, if an image acquisition request including the identification information is received, a query is performed according to the identification information, and a target image corresponding to the identification information is determined.
The image acquisition request may be information for acquiring a target image.
In an exemplary embodiment of the present application, if the identification information is a numeric code or an alphabetic code, etc., such as 132546514 or sdgakbdjha, etc. The user can input the identification information in the display interface of the terminal device, so that an image acquisition request containing the identification information is generated and sent to the server. The server may obtain corresponding identification information according to the image obtaining request, and perform a query (for example, query a correspondence table between the identification information and the target image, etc.) according to the identification information, thereby determining the target image corresponding to the identification information.
If the identification information is a graphic code, the user can photograph the identification information through the mobile terminal, and the photographed graphic code is placed at a scanning position of a code scanner configured by the terminal device, and after the code scanner scans the graphic code, an image acquisition request containing the identification information can be correspondingly generated.
Therefore, even if the network state of the mobile terminal is not good, the user can generate the image acquisition request in a mode of shooting or inputting the identification information, so that the corresponding target image is acquired, and the user experience is improved.
In step S620, in response to a print request for the target image, a print operation is performed on the target image.
In an exemplary embodiment of the application, after determining the target image according to the identification information, the server may display the target image in a display interface of the terminal device. If the target image is an image that the user wants to print, the user can click a specific area in the display interface, such as a "print photo" button, to generate a print request for the target image and send the print request to the server. The server may then pull up the print function to print the target image in response to the print request.
In an example, after the server generates the target image, the server may detect a network state of the terminal device, and if the network state of the terminal device is not good, the terminal device may store the target image locally for the user to obtain or print. When the network is recovered, the target image can be synchronized to the server, so that the user can acquire the target image through the small program page.
Based on the embodiment shown in fig. 2, fig. 7 shows a flowchart of step S210 in the image processing method of fig. 2 according to an embodiment of the present application. Referring to fig. 7, step S210 at least includes steps S710 to S730, which are described in detail as follows:
in step S710, according to the real-time picture including the face acquired in the shooting interface, video stream data corresponding to the real-time picture is acquired.
In an exemplary embodiment of the application, the terminal device may generate corresponding video stream data according to the real-time picture acquired by the shooting interface and transmit the video stream data to the server. The server may then receive and parse the video stream data to restore the corresponding real-time pictures. In an example, a video data transmission channel may be established between the terminal device and the server, and the terminal device may transmit video stream data corresponding to the real-time picture to the server in real time, so as to improve subsequent identification efficiency of the server.
In step S720, according to the video stream data, a drawing tool is used to draw the video stream data, so as to obtain an image frame set corresponding to the real-time picture, where the image frame set includes at least one image frame.
In an exemplary embodiment of the present application, the server may parse the received video stream data and draw the video stream data by using a drawing tool (e.g., a Canvas drawing tool, etc.) to obtain an image frame corresponding to the video stream data, and sort the image frames in a time sequence, so as to obtain an image frame set corresponding to the real-time image.
In an example, when a drawing tool is used for drawing video stream data, display parameters of a background area in a real-time picture can be adjusted to achieve a display effect similar to a 'green screen', so that a face of a user is highlighted, and accuracy of subsequent recognition is improved.
In step S730, at least one image to be recognized is determined based on the image frames included in the image frame set.
In an exemplary embodiment of the application, after one image frame is drawn, the server may determine the image frame as an image to be recognized for subsequent recognition, so that an image template determined according to the image to be recognized may correspond to a real-time expression state of the user.
In another exemplary embodiment of the present application, the server may select one image frame as the image to be recognized at predetermined intervals, for example, two image frames may be selected at the predetermined intervals, and then the first image frame, the fourth image frame, the seventh image frame, and the like may be selected as the image to be recognized, so that the computing resources may be saved, and the computing pressure of the server may be relieved.
Therefore, in the embodiment shown in fig. 7, by using the drawing tool to draw the real-time picture acquired in the shooting interface, the definition of the drawn image frame can be ensured, so as to improve the accuracy of the subsequent recognition. Meanwhile, a person skilled in the art can adopt a preset selection strategy of the image to be identified, the calculation performance and the calculation efficiency of the server are considered, the interactivity is guaranteed, and the user experience is improved.
Based on the embodiment shown in fig. 2, in an exemplary embodiment of the present application, before acquiring at least one image to be recognized according to a real-time picture including a human face acquired in a shooting interface, the method further includes:
and responding to a generation instruction for a target image, and displaying the shooting interface in a target webpage.
In the embodiment, the image processing method can be applied to a webpage interface without specially downloading a corresponding application program, so that the storage space of the terminal equipment is saved, and the application range of the image processing method is expanded.
The user may click on a specific area (e.g., a "picture generation" button, etc.) on the display interface of the terminal device to generate a generation instruction for the target image. When the server receives the generation instruction, the server may send an address link of the target webpage to the terminal device and instruct the terminal device to access the target webpage. When the terminal device accesses the target webpage, the shooting interface can be pulled up, and the image acquisition function of the terminal device can be opened at the same time, so that the real-time picture of the user is displayed in the shooting interface.
Based on the technical solution of the above embodiment, a specific application scenario of the embodiment of the present application is introduced as follows:
referring to fig. 8, fig. 8 is a flow chart illustrating a method for processing an image according to an embodiment of the present application (hereinafter, a smiley face machine is taken as an example for description). Referring to fig. 8, the image processing method at least includes steps S810 to S870, which are described in detail as follows:
in step S810, a smiley face welcome top page is displayed.
The smiling face machine may be a terminal device that is set in a public place (e.g., a mall, a supermarket, or a street) and is used for generating personalized pictures. The user can generate a personalized photo containing the face of the user through the smiling face machine, so that the interest of the photo is enhanced. The smiley welcome homepage may include instructions for the use of the smiley for the user to read and know the method of use of the smiley.
In step S820, the video rendering web page is displayed.
In this embodiment, the user may click on a particular area in the display interface of the smiley face machine, thereby pulling up the video rendering web page (i.e., the capture interface). For example, the user may click on the "take a picture" button on the smiley machine welcome homepage to pull up the video rendering web page. When the smiley face machine displays the video rendering web page, the camera of the smiley face machine can be started at the same time to obtain the real-time picture of the user and display the real-time picture in the video rendering web page.
In step S830, a human face smiling face is identified.
In this embodiment, the smiling face machine may identify the real-time expression state of the user according to the acquired real-time image, so as to determine an expression type corresponding to the real-time expression state of the user.
In step S840, the image template is displayed.
In this embodiment, the smiley face machine may select an image template corresponding to the expression type according to the determined expression type, and display the image template in a video rendering web page for viewing by a user. If the user likes the image template, the expression state of the user can be kept until the photographing is finished, and if the user does not like the image template, the expression state of the user can be adjusted to be matched with other image templates again.
In step S850, a personalized smiley face photograph is generated and displayed.
In this embodiment, according to the image template determined when the photographing is finished, the smiling face machine may render the picture of the web page when the photographing is finished and the image template according to the video, generate a personalized smiling face template photo, and display the personalized smiling face photo in a display interface of the smiling face machine for the user to view.
After the personalized smiling face photo is generated, the smiling face machine can also generate corresponding identification information according to the generated personalized smiling face photo, so that a user can establish an association relationship between the user information of the user and the personalized smiling face photo according to the identification information, and the user can print the personalized photo through the association relationship.
In addition, if the user is not satisfied with the currently generated personalized photo, the're-photographing' button can be clicked to re-display the video rendering web page and re-acquire the expression state of the user for recognition.
In step S860, the print photograph is selected.
In this embodiment, the user may select the generated personalized smiley face photograph for printing. To be noted. In the using process of the user, only one personalized smiling face photo can be generated, and a plurality of personalized smiling face photos can also be generated. The user can select one or more personalized photos from the generated personalized smiley face photos to print.
In step S870, a print photo interface is displayed.
In this embodiment, the smiley face machine may print the personalized smiley face photo selected by the user while displaying the print photo interface. The printed photo interface may include printed progress information for viewing by a user to enhance the interactivity of the smiley face machine. When the current user finishes using, the smiling face machine can welcome the first page again to wait for the next use.
In the embodiment shown in fig. 8, the smiling face machine may match and display the corresponding image template according to the real-time expression state of the user, and then generate an individualized smiling face photo according to the determined image template and the face of the user, so that the adaptability between the image template and the real-time expression state of the user is improved, and the user experience is also improved.
Fig. 9 illustrates a terminal interface diagram of a processing method of an image applicable to an embodiment of the present application.
Referring to fig. 9, fig. 9 is a schematic view of a shooting interface of a smiling face machine. The shooting interface may include an indication frame 910 for indicating a shooting area of a human face, and when a user shoots, the user may position the face according to the adjustment in the indication frame 910 to obtain better shooting and recognition effects.
After the smiling face machine determines the corresponding image template according to the real-time expression state of the user, the image template may be displayed in a shooting interface, for example, 920 shown in fig. 9, so that the user can know the matched image template. If the user does not like the current image template, the expression state of the user can be adjusted to match with the new image template. If a new image template is matched, the smiling face machine can replace the image template determined later with the image template determined earlier and display the image template at the corresponding display position in the shooting interface so that the user can view the newly matched image template.
In addition, a shooting countdown (shown as 930 in fig. 9) can be displayed in the shooting interface, and the user can know the remaining shooting time through the shooting countdown, so that the expression state of the user can be adjusted in time, a better shooting effect is achieved, and the interactivity is enhanced.
Embodiments of the apparatus of the present application are described below, which may be used to perform the image processing method in the above-described embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the image processing method described above in the present application.
Fig. 10 shows a block diagram of an apparatus for processing an image according to an embodiment of the present application.
Referring to fig. 10, an image processing apparatus according to an embodiment of the present application includes:
the acquiring module 1010 is configured to acquire at least one image to be recognized according to a real-time picture including a human face acquired in a shooting interface;
a first determining module 1020, configured to determine, according to the at least one image to be recognized, an expression value corresponding to the at least one image to be recognized, where the expression value is used to describe a matching degree between the face and multiple expressions;
a second determining module 1030, configured to determine, according to the expression value, an image template corresponding to the at least one image to be recognized;
the display module 1040 is configured to display the image template in the shooting interface;
and the processing module 1050 is configured to generate a target image including the image template and the face according to the image template and the current real-time picture of the shooting interface.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 1010 is further configured to: and responding to a generation instruction aiming at the target image, and displaying the shooting interface, wherein the shooting interface contains prompt information used for indicating a shooting area of the human face.
In some embodiments of the present application, based on the foregoing solution, the prompt information is an indication frame located at a predetermined position in the shooting interface; the acquisition module 1010 is configured to: and if at least one complete face is detected in the indication frame, acquiring at least one image to be identified according to the real-time picture acquired in the shooting interface.
In some embodiments of the present application, based on the foregoing, the first determining module 1020 is configured to: and inputting the at least one image to be recognized into a pre-trained recognition model, and outputting an expression value corresponding to the at least one image to be recognized through the recognition model.
In some embodiments of the present application, based on the foregoing, the second determining module 1030 is configured to: determining a threshold interval where the expression value is located according to the expression value; and selecting an image template corresponding to the threshold interval from an image template library according to the threshold interval.
In some embodiments of the present application, based on the foregoing, the second determining module 1030 is configured to: determining at least one image template to be selected corresponding to the threshold interval from the image template library according to the threshold interval; displaying the at least one template to be selected in the shooting interface; and determining a target image template in response to a selection instruction for the at least one template to be selected.
In some embodiments of the present application, based on the foregoing scheme, the number of the at least one image to be recognized is greater than or equal to two; the display module 1040 is configured to: and replacing the image template determined later with the image template determined earlier according to the time sequence corresponding to the at least one image to be recognized, and displaying the image template in the shooting interface.
In some embodiments of the present application, based on the foregoing solution, the processing module 1050 is further configured to: and generating identification information corresponding to the target image according to the target image, wherein the identification information is a certificate for acquiring the target image.
In some embodiments of the present application, based on the foregoing scheme, the identification information is a graphic code; the processing module 1050 is further configured to: if receiving a correlation request sent by scanning the graphic code, acquiring user information contained in the correlation request; and establishing an association relationship between the user information and the target image so as to execute printing operation on the target image through the association relationship.
In some embodiments of the present application, based on the foregoing solution, the processing module 1050 is further configured to: if an image acquisition request containing the identification information is received, inquiring according to the identification information, and determining a target image corresponding to the identification information; in response to a print request for the target image, a print operation is performed on the target image.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 1010 is configured to: acquiring video stream data corresponding to a real-time picture according to the real-time picture containing the face acquired in a shooting interface; according to the video stream data, drawing the video stream data by adopting a drawing tool to obtain an image frame set corresponding to the real-time picture, wherein the image frame set comprises at least one image frame; and determining at least one image to be identified based on the image frames contained in the image frame set.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 1010 is further configured to: and responding to a generation instruction for a target image, and displaying the shooting interface in a target webpage.
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system of the electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 11, the computer system includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An Input/Output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output section 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. When the computer program is executed by a Central Processing Unit (CPU)1101, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention 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 invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method of processing an image, comprising:
acquiring at least one image to be recognized according to a real-time picture containing a human face acquired in a shooting interface;
determining an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, wherein the expression value is used for describing the matching degree between the human face and various expressions;
determining an image template corresponding to the at least one image to be recognized according to the expression value;
displaying the image template in the shooting interface;
and generating a target image comprising the image template and the human face according to the image template and the real-time picture of the shooting interface.
2. The method according to claim 1, wherein before the obtaining at least one image to be recognized according to the real-time picture containing the human face obtained in the shooting interface, the method further comprises:
and responding to a generation instruction aiming at the target image, and displaying the shooting interface, wherein the shooting interface contains prompt information used for indicating a shooting area of the human face.
3. The method of claim 2, wherein the prompt message is an indication box located at a predetermined position in the shooting interface;
the method for acquiring at least one image to be recognized according to the real-time picture containing the face acquired in the shooting interface comprises the following steps:
and if at least one complete face is detected in the indication frame, acquiring at least one image to be identified according to the real-time picture acquired in the shooting interface.
4. The method according to claim 1, wherein the determining, according to the at least one image to be recognized, an expression value corresponding to the at least one image to be recognized comprises:
and inputting the at least one image to be recognized into a pre-trained recognition model, and outputting an expression value corresponding to the at least one image to be recognized through the recognition model.
5. The method of claim 1, wherein determining an image template corresponding to the at least one image to be recognized according to the expression value comprises:
determining a threshold interval where the expression value is located according to the expression value;
and selecting an image template corresponding to the threshold interval from an image template library according to the threshold interval.
6. The method of claim 5, wherein selecting the image template corresponding to the threshold interval from an image template library according to the threshold interval comprises:
determining at least one image template to be selected corresponding to the threshold interval from the image template library according to the threshold interval;
displaying the at least one image template to be selected in the shooting interface;
and determining a target image template in response to a selection instruction for the at least one image template to be selected.
7. The method according to claim 1, characterized in that the number of the at least one image to be recognized is greater than or equal to two;
the displaying the image template in the shooting interface includes:
and replacing the image template determined later with the image template determined earlier according to the time sequence corresponding to the at least one image to be recognized, and displaying the image template in the shooting interface.
8. The method according to claim 1, wherein after generating the target image including the image template and the human face according to the image template and the current real-time picture of the shooting interface, the method further comprises:
and generating identification information corresponding to the target image according to the target image, wherein the identification information is a certificate for acquiring the target image.
9. The method of claim 8, wherein the identification information is a graphic code;
after generating the identification information corresponding to the target image according to the target image, the method further includes:
if receiving a correlation request sent by scanning the graphic code, acquiring user information contained in the correlation request;
and establishing an association relationship between the user information and the target image so as to execute printing operation on the target image through the association relationship.
10. The method according to claim 8, after generating the identification information corresponding to the target image according to the target image, further comprising:
if an image acquisition request containing the identification information is received, inquiring according to the identification information, and determining a target image corresponding to the identification information;
in response to a print request for the target image, a print operation is performed on the target image.
11. The method according to claim 1, wherein the acquiring at least one image to be recognized according to the real-time picture including the face acquired in the shooting interface comprises:
acquiring video stream data corresponding to a real-time picture according to the real-time picture containing the face acquired in a shooting interface;
according to the video stream data, drawing the video stream data by adopting a drawing tool to obtain an image frame set corresponding to the real-time picture, wherein the image frame set comprises at least one image frame;
and determining at least one image to be identified based on the image frames contained in the image frame set.
12. The method according to claim 1, wherein before the obtaining at least one image to be recognized according to the real-time picture containing the human face obtained in the shooting interface, the method further comprises:
and responding to a generation instruction for a target image, and displaying the shooting interface in a target webpage.
13. An apparatus for processing an image, comprising:
the acquisition module is used for acquiring at least one image to be recognized according to the real-time picture containing the face acquired in the shooting interface;
the first determining module is used for determining an expression value corresponding to the at least one image to be recognized according to the at least one image to be recognized, wherein the expression value is used for describing the matching degree between the face and various expressions;
the second determining module is used for determining an image template corresponding to the at least one image to be recognized according to the expression value;
the display module is used for displaying the image template in the shooting interface;
and the processing module is used for generating a target image containing the image template and the human face according to the image template and the current real-time picture of the shooting interface.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out a method of processing an image according to any one of claims 1 to 12.
15. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out a method of processing an image according to any one of claims 1 to 12.
CN202110077153.6A 2021-01-20 2021-01-20 Image processing method and device, computer readable medium and electronic equipment Active CN112866577B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110077153.6A CN112866577B (en) 2021-01-20 2021-01-20 Image processing method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110077153.6A CN112866577B (en) 2021-01-20 2021-01-20 Image processing method and device, computer readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112866577A true CN112866577A (en) 2021-05-28
CN112866577B CN112866577B (en) 2022-05-27

Family

ID=76007887

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110077153.6A Active CN112866577B (en) 2021-01-20 2021-01-20 Image processing method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112866577B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023005200A1 (en) * 2021-07-29 2023-02-02 华为技术有限公司 Image generation method, apparatus and system, and computer-readable storage medium
CN115690130A (en) * 2022-12-30 2023-02-03 杭州咏柳科技有限公司 Image processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030091306A (en) * 2002-05-27 2003-12-03 이채헌 The dynamic character and image character making system and the method using face components relationship on face image.
CN108022206A (en) * 2017-11-30 2018-05-11 广东欧珀移动通信有限公司 Image processing method, device, electronic equipment and computer-readable recording medium
CN108509941A (en) * 2018-04-20 2018-09-07 北京京东金融科技控股有限公司 Emotional information generation method and device
CN110213458A (en) * 2019-05-31 2019-09-06 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium
CN111339420A (en) * 2020-02-28 2020-06-26 北京市商汤科技开发有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111507139A (en) * 2019-01-31 2020-08-07 北京字节跳动网络技术有限公司 Image effect generation method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030091306A (en) * 2002-05-27 2003-12-03 이채헌 The dynamic character and image character making system and the method using face components relationship on face image.
CN108022206A (en) * 2017-11-30 2018-05-11 广东欧珀移动通信有限公司 Image processing method, device, electronic equipment and computer-readable recording medium
CN108509941A (en) * 2018-04-20 2018-09-07 北京京东金融科技控股有限公司 Emotional information generation method and device
CN111507139A (en) * 2019-01-31 2020-08-07 北京字节跳动网络技术有限公司 Image effect generation method and device and electronic equipment
CN110213458A (en) * 2019-05-31 2019-09-06 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium
CN111339420A (en) * 2020-02-28 2020-06-26 北京市商汤科技开发有限公司 Image processing method, image processing device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023005200A1 (en) * 2021-07-29 2023-02-02 华为技术有限公司 Image generation method, apparatus and system, and computer-readable storage medium
CN115690130A (en) * 2022-12-30 2023-02-03 杭州咏柳科技有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN112866577B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
US20210227152A1 (en) Method and apparatus for generating image
US11386933B2 (en) Image information processing method and apparatus, and storage medium
CN104618803B (en) Information-pushing method, device, terminal and server
CN111277849B (en) Image processing method and device, computer equipment and storage medium
US11670015B2 (en) Method and apparatus for generating video
US8908987B1 (en) Providing image candidates based on diverse adjustments to an image
CN109992237B (en) Intelligent voice equipment control method and device, computer equipment and storage medium
CN112866577B (en) Image processing method and device, computer readable medium and electronic equipment
CN111241340A (en) Video tag determination method, device, terminal and storage medium
CN111429338B (en) Method, apparatus, device and computer readable storage medium for processing video
CN110740389A (en) Video positioning method and device, computer readable medium and electronic equipment
CN109274999A (en) A kind of video playing control method, device, equipment and medium
CN110648170A (en) Article recommendation method and related device
CN112785669B (en) Virtual image synthesis method, device, equipment and storage medium
CN113031813A (en) Instruction information acquisition method and device, readable storage medium and electronic equipment
KR102058190B1 (en) Apparatus for providing character service in character service system
CN111405371A (en) Data processing method and related device
CN113875227A (en) Information processing apparatus, information processing method, and program
CN112235516B (en) Video generation method, device, server and storage medium
CN115526772A (en) Video processing method, device, equipment and storage medium
CN111461005B (en) Gesture recognition method and device, computer equipment and storage medium
CN113596597A (en) Game video acceleration method and device, computer equipment and storage medium
CN113705154A (en) Video-based content interaction method and device, computer equipment and storage medium
CN111010526A (en) Interaction method and device in video communication
CN114584824A (en) Data processing method and system, electronic equipment, server and client equipment

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043872

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant