WO2018219120A1 - Image display method, image processing method and device, terminal and server - Google Patents

Image display method, image processing method and device, terminal and server Download PDF

Info

Publication number
WO2018219120A1
WO2018219120A1 PCT/CN2018/086377 CN2018086377W WO2018219120A1 WO 2018219120 A1 WO2018219120 A1 WO 2018219120A1 CN 2018086377 W CN2018086377 W CN 2018086377W WO 2018219120 A1 WO2018219120 A1 WO 2018219120A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
model
image processing
terminal
target
Prior art date
Application number
PCT/CN2018/086377
Other languages
French (fr)
Chinese (zh)
Inventor
梁宇轩
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018219120A1 publication Critical patent/WO2018219120A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • G06T3/04

Definitions

  • the embodiments of the present invention relate to the field of image processing, and in particular, to an image display method, an image processing method device, a terminal, and a server.
  • image processing technology continues to mature, more and more image processing applications have emerged. While the user is taking a photo or video, the image processing application can be used to visualize the captured image in real time.
  • Beauty Camera app After the user selects the beauty function of the beauty camera application, the beauty camera application performs real-time beauty treatment on the characters in the shooting screen, for example, whitening the eyes, magnifying the eyes, etc. To achieve a beauty effect.
  • the beauty camera application provides different beauty schemes for users to select and use in the form of pictures or texts.
  • the actual beauty effects cannot be accurately reflected by pictures or texts.
  • the picture or text cannot accurately reflect the actual beauty effect.
  • the embodiment of the present application provides an image display method, an image processing method, a device, a terminal, and a server, which can solve the problem that the actual effect of the image processing cannot be accurately reflected by the picture or the text.
  • the technical solution is as follows:
  • an image display method comprising:
  • the AR model data is sent when the original image includes the target face, the AR model data is used to render at least one AR model, and the AR model is used to display the image processing effect;
  • the second image data sent by the server is received and rendered and displayed, and the second image data is image data of the original image after image processing.
  • an image processing method comprising:
  • the AR model data is sent to the terminal, and the terminal is configured to render and display at least one AR model according to the AR model data, and the AR model is used to display the image processing effect;
  • the second image data is image data of the original image after image processing
  • the terminal is configured to render and display the second image data
  • an image display apparatus comprising:
  • An uploading module configured to upload a target face image of the target face to the server
  • a first sending module configured to send, to the server, first image data corresponding to the original image
  • a first receiving module configured to receive AR model data sent by the server, where the AR model data is sent when the original image includes the target human face, the AR model data is used to render at least one AR model, and the AR model is used to display the image processing effect;
  • a first display module configured to render and display an AR model according to the AR model data
  • a second sending module configured to send a selection signal to the target AR model to the server, where the server is configured to perform image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model;
  • the second display module is configured to receive second image data sent by the server and perform rendering display, where the second image data is image data of the original image after image processing.
  • an image processing apparatus comprising:
  • a fourth receiving module configured to receive a target face image of the target face uploaded by the terminal
  • a second receiving module configured to receive first image data corresponding to the original image sent by the terminal
  • a third sending module configured to: when the original image includes the target human face, send the AR model data to the terminal, where the terminal is configured to render and display at least one AR model according to the AR model data, where the AR model is used to display the image processing effect;
  • a third receiving module configured to receive a selection signal sent by the terminal to the target AR model
  • a processing module configured to perform image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model
  • a fourth sending module configured to send second image data to the terminal, where the second image data is image data of the original image after the image processing, and the terminal is configured to perform rendering and displaying the second image data.
  • a terminal comprising a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor to implement as the first The image display method described in the aspect.
  • a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement an image as described in the first aspect Display method.
  • a server comprising a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor to implement a second The image processing method described in the aspect.
  • a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement an image as described in the second aspect Approach.
  • the terminal renders and displays the corresponding AR model according to the AR model data sent by the server, and feeds back the target AR model selected by the user to the server, so that the server responds to the original image according to the image processing effect displayed by the target AR model.
  • Image processing, and the image processed data is fed back to the terminal for rendering and display by the terminal; compared with the image processing effect using image or text, the image processing effect is more intuitive and accurate by using the AR model, which is beneficial to improving the user's selection image.
  • image processing is performed only on the target face in the original image, thereby achieving the effect of directional beauty.
  • FIG. 1 is a schematic diagram showing an implementation environment provided by an embodiment of the present application
  • FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of an image processing method provided by another embodiment of the present application.
  • FIG. 4 is a schematic diagram of an implementation of face recognition and image processing by a web server using dual threads
  • FIG. 5 is a flowchart of a process of determining a candidate AR model involved in the image processing method shown in FIG. 4;
  • 6A and 6B are schematic diagrams showing an interface of a terminal to display an AR model
  • FIG. 7 is a block diagram showing the structure of an image display apparatus according to an embodiment of the present application.
  • FIG. 8 is a block diagram showing the structure of an image processing apparatus according to an embodiment of the present application.
  • FIG. 9 is a structural block diagram of a server provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • Multiple as referred to herein means two or more. "and/or”, describing the association relationship of the associated objects, indicating that there may be three relationships, for example, A and/or B, which may indicate that there are three cases where A exists separately, A and B exist at the same time, and B exists separately.
  • the character "/" generally indicates that the contextual object is an "or" relationship.
  • AR Augmented Reality Technology is a technology that integrates real world information with virtual world information.
  • the built virtual model can be displayed in the real image, and the user can interact with the virtual model.
  • the user can select the virtual model by gesture or perform corresponding operations on the virtual model (such as grabbing, placing, etc. ).
  • the terminal displays the image processing effect in the form of an AR model in the displayed original image according to the AR model data sent by the web server, and further acquires the AR model selected by the user, wherein the AR model is a three-dimensional human body. Face model.
  • Web Graphics Library A three-dimensional (3-dimension, 3D) drawing standard that allows Java scripts (JavaScript) to be combined with OpenGL for Embedded Systems (OpenGL ES 2.0). Together. By adding a JavaScript binding to OpenGL ES 2.0, webGL can provide hardware 3D accelerated rendering for HyperText Markup Language 5 (HTML5) web pages, using a graphics processing unit (GPU) on the web page. Render and display 3D scenes and models in the browser.
  • HTML5 HyperText Markup Language 5
  • Vertex Shader Program code used to render vertices of 3D model shapes.
  • the vertex shader is used to render the vertex of each shape in the AR model, thereby drawing the shape contour of the AR model.
  • Fragment Shader Program code used to render the surface color and/or surface texture of a 3D model.
  • the vertex shader is used to render the shape vertex of the AR model
  • the color and texture of the AR model are rendered using the fragment shader.
  • the image display and image processing method provided by the embodiments of the present application can be used for a local photo/video beautification scene, or a video call scene, or a photo shooting/video recording scene. Of course, it can be applied to other scenarios that need to beautify the face. This embodiment of the present application does not limit this.
  • the image processing application usually displays the beauty effect in the form of text or pictures, and the display effect is not intuitive, and the actual beauty effect cannot be accurately expressed.
  • the image processing application uses the AR model to display different beauty effects, so that the beauty effect is achieved.
  • the display is more intuitive and accurate; at the same time, the image processing application can specifically target the face specified in the photo or video to achieve the effect of directed beauty.
  • the video call application When a user uses a video call application (or web page) to make a video call with another person, they can make a beauty of their face through the beauty function provided by the application.
  • the video call application usually displays the beauty effect in text form. This display method is not intuitive and accurate, and the user frequently switches between different beauty effects during the video call.
  • the video call application displays different beauty effects in the form of an AR model, so that the user can quickly and accurately select the appropriate beauty mode. Avoid frequent user switching.
  • the video data after the beauty is transmitted to the terminal of the video call dual-issue, so that the terminal performs rendering display.
  • the corresponding beauty effect can be selected to make a beauty of the face in the screen.
  • the beauty effect is displayed in the form of text or pictures, and the display effect is not intuitive, which is not conducive to the user to quickly select the appropriate beauty effect.
  • the server feeds back the AR model data to the terminal, so that the terminal renders and displays the AR model according to the AR model data, thereby viewing different beauty effects through the displayed AR model, and
  • the face in the image is beautifully decorated according to the beauty mode selected by the user.
  • the framing picture includes a plurality of faces, it is possible to perform beauty on the target face.
  • the image processing is performed by the terminal independently.
  • the image processing is completed by the terminal and the server.
  • the terminal is responsible for image acquisition, image processing mode selection and image processing after the image is processed
  • the server is responsible for providing different image processing methods and processing the image.
  • FIG. 1 shows a schematic diagram of an implementation environment provided by an embodiment of the present application, where the implementation environment includes a terminal 110 and a server 120 .
  • the terminal 110 is an electronic device having an image capturing function.
  • the electronic device is a smart phone, a tablet brain, a personal portable computer, and the like.
  • a web browser or an image processing application supporting web real-time communication (webRTC) and webGL technology is installed and run in the terminal 110.
  • webRTC technology enables users to use a web browser for real-time audio and video conversations or recordings; with webGL technology, when a complex 3D model or scene needs to be displayed on a web page, the web browser can call the terminal.
  • the GPU in 110 performs 3D rendering.
  • the terminal 110 and the server 120 are connected by a wired or wireless network.
  • the server 120 is a server cluster or a cloud computing center composed of one server and several servers.
  • the server 120 is a background server of the image processing application; in another possible implementation, the server 120 is a web server corresponding to the image processing webpage, and is used to receive the webpage through the image processing. The image is processed image.
  • the terminal 110 collects the original image through the image capturing component, and sends the original image to the web corresponding to the image processing webpage by using webRTC technology.
  • the server 120 performs corresponding image processing on the original image by the web server 120, and then returns the image processed original image to the terminal 110 by using the webRTC technology, and the terminal 110 performs real-time display.
  • the server 120 is further configured to provide different image processing modes for the user to select and use.
  • an AR model database 121 is built in the server 120, and the AR model database 121 stores an AR model for displaying different image processing effects.
  • the AR model is a 3D face model for displaying changes in the face before and after image processing in an animated form.
  • the server after receiving the original image sent by the terminal 110, the server selects several AR models from the AR model database 121 and feeds back to the terminal 110, and the terminal 110 renders and displays several AR models, so that The user selects the corresponding image processing mode according to the image processing effect displayed by the AR model.
  • the server 120 is further configured to provide image processing for a face image of a specific user.
  • a server face image database 122 is configured in the server 120, and the face image database 122 stores a face image uploaded by the terminal.
  • the server 120 after receiving the original image sent by the terminal 110, the server 120 acquires the face image of the target user corresponding to the target 110 from the face image database 122, and recognizes that the original image contains multiple faces. At this time, the server 120 performs image processing only on the face image of the target user in the original image.
  • the wireless or wired network described above uses standard communication techniques and/or protocols.
  • the network is usually the Internet, but can also be any network, including but not limited to a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, a wired or a wireless. Any combination of networks, private networks, or virtual private networks).
  • data exchanged over a network is represented using techniques and/or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), and the like.
  • SSL Secure Socket Layer
  • TLS Transport Layer Security
  • VPN Virtual Private Network
  • IPsec Internet Protocol Security
  • Regular encryption techniques are used to encrypt all or some of the links.
  • the above described data communication techniques may also be replaced or supplemented using custom and/or dedicated data communication techniques.
  • FIG. 2 is a flowchart of an image processing method according to an embodiment of the present application.
  • the image processing method is used in the implementation environment shown in FIG. 1 as an example.
  • the method includes:
  • Step 201 The terminal uploads a target face image of the target face to the server.
  • the target uploading image corresponding to the target face of the terminal is uploaded to the terminal by the HyperText Transfer Protocol (HTTP) post uploading method.
  • HTTP HyperText Transfer Protocol
  • the terminal encrypts the target face image by using a preset encryption algorithm, and then uploads the encrypted target face image to the server.
  • the preset encryption algorithm is an RSA (Rivest-Shamir-Adleman) algorithm, a Message Digest Algorithm 5 (MD5) algorithm, or a Data Encryption Standard (DES) algorithm.
  • Step 202 The server receives the target face image of the target face uploaded by the terminal.
  • the server receives the target face image uploaded by the terminal, and stores the target face image in association with the terminal, so as to be called when the face recognition is performed subsequently.
  • the server 120 stores the received target face image in the face image database 122.
  • the terminal uploads multiple target face images, and correspondingly, the server stores multiple target face images corresponding to the same terminal.
  • At least two target face images are stored in the terminal, and different target face images correspond to target faces of different users.
  • Step 203 The terminal sends the first image data corresponding to the original image to the server.
  • the server is a web server corresponding to the image processing webpage
  • the terminal accesses the image processing webpage through the web browser and performs video recording
  • the web browser invokes the image capturing component of the terminal (such as a camera).
  • the original image is collected, and the original image is encoded by using a video image coding technology (such as x264 encoding technology) to obtain the first image data, and then the first image data is transmitted to the web server by using webRTC technology.
  • a video image coding technology such as x264 encoding technology
  • the image processing webpage and the web browser support webGL technology.
  • Step 204 The server receives first image data of an original image sent by the terminal.
  • Step 205 When the target face is included in the original image, the server sends the AR model data to the terminal.
  • the server after receiving the first image data, the server provides the AR model data to the terminal for at least one display by the terminal. An AR model showing the effect of image processing.
  • an AR model database is built in the server, and the AR model database stores data corresponding to different AR models.
  • the AR model data is defined using OpenGL and includes vertex shaders and fragment shaders.
  • the terminal when detecting that the original image includes the target face corresponding to the terminal, the terminal sends the AR model data to the terminal; when the original image does not include the target face, the server does not send the terminal to the terminal. Send AR model data.
  • the server restores the original image by using a video image decoding technology, and then identifies the face feature of the face in the original image by using image recognition technology, and from the AR model database.
  • the target AR model matching the facial feature is searched, and the AR model data of the target AR model is sent to the terminal for rendering and display by the terminal. Since the AR model displayed by the terminal is highly similar to the user's face, the image processing effect (beauty effect) displayed by the AR model is more realistic.
  • Step 206 The terminal receives the AR model data sent by the server.
  • Step 207 The terminal renders and displays at least one AR model according to the AR model data, and the AR model is used to display an image processing effect.
  • the web browser invokes the terminal according to the AR model data.
  • the GPU performs AR model rendering, which improves the rendering speed of the AR model, while eliminating the need to develop additional web rendering plugins.
  • the terminal displays the AR model rendered by the GPU in a web browser, so that the user can intuitively understand the actual effect of different image processing modes through the AR model, and facilitate the user to directly select the image processing mode desired by the user.
  • Step 208 The terminal sends a selection signal to the target AR model to the server.
  • the terminal after the terminal displays the AR model on the screen, the terminal receives a touch selection signal of the target AR model, where the touch selection signal is triggered when the user touches the display area where the target AR model is located.
  • the server determines, by using the AR identification technology, that the user is selected through the interaction action.
  • the target AR model when the user performs real-time interaction with the virtual AR model by performing a predetermined interaction action, after the terminal sends the interactive image including the interaction action to the server, the server determines, by using the AR identification technology, that the user is selected through the interaction action.
  • the target AR model when the user performs real-time interaction with the virtual AR model by performing a predetermined interaction action, after the terminal sends the interactive image including the interaction action to the server, the server determines, by using the AR identification technology, that the user is selected through the interaction action.
  • the target AR model when the user performs real-time interaction with the virtual AR model by performing a predetermined interaction action, after the terminal sends the interactive image including the interaction action to the server, the server determines, by using the AR identification technology, that the user is selected through the interaction action. The target AR model.
  • the web server determines the first spatial coordinate of the user's finger in the real three-dimensional space according to the interactive image sent by the terminal, and compares the coordinate position relationship between the first spatial coordinate and the second spatial coordinate of each virtual AR model, the server. Determine the AR model selected by the user's finger.
  • Step 209 The server receives a selection signal sent by the terminal to the target AR model.
  • Step 210 The server performs image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model.
  • the server After determining the target AR model selected by the user, the server performs corresponding image processing on the original image according to the image processing parameters corresponding to the target AR model, thereby achieving an image processing effect consistent with the target AR model.
  • the image processing parameters include a face adjustment parameter, a skin color adjustment parameter, a face organ size adjustment parameter, and the like.
  • the server enables the recognition thread to recognize the face image in the original image, thereby performing image processing only on the specific target face in the original image according to the face recognition result, and for the non-target in the original image.
  • the face the server will not image it, to achieve personalized image processing.
  • Step 211 The server sends second image data to the terminal, where the second image data is image data of the original image after image processing.
  • the server returns the second image data of the original image after the image processing to the terminal in real time through the webRTC technology, so that the terminal performs real-time rendering display according to the second image data, thereby viewing the effect of real-time beauty.
  • Step 212 The terminal receives the second image data sent by the server, and performs rendering display.
  • the terminal presents the actual effect of different image processing modes to the user in the manner of the AR model according to the AR model data sent by the server, and instructs the server to process the original image according to the image processing mode selected by the user, thereby improving image processing.
  • the efficiency of the selection method improves the user experience.
  • the terminal renders and displays the corresponding AR model according to the AR model data sent by the server, and feeds back the target AR model selected by the user to the server, so that the server displays according to the target AR model.
  • the image processing effect the corresponding image processing is performed on the original image, and the image processed data is fed back to the terminal for rendering and display by the terminal; compared with the image processing effect by using the image or the text, the image processing effect is further improved by using the AR model.
  • it is beneficial to improve the efficiency of the user's choice of image processing method.
  • image processing is performed only on the target face in the original image, thereby achieving the effect of oriented beauty.
  • the server is a web server
  • the image processing webpage provided by the web server supports webGL
  • the web browser running in the terminal also supports webGL
  • the webGL and the webRTC technology can be used between the terminal and the web server. Real-time image processing is implemented, thereby eliminating the need to install an image processing application in the terminal, which will be described below using an illustrative embodiment.
  • FIG. 3 is a flowchart of an image processing method according to an embodiment of the present application.
  • the image processing method is used in the implementation environment shown in FIG. 1 as an example.
  • the method includes:
  • Step 301 The terminal uploads a target face image of the target human face to the web server.
  • Step 302 The web server receives the target face image of the target face uploaded by the terminal.
  • steps 301 to 302 For the implementation of the foregoing steps 301 to 302, refer to steps 201 to 202, and details are not described herein again.
  • Step 303 The terminal accesses the image processing webpage through the browser, the image processing webpage supports the webpage graphics library webGL technology, and the browser supports the webGL technology.
  • the web browser running in the terminal supports the webGL technology, and the image processing webpage accessed by the terminal is developed using the webGL technology.
  • Step 304 The terminal sends the first image data to the web server corresponding to the image processing webpage through the browser.
  • the terminal When the image processing webpage is accessed through a web browser and video recording is performed, the terminal enables the image capturing component to collect the original image, and sends the original image to the web server through webRTC technology.
  • step 203 For the process of the terminal acquiring the original image and converting the original image into the first image data, refer to step 203, which is not described herein again.
  • Step 305 The web server receives the first image data sent by the terminal through the image processing webpage.
  • Step 306 the web server stores the first image data into the buffer pool.
  • the web server receives the first image data, instead of directly processing the first image data, but the first image.
  • the data is stored in the buffer pool, and the original image is subjected to face recognition and image processing by enabling the first thread and the second thread respectively.
  • Step 307 the web server enables the first thread to read the first image data from the buffer pool.
  • the web server is configured to identify the target face in the original image by the first thread.
  • the web server uses the shell_exec function in a hypertext preprocessor (PHP) to start an independent shell (shell).
  • PHP hypertext preprocessor
  • the PHP script thus independently enables a shell process to perform face recognition.
  • the web server After the first thread is enabled, the web server reads the first image data from the buffer pool through the first thread, thereby performing target face recognition based on the first image data.
  • Step 308 The web server identifies, according to the target face image, whether the target face is included in the original image.
  • the web server obtains the target face image uploaded by the terminal from the face image database, and intercepts the face from the original image by the face recognition technology. Part image. Further, the web server calculates the similarity between the face image and the target face image in the original image, thereby identifying the target face included in the original image based on the similarity.
  • the web server uses a perceptual hash algorithm to calculate the similarity between the facial image and the target facial image in the original image, including the following steps.
  • the web server scales the face image and the target face image in the original image to generate the first picture and the second picture of the same size.
  • the size of the first picture and the second picture generated by the web server are both 8 ⁇ 8 and a total of 64 pixels.
  • the first grayscale picture and the second grayscale picture are both 64 grayscale pictures, that is, the gray value of any pixel point in the first grayscale picture and the second grayscale picture belongs to the pre Set 64 preset continuous gray values.
  • the web server calculates a first grayscale average value of the first grayscale image according to the grayscale value of each pixel in the first grayscale image; similarly, the web server determines the grayscale value of each pixel in the second degree image. And calculating a second gray average value of the second grayscale picture.
  • the picture fingerprint is used to represent the distribution feature of the pixel in the picture, and the higher the similarity between the two picture fingerprints, the higher the similarity of the picture corresponding to the picture fingerprint.
  • the web server compares the gray value of each pixel point with the average value of the first gray level. If the gray value of the pixel is greater than or equal to the first gray average, the web server sets the value of the pixel to 1; if the gray value of the pixel is smaller than the first gray average, the web server selects the pixel The value of the point is set to 0. The web server combines the values of the respective pixels to obtain the first picture fingerprint of the first grayscale picture.
  • the first picture fingerprint and the second picture fingerprint are both 64-bit binary numbers.
  • the web server After calculating the first picture fingerprint and the second picture fingerprint, the web server counts different digits of the first picture fingerprint and the second picture fingerprint. If the number of different digits is less than the first threshold (for example, 5), the web server determines that the facial image in the original image has a high degree of similarity to the target facial image, that is, the original image includes the target human face; if the different number of digits is greater than the second threshold (eg 10) The web server determines that the facial image in the original image has low similarity to the target facial image, that is, the original image does not include the target human face.
  • the first threshold for example, 5
  • the web server determines that the facial image in the original image has a high degree of similarity to the target facial image, that is, the original image includes the target human face
  • the second threshold eg 10
  • the server When the target face is included in the original image, the server performs step 309.
  • the server sends a prompt message to the terminal, prompting the user to upload the target face that needs image processing, or prompting the user to mark the target face that needs to be processed in the current viewfinder image. And store the marked target face.
  • Step 309 when the target image includes the target face, the web server sends the AR model data to the terminal.
  • the web server performs image processing only on the target face, when it is recognized that the target image includes the target face, the web server sends the AR model data to the terminal, and when the original image is identified as not including the target face, the web server The AR model data is not sent to the terminal.
  • the step includes the following steps.
  • Step 309A identifying a facial feature of the target human face in the original image by a predetermined image recognition technology, the facial feature including at least one of a skin color, a face shape, or a face organ size.
  • the image recognition technology After the web server determines that the original image contains the target face, the image recognition technology performs face feature recognition on the target face, thereby obtaining features such as skin color, face shape and face organ size.
  • the web server calculates a target size of each face organ in the target face according to the face feature recognition result, so as to determine the adjustment size of each face organ according to the target size and the actual face organ size, so as to follow
  • the face organ is image processed based on the resizing.
  • Step 309B Find a matching candidate AR model from the AR model database according to the face feature of the target face, and the similarity of the face features of the target face of the candidate AR model is greater than a threshold.
  • the web server stores an AR model with different facial features, such as an AR model of the face of the face, an AR model of the face of the Chinese character, an AR model of the long face, and the like.
  • the web server searches for the AR model with the similarity greater than the threshold in the AR model database based on the face feature of the target face obtained in the above step 309A.
  • the web server determines an AR model satisfying the above face feature in the AR model database as a candidate AR model.
  • Step 309C Send AR model data corresponding to the candidate AR model to the terminal.
  • the terminal sends the AR model data corresponding to the candidate AR model to the terminal for rendering and display.
  • the AR model data is defined by OpenGL, and includes a vertex shader and a fragment shader, wherein the vertex shader is program code for rendering a shape vertex of the AR model, and the fragment shader is used to render the AR model. Program code for color and/or texture.
  • Step 310 The terminal receives the AR model data sent by the web server.
  • Step 311 The terminal renders and displays at least one AR model according to the AR model data, and the AR model is used to display an image processing effect.
  • the terminal when the web browser running by the terminal supports the webGL technology, and the received AR model data is defined by OpenGL, including the vertex shader and the fragment shader, the terminal renders the AR model according to the AR model data. Including the following steps:
  • the AR model data is rendered by the webGL technology to obtain the AR model.
  • the web browser when receiving the AR model data sent by the web server, invokes the GPU of the terminal through the webGL, thereby using the GPU to respectively run the vertex shader and the fragment shader, and render Get the corresponding AR model.
  • the dedicated webpage rendering plug-in software
  • the GPU hardware
  • the development of an additional webpage rendering plug-in is eliminated.
  • the web browser renders the AR model according to the AR model data
  • the AR model is drawn by gldraw, and finally the drawn AR model is displayed on the terminal screen.
  • the terminal displays the rendered first AR model 62 and the second AR model 63 when displaying the user's face 61, wherein the first AR model 62 is used for 3D animation.
  • the method displays the image processing effect of the enlarged eye, and the second AR model 63 is used to display the image processing effect of pulling the bridge of the nose in a 3D animation manner.
  • the terminal drawing the display AR model in the image processing webpage includes the following steps.
  • the terminal identifies each object included in the current picture, and constructs a three-dimensional space corresponding to the real environment according to the depth of field and the relative positional relationship of each object in the current picture.
  • the terminal further acquires the head coordinates of the user's head in the three-dimensional space, and determines the display coordinates of the AR model in the three-dimensional space according to the head coordinates, wherein the display coordinates and the head of the AR model The coordinates are adjacent, that is, in the three-dimensional space, the AR model is displayed on the side of the user's head.
  • the terminal displays the AR model at the corresponding position of the current screen according to the determined display coordinates, and adjusts the display angle of the AR model, thereby simulating the effect of displaying the virtual model in the real three-dimensional space.
  • the first AR model 62 and the second AR model 63 are displayed on the three-dimensional space side of the user's face 61.
  • step 312 the terminal sends a selection signal to the target AR model to the web server.
  • the terminal when the user touches the display area corresponding to the first AR model 62, the terminal transmits a selection signal to the first AR model to the web server; when the user touches the display corresponding to the second AR model 63 In the case of the area, the terminal transmits a selection signal to the second AR model to the web server.
  • the user can select the virtual AR model by gesture in the three-dimensional space.
  • the terminal identifies the three-dimensional space region selected by the user's finger.
  • the first AR model 62 is determined to be selected, and
  • the web server sends a selection signal to the first AR model.
  • Step 313 The web server receives a selection signal sent by the terminal to the target AR model.
  • Step 314 the web server enables the second thread to read the first image data from the buffer pool.
  • the web server enables the second thread to perform image processing on the original image in parallel while enabling the first thread for face recognition.
  • the manner in which the web server enables the second thread is similar to the manner in which the first thread is enabled. This embodiment is not described herein again.
  • the web server reads the first image data from the buffer pool, thereby performing image processing on the target face in the original image based on the first image data and the image processing manner fed back by the terminal.
  • Step 315 The web server performs image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model.
  • the web server polls the first thread while executing the second thread, and changes the target AR model selected by the user in the first thread, that is, when the user switches the image processing mode, according to the change
  • the image processing effect exhibited by the target AR model is re-image processed.
  • the web server directly feeds back the original image to the terminal.
  • step 316 the web server sends the second image data to the terminal.
  • the second thread in order to speed up the feedback speed of the original image after the image processing, when the web server detects that the target image includes the target human face, the second thread performs the target face based on the image processing parameters corresponding to each AR model.
  • the image processing is performed to obtain a plurality of sets of second image data, and when the selection signal for the target AR model is received, the target second image data corresponding to the original image processed by the target image processing parameter is directly fed back to the terminal.
  • Step 317 The terminal receives the second image data sent by the web server, and performs rendering display.
  • the web server enables dual-threading, and performs face recognition and image processing on the original image respectively, fully utilizes the processing resources of the web server, maximizes hardware performance, and improves the response speed of the terminal interface; meanwhile, due to high concurrent Face recognition and image processing are performed on the web server side, and the terminal is only responsible for rendering and displaying the original image after image processing, so that even in the case of poor terminal performance, a better image processing effect can be achieved.
  • the server performs image processing only on a specific target face in the original image, and achieves the effect of personalized beauty.
  • the step of using the terminal as the execution subject may be separately implemented as the image display method on the terminal side, and the step of using the server or the web server as the execution subject may be separately implemented as the image processing method on the server side. This embodiment is not described here.
  • FIG. 7 is a structural block diagram of an image display apparatus according to an embodiment of the present application.
  • the image display device is implemented as a whole or a part of the terminal 110 in FIG. 1 by hardware or a combination of hardware and software.
  • the device includes: a first sending module 710, a first receiving module 720, a first display module 730, a second sending module 740, and a second display module 750.
  • the first sending module 710 is configured to implement the function of step 203 above;
  • the first receiving module 720 is configured to implement the functions of the foregoing step 206 or 310;
  • the first display module 730 is configured to implement the functions of the foregoing step 207 or 311;
  • a second sending module 740 configured to implement the functions of the foregoing step 208 or 312;
  • the second display module 750 is configured to implement the functions of the foregoing step 212 or 317.
  • the first sending module 710 includes: an access unit, and a first sending unit;
  • An access unit configured to implement the functions of step 303 above;
  • a first sending unit configured to implement the function of step 304 above;
  • the first display module 730 includes:
  • a rendering unit configured to render AR model data by using webGL technology to obtain an AR model
  • a display unit for drawing and displaying the AR model in the image processing webpage.
  • a rendering unit is used to:
  • the vertex shader and the fragment shader are run by the GPU, and the AR model is rendered.
  • the device further includes: an uploading module;
  • the uploading module is used to implement the functions of step 201 or 301 above.
  • FIG. 8 is a structural block diagram of an image processing apparatus according to an embodiment of the present application.
  • the image processing apparatus is implemented as a whole or a part of the server 120 in FIG. 1 by hardware or a combination of hardware and software.
  • the device includes: a second receiving module 810, a third sending module 820, a third receiving module 830, a processing module 840, and a fourth sending module 850;
  • a second receiving module 810 configured to implement the functions of step 204 above;
  • a third sending module 820 configured to implement the functions of step 205 above;
  • the third receiving module 830 is configured to implement the functions of the foregoing step 209 or 313;
  • the processing module 840 is configured to implement the functions of the foregoing step 210 or 315;
  • the fourth sending module 850 is configured to implement the functions of the foregoing step 211 or 316.
  • the second receiving module 810 is further configured to implement the function of the foregoing step 305.
  • the device further includes: a fourth receiving module
  • a fourth receiving module configured to implement the functions of the foregoing step 202 or 302;
  • the device further includes: a storage module, a first reading module, and an identification module;
  • a storage module configured to implement the functions of step 306 above;
  • a first reading module configured to implement the function of step 307 above;
  • An identification module configured to implement the functions of step 308 above;
  • the third sending module 820 is further configured to implement the function of the foregoing step 309;
  • the device further includes: a second reading module
  • the second reading module is configured to implement the functions of step 314 above.
  • the third sending module 820 includes: an identifying unit, a searching unit, and a sending unit;
  • An identification unit configured to implement the function of step 309A above;
  • a searching unit configured to implement the function of step 309B above;
  • the sending unit is configured to implement the function of step 309C.
  • FIG. 9 is a structural block diagram of a server provided by an embodiment of the present application.
  • the server 900 is implemented as the server 120 of FIG. Specifically:
  • the server 900 includes a central processing unit (CPU) 901, a system memory 904 including a random access memory (RAM) 902 and a read only memory (ROM) 903, and a system bus 905 that connects the system memory 904 and the central processing unit 901.
  • the server 900 also includes a basic input/output system (I/O system) 906 that facilitates transfer of information between various devices within the computer, and mass storage for storing the operating system 913, applications 914, and other program modules 915.
  • I/O system basic input/output system
  • the basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse or keyboard for user input of information. Both the display 908 and the input device 909 are connected to the central processing unit 901 via an input and output controller 910 that is coupled to the system bus 905.
  • the basic input/output system 906 can also include an input and output controller 910 for receiving and processing input from a plurality of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input and output controller 910 also provides output to a display screen, printer, or other type of output device.
  • the mass storage device 907 is connected to the central processing unit 901 by a mass storage controller (not shown) connected to the system bus 905.
  • the mass storage device 907 and its associated computer readable medium provide non-volatile storage for the server 900. That is, the mass storage device 907 can include a computer readable medium (not shown) such as a hard disk or a CD-ROM drive.
  • the computer readable medium can include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid state storage technologies, CD-ROM, DVD or other optical storage, tape cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices.
  • RAM random access memory
  • ROM read only memory
  • EPROM Erasable programmable read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • the server 900 may also be operated by a remote computer connected to the network through a network such as the Internet. That is, the server 900 can be connected to the network 912 through a network interface unit 911 connected to the system bus 905, or can also be connected to other types of networks or remote computer systems (not shown) using the network interface unit 911. .
  • the memory further includes one or more programs, the one or more programs being stored in a memory, the one or more programs including instructions for performing the image processing methods provided by embodiments of the present invention.
  • the program can be stored in a computer readable storage medium, and the storage medium can include: Read Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.
  • FIG. 10 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • the terminal 1000 is the terminal 110 in FIG. Specifically:
  • the terminal 1000 may include an RF (Radio Frequency) circuit 1010, a memory 1020 including one or more computer readable storage media, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a near field communication module 1070, A processor 1080 having one or more processing cores, and a power supply 1090 and the like are included.
  • RF Radio Frequency
  • FIG. 10 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or combine some components, or different component arrangements. among them:
  • the RF circuit 1010 can be used for receiving and transmitting signals during and after receiving or transmitting information, in particular, receiving downlink information of the base station and then processing it by one or more processors 1080; in addition, transmitting data related to the uplink to the base station .
  • the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier). , duplexer, etc.
  • SIM Subscriber Identity Module
  • RF circuit 1010 can also communicate with the network and other devices via wireless communication.
  • the wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • e-mail Short Messaging Service
  • the memory 1020 can be used to store software programs and modules, and the processor 1080 executes various functional applications and data processing by running software programs and modules stored in the memory 1020.
  • the memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to The data created by the use of the terminal 1000 (such as audio data, phone book, etc.) and the like.
  • memory 1020 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 1020 can also include a memory controller to provide access to memory 1020 by processor 1080 and input unit 1030.
  • Input unit 1030 can be used to receive input numeric or character information, as well as to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
  • the input unit 1030 may include an image input device 1031 and other input devices 1032.
  • the image input device 1031 may be a camera or an optical scanning device.
  • the input unit 1030 may also include other input devices 1032.
  • other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • Display unit 1040 can be used to display information entered by the user or information provided to the user and various graphical user interfaces of terminal 1000, which can be constructed from graphics, text, icons, video, and any combination thereof.
  • the display unit 1040 may include a display panel 1041.
  • the display panel 1041 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
  • Terminal 1000 can also include at least one type of sensor 1050, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 when the terminal 1000 moves to the ear. / or backlight.
  • the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • the terminal 1000 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, not here Let me repeat.
  • Audio circuit 1060, speaker 1061, and microphone 1062 can provide an audio interface between the user and terminal 1000.
  • the audio circuit 1060 can transmit the converted electrical data of the received audio data to the speaker 1061, and convert it into a sound signal output by the speaker 1061; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, by the audio circuit 1060. After receiving, it is converted into audio data, and then processed by the audio data output processor 1080, transmitted to the electronic device such as another electronic device via the RF circuit 1010, or outputted to the memory 1020 for further processing.
  • the audio circuit 1060 may also include an earbud jack to provide communication of the peripheral earphones with the terminal 1000.
  • the terminal 1000 establishes a near field communication connection with the external device through the near field communication module 1070, and performs data interaction through the near field communication connection.
  • the near field communication module 1070 specifically includes a Bluetooth module and/or a WiFi module.
  • the processor 1080 is the control center of the terminal 1000, connecting various portions of the entire handset with various interfaces and lines, by running or executing software programs and/or modules stored in the memory 1020, and recalling data stored in the memory 1020, The various functions and processing data of the terminal 1000 are performed to perform overall monitoring of the mobile phone.
  • the processor 1080 may include one or more processing cores; preferably, the processor 1080 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1080.
  • the terminal 1000 also includes a power source 1090 (such as a battery) for powering various components.
  • the power source can be logically coupled to the processor 1080 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the power supply 1090 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
  • the terminal 1000 may further include a Bluetooth module or the like, and details are not described herein again.
  • the terminal 1000 further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors to implement the image display described above. method.

Abstract

The embodiments of the present application belong to the field of image processing, and disclosed thereby are an image display method, an image processing method and device, a terminal and a server. The image display method comprises: uploading a target face image of a target face to a server; sending first image data corresponding to an original image to the server; receiving augmented reality (AR) model data sent by the server, the AR model data being sent when the target face is comprised in the original image; rendering and displaying an AR model according to the AR model data; and sending a selection signal for the target AR model to the server, the server being used for performing image processing on the target face in the original image according to image processing parameters corresponding to the target AR model; and receiving second image data sent by the server, and rendering and displaying the second image data, the second image data being the image data of the original image after image processing. Within the embodiments of the present application, the actual effect of different image processing is displayed by means of an AR model, which is more vivid and accurate than pictures or text descriptions.

Description

图像显示方法、图像处理方法、装置、终端及服务器Image display method, image processing method, device, terminal, and server
本申请实施例要求于2017年05月31日提交中国国家知识产权局、申请号为201710400342.6、发明名称为“图像显示方法、图像处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中。The embodiment of the present application claims the priority of the Chinese patent application submitted by the State Intellectual Property Office of China, the application number is 201710400342.6, and the invention name is "image display method, image processing method and device" on May 31, 2017, the entire content of which is The citations are incorporated in the examples of the present application.
技术领域Technical field
本申请实施例涉及图像处理领域,特别涉及一种图像显示方法、图像处理方法装置、终端及服务器。The embodiments of the present invention relate to the field of image processing, and in particular, to an image display method, an image processing method device, a terminal, and a server.
背景技术Background technique
随着图像处理技术的不断成熟,越来越多的图像处理应用程序应运而生。用户拍摄照片或视频的同时,能够利用这类图像处理应用程序对拍摄画面进行实时美化。As image processing technology continues to mature, more and more image processing applications have emerged. While the user is taking a photo or video, the image processing application can be used to visualize the captured image in real time.
常见的图像处理应用程序包括:美颜相机应用程序。用户选择开启美颜相机应用程序的美颜功能后,美颜相机应用程序即对拍摄画面中的人物进行实时美颜处理,比如,对拍摄画面中的人物进行肤色美白处理、眼睛放大处理等等,从而达到美颜效果。Common image processing applications include: Beauty Camera app. After the user selects the beauty function of the beauty camera application, the beauty camera application performs real-time beauty treatment on the characters in the shooting screen, for example, whitening the eyes, magnifying the eyes, etc. To achieve a beauty effect.
相关技术中,美颜相机应用程序以图片或文字的方式提供不同的美颜方案供用户选择使用,但是,对于部分美颜方案,通过图片或文字无法精准体现出实际美颜效果。比如,对于抬高鼻梁这种美颜方式,图片或文字无法精准体现出实际的美颜效果。In the related art, the beauty camera application provides different beauty schemes for users to select and use in the form of pictures or texts. However, for some beauty schemes, the actual beauty effects cannot be accurately reflected by pictures or texts. For example, for the beauty mode of raising the bridge of the nose, the picture or text cannot accurately reflect the actual beauty effect.
发明内容Summary of the invention
本申请实施例提供了一种图像显示方法、图像处理方法、装置、终端及服务器,可以解决通过图片或文字无法精准体现出图像处理实际效果的问题。所述技术方案如下:The embodiment of the present application provides an image display method, an image processing method, a device, a terminal, and a server, which can solve the problem that the actual effect of the image processing cannot be accurately reflected by the picture or the text. The technical solution is as follows:
根据本申请实施例的第一方面,提供了一种图像显示方法,该方法包括:According to a first aspect of the embodiments of the present application, an image display method is provided, the method comprising:
向服务器上传目标人脸的目标人脸图像;Uploading a target face image of the target face to the server;
向服务器发送原始图像对应的第一图像数据;Sending, to the server, first image data corresponding to the original image;
接收服务器发送的增强显示(Augmented Reality,AR)模型数据,AR模 型数据是原始图像中包含目标人脸时发送的,AR模型数据用于渲染至少一个AR模型,AR模型用于展示图像处理效果;Receiving enhanced display (Augmented Reality, AR) model data sent by the server, the AR model data is sent when the original image includes the target face, the AR model data is used to render at least one AR model, and the AR model is used to display the image processing effect;
根据AR模型数据渲染并显示AR模型;Rendering and displaying an AR model based on the AR model data;
向服务器发送对目标AR模型的选择信号,服务器用于根据目标AR模型对应的图像处理参数,对原始图像中的目标人脸进行图像处理;Sending a selection signal to the target AR model to the server, and the server is configured to perform image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model;
接收服务器发送的第二图像数据,并进行渲染显示,第二图像数据是经过图像处理后原始图像的图像数据。The second image data sent by the server is received and rendered and displayed, and the second image data is image data of the original image after image processing.
根据本申请实施例的第二方面,提供了一种图像处理方法,该方法包括:According to a second aspect of the embodiments of the present application, an image processing method is provided, the method comprising:
接收终端上传的目标人脸的目标人脸图像;Receiving a target face image of the target face uploaded by the terminal;
接收终端发送的原始图像对应的第一图像数据;Receiving first image data corresponding to the original image sent by the terminal;
当原始图像中包含目标人脸时,向终端发送AR模型数据,终端用于根据AR模型数据渲染并显示至少一个AR模型,AR模型用于展示图像处理效果;When the target image includes the target face, the AR model data is sent to the terminal, and the terminal is configured to render and display at least one AR model according to the AR model data, and the AR model is used to display the image processing effect;
接收终端发送的对目标AR模型的选择信号;Receiving a selection signal sent by the terminal to the target AR model;
根据目标AR模型对应的图像处理参数,对第一图像数据进行图像处理;Performing image processing on the first image data according to image processing parameters corresponding to the target AR model;
向终端发送第二图像数据,第二图像数据是经过图像处理后原始图像的图像数据,终端用于对第二图像数据进行渲染显示。Sending second image data to the terminal, the second image data is image data of the original image after image processing, and the terminal is configured to render and display the second image data.
根据本申请实施例的第三方面,提供了一种图像显示装置,该装置包括:According to a third aspect of the embodiments of the present application, an image display apparatus is provided, the apparatus comprising:
上传模块,用于向服务器上传目标人脸的目标人脸图像;An uploading module, configured to upload a target face image of the target face to the server;
第一发送模块,用于向服务器发送原始图像对应的第一图像数据;a first sending module, configured to send, to the server, first image data corresponding to the original image;
第一接收模块,用于接收服务器发送的AR模型数据,AR模型数据是原始图像中包含目标人脸时发送的,AR模型数据用于渲染至少一个AR模型,AR模型用于展示图像处理效果;a first receiving module, configured to receive AR model data sent by the server, where the AR model data is sent when the original image includes the target human face, the AR model data is used to render at least one AR model, and the AR model is used to display the image processing effect;
第一显示模块,用于根据AR模型数据渲染并显示AR模型;a first display module, configured to render and display an AR model according to the AR model data;
第二发送模块,用于向服务器发送对目标AR模型的选择信号,服务器用于根据目标AR模型对应的图像处理参数,对原始图像中的目标人脸进行图像处理;a second sending module, configured to send a selection signal to the target AR model to the server, where the server is configured to perform image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model;
第二显示模块,用于接收服务器发送的第二图像数据,并进行渲染显示,第二图像数据是经过图像处理后原始图像的图像数据。The second display module is configured to receive second image data sent by the server and perform rendering display, where the second image data is image data of the original image after image processing.
根据本申请实施例的第四方面,提供了一种图像处理装置,该装置包括:According to a fourth aspect of the embodiments of the present application, there is provided an image processing apparatus, the apparatus comprising:
第四接收模块,用于接收终端上传的目标人脸的目标人脸图像;a fourth receiving module, configured to receive a target face image of the target face uploaded by the terminal;
第二接收模块,用于接收终端发送的原始图像对应的第一图像数据;a second receiving module, configured to receive first image data corresponding to the original image sent by the terminal;
第三发送模块,用于当原始图像中包含目标人脸时,向终端发送AR模型数据,终端用于根据AR模型数据渲染并显示至少一个AR模型,AR模型用于展示图像处理效果;a third sending module, configured to: when the original image includes the target human face, send the AR model data to the terminal, where the terminal is configured to render and display at least one AR model according to the AR model data, where the AR model is used to display the image processing effect;
第三接收模块,用于接收终端发送的对目标AR模型的选择信号;a third receiving module, configured to receive a selection signal sent by the terminal to the target AR model;
处理模块,用于根据目标AR模型对应的图像处理参数,对原始图像中的目标人脸进行图像处理;a processing module, configured to perform image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model;
第四发送模块,用于向终端发送第二图像数据,第二图像数据是经过图像处理后原始图像的图像数据,终端用于对第二图像数据进行渲染显示。And a fourth sending module, configured to send second image data to the terminal, where the second image data is image data of the original image after the image processing, and the terminal is configured to perform rendering and displaying the second image data.
根据本申请实施例的第五方面,提供了一种终端,该终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如第一方面所述的图像显示方法。According to a fifth aspect of embodiments of the present application, there is provided a terminal, the terminal comprising a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor to implement as the first The image display method described in the aspect.
根据本申请实施例的第六方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如第一方面所述的图像显示方法。According to a sixth aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement an image as described in the first aspect Display method.
根据本申请实施例的第七方面,提供了一种服务器,该服务器包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如第二方面所述的图像处理方法。According to a seventh aspect of the embodiments of the present application, there is provided a server, the server comprising a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor to implement a second The image processing method described in the aspect.
根据本申请实施例的第八方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如第二方面所述的图像处理方法。According to an eighth aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement an image as described in the second aspect Approach.
本申请实施例中,终端根据服务器发送的AR模型数据渲染显示相应的AR模型,并向服务器反馈用户选中的目标AR模型,使得服务器根据目标AR模型所展示的图像处理效果,对原始图像进行相应的图像处理,并将图像处理后的数据反馈给终端,供终端进行渲染显示;相较于采用图片或文字描述图像处理效果,利用AR模型展示图像处理效果更加直观准确,有利于提高用户选择图像处理方式的效率;同时,基于预先上传的目标人脸图像,实现了仅对原始图像中的目标人脸进行图像处理,从而达到了定向美颜的效果。In the embodiment of the present application, the terminal renders and displays the corresponding AR model according to the AR model data sent by the server, and feeds back the target AR model selected by the user to the server, so that the server responds to the original image according to the image processing effect displayed by the target AR model. Image processing, and the image processed data is fed back to the terminal for rendering and display by the terminal; compared with the image processing effect using image or text, the image processing effect is more intuitive and accurate by using the AR model, which is beneficial to improving the user's selection image. At the same time, based on the pre-uploaded target face image, image processing is performed only on the target face in the original image, thereby achieving the effect of directional beauty.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work.
图1示出了本申请一个实施例提供的实施环境的示意图;FIG. 1 is a schematic diagram showing an implementation environment provided by an embodiment of the present application;
图2示出了本申请一个实施例提供的图像处理方法的流程图;FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application;
图3示出了本申请另一个实施例提供的图像处理方法的流程图;FIG. 3 is a flowchart of an image processing method provided by another embodiment of the present application;
图4是web服务器利用双线程进行人脸识别和图像处理的实施示意图;4 is a schematic diagram of an implementation of face recognition and image processing by a web server using dual threads;
图5是图4所示图像处理方法所涉及的确定候选AR模型过程的流程图;FIG. 5 is a flowchart of a process of determining a candidate AR model involved in the image processing method shown in FIG. 4; FIG.
图6A和6B是终端显示AR模型的界面示意图;6A and 6B are schematic diagrams showing an interface of a terminal to display an AR model;
图7示出了本申请一个实施例提供的图像显示装置的结构方框图;FIG. 7 is a block diagram showing the structure of an image display apparatus according to an embodiment of the present application;
图8示出了本申请一个实施例提供的图像处理装置的结构方框图;FIG. 8 is a block diagram showing the structure of an image processing apparatus according to an embodiment of the present application;
图9示出了本申请一个实施例提供的服务器的结构方框图;FIG. 9 is a structural block diagram of a server provided by an embodiment of the present application;
图10示出了本申请一个实施例提供的终端的结构示意图。FIG. 10 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。"Multiple" as referred to herein means two or more. "and/or", describing the association relationship of the associated objects, indicating that there may be three relationships, for example, A and/or B, which may indicate that there are three cases where A exists separately, A and B exist at the same time, and B exists separately. The character "/" generally indicates that the contextual object is an "or" relationship.
为了方便理解,下面对本申请实施例中涉及的名词进行解释。For ease of understanding, the nouns involved in the embodiments of the present application are explained below.
AR:即增强现实技术,是一种将真实世界信息与虚拟世界信息进行集成的技术。利用AR技术,能够在现实图像中展示构建的虚拟模型,且用户能够与该虚拟模型进行交互,比如,用户可以通过手势选中虚拟模型或者对虚拟模型执行相应的操作(例如抓取、放置等等)。本申请实施例中,终端根据web服务器发送的AR模型数据,在显示的原始图像中以AR模型的形式展示图像处理效果,并进一步获取用户选中的AR模型,其中,该AR模型为三维立体人脸模型。AR: Augmented Reality Technology is a technology that integrates real world information with virtual world information. With AR technology, the built virtual model can be displayed in the real image, and the user can interact with the virtual model. For example, the user can select the virtual model by gesture or perform corresponding operations on the virtual model (such as grabbing, placing, etc. ). In the embodiment of the present application, the terminal displays the image processing effect in the form of an AR model in the displayed original image according to the AR model data sent by the web server, and further acquires the AR model selected by the user, wherein the AR model is a three-dimensional human body. Face model.
网页图形库(web Graphics Library,webGL):一种三维(3-dimension,3D)绘图标准,允许把Java脚本(JavaScript)和嵌入式系统开放图形库2.0(OpenGL  for Embedded Systems,OpenGL ES 2.0)结合在一起。通过增加OpenGL ES 2.0的一个JavaScript绑定,webGL可以为超文本标记语言第五版(HyperText Markup Language 5,HTML5)网页提供硬件3D加速渲染,从而借助图形处理器(Graphics Processing Unit,GPU)在网页浏览器中渲染显示3D场景和模型。Web Graphics Library (webGL): A three-dimensional (3-dimension, 3D) drawing standard that allows Java scripts (JavaScript) to be combined with OpenGL for Embedded Systems (OpenGL ES 2.0). Together. By adding a JavaScript binding to OpenGL ES 2.0, webGL can provide hardware 3D accelerated rendering for HyperText Markup Language 5 (HTML5) web pages, using a graphics processing unit (GPU) on the web page. Render and display 3D scenes and models in the browser.
顶点着色器(Vertex Shader):用于渲染3D模型形状顶点的程序代码。本申请实施例中,顶点着色器用于渲染AR模型中各个形状顶点,从而绘制出AR模型的形状轮廓。Vertex Shader: Program code used to render vertices of 3D model shapes. In the embodiment of the present application, the vertex shader is used to render the vertex of each shape in the AR model, thereby drawing the shape contour of the AR model.
片段着色器(Fragment Shader):用于渲染3D模型的表面颜色和/或表面纹理的程序代码。本申请实施例中,利用顶点着色器渲染出AR模型的形状顶点后,即使用片段着色器渲染AR模型的颜色及纹理。Fragment Shader: Program code used to render the surface color and/or surface texture of a 3D model. In the embodiment of the present application, after the vertex shader is used to render the shape vertex of the AR model, the color and texture of the AR model are rendered using the fragment shader.
本申请实施例提供的图像显示以及图像处理方法,可以用于本地照片/视频美化场景,或者视频通话场景,或者照片拍摄/视频录制场景。当然也可以适用于其他需要对人脸进行美化的场景,本申请实施例对此不做限定。The image display and image processing method provided by the embodiments of the present application can be used for a local photo/video beautification scene, or a video call scene, or a photo shooting/video recording scene. Of course, it can be applied to other scenarios that need to beautify the face. This embodiment of the present application does not limit this.
本地照片/视频美化场景Local photo/video landscaping scene
目前的图像处理类应用程序大多具有美颜功能。但是图像处理类应用程序通常是以文字或图片的形式展示美颜效果,展示效果不直观,无法准确表达出实际美颜效果。而采用本申请实施例提供的方法,用户使用图像处理类应用程序对本地照片或视频中的人脸进行美颜时,图像处理类应用程序使用AR模型展示不同的美颜效果,使得美颜效果的展示更加直观准确;同时,图像处理类应用程序可以有针对性的仅对照片或视频中指定的人脸进行美颜,达到定向美颜的效果。Most of the current image processing applications have beauty features. However, the image processing application usually displays the beauty effect in the form of text or pictures, and the display effect is not intuitive, and the actual beauty effect cannot be accurately expressed. With the method provided by the embodiment of the present application, when the user uses an image processing application to make a face in a local photo or a video, the image processing application uses the AR model to display different beauty effects, so that the beauty effect is achieved. The display is more intuitive and accurate; at the same time, the image processing application can specifically target the face specified in the photo or video to achieve the effect of directed beauty.
视频通话场景Video call scene
用户使用视频通话类应用程序(或者网页)与他人进行视频通话时,可以通过应用程序提供的美颜功能对自身人脸进行美颜。然而,视频通话类应用程序中通常以文字形式展示美颜效果,这种展示方式不够直观准确,导致用户在视频通话过程中频繁切换不同的美颜效果。采用本申请实施例提供的方法,在视频通话前(或者视频通话过程中),视频通话类应用程序以AR模型的形式展示不同的美颜效果,以便用户快速准确选取到合适的美颜方式,避免用户进行频繁切换。同时,经过美颜后的视频数据传输至视频通话双发的终端,以便终端进行渲染显示。When a user uses a video call application (or web page) to make a video call with another person, they can make a beauty of their face through the beauty function provided by the application. However, the video call application usually displays the beauty effect in text form. This display method is not intuitive and accurate, and the user frequently switches between different beauty effects during the video call. With the method provided by the embodiment of the present application, before the video call (or during the video call), the video call application displays different beauty effects in the form of an AR model, so that the user can quickly and accurately select the appropriate beauty mode. Avoid frequent user switching. At the same time, the video data after the beauty is transmitted to the terminal of the video call dual-issue, so that the terminal performs rendering display.
照片拍摄/视频录制场景Photo shooting/video recording scene
用户通过网页或应用程序进行实时照片拍摄或视频录制时,可以选择相应的美颜效果对画面中的人脸进行美颜。但是以文字或图片的形式展示美颜效果,展示效果不直观,不利于用户快速选择到合适的美颜效果。采用本申请实施例提供的方法,用户实时拍摄照片或视频时,服务器向终端反馈AR模型数据,以便终端根据AR模型数据渲染显示AR模型,从而通过显示的AR模型查看不同的美颜效果,并最终根据用户选择的美颜方式,对图像中的人脸进行美颜。同时,通过预先上传目标人脸图像,当取景画面中包含多个人脸时,可以实现对其中的目标人脸进行美颜。When a user performs real-time photo shooting or video recording through a webpage or an application, the corresponding beauty effect can be selected to make a beauty of the face in the screen. However, the beauty effect is displayed in the form of text or pictures, and the display effect is not intuitive, which is not conducive to the user to quickly select the appropriate beauty effect. With the method provided by the embodiment of the present application, when the user takes a photo or video in real time, the server feeds back the AR model data to the terminal, so that the terminal renders and displays the AR model according to the AR model data, thereby viewing different beauty effects through the displayed AR model, and Finally, the face in the image is beautifully decorated according to the beauty mode selected by the user. At the same time, by uploading the target face image in advance, when the framing picture includes a plurality of faces, it is possible to perform beauty on the target face.
与现有技术中,图像处理由终端独立执行不同,本申请实施例中,图像处理由终端与服务器交互完成。其中,终端负责图像采集、图像处理方式选择以及对图像处理后的图像进行显示,服务器则负责提供不同的图像处理方式以及对图像进行处理。Different from the prior art, the image processing is performed by the terminal independently. In the embodiment of the present application, the image processing is completed by the terminal and the server. The terminal is responsible for image acquisition, image processing mode selection and image processing after the image is processed, and the server is responsible for providing different image processing methods and processing the image.
请参考图1,其示出了本申请一个实施例提供的实施环境的示意图,该实施环境中包括终端110和服务器120。Please refer to FIG. 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application, where the implementation environment includes a terminal 110 and a server 120 .
终端110是具有图像采集功能的电子设备。该电子设备为智能手机、平板变脑、个人便携式计算机等等。可选的,本申请实施例中,终端110中安装并运行有支持网页实时通信(Web Real-Time Communication,webRTC)以及webGL技术的网页浏览器或图像处理类应用程序。以网页浏览器为例,利用webRTC技术,用户能够使用网页浏览器进行实时音视频对话或录制;利用webGL技术,当需要在网页中显示复杂的3D模型或场景时,网页浏览器即可调用终端110中的GPU进行3D渲染。The terminal 110 is an electronic device having an image capturing function. The electronic device is a smart phone, a tablet brain, a personal portable computer, and the like. Optionally, in the embodiment of the present application, a web browser or an image processing application supporting web real-time communication (webRTC) and webGL technology is installed and run in the terminal 110. Taking a web browser as an example, webRTC technology enables users to use a web browser for real-time audio and video conversations or recordings; with webGL technology, when a complex 3D model or scene needs to be displayed on a web page, the web browser can call the terminal. The GPU in 110 performs 3D rendering.
终端110与服务器120之间通过有线或无线网络相连。The terminal 110 and the server 120 are connected by a wired or wireless network.
服务器120是一台服务器、若干台服务器构成的服务器集群或云计算中心。在一种可能的实施方式中,服务器120为图像处理应用程序的后台服务器;在另一种可能的实施方式中,服务器120为图像处理网页对应的web服务器,用于对通过图像处理网页接收到的图像进行图像处理。The server 120 is a server cluster or a cloud computing center composed of one server and several servers. In a possible implementation, the server 120 is a background server of the image processing application; in another possible implementation, the server 120 is a web server corresponding to the image processing webpage, and is used to receive the webpage through the image processing. The image is processed image.
在一个示意性的应用场景下,用户使用网页浏览器访问图像处理网页并进行视频录制时,终端110即通过图像采集组件采集原始图像,并采用webRTC技术将原始图像发送至图像处理网页对应的web服务器120,由该web服务器 120对原始图像进行相应图像处理后,采用webRTC技术将图像处理后的原始图像反馈给终端110,供终端110进行实时显示。In an exemplary application scenario, when a user accesses an image processing webpage and performs video recording using a web browser, the terminal 110 collects the original image through the image capturing component, and sends the original image to the web corresponding to the image processing webpage by using webRTC technology. The server 120 performs corresponding image processing on the original image by the web server 120, and then returns the image processed original image to the terminal 110 by using the webRTC technology, and the terminal 110 performs real-time display.
本申请实施例中,服务器120还用于提供不同的图像处理方式供用户选择使用。可选的,如图1所示,服务器120中构建有AR模型数据库121,该AR模型数据库121中存储有用于展示不同图像处理效果的AR模型。比如,该AR模型为3D人脸模型,用于以动画的形式展现图像处理前后人脸的变化情况。在一种可能的实施方式中,服务器接收到终端110发送的原始图像后,从AR模型数据库121中选择若干个AR模型并反馈给终端110,由终端110对若干个AR模型进行渲染显示,以便用户根据AR模型展示的图像处理效果选择相应的图像处理方式。In the embodiment of the present application, the server 120 is further configured to provide different image processing modes for the user to select and use. Optionally, as shown in FIG. 1 , an AR model database 121 is built in the server 120, and the AR model database 121 stores an AR model for displaying different image processing effects. For example, the AR model is a 3D face model for displaying changes in the face before and after image processing in an animated form. In a possible implementation, after receiving the original image sent by the terminal 110, the server selects several AR models from the AR model database 121 and feeds back to the terminal 110, and the terminal 110 renders and displays several AR models, so that The user selects the corresponding image processing mode according to the image processing effect displayed by the AR model.
本申请实施例中,服务器120还用于为特定用户的人脸图像提供图像处理。可选的,如图1所示,服务器120中构建有人脸图像数据库122,该人脸图像数据库122中存储有终端上传的人脸图像。在一种可能的实施方式中,服务器120接收到终端110发送的原始图像后,从人脸图像数据库122中获取终端110对应目标用户的人脸图像,当识别出原始图像中包含多张人脸时,服务器120仅对原始图像中目标用户的人脸图像进行图像处理。In the embodiment of the present application, the server 120 is further configured to provide image processing for a face image of a specific user. Optionally, as shown in FIG. 1 , a server face image database 122 is configured in the server 120, and the face image database 122 stores a face image uploaded by the terminal. In a possible implementation, after receiving the original image sent by the terminal 110, the server 120 acquires the face image of the target user corresponding to the target 110 from the face image database 122, and recognizes that the original image contains multiple faces. At this time, the server 120 performs image processing only on the face image of the target user in the original image.
可选地,上述的无线网络或有线网络使用标准通信技术和/或协议。网络通常为因特网、但也可以是任何网络,包括但不限于局域网(Local Area Network,LAN)、城域网(Metropolitan Area Network,MAN)、广域网(Wide Area Network,WAN)、移动、有线或者无线网络、专用网络或者虚拟专用网络的任何组合)。在一些实施例中,使用包括超文本标记语言(Hyper Text Mark-up Language,HTML)、可扩展标记语言(Extensible Markup Language,XML)等的技术和/或格式来代表通过网络交换的数据。此外还可以使用诸如安全套接字层(Secure Socket Layer,SSL)、传输层安全(Transport Layer Security,TLS)、虚拟专用网络(Virtual Private Network,VPN)、网际协议安全(Internet Protocol Security,IPsec)等常规加密技术来加密所有或者一些链路。在另一些实施例中,还可以使用定制和/或专用数据通信技术取代或者补充上述数据通信技术。Optionally, the wireless or wired network described above uses standard communication techniques and/or protocols. The network is usually the Internet, but can also be any network, including but not limited to a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, a wired or a wireless. Any combination of networks, private networks, or virtual private networks). In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), and the like. In addition, you can use such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). Regular encryption techniques are used to encrypt all or some of the links. In other embodiments, the above described data communication techniques may also be replaced or supplemented using custom and/or dedicated data communication techniques.
请参考图2,其示出了本申请一个实施例提供的图像处理方法的流程图,本实施例以该图像处理方法用于图1所示的实施环境为例进行说明,该方法包括:Please refer to FIG. 2, which is a flowchart of an image processing method according to an embodiment of the present application. The image processing method is used in the implementation environment shown in FIG. 1 as an example. The method includes:
步骤201,终端向服务器上传目标人脸的目标人脸图像。Step 201: The terminal uploads a target face image of the target face to the server.
在一种可能的实施方式中,终端使用网页浏览器访问图像处理网页时,通过超文本传输协议(HyperText Transfer Protocol,HTTP)的post上传方式,将终端对应目标人脸的目标人脸图像上传到图像处理网页的web服务器。In a possible implementation manner, when the terminal accesses the image processing webpage by using a web browser, the target uploading image corresponding to the target face of the terminal is uploaded to the terminal by the HyperText Transfer Protocol (HTTP) post uploading method. Image processing web page web server.
可选的,为了提高图像上传的安全性,终端通过预设加密算法对目标人脸图像进行加密后,向服务器上传加密后的目标人脸图像。其中,该预设加密算法为RSA(Rivest-Shamir-Adleman)算法、信息摘要算法5(Message-Digest Algorithm 5,MD5)算法或数据加密标准(Data Encryption Standard,DES)算法等等。Optionally, in order to improve the security of image uploading, the terminal encrypts the target face image by using a preset encryption algorithm, and then uploads the encrypted target face image to the server. The preset encryption algorithm is an RSA (Rivest-Shamir-Adleman) algorithm, a Message Digest Algorithm 5 (MD5) algorithm, or a Data Encryption Standard (DES) algorithm.
步骤202,服务器接收终端上传的目标人脸的目标人脸图像。Step 202: The server receives the target face image of the target face uploaded by the terminal.
相应的,服务器接收终端上传的目标人脸图像,并将该目标人脸图像与终端进行关联存储,以便后续进行人脸识别时调用。示意性的,如图1所示,服务器120将接收到的目标人脸图像存储在人脸图像数据库122中。Correspondingly, the server receives the target face image uploaded by the terminal, and stores the target face image in association with the terminal, so as to be called when the face recognition is performed subsequently. Illustratively, as shown in FIG. 1, the server 120 stores the received target face image in the face image database 122.
可选的,为了提高后续人脸识别的准确性,终端上传多张目标人脸图像,相应的,服务器存储有同一终端对应多张目标人脸图像。Optionally, in order to improve the accuracy of the subsequent face recognition, the terminal uploads multiple target face images, and correspondingly, the server stores multiple target face images corresponding to the same terminal.
可选的,终端中存储有至少两张目标人脸图像,且不同目标人脸图像对应不同用户的目标人脸。Optionally, at least two target face images are stored in the terminal, and different target face images correspond to target faces of different users.
步骤203,终端向服务器发送原始图像对应的第一图像数据。Step 203: The terminal sends the first image data corresponding to the original image to the server.
在一种可能的实施方式中,当该服务器为图像处理网页对应的web服务器,且终端通过网页浏览器访问图像处理网页并进行视频录制时,网页浏览器调用终端的图像采集组件(比如摄像头)进行原始图像采集,并采用视频图像编码技术(比如x264编码技术)对原始图像进行编码,得到第一图像数据,进而采用webRTC技术将第一图像数据传输至web服务器。其中,该图像处理网页以及网页浏览器均支持webGL技术。In a possible implementation manner, when the server is a web server corresponding to the image processing webpage, and the terminal accesses the image processing webpage through the web browser and performs video recording, the web browser invokes the image capturing component of the terminal (such as a camera). The original image is collected, and the original image is encoded by using a video image coding technology (such as x264 encoding technology) to obtain the first image data, and then the first image data is transmitted to the web server by using webRTC technology. Among them, the image processing webpage and the web browser support webGL technology.
步骤204,服务器接收终端发送的原始图像的第一图像数据。Step 204: The server receives first image data of an original image sent by the terminal.
步骤205,当原始图像中包含目标人脸时,服务器向终端发送AR模型数据。Step 205: When the target face is included in the original image, the server sends the AR model data to the terminal.
不同于相关技术中,用户仅能够从图片或文字描述中获知图像处理的实际效果,本申请实施例中,服务器接收到第一图像数据后,向终端提供AR模型数据,供终端渲染显示至少一个展示图像处理效果的AR模型。Different from the related art, the user can only know the actual effect of the image processing from the picture or the text description. In the embodiment of the present application, after receiving the first image data, the server provides the AR model data to the terminal for at least one display by the terminal. An AR model showing the effect of image processing.
可选的,服务器中构建有AR模型数据库,该AR模型数据库中即存储有 不同AR模型对应的数据。其中,该AR模型数据使用OpenGL定义,包含顶点着色器和片段着色器。Optionally, an AR model database is built in the server, and the AR model database stores data corresponding to different AR models. The AR model data is defined using OpenGL and includes vertex shaders and fragment shaders.
另外,本申请实施例中,当检测到原始图像中包含终端对应的目标人脸时,终端才会向终端发送AR模型数据;当原始图像中未包含目标人脸时,服务器则不会向终端发送AR模型数据。In addition, in the embodiment of the present application, when detecting that the original image includes the target face corresponding to the terminal, the terminal sends the AR model data to the terminal; when the original image does not include the target face, the server does not send the terminal to the terminal. Send AR model data.
在一种可能的实施方式中,服务器接收到第一图像数据后,通过视频图像解码技术还原出原始图像,然后通过图像识别技术识别原始图像中人脸的人脸特征,并从AR模型数据库中查找与该人脸特征相匹配的目标AR模型,进而将目标AR模型的AR模型数据发送给终端,供终端进行渲染显示。由于终端显示的AR模型与用户人脸相似度较高,因此通过该AR模型展示出的图像处理效果(美颜效果)更加真实。In a possible implementation manner, after receiving the first image data, the server restores the original image by using a video image decoding technology, and then identifies the face feature of the face in the original image by using image recognition technology, and from the AR model database. The target AR model matching the facial feature is searched, and the AR model data of the target AR model is sent to the terminal for rendering and display by the terminal. Since the AR model displayed by the terminal is highly similar to the user's face, the image processing effect (beauty effect) displayed by the AR model is more realistic.
步骤206,终端接收服务器发送的AR模型数据。Step 206: The terminal receives the AR model data sent by the server.
步骤207,终端根据AR模型数据渲染并显示至少一个AR模型,AR模型用于展示图像处理效果。Step 207: The terminal renders and displays at least one AR model according to the AR model data, and the AR model is used to display an image processing effect.
在一种可能的实施方式中,当AR模型数据中包含顶点着色器和片段着色器(采用OpenGL定义),且终端运行的网页浏览器支持webGL技术时,网页浏览器根据AR模型数据调用终端中的GPU进行AR模型渲染,提高了AR模型的渲染速度,同时免去了开发额外的网页渲染插件。In a possible implementation manner, when the AR model data includes a vertex shader and a fragment shader (defined by OpenGL), and the web browser running by the terminal supports the webGL technology, the web browser invokes the terminal according to the AR model data. The GPU performs AR model rendering, which improves the rendering speed of the AR model, while eliminating the need to develop additional web rendering plugins.
终端在网页浏览器中对GPU渲染出的AR模型进行显示,使得用户通过AR模型能够直观了解到不同图像处理方式的实际效果,方便用户定向选择自身期望的图像处理方式。The terminal displays the AR model rendered by the GPU in a web browser, so that the user can intuitively understand the actual effect of different image processing modes through the AR model, and facilitate the user to directly select the image processing mode desired by the user.
步骤208,终端向服务器发送对目标AR模型的选择信号。Step 208: The terminal sends a selection signal to the target AR model to the server.
在一种可能的实施方式中,终端在屏幕上显示AR模型后,接收用户对目标AR模型的触摸选择信号,其中,该触摸选择信号是用户触摸目标AR模型所在显示区域时触发的。In a possible implementation manner, after the terminal displays the AR model on the screen, the terminal receives a touch selection signal of the target AR model, where the touch selection signal is triggered when the user touches the display area where the target AR model is located.
在其他可能的实施方式中,用户通过执行预定交互动作与虚拟的AR模型进行实时交互时,终端将包含交互动作的互动图像发送至服务器后,服务器借助AR识别技术,确定用户通过交互动作所选中的目标AR模型。In other possible implementation manners, when the user performs real-time interaction with the virtual AR model by performing a predetermined interaction action, after the terminal sends the interactive image including the interaction action to the server, the server determines, by using the AR identification technology, that the user is selected through the interaction action. The target AR model.
比如,web服务器根据终端发送的互动图像,确定出用户手指在真实三维空间中的第一空间坐标,通过比较第一空间坐标与各个虚拟AR模型的第二空间坐标之间的坐标位置关系,服务器确定出用户手指选中的AR模型。For example, the web server determines the first spatial coordinate of the user's finger in the real three-dimensional space according to the interactive image sent by the terminal, and compares the coordinate position relationship between the first spatial coordinate and the second spatial coordinate of each virtual AR model, the server. Determine the AR model selected by the user's finger.
步骤209,服务器接收终端发送的对目标AR模型的选择信号。Step 209: The server receives a selection signal sent by the terminal to the target AR model.
步骤210,服务器根据目标AR模型对应的图像处理参数,对原始图像中的目标人脸进行图像处理。Step 210: The server performs image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model.
服务器确定出用户选择的目标AR模型后,即根据该目标AR模型对应的图像处理参数,对原始图像进行相应的图像处理,从而达到与目标AR模型一致的图像处理效果。可选的,该图像处理参数包括脸型调节参数、肤色调节参数、人脸器官尺寸调节参数等等。After determining the target AR model selected by the user, the server performs corresponding image processing on the original image according to the image processing parameters corresponding to the target AR model, thereby achieving an image processing effect consistent with the target AR model. Optionally, the image processing parameters include a face adjustment parameter, a skin color adjustment parameter, a face organ size adjustment parameter, and the like.
另外,本申请实施例中,服务器启用识别线程对原始图像中的人脸图像进行识别,从而根据人脸识别结果仅对原始图像中特定的目标人脸进行图像处理,对于原始图像中的非目标人脸,服务器则不会对其进行图像处理,实现个性化图像处理的效果。In addition, in the embodiment of the present application, the server enables the recognition thread to recognize the face image in the original image, thereby performing image processing only on the specific target face in the original image according to the face recognition result, and for the non-target in the original image. The face, the server will not image it, to achieve personalized image processing.
步骤211,服务器向终端发送第二图像数据,第二图像数据是经过图像处理后原始图像的图像数据。Step 211: The server sends second image data to the terminal, where the second image data is image data of the original image after image processing.
可选的,完成图像处理后,服务器通过webRTC技术向终端实时返回图像处理后原始图像的第二图像数据,以便终端根据第二图像数据进行实时渲染显示,从而观看到实时美颜的效果。Optionally, after the image processing is completed, the server returns the second image data of the original image after the image processing to the terminal in real time through the webRTC technology, so that the terminal performs real-time rendering display according to the second image data, thereby viewing the effect of real-time beauty.
步骤212,终端接收服务器发送的第二图像数据,并进行渲染显示。Step 212: The terminal receives the second image data sent by the server, and performs rendering display.
本实施例中,终端根据服务器发送的AR模型数据,以AR模型的方式向用户展现不同图像处理方式的实际效果,并指示服务器根据用户选择的图像处理方式对原始图像进行处理,提高了图像处理方式的选择效率,提升了用户操作体验。In this embodiment, the terminal presents the actual effect of different image processing modes to the user in the manner of the AR model according to the AR model data sent by the server, and instructs the server to process the original image according to the image processing mode selected by the user, thereby improving image processing. The efficiency of the selection method improves the user experience.
综上所述,本实施例提供的图像处理方法中,终端根据服务器发送的AR模型数据渲染显示相应的AR模型,并向服务器反馈用户选中的目标AR模型,使得服务器根据目标AR模型所展示的图像处理效果,对原始图像进行相应的图像处理,并将图像处理后的数据反馈给终端,供终端进行渲染显示;相较于采用图片或文字描述图像处理效果,利用AR模型展示图像处理效果更加直观准确,有利于提高用户选择图像处理方式的效率;同时,基于预先上传的目标人脸图像,实现了仅对原始图像中的目标人脸进行图像处理,从而达到了定向美颜的效果。In summary, in the image processing method provided by the embodiment, the terminal renders and displays the corresponding AR model according to the AR model data sent by the server, and feeds back the target AR model selected by the user to the server, so that the server displays according to the target AR model. The image processing effect, the corresponding image processing is performed on the original image, and the image processed data is fed back to the terminal for rendering and display by the terminal; compared with the image processing effect by using the image or the text, the image processing effect is further improved by using the AR model. Intuitive and accurate, it is beneficial to improve the efficiency of the user's choice of image processing method. At the same time, based on the pre-uploaded target face image, image processing is performed only on the target face in the original image, thereby achieving the effect of oriented beauty.
在一种可能的实施方式中,当服务器为web服务器,且web服务器提供 的图像处理网页支持webGL,终端中运行的网页浏览器也支持webGL时,终端与web服务器之间能够借助webGL以及webRTC技术实现实时图像处理,从而免去了在终端中安装图像处理应用程序,下面采用示意性的实施例进行说明。In a possible implementation manner, when the server is a web server, and the image processing webpage provided by the web server supports webGL, and the web browser running in the terminal also supports webGL, the webGL and the webRTC technology can be used between the terminal and the web server. Real-time image processing is implemented, thereby eliminating the need to install an image processing application in the terminal, which will be described below using an illustrative embodiment.
请参考图3,其示出了本申请一个实施例提供的图像处理方法的流程图,本实施例以该图像处理方法用于图1所示的实施环境为例进行说明,该方法包括:Please refer to FIG. 3, which is a flowchart of an image processing method according to an embodiment of the present application. The image processing method is used in the implementation environment shown in FIG. 1 as an example. The method includes:
步骤301,终端向web服务器上传目标人脸的目标人脸图像。Step 301: The terminal uploads a target face image of the target human face to the web server.
步骤302,web服务器接收终端上传的目标人脸的目标人脸图像。Step 302: The web server receives the target face image of the target face uploaded by the terminal.
上述步骤301至302的实施方式参见步骤201至202,本实施例在此不再赘述。For the implementation of the foregoing steps 301 to 302, refer to steps 201 to 202, and details are not described herein again.
步骤303,终端通过浏览器访问图像处理网页,图像处理网页支持网页图形库webGL技术,且浏览器支持webGL技术。Step 303: The terminal accesses the image processing webpage through the browser, the image processing webpage supports the webpage graphics library webGL technology, and the browser supports the webGL technology.
本实施例中,终端中运行的网页浏览器支持webGL技术,且终端访问的图像处理网页使用webGL技术开发。In this embodiment, the web browser running in the terminal supports the webGL technology, and the image processing webpage accessed by the terminal is developed using the webGL technology.
步骤304,终端通过浏览器向图像处理网页对应的web服务器发送第一图像数据。Step 304: The terminal sends the first image data to the web server corresponding to the image processing webpage through the browser.
当通过网页浏览器访问图像处理网页,并进行视频录制时,终端即启用图像采集组件采集原始图像,并通过webRTC技术将原始图像发送至web服务器。When the image processing webpage is accessed through a web browser and video recording is performed, the terminal enables the image capturing component to collect the original image, and sends the original image to the web server through webRTC technology.
其中,终端采集原始图像,并将原始图像转化为第一图像数据的过程可参考步骤203,本实施例在此不再赘述。For the process of the terminal acquiring the original image and converting the original image into the first image data, refer to step 203, which is not described herein again.
步骤305,web服务器通过图像处理网页接收终端发送的第一图像数据。Step 305: The web server receives the first image data sent by the terminal through the image processing webpage.
步骤306,web服务器将第一图像数据存入缓冲池。Step 306, the web server stores the first image data into the buffer pool.
为了同时执行人脸识别和图像处理这两种高并发性的操作,如图4所示,web服务器接收到第一图像数据,并非直接对第一图像数据进行处理,而是将该第一图像数据存入缓冲池内,并通过启用第一线程和第二线程分别对原始图像进行人脸识别以及图像处理。In order to perform two high-concurrency operations of face recognition and image processing at the same time, as shown in FIG. 4, the web server receives the first image data, instead of directly processing the first image data, but the first image. The data is stored in the buffer pool, and the original image is subjected to face recognition and image processing by enabling the first thread and the second thread respectively.
步骤307,web服务器启用第一线程从缓冲池中读取第一图像数据。Step 307, the web server enables the first thread to read the first image data from the buffer pool.
其中,web服务器用于通过第一线程识别原始图像中的目标人脸。The web server is configured to identify the target face in the original image by the first thread.
针对web服务器启用第一线程的方式,在一种可能的实施方式中,web服务器在超文本预处理器(PHP:Hypertext Preprocessor,PHP)中使用shell_exec 函数,以shell(壳)的方式启动一个独立的PHP脚本,从而独立启用一个shell进程执行人脸识别。For a way that the web server enables the first thread, in one possible implementation, the web server uses the shell_exec function in a hypertext preprocessor (PHP) to start an independent shell (shell). The PHP script thus independently enables a shell process to perform face recognition.
启用第一线程后,web服务器即通过第一线程从缓冲池中读取第一图像数据,从而基于该第一图像数据进行目标人脸识别。After the first thread is enabled, the web server reads the first image data from the buffer pool through the first thread, thereby performing target face recognition based on the first image data.
步骤308,web服务器根据目标人脸图像识别原始图像中是否包含目标人脸。Step 308: The web server identifies, according to the target face image, whether the target face is included in the original image.
在一种可能的实施方式中,如图4所示,在第一线程下,web服务器从人脸图像数据库中获取终端上传的目标人脸图像,并通过人脸识别技术从原始图像中截取脸部图像。进一步的,web服务器计算原始图像中脸部图像与目标人脸图像的相似度,从而基于该相似度识别原始图像中包含的目标人脸。In a possible implementation manner, as shown in FIG. 4, under the first thread, the web server obtains the target face image uploaded by the terminal from the face image database, and intercepts the face from the original image by the face recognition technology. Part image. Further, the web server calculates the similarity between the face image and the target face image in the original image, thereby identifying the target face included in the original image based on the similarity.
可选的,web服务器采用感知哈希算法计算原始图像中脸部图像与目标人脸图像的相似度,包括如下步骤。Optionally, the web server uses a perceptual hash algorithm to calculate the similarity between the facial image and the target facial image in the original image, including the following steps.
1、根据原始图像中脸部图像生成预定尺寸的第一图片;根据目标人脸图像生成预定尺寸的第二图片。1. Generating a first picture of a predetermined size from the face image in the original image; and generating a second picture of a predetermined size according to the target face image.
为了摈弃不同尺寸和比例带来的图片差异性,web服务器对原始图像中脸部图像以及目标人脸图像进行尺寸缩放,从而生成相同尺寸的第一图片和第二图片。In order to discard the picture difference caused by different sizes and proportions, the web server scales the face image and the target face image in the original image to generate the first picture and the second picture of the same size.
在一种可能的实施方式中,web服务器生成的第一图片和第二图片的尺寸均为8×8,共64个像素点。In a possible implementation manner, the size of the first picture and the second picture generated by the web server are both 8×8 and a total of 64 pixels.
2、将第一图片转化为第一灰度图片;将第二图片转化为第二灰度图片。2. Converting the first picture into a first grayscale picture; converting the second picture into a second grayscale picture.
在一种可能的实施方式中,第一灰度图片和第二灰度图片均为64级灰度图片,即第一灰度图片和第二灰度图片中任意像素点的灰度值属于预设64个预设连续灰度值。In a possible implementation manner, the first grayscale picture and the second grayscale picture are both 64 grayscale pictures, that is, the gray value of any pixel point in the first grayscale picture and the second grayscale picture belongs to the pre Set 64 preset continuous gray values.
3、计算第一灰度图片的第一灰度平均值;计算第二灰度图片的第二灰度平均值。3. Calculating a first gray average value of the first grayscale picture; calculating a second gray level average value of the second grayscale picture.
web服务器根据第一灰度图片中各个像素点的灰度值,计算得到第一灰度图片的第一灰度平均值;相似的,web服务器根据第二度图片中各个像素点的灰度值,计算得到第二灰度图片的第二灰度平均值。The web server calculates a first grayscale average value of the first grayscale image according to the grayscale value of each pixel in the first grayscale image; similarly, the web server determines the grayscale value of each pixel in the second degree image. And calculating a second gray average value of the second grayscale picture.
4、根据第一灰度图片中各个像素点的灰度值和第一灰度平均值,生成第一灰度图片的第一图片指纹;根据第二灰度图片中各个像素点的灰度值和第二灰度平均值,生成第二灰度图片的第二图片指纹。4. generating a first picture fingerprint of the first grayscale picture according to the gray value of each pixel in the first grayscale picture and the first gray level average; according to the gray value of each pixel in the second grayscale picture And a second grayscale average to generate a second picture fingerprint of the second grayscale picture.
其中,图片指纹用于表征图片中像素点的分布特征,且两张图片指纹的相似度越高,表示图片指纹对应图片的相似度越高。针对生成图片指纹的方式,在一种可能的实施方式中,在计算第一灰度图片的第一图片指纹时,web服务器比较各个像素点的灰度值与第一灰度平均值的大小,若该像素点的灰度值大于等于第一灰度平均值,web服务器将该像素点的值设置为1;若该像素点的灰度值小于第一灰度平均值,web服务器将该像素点的值设置为0。web服务器将各个像素点的值进行组合,即得到第一灰度图片的第一图片指纹。The picture fingerprint is used to represent the distribution feature of the pixel in the picture, and the higher the similarity between the two picture fingerprints, the higher the similarity of the picture corresponding to the picture fingerprint. In a possible implementation manner, in a possible implementation manner, when calculating the first picture fingerprint of the first grayscale picture, the web server compares the gray value of each pixel point with the average value of the first gray level. If the gray value of the pixel is greater than or equal to the first gray average, the web server sets the value of the pixel to 1; if the gray value of the pixel is smaller than the first gray average, the web server selects the pixel The value of the point is set to 0. The web server combines the values of the respective pixels to obtain the first picture fingerprint of the first grayscale picture.
比如,当第一灰度图片和第二灰度图片的尺寸均为8×8时,第一图片指纹和第二图片指纹均为64位二进制数。For example, when the sizes of the first grayscale picture and the second grayscale picture are both 8×8, the first picture fingerprint and the second picture fingerprint are both 64-bit binary numbers.
5、根据第一图片指纹和第二图片指纹计算相似度。5. Calculate the similarity according to the first picture fingerprint and the second picture fingerprint.
计算得到第一图片指纹和第二图片指纹后,web服务器统计第一图片指纹和第二图片指纹的不同位数。若不同位数小于第一阈值(比如5),web服务器确定原始图像中脸部图像与目标人脸图像相似度高,即原始图像中包含目标人脸;若不同位数大于第二阈值(比如10),web服务器确定原始图像中脸部图像与目标人脸图像相似度低,即原始图像中不包含目标人脸。After calculating the first picture fingerprint and the second picture fingerprint, the web server counts different digits of the first picture fingerprint and the second picture fingerprint. If the number of different digits is less than the first threshold (for example, 5), the web server determines that the facial image in the original image has a high degree of similarity to the target facial image, that is, the original image includes the target human face; if the different number of digits is greater than the second threshold (eg 10) The web server determines that the facial image in the original image has low similarity to the target facial image, that is, the original image does not include the target human face.
当原始图像中包含目标人脸时,服务器执行步骤309。可选的,当原始图像中不包含目标人脸时,服务器向终端发送提示信息,提示用户上传需要进行图像处理的目标人脸,或,提示用户标记出当前取景画面中需要处理的目标人脸,并对标记出的目标人脸进行存储。When the target face is included in the original image, the server performs step 309. Optionally, when the original image does not include the target face, the server sends a prompt message to the terminal, prompting the user to upload the target face that needs image processing, or prompting the user to mark the target face that needs to be processed in the current viewfinder image. And store the marked target face.
步骤309,当原始图像中包含目标人脸时,web服务器向终端发送AR模型数据。Step 309, when the target image includes the target face, the web server sends the AR model data to the terminal.
由于web服务器仅对目标人脸进行图像处理,因此当识别出原始图像中包含目标人脸时,web服务器即向终端发送AR模型数据,当识别出原始图像中不包含目标人脸时,web服务器则不会向终端发送AR模型数据。Since the web server performs image processing only on the target face, when it is recognized that the target image includes the target face, the web server sends the AR model data to the terminal, and when the original image is identified as not including the target face, the web server The AR model data is not sent to the terminal.
为了使用户能够选择到符合自身面部特点的图像处理方式,从而优化图像处理的效果,在一种可能的实施方式中,如图5所示,本步骤包括如下步骤。In order to enable the user to select an image processing mode that conforms to the characteristics of the face, thereby optimizing the effect of the image processing, in one possible implementation, as shown in FIG. 5, the step includes the following steps.
步骤309A,通过预定图像识别技术识别原始图像中目标人脸的人脸特征,人脸特征包括肤色、脸型或人脸器官尺寸中的至少一种。 Step 309A, identifying a facial feature of the target human face in the original image by a predetermined image recognition technology, the facial feature including at least one of a skin color, a face shape, or a face organ size.
web服务器确定原始图像中包含目标人脸后,即通过图像识别技术对目标人脸进行人脸特征识别,从而得到肤色、脸型以及人脸器官尺寸等特征。After the web server determines that the original image contains the target face, the image recognition technology performs face feature recognition on the target face, thereby obtaining features such as skin color, face shape and face organ size.
可选的,web服务器根据人脸特征识别结果,计算目标人脸中各个人脸器 官的目标尺寸,从而根据该目标尺寸和实际的人脸器官尺寸,确定各个人脸器官的调整尺寸,以便后续基于该调整尺寸对人脸器官进行图像处理。Optionally, the web server calculates a target size of each face organ in the target face according to the face feature recognition result, so as to determine the adjustment size of each face organ according to the target size and the actual face organ size, so as to follow The face organ is image processed based on the resizing.
步骤309B,根据目标人脸的人脸特征从AR模型数据库中查找匹配的候选AR模型,候选AR模型的人脸特征所述目标人脸的人脸特征的相似度大于阈值。 Step 309B: Find a matching candidate AR model from the AR model database according to the face feature of the target face, and the similarity of the face features of the target face of the candidate AR model is greater than a threshold.
可选的,web服务器中存储有不同人脸特征的AR模型,比如瓜子脸的AR模型、国字脸的AR模型、长发圆脸的AR模型等等。为了使用户查看到与自身人脸特征较为相似的AR模型,web服务器基于上述步骤309A得到的目标人脸的人脸特征,在AR模型数据库中查找相似度大于阈值的AR模型。Optionally, the web server stores an AR model with different facial features, such as an AR model of the face of the face, an AR model of the face of the Chinese character, an AR model of the long face, and the like. In order for the user to view the AR model that is similar to the face feature of the user, the web server searches for the AR model with the similarity greater than the threshold in the AR model database based on the face feature of the target face obtained in the above step 309A.
比如,当目标人脸的人脸特征为国字脸、深肤色时,web服务器将AR模型数据库中满足上述人脸特征的AR模型确定为候选AR模型。For example, when the face feature of the target face is a national character face and a dark skin color, the web server determines an AR model satisfying the above face feature in the AR model database as a candidate AR model.
步骤309C,向终端发送候选AR模型对应的AR模型数据。 Step 309C: Send AR model data corresponding to the candidate AR model to the terminal.
进一步的,终端将查找到的候选AR模型对应的AR模型数据发送给终端,供终端进行渲染显示。Further, the terminal sends the AR model data corresponding to the candidate AR model to the terminal for rendering and display.
本申请实施例中,该AR模型数据采用OpenGL定义,包含顶点着色器和片段着色器,其中,顶点着色器是用于渲染AR模型的形状顶点的程序代码,片段着色器是用于渲染AR模型的颜色和/或纹理的程序代码。In the embodiment of the present application, the AR model data is defined by OpenGL, and includes a vertex shader and a fragment shader, wherein the vertex shader is program code for rendering a shape vertex of the AR model, and the fragment shader is used to render the AR model. Program code for color and/or texture.
步骤310,终端接收web服务器发送的AR模型数据。Step 310: The terminal receives the AR model data sent by the web server.
步骤311,终端根据AR模型数据渲染并显示至少一个AR模型,AR模型用于展示图像处理效果。Step 311: The terminal renders and displays at least one AR model according to the AR model data, and the AR model is used to display an image processing effect.
在一种可能的实施方式中,当终端运行的网页浏览器支持webGL技术,且接收到的AR模型数据采用OpenGL定义,包含顶点着色器和片段着色器时,终端根据AR模型数据渲染显示AR模型包括如下步骤:In a possible implementation manner, when the web browser running by the terminal supports the webGL technology, and the received AR model data is defined by OpenGL, including the vertex shader and the fragment shader, the terminal renders the AR model according to the AR model data. Including the following steps:
一、通过webGL技术对AR模型数据进行渲染,得到AR模型。First, the AR model data is rendered by the webGL technology to obtain the AR model.
可选的,对于支持webGL技术的网页浏览器,当接收到web服务器发送的AR模型数据时,网页浏览器通过webGL调用终端的GPU,从而利用该GPU分别运行顶点着色器和片段着色器,渲染得到相应的AR模型。相较于利用网页浏览器中专用的网页渲染插件(软件)进行3D模型渲染,本实施例中利用GPU(硬件)进行3D模型渲染的速度更快,且免去了开发额外的网页渲染插件。Optionally, for the web browser supporting the webGL technology, when receiving the AR model data sent by the web server, the web browser invokes the GPU of the terminal through the webGL, thereby using the GPU to respectively run the vertex shader and the fragment shader, and render Get the corresponding AR model. Compared with the dedicated webpage rendering plug-in (software) in the web browser for 3D model rendering, the GPU (hardware) is used to perform 3D model rendering faster, and the development of an additional webpage rendering plug-in is eliminated.
二、在图像处理网页中绘制显示AR模型。Second, draw and display the AR model in the image processing webpage.
在一种可能的实施方式中,网页浏览器根据AR模型数据渲染出AR模型后,通过gldraw对该AR模型进行绘制,并最终将绘制出的AR模型显示在终端屏幕上。In a possible implementation manner, after the web browser renders the AR model according to the AR model data, the AR model is drawn by gldraw, and finally the drawn AR model is displayed on the terminal screen.
示意性的,如图6A所示,终端在显示用户人脸61时,对渲染得到的第一AR模型62以及第二AR模型63进行显示,其中,第一AR模型62用于以3D动画的方式展示眼部放大的图像处理效果,第二AR模型63用于以3D动画的方式展示拉高鼻梁的图像处理效果。Illustratively, as shown in FIG. 6A, the terminal displays the rendered first AR model 62 and the second AR model 63 when displaying the user's face 61, wherein the first AR model 62 is used for 3D animation. The method displays the image processing effect of the enlarged eye, and the second AR model 63 is used to display the image processing effect of pulling the bridge of the nose in a 3D animation manner.
为了能够将虚拟AR模型显示到真实三维空间中,从而达到更加逼真的3D人脸模型显示效果,在另一种可能的实施方式中,终端在图像处理网页中绘制显示AR模型包括如下步骤。In order to be able to display the virtual AR model into the real three-dimensional space, thereby achieving a more realistic 3D face model display effect, in another possible implementation manner, the terminal drawing the display AR model in the image processing webpage includes the following steps.
一、根据当前画面构建三维空间。First, build a three-dimensional space according to the current picture.
可选的,终端识别当前画面中包含的各个物体,并根据各个物体在当前画面中的景深及相对位置关系,构建出与真实环境对应的三维空间。Optionally, the terminal identifies each object included in the current picture, and constructs a three-dimensional space corresponding to the real environment according to the depth of field and the relative positional relationship of each object in the current picture.
二、确定AR模型在三维空间中的显示坐标。Second, determine the display coordinates of the AR model in three-dimensional space.
在一种可能的实施方式中,终端进一步获取用户头部在三维空间中的头部坐标,并根据头部坐标确定AR模型在三维空间中的显示坐标,其中,AR模型的显示坐标与头部坐标相邻,即三维空间中,AR模型显示在用户头部周侧。In a possible implementation manner, the terminal further acquires the head coordinates of the user's head in the three-dimensional space, and determines the display coordinates of the AR model in the three-dimensional space according to the head coordinates, wherein the display coordinates and the head of the AR model The coordinates are adjacent, that is, in the three-dimensional space, the AR model is displayed on the side of the user's head.
三、根据该显示坐标在当前画面中绘制显示AR模型。3. Display and display the AR model in the current picture according to the display coordinates.
进一步的,终端根据确定出的显示坐标,在当前画面的相应位置显示AR模型,并调整AR模型的显示角度,从而模拟出在真实三维空间中显示虚拟模型的效果。Further, the terminal displays the AR model at the corresponding position of the current screen according to the determined display coordinates, and adjusts the display angle of the AR model, thereby simulating the effect of displaying the virtual model in the real three-dimensional space.
示意性的,如图6B所示,终端显示的当前画面中,用户人脸61的三维空间周侧显示有第一AR模型62和第二AR模型63。Illustratively, as shown in FIG. 6B, in the current screen displayed by the terminal, the first AR model 62 and the second AR model 63 are displayed on the three-dimensional space side of the user's face 61.
步骤312,终端向web服务器发送对目标AR模型的选择信号。In step 312, the terminal sends a selection signal to the target AR model to the web server.
示意性的,如图6A所示,当用户触摸第一AR模型62对应的显示区域时,终端即向web服务器发送对第一AR模型的选择信号;当用户触摸第二AR模型63对应的显示区域时,终端即向web服务器发送对第二AR模型的选择信号。Illustratively, as shown in FIG. 6A, when the user touches the display area corresponding to the first AR model 62, the terminal transmits a selection signal to the first AR model to the web server; when the user touches the display corresponding to the second AR model 63 In the case of the area, the terminal transmits a selection signal to the second AR model to the web server.
当虚拟AR模型显示在真实三维空间时,用户可以在三维空间中通过手势选中虚拟AR模型。如图6B所示,终端识别用户手指选中的三维空间区域,当检测到手指选中的三维空间区域与第一AR模型62对应的显示坐标相匹配 时,即确定选中第一AR模型62,并向web服务器发送对第一AR模型的选择信号。When the virtual AR model is displayed in the real three-dimensional space, the user can select the virtual AR model by gesture in the three-dimensional space. As shown in FIG. 6B, the terminal identifies the three-dimensional space region selected by the user's finger. When it is detected that the three-dimensional spatial region selected by the finger matches the display coordinate corresponding to the first AR model 62, the first AR model 62 is determined to be selected, and The web server sends a selection signal to the first AR model.
步骤313,web服务器接收终端发送的对目标AR模型的选择信号。Step 313: The web server receives a selection signal sent by the terminal to the target AR model.
步骤314,web服务器启用第二线程从缓冲池中读取第一图像数据。Step 314, the web server enables the second thread to read the first image data from the buffer pool.
如图4所示,web服务器在启用第一线程进行人脸识别的同时,并行启用第二线程对原始图像进行图像处理。其中,web服务器启用第二线程的方式与启用第一线程的方式相似,本实施例在此不再赘述。As shown in FIG. 4, the web server enables the second thread to perform image processing on the original image in parallel while enabling the first thread for face recognition. The manner in which the web server enables the second thread is similar to the manner in which the first thread is enabled. This embodiment is not described herein again.
在第二线程下,web服务器从缓冲池中读取第一图像数据,从而基于第一图像数据以及终端反馈的图像处理方式对原始图像中的目标人脸进行图像处理。Under the second thread, the web server reads the first image data from the buffer pool, thereby performing image processing on the target face in the original image based on the first image data and the image processing manner fed back by the terminal.
步骤315,web服务器根据目标AR模型对应的图像处理参数,对原始图像中的目标人脸进行图像处理。Step 315: The web server performs image processing on the target human face in the original image according to the image processing parameter corresponding to the target AR model.
在一种可能的实施方式中,web服务器在执行第二线程的同时轮询第一线程,并在第一线程中用户选中的目标AR模型发生变化,即用户切换图像处理方式时,根据变化后目标AR模型所展示的图像处理效果重新进行图像处理。In a possible implementation manner, the web server polls the first thread while executing the second thread, and changes the target AR model selected by the user in the first thread, that is, when the user switches the image processing mode, according to the change The image processing effect exhibited by the target AR model is re-image processed.
需要说明的是,当未接收到对目标AR模型的选择信号或原始图像中不包含目标人脸时,web服务器直接向终端反馈原始图像。It should be noted that when the selection signal for the target AR model is not received or the target face is not included in the original image, the web server directly feeds back the original image to the terminal.
步骤316,web服务器向终端发送第二图像数据。In step 316, the web server sends the second image data to the terminal.
在其他可能的实施方式中,为了加快图像处理后原始图像的反馈速度,web服务器检测到原始图像中包含目标人脸时,通过第二线程,基于各个AR模型对应图像处理参数对目标人脸进行图像处理,从而得到多组第二图像数据,并在接收到对目标AR模型的选择信号时,直接向终端反馈经过目标图像处理参数处理后原始图像对应的目标第二图像数据。In other possible implementation manners, in order to speed up the feedback speed of the original image after the image processing, when the web server detects that the target image includes the target human face, the second thread performs the target face based on the image processing parameters corresponding to each AR model. The image processing is performed to obtain a plurality of sets of second image data, and when the selection signal for the target AR model is received, the target second image data corresponding to the original image processed by the target image processing parameter is directly fed back to the terminal.
步骤317,终端接收web服务器发送第二图像数据,并进行渲染显示。Step 317: The terminal receives the second image data sent by the web server, and performs rendering display.
本实施例中,web服务器启用双线程,分别对原始图像进行人脸识别和图像处理,充分利用web服务器的处理资源,最大限度发挥硬件性能,提高终端界面的响应速度;同时,由于高并发的人脸识别和图像处理在web服务器侧执行,终端仅负责对图像处理后的原始图像进行渲染显示,因此即使在终端性能较差的情况下,也能达到较好的图像处理效果。In this embodiment, the web server enables dual-threading, and performs face recognition and image processing on the original image respectively, fully utilizes the processing resources of the web server, maximizes hardware performance, and improves the response speed of the terminal interface; meanwhile, due to high concurrent Face recognition and image processing are performed on the web server side, and the terminal is only responsible for rendering and displaying the original image after image processing, so that even in the case of poor terminal performance, a better image processing effect can be achieved.
区别于对图像中的各张人脸进行一致性处理,本实施例中服务器仅对原始图像中特定的目标人脸进行图像处理,达到了个性化美颜的效果。Different from the consistency processing of each face in the image, in this embodiment, the server performs image processing only on a specific target face in the original image, and achieves the effect of personalized beauty.
需要说明的是,上述各个实施例中,以终端为执行主体的步骤可以单独实现成为终端侧的图像显示方法,以服务器或web服务器为执行主体的步骤可以单独实现成为服务器侧的图像处理方法,本实施例在此不再赘述。It should be noted that, in the foregoing embodiments, the step of using the terminal as the execution subject may be separately implemented as the image display method on the terminal side, and the step of using the server or the web server as the execution subject may be separately implemented as the image processing method on the server side. This embodiment is not described here.
下述为本申请装置实施例,对于装置实施例中未详尽描述的细节,可以参考上述一一对应的方法实施例。The following is an embodiment of the apparatus of the present application. For details not specifically described in the apparatus embodiment, reference may be made to the one-to-one corresponding method embodiment.
请参考图7,其示出了本申请一个实施例提供的图像显示装置的结构方框图。该图像显示装置通过硬件或者软硬件的结合实现成为图1中终端110的全部或者一部分。该装置包括:第一发送模块710、第一接收模块720、第一显示模块730、第二发送模块740和第二显示模块750。Please refer to FIG. 7, which is a structural block diagram of an image display apparatus according to an embodiment of the present application. The image display device is implemented as a whole or a part of the terminal 110 in FIG. 1 by hardware or a combination of hardware and software. The device includes: a first sending module 710, a first receiving module 720, a first display module 730, a second sending module 740, and a second display module 750.
第一发送模块710,用于实现上述步骤203的功能;The first sending module 710 is configured to implement the function of step 203 above;
第一接收模块720,用于实现上述步骤206或310的功能;The first receiving module 720 is configured to implement the functions of the foregoing step 206 or 310;
第一显示模块730,用于实现上述步骤207或311的功能;The first display module 730 is configured to implement the functions of the foregoing step 207 or 311;
第二发送模块740,用于实现上述步骤208或312的功能;a second sending module 740, configured to implement the functions of the foregoing step 208 or 312;
第二显示模块750,用于实现上述步骤212或317的功能。The second display module 750 is configured to implement the functions of the foregoing step 212 or 317.
可选的,第一发送模块710,包括:访问单元、第一发送单元;Optionally, the first sending module 710 includes: an access unit, and a first sending unit;
访问单元,用于实现上述步骤303的功能;An access unit, configured to implement the functions of step 303 above;
第一发送单元,用于实现上述步骤304的功能;a first sending unit, configured to implement the function of step 304 above;
第一显示模块730,包括:The first display module 730 includes:
渲染单元,用于通过webGL技术对AR模型数据进行渲染,得到AR模型;a rendering unit, configured to render AR model data by using webGL technology to obtain an AR model;
显示单元,用于在图像处理网页中绘制显示AR模型。a display unit for drawing and displaying the AR model in the image processing webpage.
可选的,渲染单元,用于:Optionally, a rendering unit is used to:
通过webGL技术调用GPU;Calling the GPU through webGL technology;
通过所述GPU运行顶点着色器和片段着色器,渲染得到AR模型。The vertex shader and the fragment shader are run by the GPU, and the AR model is rendered.
可选的,该装置,还包括:上传模块;Optionally, the device further includes: an uploading module;
上传模块,用于实现上述步骤201或301的功能。The uploading module is used to implement the functions of step 201 or 301 above.
请参考图8,其示出了本申请一个实施例提供的图像处理装置的结构方框图。该图像处理装置通过硬件或者软硬件的结合实现成为图1中服务器120的全部或者一部分。该装置包括:第二接收模块810、第三发送模块820、第三接收模块830、处理模块840和第四发送模块850;Please refer to FIG. 8 , which is a structural block diagram of an image processing apparatus according to an embodiment of the present application. The image processing apparatus is implemented as a whole or a part of the server 120 in FIG. 1 by hardware or a combination of hardware and software. The device includes: a second receiving module 810, a third sending module 820, a third receiving module 830, a processing module 840, and a fourth sending module 850;
第二接收模块810,用于实现上述步骤204的功能;a second receiving module 810, configured to implement the functions of step 204 above;
第三发送模块820,用于实现上述步骤205的功能;a third sending module 820, configured to implement the functions of step 205 above;
第三接收模块830,用于实现上述步骤209或313的功能;The third receiving module 830 is configured to implement the functions of the foregoing step 209 or 313;
处理模块840,用于实现上述步骤210或315的功能;The processing module 840 is configured to implement the functions of the foregoing step 210 or 315;
第四发送模块850,用于实现上述步骤211或316的功能。The fourth sending module 850 is configured to implement the functions of the foregoing step 211 or 316.
可选的,第二接收模块810,还用于实现上述步骤305的功能。Optionally, the second receiving module 810 is further configured to implement the function of the foregoing step 305.
可选的,该装置,还包括:第四接收模块;Optionally, the device further includes: a fourth receiving module;
第四接收模块,用于实现上述步骤202或302的功能;a fourth receiving module, configured to implement the functions of the foregoing step 202 or 302;
该装置,还包括:存储模块、第一读取模块和识别模块;The device further includes: a storage module, a first reading module, and an identification module;
存储模块,用于实现上述步骤306的功能;a storage module, configured to implement the functions of step 306 above;
第一读取模块,用于实现上述步骤307的功能;a first reading module, configured to implement the function of step 307 above;
识别模块,用于实现上述步骤308的功能;An identification module, configured to implement the functions of step 308 above;
第三发送模块820,还用于实现上述步骤309的功能;The third sending module 820 is further configured to implement the function of the foregoing step 309;
该装置,还包括:第二读取模块;The device further includes: a second reading module;
第二读取模块,用于实现上述步骤314的功能。The second reading module is configured to implement the functions of step 314 above.
可选的,第三发送模块820,包括:识别单元、查找单元和发送单元;Optionally, the third sending module 820 includes: an identifying unit, a searching unit, and a sending unit;
识别单元,用于实现上述步骤309A的功能;An identification unit, configured to implement the function of step 309A above;
查找单元,用于实现上述步骤309B的功能;a searching unit, configured to implement the function of step 309B above;
发送单元,用于实现上述步骤309C的功能。The sending unit is configured to implement the function of step 309C.
请参考图9,其示出了本申请一个实施例提供的服务器的结构方框图。该服务器900实现为图1中的服务器120。具体来讲:Please refer to FIG. 9, which is a structural block diagram of a server provided by an embodiment of the present application. The server 900 is implemented as the server 120 of FIG. Specifically:
服务器900包括中央处理单元(CPU)901、包括随机存取存储器(RAM)902和只读存储器(ROM)903的系统存储器904,以及连接系统存储器904和中央处理单元901的系统总线905。所述服务器900还包括帮助计算机内的各个器件之间传输信息的基本输入/输出系统(I/O系统)906,和用于存储操作系统913、应用程序914和其他程序模块915的大容量存储设备907。The server 900 includes a central processing unit (CPU) 901, a system memory 904 including a random access memory (RAM) 902 and a read only memory (ROM) 903, and a system bus 905 that connects the system memory 904 and the central processing unit 901. The server 900 also includes a basic input/output system (I/O system) 906 that facilitates transfer of information between various devices within the computer, and mass storage for storing the operating system 913, applications 914, and other program modules 915. Device 907.
所述基本输入/输出系统906包括有用于显示信息的显示器908和用于用户输入信息的诸如鼠标、键盘之类的输入设备909。其中所述显示器908和输入设备909都通过连接到系统总线905的输入输出控制器910连接到中央处理单元901。所述基本输入/输出系统906还可以包括输入输出控制器910以用于接 收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器910还提供输出到显示屏、打印机或其他类型的输出设备。The basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse or keyboard for user input of information. Both the display 908 and the input device 909 are connected to the central processing unit 901 via an input and output controller 910 that is coupled to the system bus 905. The basic input/output system 906 can also include an input and output controller 910 for receiving and processing input from a plurality of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input and output controller 910 also provides output to a display screen, printer, or other type of output device.
所述大容量存储设备907通过连接到系统总线905的大容量存储控制器(未示出)连接到中央处理单元901。所述大容量存储设备907及其相关联的计算机可读介质为服务器900提供非易失性存储。也就是说,所述大容量存储设备907可以包括诸如硬盘或者CD-ROM驱动器之类的计算机可读介质(未示出)。The mass storage device 907 is connected to the central processing unit 901 by a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer readable medium provide non-volatile storage for the server 900. That is, the mass storage device 907 can include a computer readable medium (not shown) such as a hard disk or a CD-ROM drive.
不失一般性,所述计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM、EEPROM、闪存或其他固态存储其技术,CD-ROM、DVD或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知所述计算机存储介质不局限于上述几种。上述的系统存储器904和大容量存储设备907可以统称为存储器。Without loss of generality, the computer readable medium can include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid state storage technologies, CD-ROM, DVD or other optical storage, tape cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above. The system memory 904 and mass storage device 907 described above may be collectively referred to as a memory.
根据本申请的各种实施例,所述服务器900还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器900可以通过连接在所述系统总线905上的网络接口单元911连接到网络912,或者说,也可以使用网络接口单元911来连接到其他类型的网络或远程计算机系统(未示出)。According to various embodiments of the present application, the server 900 may also be operated by a remote computer connected to the network through a network such as the Internet. That is, the server 900 can be connected to the network 912 through a network interface unit 911 connected to the system bus 905, or can also be connected to other types of networks or remote computer systems (not shown) using the network interface unit 911. .
所述存储器还包括一个或者一个以上的程序,所述一个或者一个以上程序存储于存储器中,所述一个或者一个以上程序包含用于进行本发明实施例提供的图像处理方法的指令。本领域普通技术人员可以理解上述实施例的图像处理方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。The memory further includes one or more programs, the one or more programs being stored in a memory, the one or more programs including instructions for performing the image processing methods provided by embodiments of the present invention. A person skilled in the art can understand that all or part of the steps in the image processing method of the above embodiment can be completed by a program to instruct related hardware. The program can be stored in a computer readable storage medium, and the storage medium can include: Read Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.
请参考图10,其示出了本申请一个实施例提供的终端的结构示意图。该终端1000为图1中的终端110。具体来讲:Please refer to FIG. 10, which is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal 1000 is the terminal 110 in FIG. Specifically:
终端1000可以包括RF(Radio Frequency,射频)电路1010、包括有一个或一个以上计算机可读存储介质的存储器1020、输入单元1030、显示单元 1040、传感器1050、音频电路1060、近场通信模块1070、包括有一个或者一个以上处理核心的处理器1080、以及电源1090等部件。本领域技术人员可以理解,图10中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The terminal 1000 may include an RF (Radio Frequency) circuit 1010, a memory 1020 including one or more computer readable storage media, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a near field communication module 1070, A processor 1080 having one or more processing cores, and a power supply 1090 and the like are included. It will be understood by those skilled in the art that the terminal structure shown in FIG. 10 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or combine some components, or different component arrangements. among them:
RF电路1010可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器1080处理;另外,将涉及上行的数据发送给基站。通常,RF电路1010包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM)卡、收发信机、耦合器、LNA(Low Noise Amplifier,低噪声放大器)、双工器等。此外,RF电路1010还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于GSM(Global System of Mobile communication,全球移动通讯系统)、GPRS(General Packet Radio Service,通用分组无线服务)、CDMA(Code Division Multiple Access,码分多址)、WCDMA(Wideband Code Division Multiple Access,宽带码分多址)、LTE(Long Term Evolution,长期演进)、电子邮件、SMS(Short Messaging Service,短消息服务)等。The RF circuit 1010 can be used for receiving and transmitting signals during and after receiving or transmitting information, in particular, receiving downlink information of the base station and then processing it by one or more processors 1080; in addition, transmitting data related to the uplink to the base station . Generally, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier). , duplexer, etc. In addition, RF circuit 1010 can also communicate with the network and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
存储器1020可用于存储软件程序以及模块,处理器1080通过运行存储在存储器1020的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器1020可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端1000的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器1020还可以包括存储器控制器,以提供处理器1080和输入单元1030对存储器1020的访问。The memory 1020 can be used to store software programs and modules, and the processor 1080 executes various functional applications and data processing by running software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to The data created by the use of the terminal 1000 (such as audio data, phone book, etc.) and the like. Moreover, memory 1020 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 1020 can also include a memory controller to provide access to memory 1020 by processor 1080 and input unit 1030.
输入单元1030可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元1030可包括图像输入设备1031以及其他输入设备1032。图像输入设备1031可以是摄像头,也可以是光电扫描设备。除了图像输入设备1031,输入单元1030还可以包括其他输入设备1032。具体地,其他输入设备1032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、 鼠标、操作杆等中的一种或多种。 Input unit 1030 can be used to receive input numeric or character information, as well as to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. Specifically, the input unit 1030 may include an image input device 1031 and other input devices 1032. The image input device 1031 may be a camera or an optical scanning device. In addition to the image input device 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
显示单元1040可用于显示由用户输入的信息或提供给用户的信息以及终端1000的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元1040可包括显示面板1041,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板1041。 Display unit 1040 can be used to display information entered by the user or information provided to the user and various graphical user interfaces of terminal 1000, which can be constructed from graphics, text, icons, video, and any combination thereof. The display unit 1040 may include a display panel 1041. Alternatively, the display panel 1041 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
终端1000还可包括至少一种传感器1050,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1041的亮度,接近传感器可在终端1000移动到耳边时,关闭显示面板1041和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端1000还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Terminal 1000 can also include at least one type of sensor 1050, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 when the terminal 1000 moves to the ear. / or backlight. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for the terminal 1000 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, not here Let me repeat.
音频电路1060、扬声器1061,传声器1062可提供用户与终端1000之间的音频接口。音频电路1060可将接收到的音频数据转换后的电信号,传输到扬声器1061,由扬声器1061转换为声音信号输出;另一方面,传声器1062将收集的声音信号转换为电信号,由音频电路1060接收后转换为音频数据,再将音频数据输出处理器1080处理后,经RF电路1010以发送给比如另一电子设备,或者将音频数据输出至存储器1020以便进一步处理。音频电路1060还可能包括耳塞插孔,以提供外设耳机与终端1000的通信。 Audio circuit 1060, speaker 1061, and microphone 1062 can provide an audio interface between the user and terminal 1000. The audio circuit 1060 can transmit the converted electrical data of the received audio data to the speaker 1061, and convert it into a sound signal output by the speaker 1061; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, by the audio circuit 1060. After receiving, it is converted into audio data, and then processed by the audio data output processor 1080, transmitted to the electronic device such as another electronic device via the RF circuit 1010, or outputted to the memory 1020 for further processing. The audio circuit 1060 may also include an earbud jack to provide communication of the peripheral earphones with the terminal 1000.
终端1000通过近场通信模块1070与外部设备建立近场通信连接,并通过该近场通信连接进行数据交互。本实施例中,该近场通信模块1070具体包括蓝牙模块和/或WiFi模块。The terminal 1000 establishes a near field communication connection with the external device through the near field communication module 1070, and performs data interaction through the near field communication connection. In this embodiment, the near field communication module 1070 specifically includes a Bluetooth module and/or a WiFi module.
处理器1080是终端1000的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1020内的软件程序和/或模块,以及调用存储在存储器1020内的数据,执行终端1000的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器1080可包括一个或多个处理核心;优选的,处理器1080可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线 通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1080中。The processor 1080 is the control center of the terminal 1000, connecting various portions of the entire handset with various interfaces and lines, by running or executing software programs and/or modules stored in the memory 1020, and recalling data stored in the memory 1020, The various functions and processing data of the terminal 1000 are performed to perform overall monitoring of the mobile phone. Optionally, the processor 1080 may include one or more processing cores; preferably, the processor 1080 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1080.
终端1000还包括给各个部件供电的电源1090(比如电池),优选的,电源可以通过电源管理系统与处理器1080逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源1090还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The terminal 1000 also includes a power source 1090 (such as a battery) for powering various components. Preferably, the power source can be logically coupled to the processor 1080 through a power management system to manage functions such as charging, discharging, and power management through the power management system. The power supply 1090 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
尽管未示出,终端1000还可以包括蓝牙模块等,在此不再赘述。Although not shown, the terminal 1000 may further include a Bluetooth module or the like, and details are not described herein again.
具体在本实施例中,终端1000还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行以实现上述图像显示方法。Specifically, in this embodiment, the terminal 1000 further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors to implement the image display described above. method.
本领域普通技术人员可以理解上述实施例的图像显示方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。A person skilled in the art can understand that all or part of the steps in the image display method of the above embodiment can be completed by a program instructing related hardware, and the program can be stored in a computer readable storage medium, and the storage medium can include: Read memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the present invention, should be included in the protection of the present invention. Within the scope.

Claims (18)

  1. 一种图像显示方法,其特征在于,所述方法包括:An image display method, characterized in that the method comprises:
    向服务器上传目标人脸的目标人脸图像;Uploading a target face image of the target face to the server;
    向所述服务器发送原始图像对应的第一图像数据;Sending, to the server, first image data corresponding to the original image;
    接收所述服务器发送的增强现实AR模型数据,所述AR模型数据是所述原始图像中包含所述目标人脸时发送的,所述AR模型数据用于渲染至少一个AR模型,所述AR模型用于展示图像处理效果;Receiving, by the server, the augmented reality AR model data, where the AR model data is sent when the target image includes the target human face, and the AR model data is used to render at least one AR model, the AR model Used to display image processing effects;
    根据所述AR模型数据渲染并显示所述AR模型;Rendering and displaying the AR model according to the AR model data;
    向所述服务器发送对目标AR模型的选择信号,所述服务器用于根据所述目标AR模型对应的图像处理参数,对所述原始图像中的所述目标人脸进行图像处理;Sending a selection signal to the target AR model to the server, the server is configured to perform image processing on the target human face in the original image according to image processing parameters corresponding to the target AR model;
    接收所述服务器发送第二图像数据,并进行渲染显示,所述第二图像数据是经过图像处理后所述原始图像的图像数据。Receiving, by the server, sending second image data, and performing rendering display, wherein the second image data is image data of the original image after image processing.
  2. 根据权利要求1所述的方法,其特征在于,所述服务器为网页web服务器,所述向所述服务器发送原始图像对应的第一图像数据,包括:The method according to claim 1, wherein the server is a webpage web server, and the sending the first image data corresponding to the original image to the server comprises:
    通过浏览器访问图像处理网页,所述图像处理网页支持网页图形库webGL技术,且所述浏览器支持webGL技术;Accessing an image processing webpage through a browser, the image processing webpage supporting a web graphics library webGL technology, and the browser supports webGL technology;
    通过所述浏览器向所述图像处理网页对应的所述web服务器发送所述第一图像数据;Transmitting, by the browser, the first image data to the web server corresponding to the image processing webpage;
    所述根据所述AR模型数据渲染并显示所述AR模型,包括:The rendering and displaying the AR model according to the AR model data includes:
    通过webGL技术对所述AR模型数据进行渲染,得到所述AR模型;Rendering the AR model data by using a webGL technology to obtain the AR model;
    在所述图像处理网页中绘制显示所述AR模型。The AR model is displayed and displayed in the image processing web page.
  3. 根据权利要求2所述的方法,其特征在于,所述AR模型数据中包含顶点着色器和片段着色器,所述顶点着色器是用于渲染所述AR模型的形状顶点的程序代码,所述片段着色器是用于渲染所述AR模型的颜色和/或纹理的程序代码;The method according to claim 2, wherein said AR model data includes a vertex shader and a fragment shader, said vertex shader being program code for rendering a shape vertex of said AR model, said A fragment shader is program code for rendering colors and/or textures of the AR model;
    所述通过所述webGL技术对所述AR模型数据进行渲染,得到所述AR模型,包括:The AR model data is rendered by using the webGL technology to obtain the AR model, including:
    通过所述webGL技术调用图像处理器GPU;Calling the image processor GPU through the webGL technology;
    通过所述GPU运行所述顶点着色器和所述片段着色器,渲染得到所述AR模型。The AR model is rendered by running the vertex shader and the fragment shader through the GPU.
  4. 一种图像处理方法,其特征在于,所述方法包括:An image processing method, the method comprising:
    接收终端上传的目标人脸的目标人脸图像;Receiving a target face image of the target face uploaded by the terminal;
    接收所述终端发送的原始图像对应的第一图像数据;Receiving first image data corresponding to the original image sent by the terminal;
    当所述原始图像中包含所述目标人脸时,向所述终端发送增强现实AR模型数据,所述终端用于根据所述AR模型数据渲染并显示至少一个AR模型,所述AR模型用于展示图像处理效果;And when the target image includes the target human face, transmitting, by the terminal, augmented reality AR model data, where the terminal is configured to render and display at least one AR model according to the AR model data, where the AR model is used to Display image processing effects;
    接收终端发送的对目标AR模型的选择信号;Receiving a selection signal sent by the terminal to the target AR model;
    根据所述目标AR模型对应的图像处理参数,对所述原始图像中的所述目标人脸进行图像处理;Performing image processing on the target face in the original image according to image processing parameters corresponding to the target AR model;
    向所述终端发送第二图像数据,所述第二图像数据是经过图像处理后所述原始图像的图像数据,所述终端用于对所述第二图像数据进行渲染显示。Sending second image data to the terminal, the second image data is image data of the original image after image processing, and the terminal is configured to perform rendering display on the second image data.
  5. 根据权利要求4所述的方法,其特征在于,所述接收所述终端发送的原始图像对应的第一图像数据,包括:The method according to claim 4, wherein the receiving the first image data corresponding to the original image sent by the terminal comprises:
    通过图像处理网页接收所述终端发送的第一图像数据,所述图像处理网页支持网页图形库webGL技术,且所述终端通过支持webGL技术的浏览器访问所述图像处理网页时,通过所述浏览器发送所述第一图像数据。Receiving, by the image processing webpage, the first image data sent by the terminal, where the image processing webpage supports the webpage graphics library webGL technology, and the terminal accesses the image processing webpage through a browser supporting the webGL technology, Transmitting the first image data.
  6. 根据权利要求4或5所述的方法,其特征在于,所述接收所述终端发送的原始图像的第一图像数据之后,还包括:The method according to claim 4 or 5, wherein after the receiving the first image data of the original image sent by the terminal, the method further comprises:
    将所述第一图像数据存入缓冲池;Depositing the first image data into a buffer pool;
    启用第一线程从所述缓冲池中读取所述第一图像数据;Enabling the first thread to read the first image data from the buffer pool;
    根据所述目标人脸图像识别所述原始图像中是否包含所述目标人脸;Identifying whether the target face is included in the original image according to the target face image;
    当所述原始图像中包含所述目标人脸时,执行所述向所述终端发送AR模型数据的步骤;Performing the step of transmitting the AR model data to the terminal when the target face is included in the original image;
    所述根据所述目标AR模型对应的图像处理参数,对所述原始图像中的所述目标人脸进行图像处理之前,还包括:Before performing image processing on the target face in the original image according to the image processing parameter corresponding to the target AR model, the method further includes:
    启用第二线程从所述缓冲池中读取所述第一图像数据。The second thread is enabled to read the first image data from the buffer pool.
  7. 根据权利要求6所述的方法,其特征在于,所述向所述终端发送AR模型数据,包括:The method according to claim 6, wherein the transmitting the AR model data to the terminal comprises:
    通过预定图像识别技术识别所述原始图像中所述目标人脸的人脸特征,所述人脸特征包括肤色、脸型或人脸器官尺寸中的至少一种;Recognizing a facial feature of the target human face in the original image by a predetermined image recognition technique, the facial feature including at least one of a skin color, a face shape, or a face organ size;
    根据所述目标人脸的人脸特征从AR模型数据库中查找匹配的候选AR模型,所述候选AR模型的人脸特征所述目标人脸的人脸特征的相似度大于阈值;Finding a matching candidate AR model from the AR model database according to the face feature of the target face, the face feature of the candidate AR model, the similarity of the face feature of the target face is greater than a threshold;
    向所述终端发送所述候选AR模型对应的AR模型数据。Sending AR model data corresponding to the candidate AR model to the terminal.
  8. 一种图像显示装置,其特征在于,所述装置包括:An image display device, characterized in that the device comprises:
    上传模块,用于向服务器上传目标人脸的目标人脸图像;An uploading module, configured to upload a target face image of the target face to the server;
    第一发送模块,用于向所述服务器发送原始图像对应的第一图像数据;a first sending module, configured to send, to the server, first image data corresponding to the original image;
    第一接收模块,用于接收所述服务器发送的增强现实AR模型数据,所述AR模型数据是所述原始图像中包含所述目标人脸时发送的,所述AR模型数据用于渲染至少一个AR模型,所述AR模型用于展示图像处理效果;a first receiving module, configured to receive the augmented reality AR model data sent by the server, where the AR model data is sent when the target image includes the target human face, and the AR model data is used to render at least one An AR model for displaying an image processing effect;
    第一显示模块,用于根据所述AR模型数据渲染并显示所述AR模型;a first display module, configured to render and display the AR model according to the AR model data;
    第二发送模块,用于向所述服务器发送对目标AR模型的选择信号,所述服务器用于根据所述目标AR模型对应的图像处理参数,对所述原始图像中的所述目标人脸进行图像处理;a second sending module, configured to send, to the server, a selection signal for a target AR model, where the server is configured to perform, according to the image processing parameter corresponding to the target AR model, the target face in the original image Image Processing;
    第二显示模块,用于接收所述服务器发送的第二图像数据,并进行渲染显示,所述第二图像数据是经过图像处理后所述原始图像的图像数据。a second display module, configured to receive second image data sent by the server, and perform rendering display, where the second image data is image data of the original image after image processing.
  9. 根据权利要求8所述的装置,其特征在于,所述服务器为网页web服务器,所述第一发送模块,包括:The device according to claim 8, wherein the server is a webpage web server, and the first sending module comprises:
    访问单元,用于通过浏览器访问图像处理网页,所述图像处理网页支持网页图形库webGL技术,且所述浏览器支持webGL技术;An access unit for accessing an image processing webpage through a browser, the image processing webpage supporting a web graphics library webGL technology, and the browser supports webGL technology;
    第一发送单元,用于通过所述浏览器向所述图像处理网页对应的所述web服务器发送所述第一图像数据;a first sending unit, configured to send, by using the browser, the first image data to the web server corresponding to the image processing webpage;
    所述第一显示模块,包括:The first display module includes:
    渲染单元,用于通过webGL技术对所述AR模型数据进行渲染,得到所述 AR模型;a rendering unit, configured to render the AR model data by using a webGL technology to obtain the AR model;
    显示单元,用于在所述图像处理网页中绘制显示所述AR模型。And a display unit, configured to draw and display the AR model in the image processing webpage.
  10. 根据权利要求8所述的装置,其特征在于,所述AR模型数据中包含顶点着色器和片段着色器,所述顶点着色器是用于渲染所述AR模型的形状顶点的程序代码,所述片段着色器是用于渲染所述AR模型的颜色和/或纹理的程序代码;The apparatus according to claim 8, wherein said AR model data includes a vertex shader and a fragment shader, said vertex shader being program code for rendering a shape vertex of said AR model, said A fragment shader is program code for rendering colors and/or textures of the AR model;
    所述渲染单元,用于:The rendering unit is configured to:
    通过所述webGL技术调用图像处理器GPU;Calling the image processor GPU through the webGL technology;
    通过所述GPU运行所述顶点着色器和所述片段着色器,渲染得到所述AR模型。The AR model is rendered by running the vertex shader and the fragment shader through the GPU.
  11. 一种图像处理装置,其特征在于,所述装置包括:An image processing apparatus, characterized in that the apparatus comprises:
    第四接收模块,用于接收终端上传的目标人脸的目标人脸图像;a fourth receiving module, configured to receive a target face image of the target face uploaded by the terminal;
    第二接收模块,用于接收所述终端发送的原始图像对应的第一图像数据;a second receiving module, configured to receive first image data corresponding to the original image sent by the terminal;
    第三发送模块,用于当所述原始图像中包含所述目标人脸时,向所述终端发送增强现实AR模型数据,所述终端用于根据所述AR模型数据渲染并显示至少一个AR模型,所述AR模型用于展示图像处理效果;a third sending module, configured to send, when the target image includes the target human face, augmented reality AR model data, where the terminal is configured to render and display at least one AR model according to the AR model data. The AR model is used to display an image processing effect;
    第三接收模块,用于接收终端发送的对目标AR模型的选择信号;a third receiving module, configured to receive a selection signal sent by the terminal to the target AR model;
    处理模块,用于根据所述目标AR模型对应的图像处理参数,对所述原始图像中的所述目标人脸进行图像处理;a processing module, configured to perform image processing on the target human face in the original image according to image processing parameters corresponding to the target AR model;
    第四发送模块,用于向所述终端发送第二图像数据,所述第二图像数据是经过图像处理后所述原始图像的图像数据,所述终端用于对所述第二图像数据进行渲染显示。a fourth sending module, configured to send second image data to the terminal, where the second image data is image data of the original image after image processing, and the terminal is configured to render the second image data display.
  12. 根据权利要求11所述的装置,其特征在于,所述第二接收模块,用于:The device according to claim 11, wherein the second receiving module is configured to:
    通过图像处理网页接收所述终端发送的第一图像数据,所述图像处理网页支持网页图形库webGL技术,且所述终端通过支持webGL技术的浏览器访问所述图像处理网页时,通过所述浏览器发送所述第一图像数据。Receiving, by the image processing webpage, the first image data sent by the terminal, where the image processing webpage supports the webpage graphics library webGL technology, and the terminal accesses the image processing webpage through a browser supporting the webGL technology, Transmitting the first image data.
  13. 根据权利要求11或12所述的装置,其特征在于,所述装置,还包括:The device according to claim 11 or 12, wherein the device further comprises:
    存储模块,用于将所述第一图像数据存入缓冲池;a storage module, configured to store the first image data into a buffer pool;
    第一读取模块,用于启用第一线程从所述缓冲池中读取所述第一图像数据;a first reading module, configured to enable the first thread to read the first image data from the buffer pool;
    识别模块,用于根据所述目标人脸图像识别所述原始图像中是否包含所述目标人脸;An identification module, configured to identify, according to the target face image, whether the target face is included in the original image;
    所述装置,还包括:The device further includes:
    第二读取模块,用于启用第二线程从所述缓冲池中读取所述第一图像数据。a second reading module, configured to enable the second thread to read the first image data from the buffer pool.
  14. 根据权利要求13所述的装置,其特征在于,所述第三发送模块,包括:The device according to claim 13, wherein the third sending module comprises:
    识别单元,用于通过预定图像识别技术识别所述原始图像中所述目标人脸的人脸特征,所述人脸特征包括肤色、脸型或人脸器官尺寸中的至少一种;a recognition unit, configured to identify a facial feature of the target human face in the original image by a predetermined image recognition technology, the facial feature including at least one of a skin color, a face shape, or a face organ size;
    查找单元,用于根据所述目标人脸的人脸特征从AR模型数据库中查找匹配的候选AR模型,所述候选AR模型的人脸特征所述目标人脸的人脸特征的相似度大于阈值;a searching unit, configured to search, according to the facial features of the target human face, a matching candidate AR model from an AR model database, where the similarity of the facial features of the target facial face of the candidate AR model is greater than a threshold ;
    发送单元,用于向所述终端发送所述候选AR模型对应的AR模型数据。And a sending unit, configured to send, to the terminal, AR model data corresponding to the candidate AR model.
  15. 一种终端,其特征在于,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求1至3任一所述的图像显示方法。A terminal, comprising: a processor and a memory, wherein the memory stores at least one instruction loaded by the processor and executed to implement the method of any one of claims 1 to 3. The image display method.
  16. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1至3任一所述的图像显示方法。A computer readable storage medium, characterized in that the storage medium stores at least one instruction loaded by a processor and executed to implement the image display method according to any one of claims 1 to 3.
  17. 一种服务器,其特征在于,所述服务器包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求4至7任一所述的图像处理方法。A server, comprising: a processor and a memory, wherein the memory stores at least one instruction loaded by the processor and executed to implement the method of any one of claims 4 to 7. Image processing method.
  18. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求4至7任一所述的图像处理方法。A computer readable storage medium, characterized in that the storage medium stores at least one instruction loaded by a processor and executed to implement the image processing method according to any one of claims 4 to 7.
PCT/CN2018/086377 2017-05-31 2018-05-10 Image display method, image processing method and device, terminal and server WO2018219120A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710400342.6A CN107247548B (en) 2017-05-31 2017-05-31 Method for displaying image, image processing method and device
CN201710400342.6 2017-05-31

Publications (1)

Publication Number Publication Date
WO2018219120A1 true WO2018219120A1 (en) 2018-12-06

Family

ID=60017813

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/086377 WO2018219120A1 (en) 2017-05-31 2018-05-10 Image display method, image processing method and device, terminal and server

Country Status (2)

Country Link
CN (1) CN107247548B (en)
WO (1) WO2018219120A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114554079A (en) * 2022-01-11 2022-05-27 浙江大华技术股份有限公司 Intelligent service management method and intelligent service management system
EP4177724A4 (en) * 2020-09-17 2023-12-06 Beijing Bytedance Network Technology Co., Ltd. Facial image display method and apparatus, and electronic device and storage medium

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247548B (en) * 2017-05-31 2018-09-04 腾讯科技(深圳)有限公司 Method for displaying image, image processing method and device
CN107767462B (en) * 2017-10-16 2023-08-25 北京视据科技有限公司 Non-wearable augmented reality holographic display method and display system
CN107766013A (en) * 2017-10-18 2018-03-06 重庆德固科技有限公司 A kind of 3D printing system for supporting to be wirelessly transferred
CN107521110A (en) * 2017-10-18 2017-12-29 重庆德固科技有限公司 A kind of 3D printer of the automatic U.S. face of energy
CN107766012A (en) * 2017-10-18 2018-03-06 重庆德固科技有限公司 Based on the 3D printing equipment for supporting the U.S. face of terminal and scene
CN107833264B (en) 2017-11-13 2019-02-01 百度在线网络技术(北京)有限公司 A kind of image processing method, device, equipment and computer readable storage medium
CN108364324B (en) * 2018-01-22 2021-10-08 杭州橙云科技创新服务有限公司 Image data processing method and device and electronic terminal
CN108597028A (en) * 2018-04-11 2018-09-28 北京邮电大学 A kind of method, apparatus and equipment of continuous load Web AR objects
CN108629296A (en) * 2018-04-17 2018-10-09 广州视源电子科技股份有限公司 Image processing method and device
CN109379551B (en) * 2018-11-26 2021-05-18 京东方科技集团股份有限公司 Enhanced content display method, processing method, display device and processing device
CN109743626B (en) * 2019-01-02 2022-08-12 京东方科技集团股份有限公司 Image display method, image processing method and related equipment
CN111192641B (en) * 2019-12-20 2023-06-23 深圳晶泰科技有限公司 System and method for user interaction in complex web 3D scene
CN112333468B (en) * 2020-09-28 2023-05-12 影石创新科技股份有限公司 Image processing method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2654019A2 (en) * 2012-04-18 2013-10-23 Samsung Electronics Co., Ltd Method for displaying augmented reality image and electronic device thereof
CN105139450A (en) * 2015-09-11 2015-12-09 重庆邮电大学 Three-dimensional virtual character construction method and system on the basis of human face simulation
CN105657249A (en) * 2015-12-16 2016-06-08 东莞酷派软件技术有限公司 Image processing method and user terminal
CN106303646A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 Method, electronic equipment and the server of a kind of specially good effect coupling
CN106303354A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 A kind of face specially good effect recommends method and electronic equipment
CN107247548A (en) * 2017-05-31 2017-10-13 腾讯科技(深圳)有限公司 Method for displaying image, image processing method and device

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007066177A (en) * 2005-09-01 2007-03-15 Media Groove:Kk Image processor, and image processing method and program
JP5620674B2 (en) * 2009-12-15 2014-11-05 キヤノン株式会社 Image processing apparatus, image processing apparatus control method, and program
JP5845830B2 (en) * 2011-11-09 2016-01-20 ソニー株式会社 Information processing apparatus, display control method, and program
US20140176548A1 (en) * 2012-12-21 2014-06-26 Nvidia Corporation Facial image enhancement for video communication
KR20140122054A (en) * 2013-04-09 2014-10-17 삼성전자주식회사 converting device for converting 2-dimensional image to 3-dimensional image and method for controlling thereof
CN103632165B (en) * 2013-11-28 2017-07-04 小米科技有限责任公司 A kind of method of image procossing, device and terminal device
CN105321196A (en) * 2014-07-21 2016-02-10 上海羽舟网络科技有限公司 3D image processing method and system
CN104461215A (en) * 2014-11-12 2015-03-25 深圳市东信时代信息技术有限公司 Augmented reality system and method based on virtual augmentation technology
JP6376403B2 (en) * 2015-05-08 2018-08-22 雅之 澤田 Target discovery system using face image intermittent clipping control mechanism for the same person video
CN104967774B (en) * 2015-06-05 2018-03-27 广东欧珀移动通信有限公司 A kind of method and terminal for controlling dual camera shooting
KR20160146281A (en) * 2015-06-12 2016-12-21 삼성전자주식회사 Electronic apparatus and method for displaying image
CN105096241A (en) * 2015-07-28 2015-11-25 努比亚技术有限公司 Face image beautifying device and method
CN105915782A (en) * 2016-03-29 2016-08-31 维沃移动通信有限公司 Picture obtaining method based on face identification, and mobile terminal
CN105979035B (en) * 2016-06-28 2019-08-27 Oppo广东移动通信有限公司 A kind of augmented reality AR image processing method, device and intelligent terminal
CN106101575B (en) * 2016-06-28 2019-06-21 Oppo广东移动通信有限公司 A kind of generation method, device and the mobile terminal of augmented reality photo
CN106250187A (en) * 2016-07-29 2016-12-21 宇龙计算机通信科技(深圳)有限公司 The information processing method of a kind of augmented reality AR, Apparatus and system
CN106296701A (en) * 2016-08-15 2017-01-04 北京小米移动软件有限公司 Image processing method and device
CN106294820A (en) * 2016-08-16 2017-01-04 深圳市金立通信设备有限公司 A kind of method instructing cosmetic and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2654019A2 (en) * 2012-04-18 2013-10-23 Samsung Electronics Co., Ltd Method for displaying augmented reality image and electronic device thereof
CN105139450A (en) * 2015-09-11 2015-12-09 重庆邮电大学 Three-dimensional virtual character construction method and system on the basis of human face simulation
CN105657249A (en) * 2015-12-16 2016-06-08 东莞酷派软件技术有限公司 Image processing method and user terminal
CN106303646A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 Method, electronic equipment and the server of a kind of specially good effect coupling
CN106303354A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 A kind of face specially good effect recommends method and electronic equipment
CN107247548A (en) * 2017-05-31 2017-10-13 腾讯科技(深圳)有限公司 Method for displaying image, image processing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4177724A4 (en) * 2020-09-17 2023-12-06 Beijing Bytedance Network Technology Co., Ltd. Facial image display method and apparatus, and electronic device and storage medium
US11935176B2 (en) 2020-09-17 2024-03-19 Beijing Bytedance Network Technology Co., Ltd. Face image displaying method and apparatus, electronic device, and storage medium
CN114554079A (en) * 2022-01-11 2022-05-27 浙江大华技术股份有限公司 Intelligent service management method and intelligent service management system

Also Published As

Publication number Publication date
CN107247548B (en) 2018-09-04
CN107247548A (en) 2017-10-13

Similar Documents

Publication Publication Date Title
WO2018219120A1 (en) Image display method, image processing method and device, terminal and server
CN109427083B (en) Method, device, terminal and storage medium for displaying three-dimensional virtual image
WO2018171429A1 (en) Image stitching method, device, terminal, and storage medium
CN109951654B (en) Video synthesis method, model training method and related device
JP7206388B2 (en) Virtual character face display method, apparatus, computer device, and computer program
WO2019184889A1 (en) Method and apparatus for adjusting augmented reality model, storage medium, and electronic device
CN111417028B (en) Information processing method, information processing device, storage medium and electronic equipment
WO2018077206A1 (en) Augmented reality scene generation method, device, system and equipment
CN108985220B (en) Face image processing method and device and storage medium
CN108551519B (en) Information processing method, device, storage medium and system
WO2020233403A1 (en) Personalized face display method and apparatus for three-dimensional character, and device and storage medium
JP7467667B2 (en) Detection result output method, electronic device and medium
CN109426343B (en) Collaborative training method and system based on virtual reality
WO2022062808A1 (en) Portrait generation method and device
WO2022237116A1 (en) Image processing method and apparatus
WO2020083178A1 (en) Digital image display method, apparatus, electronic device, and storage medium
US11922587B2 (en) Dynamic augmented reality experience
US20220317774A1 (en) Real-time communication interface with haptic and audio feedback response
CN111756705B (en) Attack testing method, device, equipment and storage medium of in-vivo detection algorithm
US11567335B1 (en) Selector input device to target recipients of media content items
US20220206582A1 (en) Media content items with haptic feedback augmentations
US20220377309A1 (en) Hardware encoder for stereo stitching
US20220317775A1 (en) Virtual reality communication interface with haptic feedback response
US20220210370A1 (en) Real-time video communication interface with haptic feedback response
US20230069614A1 (en) High-definition real-time view synthesis

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18808884

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18808884

Country of ref document: EP

Kind code of ref document: A1