Surface normal of pixel alignment object

By estimating surface normal tensors in images using machine learning models in AR systems, the problem of increasing device complexity in the existing technology is solved, realizing the application of realistic AR effects on objects in the image, and improving AR The overall performance of the system.

CN119013697APending Publication Date: 2024-11-22SNAP INC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202380031909.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-06-16
Filing Date
2023-03-30
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Existing augmented reality (AR) systems are difficult to identify and process complex scenes in images without using depth sensors, especially when the object exceeds a threshold distance from the camera device, resulting in background replacement failure and image quality degradation, which cannot be appropriately used. Apply visual effects to the whole object.

Method used

By cropping parts of an object from an image or video, a machine learning model is applied to estimate the segmentation and surface normal tensor of the object, and then applying augmented reality effects in the image, modifying only parts of the object without affecting the background.

Benefits of technology

It significantly improves the fidelity of the AR effect, reduces the total amount of system resources, and provides a more realistic real-world environment illusion without using depth sensors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119013697A_ABST
    Figure CN119013697A_ABST
Patent Text Reader

Abstract

Methods and systems are disclosed for performing operations for applying augmented reality elements to a person depicted in an image. Operations include: receiving an image including data representing a depiction of a person; generating a segmentation of data representing a person depicted in the image; extracting a portion in the image corresponding to the division of the data representing the person depicted in the image; applying a machine learning model to the portion of the image to predict a surface normal tensor representing the depicted data of the person, the surface normal tensor representing a surface normal for each pixel within the portion of the image; and applying one or more augmented reality (AR) elements to the image based on the surface normal tensor.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Priority declaration

[0002] This application claims the benefit of priority to Greek patent application serial number 20220100284 filed on March 30, 2022 and U.S. patent application serial number 17 / 841,994 filed on June 16, 2022, each of which is incorporated herein by reference in its entirety. Technical Field

[0003] The present disclosure generally relates to providing an augmented reality experience using a messaging application. Background Art

[0004] Augmented reality (AR) is a modification of a virtual environment. For example, in virtual reality (VR), the user is completely immersed in a virtual world, while in AR, the user is immersed in a world that combines virtual objects with the real world or superimposes virtual objects on the real world. AR systems are designed to generate and present virtual objects that interact realistically with the real world environment and with each other. Examples of AR applications can include single or multiplayer video games, instant messaging systems, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0005] In the accompanying drawings (which are not necessarily drawn to scale), like numbers may describe similar components in different views. To easily identify the discussion of any particular element or action, the most significant digit or digits in a reference numeral refer to the figure number in which the element is first introduced. Some non-limiting examples are shown in the accompanying drawings, in which:

[0006] Figure 1 is a diagrammatic representation of a networking environment in which the present disclosure may be deployed, according to some examples.

[0007] Figure 2 is a diagrammatic representation of a messaging client application according to some examples.

[0008] Figure 3 is a diagrammatic representation of data structures maintained in a database according to some examples.

[0009] Figure 4 is a graphical representation of messages according to some examples.

[0010] Figure 5 is a block diagram illustrating an example surface normal tensor control system according to some examples.

[0011] Figure 6 , Figure 7 and Figure 8 is a graphical representation of the output of a surface normal tensor control system according to some examples.

[0012] Fig. 9 is a flow chart illustrating example operation of a surface normal tensor control system according to some examples.

[0013] Fig.10 is a diagrammatic representation of a machine in the form of a computer system according to some examples within which a set of instructions may be executed for causing the machine to perform any one or more of the methodologies discussed herein.

[0014] Fig.11 is a block diagram illustrating a software architecture in which examples may be implemented. DETAILED DESCRIPTION

[0015] The following description includes systems, methods, techniques, instruction sequences and computing machine program products that implement the illustrative examples of the present disclosure. In the following description, for the purpose of illustration, many specific details are set forth to provide an understanding of various examples. However, it will be apparent to those skilled in the art that examples may be practiced without these specific details. Typically, it is not necessary to show in detail known instruction instances, protocols, structures and techniques.

[0016] Typically, VR and AR systems display an image representing a given real-world object such as a user by capturing an image of the object and additionally using a depth sensor to obtain a depth map of the real-world object depicted in the image. By processing the depth map and the image together, VR and AR systems can detect the positioning of the object in the image and can modify the object or background in the image appropriately. While such systems can work well, the need for a depth sensor limits their scope of application. This is because adding a depth sensor to a user device for the purpose of modifying the image increases the overall cost and complexity of the device, making them less attractive.

[0017] Some systems do not require the use of a depth sensor to modify an image. For example, some systems allow a user to replace the background in a video conference in which the user's face is detected. Specifically, such systems can use specialized techniques optimized for identifying a portion of an object such as a user's face to identify the background in an image that depicts a portion of an object (e.g., a user's face). These systems can then replace only those pixels that depict the background, so that the real-world background is replaced by the alternative background in the image. However, such systems are generally unable to recognize the entirety of an object such as a user's entire body. Therefore, if the object is greater than a threshold distance from the camera device, so that more than just a portion of the object (e.g., the user's face) is captured by the camera device, then replacing the background with the alternative background begins to fail. In this case, image quality is severely affected, and portions of the object (e.g., the user's face and body) may be inadvertently removed by the system because the system mistakenly identifies such portions as belonging to the background of the image rather than the foreground.

[0018] Furthermore, these types of systems also fail to properly replace the background when more than one object is depicted in an image or video feed. Since such systems are typically unable to distinguish the entirety of an object from the background, these systems also fail to apply visual effects to certain parts of an object. For example, a system that recognizes a user's face may fail to apply visual effects to other parts of the user, such as the user's body, articles of clothing, etc.

[0019] The disclosed technology improves the efficiency of using an electronic device by cropping a portion of an object (e.g., a person's body) depicted in an image or video from the image or video and applying a machine learning model to the cropped object to estimate both the segmentation of the object and the surface normal tensor. The surface normal tensor can represent the surface normal of each pixel that is a segmented portion of the object depicted in the image. This enables the disclosed system to apply one or more AR effects only to the object depicted in the image (e.g., a person's body) without affecting the background. Therefore, a more realistic display of AR effects can be provided to the user, thereby significantly improving the illusion that such AR effects are part of the real-world environment.

[0020] In some examples, the surface normal of the pixel of the object is calculated or provided relative to the surface normal of the camera or camera used to capture the image or video. In some examples, the disclosed technology can change the lighting effects and reflections on the object, for example, by adding effects to the human body and / or fashion items or clothing worn by the human body. AR effects can be applied based on the geometry of objects such as a person's body, a person's hair, a person's clothes, and / or one or more accessories worn by a person. In some examples, artificial light can be applied to data representing an object depicted in an image based on a surface normal tensor. In this case, the surface normal tensor provides information about details of the object such as wrinkles of the skin or fashion items worn by a person, so as to modify the shadows and / or reflections of the artificial light in a realistic manner. For example, a portion of one or more AR elements covering one or more wrinkles can be bent based on the surface normal tensor. In some examples, two AR elements such as 3D columns can be generated to extend from corresponding pixels along corresponding directions of the surface normals of such pixels.

[0021] This improves the overall experience of the user when using the electronic device. In addition, by performing such segmentation without the use of a depth sensor, the total amount of system resources required to complete the task is reduced.

[0022] Networked computing environment

[0023] Figure 1 1 is a block diagram illustrating an example messaging system 100 for exchanging data (e.g., messages and associated content) over a network. The messaging system 100 includes multiple instances of a client device 102, each of the multiple instances hosting a number of applications including a messaging client 104 and other external applications 109 (e.g., third-party applications). Each messaging client 104 is communicatively coupled to other instances of the messaging client 104 (e.g., hosted on corresponding other client devices 102), a messaging server system 108, and an external application server 110 via a network 112 (e.g., the Internet). The messaging client 104 may also communicate with locally hosted third-party applications such as the external application 109 using an application program interface (API).

[0024] The client device 102 can operate as a standalone device, or can be coupled (e.g., networked) to other machines. In a networked deployment, the client device 102 can operate with the capabilities of a server machine or a client machine in a server-client network environment, or operate as a peer machine in a peer-to-peer (or distributed) network environment. The client device 102 may include, but is not limited to, a server computer, a client computer, a personal computer (PC), a tablet computer, a notebook computer, a netbook, a set-top box (STB), a personal digital assistant (PDA), an entertainment media system, a cellular phone, a smart phone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web device, a network router, a network switch, a network bridge, or any machine capable of performing the disclosed operations. In addition, although only a single client device 102 is shown, the term "client device" should also be considered to include a collection of machines that perform the disclosed operations individually or jointly.

[0025] In some examples, client device 102 may include AR glasses or AR headsets, where virtual content or AR / VR elements are displayed within the lenses of the glasses while the user views the real world environment through the lenses. For example, images may be presented on a transparent display, which allows the user to simultaneously view virtual content and real-world objects presented on the display.

[0026] The messaging clients 104 are able to communicate and exchange data with other messaging clients 104 and messaging server systems 108 via the network 112. The data exchanged between the messaging clients 104 and between the messaging clients 104 and messaging server systems 108 include functions (e.g., commands for activating functions) and payload data (e.g., text, audio, video, or other multimedia data).

[0027] The messaging server system 108 provides server-side functionality to specific messaging clients 104 via the network 112. Although certain functions of the messaging system 100 are described herein as being performed by the messaging client 104 or by the messaging server system 108, the location of certain functions within the messaging client 104 or within the messaging server system 108 may be a design choice. For example, it may be technically preferable to initially deploy certain technologies and functions within the messaging server system 108, but later migrate the technologies and functions to the messaging client 104 where the client device 102 has sufficient processing power.

[0028] The messaging server system 108 supports various services and operations provided to the messaging clients 104. Such operations include sending data to the messaging clients 104, receiving data from the messaging clients 104, and processing data generated by the messaging clients 104. As examples, the data may include message content, client device information, geographic location information, media enhancements and overlays, message content persistence conditions, social network information, and live event information. The data exchange within the messaging system 100 is activated and controlled by functions available via the user interface of the messaging client 104.

[0029] Turning now specifically to the messaging server system 108, an API server 116 is coupled to and provides a programming interface to the application server 114. The application server 114 is communicatively coupled to a database server 120, which facilitates access to a database 126 that stores data associated with messages processed by the application server 114. Similarly, a web server 128 is coupled to and provides a web-based interface to the application server 114. To this end, the web server 128 processes incoming network requests via the Hypertext Transfer Protocol (HTTP) and several other related protocols.

[0030] The API server 116 receives and sends message data (e.g., commands and message payloads) between the client device 102 and the application server 114. Specifically, the API server 116 provides a set of interfaces (e.g., routines and protocols) that can be called or queried by the messaging client 104 to activate the functionality of the application server 114. The API server 116 exposes various functions supported by the application server 114, including: account registration; login functionality; sending messages from a particular messaging client 104 to another messaging client 104 via the application server 114; sending media files (e.g., images or videos) from the messaging client 104 to the messaging server 118 and for possible access by another messaging client 104; setting up a collection of media data (e.g., a story); retrieving a friend list of the user of the client device 102; retrieving such a collection; retrieving messages and content; adding and removing entities (e.g., friends) from an entity graph (e.g., a social graph); locating friends in a social graph; and opening application events (e.g., related to the messaging client 104).

[0031] The application server 114 hosts several server applications and subsystems, including, for example, a messaging server 118, an image processing server 122, and a social network server 124. The messaging server 118 implements several message processing technologies and functions, particularly those related to aggregation and other processing of content (e.g., text and multimedia content) included in messages received from multiple instances of the messaging client 104. As will be described in further detail, text and media content from multiple sources can be aggregated into collections of content (e.g., called stories or galleries). These collections are then made available to the messaging client 104. In view of the hardware requirements for other processor and memory intensive processing of data, such processing can also be performed on the server side by the messaging server 118.

[0032] The application server 114 also includes an image processing server 122 that is dedicated to performing various image processing operations, typically on images or videos within the payload of messages sent from or received at the messaging server 118 .

[0033] The image processing server 122 is used to implement the enhancement system 208 ( Figure 2 ). The scanning function includes activating and providing one or more AR experiences on the client device 102 when an image is captured by the client device 102. Specifically, the messaging client 104 on the client device 102 can be used to activate the camera. The camera displays one or more real-time images or videos and one or more icons or identifiers of one or more AR experiences to the user. The user can select a given identifier in the identifier to start the corresponding AR experience or perform the desired image modification (for example, replace the clothing worn by the user in the video or recolor the clothing worn by the user in the video or modify the clothing based on the gesture performed by the user).

[0034] The social network server 124 supports various social networking functions and services and makes them available to the messaging server 118. To this end, the social network server 124 maintains and accesses an entity graph 308 (e.g., Figure 3 ). Examples of functions and services supported by the social networking server 124 include identifying other users of the messaging system 100 that have a relationship with a particular user or that the particular user is "following," and also include identifying interests and other entities of a particular user.

[0035] Returning to the messaging client 104, the features and functions of the external resource (e.g., a third-party application 109 or an applet) are available to the user via the interface of the messaging client 104. The messaging client 104 receives a user selection of an option for launching or accessing features of an external resource (e.g., a third-party resource) such as an external application 109. The external resource can be a third-party application (external application 109) installed on the client device 102 (e.g., a "native application"), or a small-scale version of a third-party application (e.g., a "mini-program") hosted on the client device 102 or located at the far end of the client device 102 (e.g., on a third-party server 110). The small-scale version of the third-party application includes a subset of the features and functions of the third-party application (e.g., a full-scale, native version of a third-party standalone application) and is implemented using a markup language document. In one example, the small-scale version of the third-party application (e.g., a "mini-program") is a web-based markup language version of the third-party application and is embedded in the messaging client 104. In addition to using markup language documents (eg, *ml files), applets may include scripting languages ​​(eg, .*js files or .json files) and style sheets (eg, *ss files).

[0036] In response to receiving a user selection of an option for launching or accessing a feature of an external resource (external application 109), the messaging client 104 determines whether the selected external resource is a web-based external resource or a locally installed external application. In some cases, the external application 109 locally installed on the client device 102 can be independently launched from the messaging client 104 and separately from the messaging client 104, for example, by selecting an icon corresponding to the external application (app) 109 on the home screen of the client device 102. A small-scale version of such an external application can be launched or accessed via the messaging client 104, and in some examples, no part of the small-scale external application can be (or only a limited part can be) accessed outside the messaging client 104. The small-scale external application can be launched by the messaging client 104 receiving a markup language document associated with the small-scale external application from the external application server 110 and processing such a document.

[0037] In response to determining that the external resource is a locally installed external application 109, the messaging client 104 instructs the client device 102 to launch the external application 109 by executing the locally stored code corresponding to the external application 109. In response to determining that the external resource is a web-based resource, the messaging client 104 communicates with the external application server 110 to obtain a markup language document corresponding to the selected resource. The messaging client 104 then processes the obtained markup language document to present the web-based external resource within the user interface of the messaging client 104.

[0038] The messaging client 104 may notify the user of the client device 102 or other users (e.g., "friends") associated with such a user of activities occurring in one or more external resources. For example, the messaging client 104 may provide a notification related to the current or recent use of an external resource by one or more members of a user group to a participant in a conversation (e.g., a chat session) in the messaging client 104. One or more users may be invited to join an active external resource or to start an external resource that was recently used but is currently inactive (in the friend group). The external resource may provide the participants in the conversation who each use the corresponding messaging client 104 with the ability to share items, conditions, states, or locations in the external resource with one or more members of the user group entering the chat session. The shared item may be an interactive chat card, and members of the chat may interact using the interactive chat card, such as to start the corresponding external resource, view specific information in the external resource, or bring members of the chat to a specific location or state in the external resource. In a given external resource, a response message may be sent to the user on the messaging client 104. The external resource may selectively include different media items in the response based on the current context of the external resource.

[0039] The messaging client 104 may present a list of available external resources (e.g., third-party or external applications 109 or applets) to the user to launch or access a given external resource. The list may be presented in a context-sensitive menu. For example, icons representing different external applications in the external applications 109 (or applets) may vary based on how the user launches the menu (e.g., from a conversation interface or from a non-conversation interface).

[0040] The messaging client 104 may present one or more AR experiences to the user, which may be controlled and presented on a person's (or user's) body or a clothing article such as a shirt (fashion item or top) worn by the person (or user) depicted in the image. As an example, the messaging client 104 may detect a person in an image or video captured by the client device 102. The messaging client 104 may crop a portion of the image depicting the person. The messaging client 104 may apply a machine learning model to the cropped portion to generate a segmentation of the person's body depicted in the image, and generate a surface normal tensor for the person's body. Using the surface normal tensor and the segmentation of the body, the messaging client 104 may apply one or more AR elements to a body and / or clothing article (or fashion item) in the image or video, such as a shirt, clothing article, top, fashion item, dress, pants, shorts, skirt, jacket, T-shirt, top, glasses, jewelry, hat, earmuffs, etc.

[0041] For example, the surface normal tensor indicates an estimated angle of each pixel in the portion of the image corresponding to the body segmentation, for example, relative to a camera used to capture the image (e.g., relative to a surface normal of a camera used to capture the image or video). This enables the messaging client 104 to present one or more AR elements on the body and / or clothing depicted in the image based on the surface normal tensor.

[0042] In some examples, the messaging client 104 may determine that light is being focused on a portion of the depicted person's body from a first direction based on a surface normal tensor. In response, the messaging client 104 may modify the pixel values ​​of the portion of the depicted person's body so as to refocus the light from a second direction onto the depicted person's body based on the surface normal tensor (e.g., the surface normal of each pixel located in the portion of the body). Specifically, the messaging client 104 may determine that a first pixel in a portion of the image points in a given direction relative to a camera or a surface normal of the camera. In this case, the messaging client 104 may modify the first pixel to present a reflection of the refocused light from the second direction toward the given direction.

[0043] For example, the light in the image depicting a person can be focused from the top of the image toward the bottom of the image. That is, the spotlight can be presented above the person depicted in the image, and can be pointed downward to the floor depicted in the image. In this case, the messaging client 104 can modify the pixel value to refocus the artificial light from the bottom toward the top. For example, the messaging client 104 can remove the light or spotlight from the top of the image depicting the person, and can render a display of AR light originating from the floor depicted in the image. The messaging client 104 can control the reflection of the person depicted in the image based on the surface normal tensor of the person's body. Specifically, the messaging client 104 can determine how the light directed toward each given pixel of the person is reflected or absorbed based on the corresponding angle of each pixel relative to the camera device, and based on the angle of each pixel relative to the origin of the AR light. This creates a realistic illusion that the light source comes from the bottom of the image because the way the light is reflected and absorbed above the person depicted in the image is retained.

[0044] In some examples, the messaging client 104 can generate a 3D graphic as an AR element. The 3D graphic can be associated with a pixel group having a certain number of pixels. For example, a pixel group located within a specified area (e.g., a square area or a circular area of ​​a certain size) can be associated with each 3D graphic. In this case, the messaging client 104 can identify a first pixel group located within a first portion of the segmentation of the body of the person depicted in the image. The messaging client 104 can obtain a surface normal tensor for the first pixel group and generate an average surface normal representing the average value of the surface normals of the first pixel group. Then, the messaging client 104 can retrieve the 3D graphic and align the 3D graphic on top of the first pixel group and angle the 3D graphic along the average of the surface normal. This makes the 3D graphic appear to extend from the first pixel group corresponding to the first portion of the segmentation of the person's body. The messaging client 104 can perform a similar operation on a second pixel group located within a second portion of the segmentation to generate a second 3D graphic for display on top of the second pixel group. This process may be repeated until all pixel groups within the segmentation of the body are associated with corresponding 3D shapes.

[0045] When a new image or video is received, the messaging client 104 continuously or periodically recalculates and re-estimates the surface normal tensor. Specifically, the messaging client 104 can track the movement of a person depicted in an image or video across frames of the image or video. As the person moves, the messaging client 104 can recalculate and re-estimate the surface normal tensor in the portion of the image corresponding to the depicted person. The messaging client 104 can continuously or periodically modify the AR elements presented above the person, and based on changes in the surface normal tensor, specifically modify the way light is reflected or absorbed by pixels corresponding to the person and the way shadows are generated.

[0046] System Architecture

[0047] Figure 2 1 is a block diagram showing additional details about the messaging system 100 according to some examples. Specifically, the messaging system 100 is shown to include a messaging client 104 and an application server 114. The messaging system 100 contains several subsystems that are supported on the client side by the messaging client 104 and on the server side by the application server 114. These subsystems include, for example, a transient timer system 202, a collection management system 204, an enhancement system 208, a map system 210, a game system 212, and an external resource system 220.

[0048] The transient timer system 202 is responsible for implementing temporary or time-limited access to content by the messaging client 104 and the messaging server 118. The transient timer system 202 includes several timers that selectively enable access to messages and associated content (e.g., for presentation and display) via the messaging client 104 based on duration and display parameters associated with a message or a collection of messages (e.g., a story). Additional details regarding the operation of the transient timer system 202 are provided below.

[0049] The collection management system 204 is responsible for managing collections or collections of media (e.g., collections of text, image video, and audio data). Collections of content (e.g., messages, including images, videos, text, and audio) can be organized into "event galleries" or "event stories." Such collections can be available for a specified period of time (e.g., the duration of an event related to the content). For example, content related to a concert can be made available as a "story" for the duration of the concert. The collection management system 204 can also be responsible for publishing an icon that provides notification of the existence of a particular collection to the user interface of the messaging client 104.

[0050] In addition, the collection management system 204 also includes a curation interface 206, which allows a collection manager to manage and curate a specific content collection. For example, the curation interface 206 enables an event organizer to curate a collection of content related to a specific event (e.g., to delete inappropriate content or redundant messages). In addition, the collection management system 204 uses machine vision (or image recognition technology) and content rules to automatically curate content collections. In some examples, compensation can be paid to users for including user-generated content in a collection. In such a case, the collection management system 204 operates to automatically pay such users for using their content.

[0051] The enhancement system 208 provides various functions that enable users to enhance (e.g., annotate or otherwise modify or edit) media content associated with a message. For example, the enhancement system 208 provides functions related to generating and publishing media overlays for messages processed by the messaging system 100. The enhancement system 208 is operable to provide a media overlay or enhancement (e.g., an image filter) to the messaging client 104 based on the geographic location of the client device 102. In another example, the enhancement system 208 is operable to provide a media overlay to the messaging client 104 based on other information such as social network information of the user of the client device 102. The media overlay may include audio and visual content and visual effects. Examples of audio and visual content include pictures, text, logos, animations, and sound effects. Examples of visual effects include color overlays. Audio and visual content or visual effects can be applied to media content items (e.g., photos) at the client device 102. For example, the media overlay may include text, graphic elements, or images that can be overlaid on photos taken by the client device 102. In another example, the media overlay includes a location identification overlay (e.g., Venice Beach), the name of a live event, or a business name overlay (e.g., Beach Cafe). In another example, the enhancement system 208 uses the geographic location of the client device 102 to identify a media overlay that includes the name of the business at the geographic location of the client device 102. The media overlay may include other tags associated with the business. The media overlay may be stored in the database 126 and accessed through the database server 120.

[0052] In some examples, the enhancement system 208 provides a user-based publishing platform that enables a user to select a geographic location on a map and upload content associated with the selected geographic location. The user can also specify an environment in which a particular media overlay should be provided to other users. The enhancement system 208 generates a media overlay that includes the uploaded content and associates the uploaded content with the selected geographic location.

[0053] In other examples, the augmentation system 208 provides a merchant-based publishing platform that enables merchants to select specific media overlays associated with a geographic location via a bidding process. For example, the augmentation system 208 associates the media overlay of the highest bidding merchant with the corresponding geographic location for a predefined amount of time. The augmentation system 208 communicates with the image processing server 122 to obtain an AR experience and presents an identifier of such an experience in one or more user interfaces (e.g., as an icon on a real-time image or video, or as a thumbnail or icon in an interface dedicated to the identifier of the presented AR experience). Once the AR experience is selected, one or more images, videos, or AR graphical elements are retrieved and presented as an overlay on top of the image or video captured by the client device 102. In some cases, the camera is switched to a front view (e.g., the front camera of the client device 102 is activated in response to activation of a particular AR experience), and an image from the front camera of the client device 102, rather than the rear camera of the client device 102, begins to be displayed on the client device 102. One or more images, videos, or AR graphical elements are retrieved and rendered as an overlay on top of the image captured and displayed by the front-facing camera of the client device 102 .

[0054] In other examples, the augmentation system 208 can communicate and exchange data with another augmentation system 208 on another client device 102 and a server via the network 112. The exchanged data may include: a session identifier identifying the shared AR session; a transformation between a first client device 102 and a second client device 102 (e.g., a plurality of client devices 102, including the first device and the second device) for aligning the shared AR session to a common origin; a common coordinate system; functionality (e.g., commands for activating functions), and other payload data (e.g., text, audio, video, or other multimedia data).

[0055] The augmentation system 208 sends the transformation to the second client device 102 so that the second client device 102 can adjust the AR coordinate system based on the transformation. In this way, the first client device 102 and the second client device 102 synchronize their coordinate systems and frames to display the content in the AR session. Specifically, the augmentation system 208 calculates the origin of the second client device 102 in the coordinate system of the first client device 102. The augmentation system 208 can then determine an offset in the coordinate system of the second client device 102 based on the location of the origin in the coordinate system of the second client device 102 from the perspective of the second client device 102. The transformation is generated using the offset so that the second client device 102 generates AR content according to a common coordinate system with the first client device 102.

[0056] The augmentation system 208 can communicate with the client device 102 to establish a separate or shared AR session. The augmentation system 208 can also be coupled to the messaging server 118 to establish an electronic group communication session (e.g., group chat, instant messaging) for the client device 102 in the shared AR session. The electronic group communication session can be associated with a session identifier provided by the client device 102 to obtain access rights to the electronic group communication session and the shared AR session. In one example, the client device 102 first obtains access rights to the electronic group communication session, and then obtains a session identifier in the electronic group communication session that allows the client device 102 to access the shared AR session. In some examples, the client device 102 is able to access the shared AR session without the assistance of the augmentation system 208 in the application server 114 or communication with the augmentation system 208 in the application server 114.

[0057] The mapping system 210 provides various geo-location functions and supports the presentation of map-based media content and messages by the messaging client 104. For example, the mapping system 210 enables the display of user icons or avatars (e.g., stored in the profile data 316) on a map to indicate the current or past locations of the user's "friends", as well as media content (e.g., a collection of messages including photos and videos) generated by such friends within the context of the map. For example, a message posted by a user to the messaging system 100 from a particular geographic location can be displayed to a particular user's "friends" on the mapping interface of the messaging client 104 within the context of that particular location on the map. The user can also share his or her location and status information with other users of the messaging system 100 (e.g., using an appropriate status avatar) via the messaging client 104, where the location and status information is similarly displayed to the selected user within the context of the mapping interface of the messaging client 104.

[0058] The gaming system 212 provides various gaming functions within the context of the messaging client 104. The messaging client 104 provides a gaming interface that provides a list of available games (e.g., web-based games or web-based applications) that can be launched by a user within the context of the messaging client 104 and played with other users of the messaging system 100. The messaging system 100 also enables a particular user to invite other users to participate in playing a particular game by sending an invitation to such other users from the messaging client 104. The messaging client 104 also supports both voice messaging and text messaging within the context of playing games (e.g., chatting), provides leaderboards for games, and also supports providing in-game rewards (e.g., game coins and items).

[0059] The external resource system 220 provides an interface for communicating with an external application server 110 to start or access external resources to the messaging client 104. Each external resource (application) server 110 hosts, for example, an application based on a markup language (e.g., HTML5) or a small-scale version of an external application (e.g., a game, utility, payment, or ride-sharing application external to the messaging client 104). The messaging client 104 can start the web-based resource (e.g., application) by accessing an HTML5 file from an external resource (application) server 110 associated with a web-based resource. In some examples, the application hosted by the external resource server 110 is programmed in JavaScript using a software development kit (SDK) provided by the messaging server 118. The SDK includes an API with functions that can be called or activated by a web-based application. In some examples, the messaging server 118 includes a JavaScript library that provides access to certain user data of the messaging client 104 to a given third-party resource. HTML5 is used as an example technology for programming games, but applications and resources programmed based on other technologies can be used.

[0060] In order to integrate the functionality of the SDK into a web-based resource, the SDK is downloaded from the messaging server 118 by the external resource (application) server 110 or received in other ways by the external resource (application) server 110. Once downloaded or received, the SDK is included as part of the application code of the web-based external resource. The code of the web-based resource can then call or activate certain functions of the SDK to integrate the features of the messaging client 104 into the web-based resource.

[0061] The SDK stored on the messaging server 118 effectively provides a bridge between external resources (e.g., a third party or external application 109 or applet and a messaging client 104). This provides users with a seamless experience of communicating with other users on the messaging client 104 while retaining the look and feel of the messaging client 104. In order to bridge the communication between the external resources and the messaging client 104, in some examples, the SDK facilitates the communication between the external resource server 110 and the messaging client 104. In some examples, the WebViewJavaScriptBridge running on the client device 102 establishes two one-way communication channels between the external resources and the messaging client 104. Messages are sent asynchronously via these communication channels between the external resources and the messaging client 104. Each SDK function activation is sent as a message and a callback. Each SDK function is implemented by constructing a unique callback identifier and sending a message with the callback identifier.

[0062] By using the SDK, not all information from the messaging client 104 is shared with the external resource server 110. The SDK limits which information is shared based on the needs of the external resource. In some examples, each external resource server 110 provides an HTML5 file corresponding to a web-based external resource to the messaging server 118. The messaging server 118 can add a visual representation (e.g., box art or other graphics) of the web-based external resource in the messaging client 104. Once the user selects the visual representation or instructs the messaging client 104 to access the features of the web-based external resource through the graphical user interface of the messaging client 104, the messaging client 104 obtains the HTML5 file and instantiates the resources required to access the features of the web-based external resource.

[0063] The messaging client 104 presents a graphical user interface (e.g., a login page or title screen) for the external resource. During, before, or after presenting the login page or title screen, the messaging client 104 determines whether the launched external resource has been previously authorized to access the user data of the messaging client 104. In response to determining that the launched external resource has been previously authorized to access the user data of the messaging client 104, the messaging client 104 presents another graphical user interface of the external resource, which includes the functions and features of the external resource. In response to determining that the launched external resource has not been previously authorized to access the user data of the messaging client 104, after a threshold time period (e.g., 3 seconds) of displaying the login page or title screen of the external resource, the messaging client 104 slides a menu for authorizing the external resource to access the user data (e.g., animating the menu to emerge from the bottom of the screen to the middle or other portion of the screen). The menu identifies the type of user data that the external resource will be authorized to use. In response to receiving the user selection of the accept option, the messaging client 104 adds the external resource to the list of authorized external resources and enables the external resource to access the user data from the messaging client 104. In some examples, the external resource is authorized to access the user data by the messaging client 104 according to the OAuth 2 framework.

[0064] The messaging client 104 controls the type of user data shared with the external resource based on the type of external resource that is authorized. For example, access to a first type of user data (e.g., only a two-dimensional (2D) avatar of a user with or without different avatar characteristics) is provided to an external resource including a full-scale external application (e.g., a third party or external application 109). As another example, access to a second type of user data (e.g., payment information, a 2D avatar of a user, a three-dimensional (3D) avatar of a user, and an avatar with various avatar characteristics) is provided to an external resource including a small-scale version of an external application (e.g., a web-based version of a third-party application). Avatar characteristics include different ways to customize the look and feel of an avatar (e.g., different poses, facial features, clothing, etc.).

[0065] The surface normal tensor control system 224 crops out a portion of an image or video of a person's body depicted in the image or video, and applies a machine learning model (e.g., a convolutional neural network or other artificial neural network) to the cropped body to estimate both the segmentation of the body and the surface normal tensor. The surface normal tensor can represent the surface normal of each pixel that is a segmented portion of the body depicted in the image. This enables the surface normal tensor control system 224 to apply one or more AR effects only to the body of the person depicted in the image, without affecting the background. Therefore, a more realistic display of AR effects can be provided to the user, thereby significantly improving the illusion that such AR effects are part of the real-world environment. The following is combined with Figure 5 An illustrative implementation of a surface normal tensor control system 224 is shown and described.

[0066] Specifically, the surface normal tensor control system 224 is a component that can be accessed by an AR / VR application implemented on the client device 102. The AR / VR application uses an RGB camera to capture a monocular image of a user or person and one or more garments (alternatively, referred to as fashion items) worn by the user or person. The AR / VR application applies various trained machine learning techniques to the captured image of the person to generate or estimate the surface normal tensor of the person's pixels, and applies one or more AR visual effects to the portion of the image depicting the person without modifying other portions of the image that do not depict the person (e.g., background portions). Body segmentation is used to distinguish the person depicted in the image from other objects or elements depicted in the image. In some implementations, the AR / VR application continuously captures images of the person in real time or periodically to continuously or periodically update the applied one or more visual effects. This enables the user to move around in the real world and view one or more visual effect updates in real time.

[0067] In order for the AR / VR application to apply one or more visual effects directly based on the captured RGB image, the AR / VR application obtains the trained machine learning technology from the surface normal tensor control system 224. The trained machine learning technology processes the captured RGB image to generate a segmentation and surface normal tensor corresponding to the person depicted in the captured RGB image from the captured image.

[0068] During training, the surface normal tensor control system 224 obtains a first plurality of input training images, the first plurality of input training images including training portions representing people depicted in the images and corresponding true surface normal tensors. A machine learning technique (or machine learning model) (e.g., a deep neural network) is trained based on features of the plurality of training images. Specifically, the machine learning technique extracts one or more features from a given training image and estimates (predicts) a surface normal tensor of a body depicted in the given training image. The machine learning technique obtains true information corresponding to the training image and adjusts or updates one or more coefficients or parameters to improve subsequent estimates of the surface normal tensor and segmentation of the person depicted in the image.

[0069] Data Architecture

[0070] Figure 3 is a schematic diagram illustrating a data structure 300 that may be stored in a database 126 of a messaging server system 108 according to some examples. Although the contents of the database 126 are illustrated as including several tables, it will be appreciated that data may be stored in other types of data structures (e.g., as an object-oriented database).

[0071] Database 126 includes message data stored in message table 302. For any particular message, the message data includes at least message sender data, message recipient (or receiver) data, and payload. Figure 4 Additional details regarding information that may be included in a message and included within the message data stored in message table 302 are described.

[0072] The entity table 306 stores entity data and is linked (e.g., by reference) to the entity graph 308 and profile data 316. The entities whose records are maintained within the entity table 306 may include individuals, corporate entities, organizations, objects, places, events, etc. Regardless of the entity type, any entity about which the messaging server system 108 stores data may be an identified entity. Each entity is provided with a unique identifier as well as an entity type identifier (not shown).

[0073] The entity graph 308 stores information about relationships and associations between entities. By way of example only, such relationships may be social, professional (e.g., working in a common company or organization), interest-based, or activity-based.

[0074] Profile data 316 stores multiple types of profile data about a particular entity. Based on the privacy settings specified by the particular entity, profile data 316 can be selectively used and presented to other users of the messaging system 100. In the case where the entity is a person, profile data 316 includes, for example, a user name, phone number, address, and settings (e.g., notification and privacy settings) as well as an avatar representation (or a collection of such avatar representations) selected by the user. A particular user can then selectively include one or more of these avatar representations within the content of messages transmitted via the messaging system 100 and on a map interface displayed to other users by the messaging client 104. A collection of avatar representations may include a "status avatar" that presents a graphical representation of a status or activity that a user may choose to convey at a particular time.

[0075] Where the entity is a group, profile data 316 for the group may similarly include one or more avatar representations associated with the group, in addition to the group name, members, and various settings for the relevant group (eg, notifications).

[0076] The database 126 also stores enhancement data, such as overlays or filters, in an enhancement table 310. The enhancement data is associated with and applied to videos (data for videos is stored in the video table 304) and images (data for images is stored in the image table 312).

[0077] The database 126 may also store data related to individual and shared AR sessions. The data may include data transmitted between an AR session client controller of a first client device 102 and another AR session client controller of a second client device 102, and data transmitted between an AR session client controller and an augmented system 208. The data may include data for establishing a common coordinate system for a shared AR scene, transformations between devices, session identifiers, images depicting the body, skeletal joint positioning, wrist positioning, feet, etc.

[0078] In one example, a filter is an overlay displayed over an image or video during presentation to a recipient user. The filter can be of various types, including a user-selected filter from a set of filters presented to a sending user by the messaging client 104 when the sending user is composing a message. Other types of filters include geolocation filters (also referred to as geofilters), which can be presented to a sending user based on geographic location. For example, a geolocation filter specific to a nearby or specific location can be presented by the messaging client 104 within a user interface based on geographic location information determined by a global positioning system (GPS) unit of the client device 102.

[0079] Another type of filter is a data filter that can be selectively presented to the sending user by the messaging client 104 based on other input or information collected during the message creation process by the client device 102. Examples of data filters include the current temperature at a particular location, the current speed the sending user is traveling, the battery life of the client device 102, or the current time.

[0080] Other augmented data that may be stored in the image table 312 include AR content items (eg, corresponding to an applied AR experience). AR content items or AR items may be real-time special effects and sounds that may be added to an image or video.

[0081] As described above, augmented data includes AR content items, overlays, image transformations, AR images, AR logos or badges, and similar items involving modifications that can be applied to image data (e.g., videos or images). This includes real-time modifications that modify the image when it is captured using the device sensor (e.g., one or more cameras) of the client device 102 and then display the image with the modifications on the screen of the client device 102. This also includes modifications to stored content (e.g., video clips in a gallery that can be modified). For example, in a client device 102 that has access to multiple AR content items, a user can use a single video clip with multiple AR content items to see how different AR content items will modify the stored clips. For example, by selecting different AR content items for the content, multiple AR content items that apply different pseudo-random movement models can be applied to the same content. Similarly, real-time video capture can be used with the modifications shown to show how the video image currently captured by the sensor of the client device 102 will modify the captured data. Such data may be displayed only on the screen and not stored in memory, or content captured by the device sensors may be recorded and stored in memory with or without modification (or both). In some systems, a preview feature may simultaneously show how different AR content items will look in different windows in the display. This may, for example, enable viewing of multiple windows with different pseudo-random animations on the display at the same time.

[0082] Thus, data and various systems using AR content items or other such transformation systems using the data to modify content may involve: detection of objects (e.g., faces, hands, bodies, cats, dogs, surfaces, objects, etc.) in video frames; tracking such objects as they leave, enter, and move around the field of view; and modifying or transforming such objects as they are tracked. In various examples, different methods for implementing such transformations may be used. Some examples may involve: generating a 3D mesh model of one or more objects, and using transformations and animated textures of the models within a video to implement the transformations. In other examples, tracking of points on an object may be used to place an image or texture (which may be 2D or 3D) at a tracked location. In yet another example, a neural network analysis of a video frame may be used to place an image, model, or texture in content (e.g., a frame of an image or video). Thus, an AR content item refers to both images, models, and textures used to create transformations in content, as well as additional modeling and analysis information required to implement such transformations using object detection, tracking, and placement.

[0083] Real-time video processing can be performed using any type of video data (e.g., video streams, video files, etc.) stored in the memory of any type of computerized system. For example, a user can load a video file and save it in the memory of the device, or a sensor of the device can be used to generate a video stream. In addition, computer animation models can be used to process any object, such as human faces and body parts, animals, or inanimate objects (e.g., chairs, cars, or other objects).

[0084] In some examples, when a specific modification is selected together with the content to be transformed, the elements to be transformed are identified by a computing device, and then if the elements are present in the frame of the video, they are detected and tracked. The elements of the object are modified according to the modification request, thereby transforming the frame of the video stream. For different types of transformations, the transformation of the frame of the video stream can be performed by different methods. For example, for a frame transformation that mainly involves changing the form of the elements of the object, the feature points of each element of the object are calculated (for example, using an active shape model (Active Shape Model, ASM) or other known methods). Then, a grid based on the feature points is generated for each element of at least one element of the object. The grid is used for the subsequent stage of tracking the elements of the object in the video stream. During the tracking process, the grid mentioned for each element is aligned with the positioning of each element. Then, additional points are generated on the grid. A first group of first points is generated for each element based on the modification request, and a group of second points is generated for each element based on the group of first points and the modification request. Then, the frame of the video stream can be transformed by modifying the elements of the object based on the group of first points, the group of second points and the grid. In such an approach, the background of the modified object may also be changed or distorted by tracking and modifying the background.

[0085] In some examples, a transformation that changes some areas of an object using elements of an object can be performed by calculating characteristic points of each element of the object and generating a grid based on the calculated characteristic points. Points are generated on the grid, and then various areas are generated based on the points. The elements of the object are then tracked by aligning the area for each element with the positioning for each element of at least one element, and the properties of the area can be modified based on the modification request, thereby transforming the frame of the video stream. Depending on the specific modification request, the properties of the mentioned area can be transformed in different ways. Such modifications can involve changing the color of the area; removing at least some parts of the area from the frame of the video stream; including one or more new objects into the area based on the modification request; and modifying or distorting the elements of the area or object. In various examples, any combination of such modifications or other similar modifications can be used. For certain models to be animated, some characteristic points can be selected as control points for the entire state space to be used to determine options for model animation.

[0086] In some examples of computer animation models for transforming image data using face detection, faces are detected on images using a specific face detection algorithm (e.g., Viola-Jones). The ASM algorithm is then applied to the face region of the image to detect facial feature reference points.

[0087] Other methods and algorithms suitable for face detection can be used. For example, in some examples, landmarks are used to locate features, and the landmarks represent distinguishable points that are present in most of the images considered. For example, for facial landmarks, the location of the left pupil can be used. If the initial landmarks are not identifiable (for example, when a person wears an eye patch), secondary landmarks can be used. Such a landmark identification process can be used for any such object. In some examples, a set of landmarks forms a shape. The coordinates of the points in the shape can be used to represent the shape as a vector. A similarity transformation (which allows translation, scaling, and rotation) that minimizes the average Euclidean distance between the shape points is used to align one shape with another shape. The mean shape is the average value of the aligned training shapes.

[0088] In some examples, the landmark search begins with an average shape that aligns with the location and size of the face as determined by a global face detector. Such a search then repeats the steps of proposing tentative shapes by template matching the image texture around each point to adjust the position of the shape points, and then conforming the tentative shapes to the global shape model until convergence occurs. In some systems, template matching alone is unreliable, and the shape model pools the results of weak template matches to form a stronger overall classifier. The entire search is repeated at each level in the image pyramid from coarse to fine resolution.

[0089] The transformation system can capture an image or video stream on a client device (e.g., client device 102) and perform complex image manipulations locally on the client device 102 while maintaining an appropriate user experience, computation time, and power consumption. Complex image manipulations can include size and shape changes, emotion transitions (e.g., changing a face from a frown to a smile), state transitions (e.g., aging a subject, reducing apparent age, changing gender), style transitions, application of graphical elements, and any other suitable image or video manipulations enabled by a convolutional neural network that has been configured to execute efficiently on the client device 102.

[0090] In some examples, a computer animation model for transforming image data can be used by a system in which a user can capture an image or video stream of the user (e.g., a selfie) using a client device 102 having a neural network, where the neural network operates as part of a messaging client 104 operating on the client device 102. A transformation system operating within the messaging client 104 determines the presence of a face within the image or video stream and provides a modification icon associated with the computer animation model for transforming the image data, or the computer animation model can exist in association with an interface described herein. The modification icon includes the following changes, which can be the basis for modifying the user's face within the image or video stream as part of the modification operation. Once the modification icon is selected, the transformation system initiates a process of transforming the user's image to reflect the selected modification icon (e.g., generating a smiling face for the user). Once the image or video stream is captured and the specified modification is selected, the modified image or video stream can be presented in a graphical user interface displayed on the client device 102. The transformation system can implement a complex convolutional neural network on a portion of the image or video stream to generate and apply the selected modification. That is, a user can capture an image or video stream, and once a modification icon is selected, the modified result can be presented to the user in real time or near real time. In addition, the modification can be persistent while the video stream is being captured and the selected modification icon remains toggled. A machine learning neural network can be used to implement such modification.

[0091] The graphical user interface presenting the modifications performed by the transformation system can provide additional interactive options to the user. Such options can be based on the interface used to initiate the selection of a particular computer animation model and content capture (e.g., initiated from a content creator user interface). In various examples, the modifications can be persistent after the modification icon is initially selected. The user can turn the modification on or off by tapping or otherwise selecting the face being modified by the transformation system, and store it for later viewing or browsing to other areas of the imaging application. In the case where multiple faces are modified by the transformation system, the user can globally switch the modification on or off by tapping or selecting a single face modified and displayed within the graphical user interface. In some examples, each face in a group of multiple faces can be modified individually, or such modifications can be individually switched by tapping or selecting a single face or a series of faces displayed within the graphical user interface.

[0092] The story table 314 stores data related to a collection of messages and associated images, videos, or audio data that are compiled into a collection (e.g., a story or gallery). The creation of a particular collection can be initiated by a particular user (e.g., each user whose record is maintained in the entity table 306). A user can create a "personal story" in the form of a collection of content that has been created and sent / broadcasted by the user. To this end, the user interface of the messaging client 104 may include a user-selectable icon to enable the sending user to add specific content to his or her personal story.

[0093] A collection may also constitute a "live story," which is a collection of content from multiple users created manually, automatically, or using a combination of manual and automatic techniques. For example, a "live story" may constitute a curated stream of user-submitted content from various locations and events. Users whose client devices have location services enabled and who are at a common location event at a particular time may be presented with the option of contributing content to a particular live story, for example, via the user interface of the messaging client 104. Live stories may be identified to the user by the messaging client 104 based on his or her location. The end result is a "live story" told from a community perspective.

[0094] Another type of content collection is called a "location story," which enables users whose client devices 102 are located in a particular geographic location (e.g., on a college or university campus) to contribute to a particular collection. In some examples, contributions to location stories may require secondary authentication to verify that the end user belongs to a particular organization or other entity (e.g., is a student on a university campus).

[0095] As mentioned above, the video table 304 stores video data, which in one example is associated with a message whose record is maintained within the message table 302. Similarly, the image table 312 stores image data associated with a message whose message data is stored in the entity table 306. The entity table 306 can associate various enhancements from the enhancement table 310 with the various images and videos stored in the image table 312 and the video table 304.

[0096] The trained machine learning technique 307 stores parameters trained during training of the surface normal tensor control system 224. For example, the trained machine learning technique 307 stores trained parameters of one or more neural network machine learning techniques.

[0097] The training images 309 store a plurality of images, each of which includes a training portion representing a person depicted in the image and a corresponding ground truth surface normal tensor. The plurality of images stored in the training images 309 include various depictions of one or more users wearing different clothing and segmentation of clothing, which segmentation indicates which pixels in the image correspond to clothing and the corresponding surface normal tensor depicting the training portion of the body. As discussed above and below, these training images 309 are used by the surface normal tensor control system 224 to train machine learning techniques. In some cases, the training images 309 include a plurality of image resolutions of the body depicted in the image. The training images 309 may include labeled and unlabeled images and video data. The training images 309 may include a depiction of the whole body of a particular user, an image lacking a depiction of any user (e.g., a negative image), a depiction of multiple users wearing different clothing, and a depiction of users wearing clothing at different distances from the image capture device.

[0098] Data communication architecture

[0099] Figure 4 is a schematic diagram illustrating the structure of a message 400 according to some examples, the message 400 being generated by a messaging client 104 for transmission to another messaging client 104 or a messaging server 118. The content of a particular message 400 is used to populate a message table 302 stored in a database 126 accessible by a messaging server 118. Similarly, the content of the message 400 is stored in memory as "in-transit" or "in-flight" data of a client device 102 or application server 114. The message 400 is illustrated as including the following example components.

[0100] Message identifier 402 : a unique identifier that identifies the message 400 .

[0101] Message text payload 404 : Text to be generated by a user via the user interface of the client device 102 and included in the message 400 .

[0102] Message image payload 406 : Image data captured by a camera component of the client device 102 or retrieved from a memory component of the client device 102 and included in the message 400 . Image data for a sent or received message 400 may be stored in the image table 312 .

[0103] Message video payload 408 : Video data captured by the camera component or retrieved from the memory component of the client device 102 and included in the message 400 . The video data for a message 400 that has been sent or received may be stored in the video table 304 .

[0104] Message audio payload 410 : audio data captured by a microphone or retrieved from a memory component of the client device 102 and included in the message 400 .

[0105] Message enhancement data 412 : Enhancement data (eg, filters, stickers, or other annotations or enhancements) representing enhancements to be applied to the message image payload 406 , message video payload 408 , or message audio payload 410 of the message 400 . The enhancement data for a sent or received message 400 may be stored in the enhancement table 310 .

[0106] Message duration parameter 414: A parameter value indicating the amount of time in seconds that the content of a message (eg, message image payload 406, message video payload 408, message audio payload 410) will be presented to or made accessible to a user via messaging client 104.

[0107] Message geolocation parameters 416: Geolocation data (e.g., latitude and longitude coordinates) associated with the content payload of the message. Multiple message geolocation parameter 416 values ​​may be included in the payload, each of which is associated with a content item included in the content (e.g., a specific image within a message image payload 406, or a specific video within a message video payload 408).

[0108] Message story identifier 418: An identifier value that identifies one or more content collections (e.g., a "story" identified in story table 314) associated with a particular content item in message image payload 406 of message 400. For example, an identifier value may be used to associate multiple images within message image payload 406 with each of multiple content collections.

[0109] Message tags 420: Each message 400 may be tagged with a plurality of tags, each of which indicates the subject of the content included in the message payload. For example, where a particular image included in the message image payload 406 depicts an animal (e.g., a lion), a tag value indicating the relevant animal may be included within the message tags 420. The tag values ​​may be manually generated based on user input, or may be automatically generated using, for example, image recognition.

[0110] • Message sender identifier 422: An identifier (eg, a messaging system identifier, an email address, or a device identifier) ​​that indicates the user of the client device 102 on which the message 400 was generated and from which the message 400 was sent.

[0111] • Message recipient identifier 424: An identifier (eg, a messaging system identifier, an email address, or a device identifier) ​​that indicates the user of the client device 102 to which the message 400 is addressed.

[0112] The content (e.g., value) of each component of message 400 may be a pointer to a location in a table in which the content data value is stored. For example, the image value in message image payload 406 may be a pointer to a location in image table 312 (or the address of a location in image table 312). Similarly, the value in message video payload 408 may point to data stored in video table 304, the value stored in message enhancement data 412 may point to data stored in enhancement table 310, the value stored in message story identifier 418 may point to data stored in story table 314, and the values ​​stored in message sender identifier 422 and message recipient identifier 424 may point to user records stored in entity table 306.

[0113] Surface Normal Tensor Control System

[0114] Figure 5 is a block diagram illustrating an example surface normal tensor control system 224 according to some examples. The surface normal tensor control system 224 includes a set of components 510 that operate on a set of input data (e.g., a monocular image 501 depicting a person's real body and training image data 502). The set of input data is obtained during a training phase from data stored in a database ( Figure 3 ) and is obtained from the RGB camera of the client device 102 when the AR / VR application is used by the messaging client 104, for example. The surface normal tensor control system 224 includes a machine learning technique module 512, a body segmentation module 514, a surface normal tensor estimation module 517, an AR effect module 519, an image modification module 518, and an image display module 520.

[0115] During training, the surface normal tensor control system 224 receives a given training image or video from the training image data 502 (e.g., a monocular image 501 depicting a person's real body, such as an image of a user wearing a shirt (short sleeves, T-shirts or long sleeves, jackets, vests, sweaters, etc.), lower body clothing (e.g., pants or short skirts), full body clothing (e.g., dresses or long coats), or any suitable combination thereof, or an image depicting multiple users wearing corresponding combinations of upper body clothing, lower body clothing, or full body clothing at the same time). The surface normal tensor control system 224 crops out a portion of the image that includes the person's real body. The surface normal tensor control system 224 uses the machine learning technique module 512 to apply one or more machine learning techniques to the given training image or video portion that has been cropped.

[0116] The machine learning techniques module 512 extracts one or more features from a given training image or video to estimate a segmentation of a person depicted in the image (e.g., generate a segmentation vector) simultaneously with the person's surface normal tensor. For example, the segmentation of the body identifies which pixels in the image correspond to the user's body and which pixels correspond to the background. That is, the segmentation output by the machine learning techniques module 512 identifies the boundaries of the user's body in a given training image. The surface normal tensor provides the pixel angle direction or surface normal for each pixel of the person's body depicted in the image.

[0117] The machine learning technique module 512 retrieves the ground truth surface normal tensor associated with a given training image or video. The machine learning technique module 512 compares the estimated surface normal tensor of the person with the ground truth clothing surface normal tensor provided as part of the training image data 502. Based on a difference threshold or deviation of the comparison, the machine learning technique module 512 updates one or more coefficients or parameters and obtains one or more additional training images or videos. After processing a specified number of epochs or batches of training images and / or when the difference threshold or deviation reaches a specified value, the machine learning technique module 512 completes training and the parameters and coefficients of the machine learning technique module 512 are stored in the trained machine learning technique 307.

[0118] The body segmentation generated by the machine learning technology module 512 is provided to the body segmentation module 514. The body segmentation module 514 can select or identify a set of pixels in the image corresponding to the body of the person based on the body segmentation received from the machine learning technology module 512. The body segmentation module 514 is used to track the 2D or 3D positioning of the body in subsequent frames of the video. This enables one or more AR elements to be displayed on the body and maintained at their corresponding positions as the body moves around on the screen. In this way, the body segmentation module 514 can determine and track which parts of the body are currently shown in the image depicting the person, and selectively adjust the corresponding AR elements displayed.

[0119] The surface normal tensor estimation module 517 receives the surface normal tensor from the machine learning technology module 512. The surface normal tensor estimation module 517 can specify the pixel direction or surface normal of each pixel in the portion of the image identified by the body segmentation module 514 as corresponding to the body depicted in the image. In this way, the outputs of both the body segmentation module 514 and the surface normal tensor estimation module 517 can be used to uniquely and specifically determine the surface normal of each pixel corresponding to the body depicted in the image. This enables the AR effect module 519 to selectively apply a given set of AR elements to the body depicted in the image without modifying any other part of the image (e.g., the background). In addition, based on the outputs of both the body segmentation module 514 and the surface normal tensor estimation module 517, the AR effect module 519 can apply AR elements to portions of the body for which the surface normals are available for presentation, and when a particular portion of the body is no longer visible, the AR effect module 519 can remove the applied AR elements.

[0120] After training, the surface normal tensor control system 224 receives an input image 501 (e.g., a monocular image depicting a person) as a single RGB image from a client device 102. The surface normal tensor control system 224 generates a segmentation of data representing a person depicted in the image. The surface normal tensor control system 224 extracts a portion of the image corresponding to the segmentation of data representing a person depicted in the image. The surface normal tensor control system 224 applies the machine learning model to the portion of the image to predict a surface normal tensor of the data representing the depiction of the person, the surface normal tensor representing the surface normal of each pixel within the portion of the image. The surface normal tensor control system 224 applies one or more AR elements to the image based on the surface normal tensor.

[0121] In some examples, the surface normal tensor control system 224 determines that light is being focused on the data representing the depiction of a person from a first direction based on the surface normal tensor. The surface normal tensor control system 224 modifies the pixel values ​​of a portion of the image corresponding to the segmentation of the data representing the depiction of the person to refocus the light from a second direction onto the depiction of the person, wherein the pixel values ​​are modified without modifying the pixel values ​​of portions outside the segmentation in the image. In some examples, the surface normal tensor control system 224 applies one or more AR elements based on the person's hair, the person's clothing and one or more accessories worn by the person, and the geometry of the person's body. In some examples, the surface normal tensor control system 224 applies artificial light to the data representing the person depicted in the image based on the surface normal tensor.

[0122] In some examples, the surface normal tensor control system 224 displays one or more AR elements on a first portion of the data representing a person depicted in a first frame of a video, where the person is positioned at a first location in the first frame. The surface normal tensor control system 224 determines that the person has moved from the first location in the video to a second location in a second frame, and updates the display location of the one or more AR elements in the second frame based on the surface normal tensor to maintain display of the one or more AR elements on the data representing the person depicted in the image.

[0123] In some examples, the surface normal tensor control system 224 replaces the data representing the depiction of the person with one or more visual effects. In this case, the surface normal tensor control system 224 determines the direction of light reflection on the person based on the surface normal tensor, and uses the surface normal tensor to cause the one or more visual effects to reflect light along the light reflection direction. For example, the surface normal tensor control system 224 recolors one or more portions of the person depicted in the image. For example, the surface normal tensor control system 224 applies one or more animated fashion items to the person depicted in the image based on the surface normal tensor.

[0124] In some examples, the surface normal tensor control system 224 determines a first direction of a first pixel corresponding to the data representing the depiction of a person. The surface normal tensor control system 224 determines a second direction of a second pixel corresponding to the data representing the depiction of a person. The surface normal tensor control system 224 generates a first AR element for display including a 3D graphic (e.g., a 3D column or bar) extending from the first pixel along the first direction. The surface normal tensor control system 224 generates a second AR element for display with the first AR element including a 3D graphic (e.g., another identical 3D column or bar) extending from the second pixel along the second direction.

[0125] In some examples, the surface normal tensor control system 224 detects one or more wrinkles of clothing worn by a person depicted in the image based on the surface normal tensor. In this case, the surface normal tensor control system 224 renders one or more virtual shadows on the clothing based on the one or more wrinkles. For example, the surface normal tensor control system 224 bends a portion of one or more AR elements covering the one or more wrinkles based on the surface normal tensor.

[0126] The surface normal tensor estimation module 517 is trained to generate or extract a value indicating a pixel direction or angle relative to a camera device used to capture an image or video, which depicts a portion of an image corresponding to a person or user depicted in the image. The angle relative to the camera device can be expressed as a normal vector or normal direction for a given pixel in some cases. For example, the surface normal tensor estimation module 517 can determine, for a given pixel, the direction in which the surface normal of the pixel points relative to the camera device that captures the image including the pixel. The direction can be associated with the pixel by storing the direction in a vector that includes or defines the x, y, z components in the red, green, and blue (RGB) channels of each pixel. This can be referred to as a normal map. That is, each pixel can be represented by an RGB channel that defines the amount of red, green, and blue associated with the pixel, such as the red, green, and blue pixel values ​​of each pixel. The RGB channel can also be associated with the following vector that defines the pixel or normal direction of each pixel in x, y, z coordinates or UV space. In this way, each pixel can include a red value, a green value, and a blue value as well as x, y, and z coordinates.

[0127] For example, if the pixel is located on the left shirt sleeve and the person wearing the shirt is turned left relative to the camera, the pixel angle can be 45 degrees or -45 degrees relative to the surface normal of the camera (or any other suitable angle, even an angle that is not facing the camera). The larger the pixel angle, the more the portion of the person represented by the corresponding pixel is turned right / left relative to the camera. The pixel angle can be one-dimensional and / or 2D. In the case of 2D, the pixel angle indicates how much the person is turned left / right relative to the camera, and also indicates how far the portion of the fashion item is pointing up / down. The surface normal tensor estimation module 517 generates a matrix of one-dimensional, 2D pixel angles, and / or 3D pixel angles for each pixel in the portion of the image corresponding to the person depicted in the image or video. The pixel angle can be represented by a 3D normal vector or a 2D normal vector and stored in the RGB channels of each pixel. In some cases, the surface normal tensor estimation module 517 generates these values ​​independently of movement or tracking information.

[0128] A user of an AR / VR application may be presented with a selection for selecting an AR application or experience to control the display of AR elements on the user, such as to refocus light from different directions (e.g., apply artificial light or AR light to the person) to generate a column or 3D element extending from a group of pixels above the person depicted in the image or video, generate shadows above the person based on wrinkles determined according to the surface normal tensor, recolor one or more portions of the person, etc. In response to receiving the user's selection of the option, a camera (e.g., a front camera or a rear camera) is activated to begin capturing an image or video of the user. The image or video depicting the user is provided to the AR effects module 519 to apply one or more AR elements to the person depicted in the image or video according to the selected option (e.g., refocus light from different directions (e.g., apply artificial light or AR light to the person) to generate a column or 3D element extending from a group of pixels above the person depicted in the image or video, generate shadows above the person based on wrinkles determined according to the surface normal tensor, recolor one or more portions of the person). The AR effects module 519 selects between various applications / modifications of AR elements displayed on the user, for example based on the user's gestures or movements, and applies such AR elements based on the body segmentation and surface normal tensor estimation provided by the machine learning techniques module 512 .

[0129] The image modification module 518 can adjust the image captured by the camera based on the AR effect selected by the AR effect module 519. The image modification module 518 adjusts the way the user is presented in the image or video, for example, by changing the color or occlusion pattern of light and shadows cast on the user based on the person's body segmentation and surface normal tensor and applying one or more AR elements to the person depicted in the image or video. The image display module 520 combines the adjustments made by the image modification module 518 into the received monocular image or video depicting the user's body. The image or video is provided to the client device 102 by the image display module 520 and can then be sent to another user or stored for later access and display.

[0130] Figures 6 to 8 2 shows an exemplary output of one or more of the visual effects that may be selected and applied by the AR effects module 519. For example, Figure 6 As shown, input from a user selecting a set of 3D AR graphical elements (e.g., 3D pillars or 3D bars) may be received. In response, the surface normal tensor control system 224 generates a user interface 600 in which a real-time video 610 is presented. The real-time video 610 may include a video captured and received from a front-facing camera or a rear-facing camera of the client device 102. The real-time video 610 may include a depiction of a person 620.

[0131] The AR effects module 519 can generate a 3D graphic as an AR element that appears to extend from each pixel group of the person 620 depicted in the video 610. The 3D graphic can be associated with a pixel group having a certain number of pixels (e.g., 100 pixels). For example, a pixel group within a specified area (e.g., a square area or a circular area of ​​a certain size) can be associated with each corresponding 3D graphic in a plurality of identical (or different) 3D graphics. The AR effects module 519 can identify a first pixel group located within a first portion of the segmentation of the body of the person 620 depicted in the video 610. The AR effects module 519 can obtain a surface normal tensor for the first pixel group, and can generate an average (or some other representative) surface normal representing the average of the surface normals of the first pixel group.

[0132] The AR effect module 519 may then retrieve a first 3D AR graphic 630 (e.g., a first AR 3D column) and align the first AR 3D graphic 630 on top of the first pixel group and angle the first AR 3D graphic along the average of the surface normals of the first pixel group. This makes the first AR 3D graphic 630 appear to extend from the first pixel group corresponding to the first portion of the segmentation of the body of the person 620. The AR effect module 519 may perform a similar operation on a second pixel group located within the second portion of the segmentation to generate a second AR 3D graphic for display on top of the second pixel group. This process may be repeated until all pixel groups within the segmentation of the body are associated with corresponding AR 3D graphics. As the person 620 moves around in subsequent frames, the AR 3D graphic changes its position and orientation, and updates the surface normals of the corresponding pixel groups.

[0133] Other portions of the video 610 that fall outside the segmentation of the person 620 (e.g., the background) are not modified or affected by the displayed AR 3D graphics. In this manner, the AR 3D graphics are displayed only on pixels corresponding to the body of the person 620 depicted in the image or video, and not on any other portions.

[0134] In some examples, such as Figure 7 As shown, input from a user selecting an option to adjust the color properties of pixels of a person depicted in an image or video and / or to adjust the reflection and absorption of light or shadows by a person depicted in an image or video may be received. In response, the surface normal tensor control system 224 generates a user interface 700 in which a real-time video 710 is presented. The real-time video 710 may include video captured and received from a front-facing camera or a rear-facing camera of the client device 102. The real-time video 710 may include a depiction of a person 712.

[0135] The AR effect module 519 may apply a first set of color modifications corresponding to or based on the surface normals of the pixels in the first region 716 to the first region 716. A second set of color modifications may be applied to the second region 714, the second set of color modifications corresponding to or based on the surface normals of the pixels in the second region 714. That is, the surface normals of the pixels in the first region 716 may be located within a first threshold or a first set of boundaries. In response, the AR effect module 519 selects the first set of color modifications and applies the first set of color modifications to the first region 716. In addition, the surface normals of the pixels in the second region 714 may be located within a second threshold or a second set of boundaries that are different from the first threshold or the first set of boundaries. In response, the AR effect module 519 selects the second set of color modifications and applies the second set of color modifications to the first region 716. The first set of color modifications may be associated with the first set of boundaries or a first threshold, and the second set of color modifications may be associated with the second threshold or the second set of boundaries. Other portions (e.g., background) in the video 710 that fall outside the segmentation of the person 712 are not modified or affected by the color modifications. In this way, the color modification is displayed only on pixels corresponding to the body of the person 710 depicted in the image or video, and not on any other portion.

[0136] In some cases, person 712 may move around in the video. Figure 8 As shown, person 712 moves to a new position, which causes an adjustment to the changes in the surface normals of the pixels of the person's body. Figure 8 As shown, a user interface 800 is presented in which a video 810 depicts a person 812 (which may be a Figure 7 712, but in a new position). Now, the AR effects module 519 can apply a third set of color modifications to the first region 816 (corresponding to the previous first region 716), the third set of color modifications corresponding to or based on the surface normals of the pixels in the first region 816. A fourth set of color modifications can be applied to the second region 814 (corresponding to the previous second region 714), the fourth set of color modifications corresponding to or based on the surface normals of the pixels in the second region 714.

[0137] In some cases, Figure 7 Person 712 in FIG. 7 remains in the same position, but a new color modification is selected. The new color modification specifies a different set of color modifications to be applied to pixels of different boundaries (ranges) or thresholds. In this case, Figure 8 As shown, a user interface 800 is presented in which a video 810 depicts a person 812 (which may be a Figure 7712, but in a new location). Now, AR effects module 519 can apply a third set of color modifications to first region 816 (corresponding to previous first region 716), the third set of color modifications corresponding to or based on the surface normals of the pixels in first region 816. A fourth set of color modifications can be applied to second region 814 (corresponding to previous second region 714), the fourth set of color modifications corresponding to or based on the surface normals of the pixels in second region 714. For example, input can be received from a user to Figure 7 Those shown in reduce the size of the boundary of the modification of a particular set of colors. In this case, the same set of pixels whose surface normals are within the threshold or boundary may no longer be within the threshold or boundary. Therefore, these pixels can remain unmodified, or a different set of colors can be applied to such pixels.

[0138] In some examples, surface normal tensor control system 224 generates user interface 800 in which real-time video 720 is presented. Real-time video 720 may include video captured and received from a front-facing camera or a rear-facing camera of client device 102. Real-time video 720 may include a depiction of person 722.

[0139] The AR effect module 519 may apply a first brightness or generate a first set of shadows in the area 724 that corresponds to or is based on the surface normals of the pixels in the area 724. That is, light (artificial light or real light) may be projected onto the person 722 from a particular angle. Shadows may be artificially projected or rendered on the person 722 (e.g., on the person's clothing) based on the surface normals of the pixels in the area 724. In some cases, wrinkles may exist on the clothing of the person 724. The wrinkles may cause a set of surface normals that indicate the direction in which light is absorbed or reflected and may be used to render shadows on the person 722 depicted in the video 720 or on the clothing of the person 722. As the person moves around in the video, the light may remain projected from the same direction, but the generated shadows may be adjusted as the surface normals of the pixels in the area change.

[0140] In some cases, input may be received from a user to (adjust) increase the amount of (artificial or real) light or decrease the amount of light projected on person 722. Based on the adjustment of the amount of light, the shadow cast on the person may increase or decrease. For example, Figure 8 As shown, a user interface 800 is presented in which a video 820 depicts a person 822 (who may be Figure 7 Now, AR effects module 519 may apply a different amount of shading to area 824 (corresponding to previous area 724) that reflects the adjustment to the amount of light.

[0141] In some examples, an AR element may be used to completely replace a depiction of a person or a portion of a person (e.g., one or more articles of clothing) in an image. The AR element may be animated and may be a 2D element or a 3D element. The AR element may be overlaid on top of clothing worn by the user. A portion of the AR element may be twisted or bent in an area of ​​clothing with a crease or fold. This makes the AR element appear as if the AR element is actually part of clothing worn by the person depicted in the image. Specifically, the AR element may be overlaid and bent or twisted in a manner that causes the surface normals of the AR element to mirror, copy, or correspond to the corresponding surface normals of the pixels overlaid with the AR element.

[0142] Fig. 9 is a flow chart of a process 900 performed by the surface normal tensor control system 224 according to some examples. Although the flow chart may describe the operations as a sequential process, many of the operations may be performed in parallel or simultaneously. In addition, the order of the operations may be rearranged. When the operations of the process are completed, the process is terminated. A process may correspond to a method, a procedure, etc. The steps of a method may be performed in whole or in part, may be performed in combination with some or all of the steps in other methods, and may be performed by any number of different systems or any portion thereof (e.g., a processor included in any system).

[0143] At operation 901 , as discussed above, the surface normal tensor control system 224 (eg, the client device 102 or a server) receives an image that includes a depiction of a person.

[0144] At operation 902 , the surface normal tensor control system 224 generates a segmentation of data representing a person depicted in an image, as discussed above.

[0145] At operation 903, the surface normal tensor control system 224 extracts a portion of the image that corresponds to a segmentation of data representing a person depicted in the image, as discussed above.

[0146] At operation 904, as discussed above, the surface normal tensor control system 224 applies a machine learning model to the portion of the image to predict a surface normal tensor of data representing a depiction of a person, the surface normal tensor representing a surface normal for each pixel within the portion of the image.

[0147] At operation 905 , the surface normal tensor control system 224 applies one or more augmented reality (AR) elements to the image based on the surface normal tensor e′, as discussed above.

[0148] Machine structure

[0149] Fig.101000 within which instructions 1008 (e.g., software, programs, applications, applet, app, or other executable code) may be executed for causing the machine 1000 to perform any one or more of the methods discussed herein. For example, the instructions 1008 may cause the machine 1000 to perform any one or more of the methods described herein. The instructions 1008 transform a general purpose, unprogrammed machine 1000 into a specific machine 1000 that is programmed to perform the functions described and illustrated in the manner described. The machine 1000 may operate as a standalone device or may be coupled (e.g., networked) to other machines. In a networked deployment, the machine 1000 may operate as a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment. The machine 1000 may include, but is not limited to, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a personal digital assistant (PDA), an entertainment media system, a cellular phone, a smart phone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web appliance, a network router, a network switch, a network bridge, or any machine capable of sequentially or otherwise executing instructions 1008 specifying actions to be taken by the machine 1000. In addition, although only a single machine 1000 is shown, the term "machine" should also be considered to include a collection of machines that individually or jointly execute instructions 1008 to perform any one or more of the methods discussed herein. For example, the machine 1000 may include any of the client devices 102 or a number of server devices that form part of the messaging server system 108. In some examples, the machine 1000 may also include both a client system and a server system, wherein certain operations of a particular method or algorithm are performed on the server side and certain operations of the particular method or algorithm are performed on the client side.

[0150] The machine 1000 may include a processor 1002, a memory 1004, and an input / output (I / O) component 1038 that may be configured to communicate with each other via a bus 1040. In an example, the processor 1002 (e.g., a central processing unit (CPU), a reduced instruction set computing (RISC) processor, a complex instruction set computing (CISC) processor, a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a radio frequency integrated circuit (RFIC), another processor, or any suitable combination thereof) may include, for example, a processor 1006 that executes instructions 1008 and a processor 1010. The term "processor" is intended to include multi-core processors, which may include two or more independent processors (sometimes referred to as "cores") that may execute instructions simultaneously. Although Fig.10 Multiple processors 1002 are shown, but the machine 1000 may include a single processor with a single core, a single processor with multiple cores (e.g., a multi-core processor), multiple processors with a single core, multiple processors with multiple cores, or any combination thereof.

[0151] The memory 1004 includes a main memory 1012, a static memory 1014, and a storage unit 1016, which are all accessible by the processor 1002 via the bus 1040. The main memory 1004, the static memory 1014, and the storage unit 1016 store instructions 1008 that embody any one or more of the methodologies or functions described herein. The instructions 1008 may also reside, completely or partially, within the main memory 1012, within the static memory 1014, within the machine-readable medium 1018 within the storage unit 1016, within at least one of the processors 1002 (e.g., within a cache memory of a processor), or within any suitable combination thereof during execution thereof by the machine 1000.

[0152] I / O components 1038 may include various components for receiving input, providing output, generating output, sending information, exchanging information, capturing measurements, etc. The specific I / O components 1038 included in a particular machine will depend on the type of machine. For example, a portable machine such as a mobile phone may include a touch input device or other such input mechanism, while a headless server machine will most likely not include such a touch input device. It should be appreciated that I / O components 1038 may include Fig.10, many other components not shown in the figure. In various examples, the I / O components 1038 may include a user output component 1024 and a user input component 1026. The user output component 1024 may include a visual component (e.g., a display such as a plasma display panel (PDP), a light emitting diode (LED) display, a liquid crystal display (LCD), a projector, or a cathode ray tube (CRT)), an acoustic component (e.g., a speaker), a tactile component (e.g., a vibration motor, a resistance mechanism), other signal generators, etc. The user input component 1026 may include an alphanumeric input component (e.g., a keyboard, a touch screen configured to receive alphanumeric input, an optical keyboard, or other alphanumeric input component), a point-based input component (e.g., a mouse, a touch pad, a trackball, a joystick, a motion sensor, or other pointing instrument), a tactile input component (e.g., a physical button, a touch screen or other tactile input component that provides the location and force of a touch or touch gesture), an audio input component (e.g., a microphone), etc.

[0153] In other examples, the I / O component 1038 may include a biometric component 1028, a motion component 1030, an environmental component 1032, or a positioning component 1034, as well as various other components. For example, the biometric component 1028 includes components for detecting expressions (e.g., hand expressions, facial expressions, voice expressions, body postures, or eye tracking), measuring biosignals (e.g., blood pressure, heart rate, body temperature, sweat, or brain waves), identifying people (e.g., voice recognition, retinal recognition, facial recognition, fingerprint recognition, or EEG-based recognition), etc. The motion component 1030 includes an acceleration sensor component (e.g., an accelerometer), a gravity sensor component, and a rotation sensor component (e.g., a gyroscope).

[0154] Environmental components 1032 include, for example, one or more cameras (with still image / photo and video capabilities), lighting sensor components (e.g., photometers), temperature sensor components (e.g., one or more thermometers that detect ambient temperature), humidity sensor components, pressure sensor components (e.g., barometers), acoustic sensor components (e.g., one or more microphones that detect background noise), proximity sensor components (e.g., infrared sensors that detect nearby objects), gas sensors (e.g., gas detection sensors that detect concentrations of hazardous gases for safety or measure pollutants in the atmosphere), or other components that can provide indications, measurements, or signals corresponding to the surrounding physical environment.

[0155] With respect to cameras, client device 102 may have a camera system including, for example, a front-facing camera on a front surface of client device 102 and a rear-facing camera on a rear surface of client device 102. The front-facing camera may, for example, be used to capture still images and videos (e.g., “selfies”) of a user of client device 102, which may then be enhanced with the enhancement data (e.g., filters) described above. For example, the rear-facing camera may be used to capture still images and videos in a more conventional camera mode, where the images are similarly enhanced with the enhancement data. In addition to the front-facing camera and the rear-facing camera, client device 102 may also include a 360° camera for capturing 360° photos and videos.

[0156] Additionally, the camera system of the client device 102 may include dual rear cameras (e.g., a main camera and a depth sensing camera), or even triple, quad, or quintuple rear camera configurations on the front and back sides of the client device 102. For example, these multiple camera systems may include a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, a macro camera, and a depth sensor.

[0157] The positioning component 1034 includes a position sensor component (for example, a GPS receiver component), an altitude sensor component (for example, an altimeter or a barometer that detects air pressure, and the altitude can be obtained based on the air pressure), an orientation sensor component (for example, a magnetometer), etc.

[0158] A variety of technologies can be used to achieve communication. The I / O components 1038 also include a communication component 1036 that is operable to couple the machine 1000 to the network 1020 or the device 1022 via a corresponding coupling or connection. For example, the communication component 1036 may include a network interface component or other suitable device that interfaces with the network 1020. In other examples, the communication component 1036 may include a wired communication component, a wireless communication component, a cellular communication component, a near field communication (NFC) component, Parts (e.g. Low energy consumption), Device 1022 may be another machine or any of a variety of peripheral devices (eg, a peripheral device coupled via USB).

[0159] In addition, the communication component 1036 can detect the identifier or include a component that can be operated to detect the identifier. For example, the communication component 1036 can include a radio frequency identification (RFID) tag reader component, an NFC smart tag detection component, an optical reader component (e.g., an optical sensor for detecting one-dimensional bar codes such as universal product code (UPC) bar codes, multi-dimensional bar codes such as Quick Response (QR) codes, Aztec codes, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D bar codes, and other optical codes) or an acoustic detection component (e.g., a microphone for identifying a tagged audio signal). In addition, various information can be obtained via the communication component 1036, such as location via Internet Protocol (IP) geolocation, ... Signal triangulation to derive location, location via detection of NFC beacon signals that can indicate a specific location, etc.

[0160] Various memories (e.g., main memory 1012, static memory 1014, and memory of processor 1002) and storage unit 1016 may store one or more sets of instructions and data structures (e.g., software) implemented or used by any one or more of the methods or functions described herein. When executed by processor 1002, these instructions (e.g., instructions 1008) cause various operations to implement the disclosed examples.

[0161] The instructions 1008 may be transmitted or received over the network 1020 using a transmission medium via a network interface device (e.g., a network interface component included in the communication component 1036) and using any of several well-known transmission protocols (e.g., HTTP). Similarly, the instructions 1008 may be sent or received via a coupling (e.g., a peer-to-peer coupling) with the device 1022 using a transmission medium.

[0162] Software Architecture

[0163] Fig.111100 is a block diagram illustrating a software architecture 1104 that may be installed on any one or more of the devices described herein. The software architecture 1104 is supported by hardware, such as a machine 1102 including a processor 1120, a memory 1126, and an I / O component 1138. In this example, the software architecture 1104 may be conceptualized as a stack of layers, where each layer provides specific functionality. The software architecture 1104 includes layers such as an operating system 1112, a library 1110, a framework 1108, and an application 1106. In operation, the application 1106 invokes an API call 1150 through the software stack and receives a message 1152 in response to the API call 1150.

[0164] The operating system 1112 manages hardware resources and provides public services. The operating system 1112 includes, for example, a kernel 1114, a service 1116, and a driver 1122. The kernel 1114 serves as an abstraction layer between the hardware and other software layers. For example, the kernel 1114 provides functions such as memory management, processor management (e.g., scheduling), component management, networking, and security settings. The service 1116 can provide other public services to other software layers. The driver 1122 is responsible for controlling the underlying hardware or interfacing with the underlying hardware. For example, the driver 1122 may include a display driver, a camera driver, or Low-power drivers, Flash drivers, Serial communication drivers (e.g., USB drivers), Drivers, audio drivers, power management drivers, etc.

[0165] The libraries 1110 provide a common low-level infrastructure used by the applications 1106. The libraries 1110 may include a system library 1118 (e.g., a C standard library) that provides functions such as memory allocation functions, string manipulation functions, mathematical functions, etc. In addition, the libraries 1110 may include an API library 1124, such as a media library (e.g., a library for supporting the presentation and manipulation of various media formats, such as Moving Picture Experts Group-4 (MPEG4), Advanced Video Coding (H.264 or AVC), Moving Picture Experts Group Layer-3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR) audio codec, Joint Photographic Experts Group (JPEG or JPG), or Portable Network Graphics (PNG)), a graphics library (e.g., an OpenGL framework for rendering in 2D and 3D in graphics content on a display), a database library (e.g., SQLite providing various relational database functions), a web library (e.g., WebKit providing web browsing functions), etc. The library 1110 may also include various other libraries 1128 to provide many other APIs to the application 1106 .

[0166] The framework 1108 provides a common high-level infrastructure used by the applications 1106. For example, the framework 1108 provides various graphical user interface functions, advanced resource management, and advanced location services. The framework 1108 can provide a wide range of other APIs that can be used by the applications 1106, some of which can be specific to a particular operating system or platform.

[0167] In an example, applications 1106 may include a home application 1136, a contacts application 1130, a browser application 1132, a book reader application 1134, a location application 1142, a media application 1144, a messaging application 1146, a game application 1148, and a variety of other applications such as external applications 1140. Applications 1106 are programs that perform functions defined in the program. Various programming languages ​​may be used to create one or more of the applications 1106 structured in various ways, such as an object-oriented programming language (e.g., Objective-C, Java, or C++) or a procedural programming language (e.g., C or assembly language). In a specific example, external applications 1140 (e.g., those created by an entity other than the vendor of a particular platform using ANDROID TM or IOS TM SDK developed applications) can be mobile operating systems such as IOS TM ANDROID TM , Phone, or another mobile operating system running on the mobile software. In this example, the external application 1140 can activate the API call 1150 provided by the operating system 1112 to facilitate the functions described herein.

[0168] Glossary

[0169] "Carrier signal" refers to any intangible medium capable of storing, encoding or carrying instructions for execution by a machine and includes digital or analog communications signals or other intangible media to facilitate the transmission of such instructions. Instructions may be sent or received over a network using a transmission medium via a network interface device.

[0170] "Client Device" refers to any machine that interfaces with a communications network to obtain resources from one or more server systems or other client devices. A client device may be, but is not limited to, a mobile phone, a desktop computer, a laptop computer, a portable digital assistant (PDA), a smart phone, a tablet computer, an ultrabook, a netbook, a laptop computer, a multiprocessor system, a microprocessor-based or programmable consumer electronics product, a game console, a set-top box, or any other communications device that a user may use to access a network.

[0171] "Communications Network" means one or more parts of a network, which may be an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a local area network (LAN), a wireless LAN (WLAN), a wide area network (WAN), a wireless WAN (WWAN), a metropolitan area network (MAN), the Internet, a part of the Internet, a part of the Public Switched Telephone Network (PSTN), a Plain Old Telephone Service (POTS) network, a cellular telephone network, a wireless network, A network, other type of network, or a combination of two or more such networks. For example, the network or a portion of the network may include a wireless network or a cellular network, and the coupling may be a code division multiple access (CDMA) connection, a global system for mobile communications (GSM) connection, or other type of cellular or wireless coupling. In this example, the coupling may implement any of various types of data transmission technologies, such as single carrier radio transmission technology (1xRTT), evolution data optimized (EVDO) technology, general packet radio service (GPRS) technology, enhanced data rates for GSM evolution (EDGE) technology, the third generation partnership project (3GPP) including 3G, fourth generation wireless (4G) networks, universal mobile telecommunications system (UMTS), high speed packet access (HSPA), world wide interoperability for microwave access (WiMAX), long term evolution (LTE) standards, other data transmission technologies defined by various standard setting organizations, other long distance protocols, or other data transmission technologies.

[0172] "Component" means a device, physical entity, or logic having boundaries defined by function or subroutine calls, branch points, APIs, or other techniques that provide partitioning or modularization of specific processing or control functions. Components may interface with other components via their interfaces to perform machine processes. A component may be a packaged functional hardware unit designed for use with other components and is part of a program that typically performs a specific one of the related functions.

[0173] Components may constitute software components (e.g., code implemented on a machine-readable medium) or hardware components. A "hardware component" is a tangible unit that is capable of performing certain operations and that can be configured or arranged in some physical manner. In various examples, one or more computer systems (e.g., stand-alone computer systems, client computer systems, or server computer systems) or one or more hardware components of a computer system (e.g., a processor or group of processors) may be configured by software (e.g., an application or application portion) as hardware components that operate to perform certain operations described herein.

[0174] Hardware components can also be implemented mechanically, electronically or in any suitable combination thereof. For example, hardware components can include dedicated circuits or logic that are permanently configured to perform certain operations. Hardware components can be dedicated processors, such as field programmable gate arrays (FPGAs) or ASICs. Hardware components can also include programmable logic or circuits that are temporarily configured to perform certain operations by software. For example, hardware components can include software executed by general-purpose processors or other programmable processors. Once configured by such software, hardware components become specific machines (or specific components of machines) that are uniquely customized to perform configured functions, and are no longer general-purpose processors. It will be recognized that it can be decided whether to implement hardware components mechanically in a dedicated and permanently configured circuit or in a temporarily configured circuit (e.g., configured by software) for cost and time considerations. Therefore, the phrase "hardware components" (or "hardware-implemented components") should be understood to include tangible entities, i.e., entities that are physically constructed, permanently configured (e.g., hardwired) or temporarily configured (e.g., programmed) to operate in some way or perform certain operations described herein.

[0175] Consider an example where hardware components are temporarily configured (e.g., programmed), without configuring or instantiating each of the hardware components at any one time. For example, where the hardware components include a general-purpose processor that is configured by software to become a special-purpose processor, the general-purpose processor can be configured into different special-purpose processors (e.g., including different hardware components) at different times. The software configures one or more specific processors accordingly, for example, to constitute a specific hardware component at one time and to constitute different hardware components at different times.

[0176] Hardware components can provide information to other hardware components and receive information from other hardware components. Therefore, the described hardware components can be considered to be communicatively coupled. In the case of multiple hardware components simultaneously, communication can be realized by signal transmission (e.g., by appropriate circuits and buses) between or among two or more hardware components in the hardware components. In the example where multiple hardware components are configured or instantiated at different times, communication between such hardware components can be realized, for example, by storing information in a memory structure to which multiple hardware components have access rights and retrieving information in the memory structure. For example, a hardware component can perform an operation and store the output of the operation in a memory device communicatively coupled thereto. Then, other hardware components can access the memory device at a subsequent time to retrieve the stored output and process it. Hardware components can also initiate communication with input devices or output devices, and can operate resources (e.g., a collection of information).

[0177] The various operations of the example methods described herein may be performed at least in part by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform related operations. Whether temporarily configured or permanently configured, such a processor may constitute a processor-implemented component that operates to perform one or more operations or functions described herein. As used herein, "processor-implemented components" refer to hardware components implemented using one or more processors. Similarly, the method described herein may be implemented at least in part by a processor, wherein a specific one or more processors are examples of hardware. For example, at least some operations of the method may be performed by one or more processors 1002 or processor-implemented components. In addition, one or more processors may also operate to support the execution of related operations in a "cloud computing" environment or as a "software as a service" (SaaS) operation. For example, at least some of the operations may be performed by a group of computers (as an example of a machine including a processor), wherein these operations may be accessed via a network (e.g., the Internet) and via one or more appropriate interfaces (e.g., API). The execution of certain operations may be distributed between processors, not just residing in a single machine, but deployed across several machines. In some examples, the processor or processor-implemented components may be located in a single geographic location (e.g., in a home environment, an office environment, or a server farm). In other examples, the processor or processor-implemented components may be distributed across several geographic locations.

[0178] "Computer-readable storage media" refers to both machine storage media and transmission media. Thus, the term includes both storage devices / media and carrier / modulated data signals. The terms "machine-readable medium," "computer-readable medium," and "device-readable medium" mean the same thing and may be used interchangeably in this disclosure.

[0179] "Transient message" refers to a message that is accessible for a limited duration. Transient messages can be text, images, videos, etc. The access time of a transient message can be set by the sender of the message. Alternatively, the access time can be a default setting or a setting specified by the recipient. Regardless of the setting technique, the message is transient.

[0180] "Machine storage media" refers to a single or multiple storage devices and media (e.g., centralized or distributed databases, and associated caches and servers) that store executable instructions, routines, and data. Thus, the term should be considered to include, but is not limited to, solid-state memory and optical and magnetic media, including memory internal or external to the processor. Specific examples of machine storage media, computer storage media, and device storage media include: non-volatile memory, including, for example, semiconductor memory devices such as erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), FPGA, and flash memory devices; magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The terms "machine storage media," "device storage media," and "computer storage media" mean the same thing and may be used interchangeably in this disclosure. The terms "machine storage media," "computer storage media," and "device storage media" expressly exclude carrier waves, modulated data signals, and other such media, at least some of which are encompassed by the term "signal media."

[0181] “Non-transitory computer-readable storage medium” refers to tangible media capable of storing, encoding, or carrying instructions to be executed by a machine.

[0182] "Signal medium" refers to any intangible medium that is capable of storing, encoding or carrying instructions to be executed by a machine, and includes digital or analog communication signals or other intangible media that facilitate the communication of software or data. The term "signal medium" should be deemed to include any form of modulated data signals, carrier waves, etc. The term "modulated data signal" refers to a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. The terms "transmission medium" and "signal medium" refer to the same thing and may be used interchangeably in this disclosure.

[0183] Changes and modifications may be made to the disclosed examples without departing from the scope of the present disclosure. These and other changes or modifications are intended to be included within the scope of the present disclosure as expressed in the appended claims.

Claims

1. A method comprising: receiving, by one or more processors of a client device, an image including data representing a depiction of a person; generating, by the one or more processors, a segmentation of the data representing a depiction of the person; extracting a portion of the image corresponding to a segmentation of the data representing the person depicted in the image; applying a machine learning model to the portion of the image to predict a surface normal tensor of the data representing the depiction of the person, the surface normal tensor representing a surface normal for each pixel within the portion of the image; as well as One or more augmented reality (AR) elements are applied to the image based on the surface normal tensor.

2. The method according to claim 1, wherein: Applying the one or more AR elements includes: determining, based on the surface normal tensor, that light is being focused from a first direction on the data representing the depiction of the person; and Modifying pixel values ​​of the portion of the image corresponding to the segmentation of the data representing the depiction of the person to refocus the light from a second direction on the depiction of the person, wherein the pixel values ​​are modified without modifying pixel values ​​of portions of the image outside of the segmentation.

3. The method according to any one of claims 1 to 2, wherein: Applying the one or more AR elements includes applying the one or more AR elements based on the person's hair, the person's clothing and one or more accessories worn by the person, and a geometry of the person's body.

4. The method according to any one of claims 1 to 3, wherein: Applying the one or more AR elements includes applying artificial light to the data representing the person depicted in the image based on the surface normal tensor.

5. The method according to any one of claims 1 to 4, further comprising: displaying the one or more AR elements on a first portion of the data representing the person depicted in a first frame of a video, wherein the person is positioned at a first location in the first frame; determining that the person has moved from the first location to a second location in a second frame of the video; and A display positioning of the one or more AR elements in the second frame is updated based on the surface normal tensor to maintain display of the one or more AR elements on the data representing the person depicted in the image.

6. The method according to any one of claims 1 to 5, wherein: The surface normal tensor is calculated relative to a surface normal of a camera used to capture the image.

7. The method according to any one of claims 1 to 6, wherein: The AR element is applied to a live video feed including the image.

8. The method according to any one of claims 1 to 7, wherein: Applying the one or more AR elements includes replacing data representing the depiction of the person with one or more visual effects, the method further comprising: determining a direction of light reflection on the person based on the surface normal tensor; and The surface normal tensor is used to cause the one or more visual effects to reflect light along the light reflection direction.

9. The method according to claim 8, wherein: Applying the one or more AR elements includes recoloring one or more portions of the person depicted in the image.

10. The method according to any one of claims 1 to 9, wherein: Applying the one or more AR elements includes applying one or more animated fashion items to the person depicted in the image based on the surface normal tensor.

11. The method according to any one of claims 1 to 10, wherein: Applying the one or more AR elements includes: determining a first direction of a first pixel corresponding to the data representing the depiction of a person; determining a second direction of a second pixel corresponding to the data representing the depiction of a person; generating a first AR element for display, the first AR element comprising a three-dimensional (3D) graphic extending from the first pixel along the first direction; and A second AR element is generated for display together with the first AR element, the second AR element including a 3D graphic extending from the second pixel along the second direction.

12. The method according to claim 11, wherein: The 3D graphic extending from the first pixel includes a 3D column.

13. The method according to any one of claims 1 to 12, wherein: The machine learning model comprises a neural network trained to establish a relationship between image portions depicting different orientations of a human body and the surface normal directions of pixels of the human body.

14. The method according to claim 13, further comprising: The machine learning model is trained by performing operations including: receiving a plurality of training data sets, each of the plurality of training data sets comprising a training portion representing a person depicted in an image and a corresponding ground-truth surface normal tensor; applying the machine learning model to a first training portion of a first training dataset to predict an estimated surface normal tensor; calculating a deviation between the ground-truth surface normal tensor associated with the first training portion and the estimated surface normal tensor; One or more parameters of the machine learning model are updated based on the calculated deviations.

15. The method according to any one of claims 1 to 14, further comprising: One or more wrinkles of clothing worn by the person depicted in the image are detected based on the surface normal tensor.

16. The method according to claim 15, wherein: Applying the one or more AR elements includes presenting one or more virtual shadows on the clothing based on the one or more wrinkles.

17. The method according to any one of claims 1 to 16, wherein: Applying the one or more AR elements includes bending portions of the one or more AR elements covering the one or more wrinkles based on the surface normal tensor.

18. The method according to any one of claims 1 to 17, wherein: The machine learning model generates a segmentation vector that associates each pixel in the image with an indication of whether the pixel corresponds to background or to data representing a depiction of the person, and applies the one or more AR elements based on the segmentation vector.

19. A system comprising: The processor of the client device; as well as A memory component, wherein the memory component stores instructions, and when the instructions are executed by the processor, the processor performs an operation, wherein the operation includes: receiving an image, the image comprising data representing a depiction of a person; generating a segmentation of said data representing said person depicted in said image; extracting a portion of the image corresponding to a segmentation of the data representing the person depicted in the image; applying a machine learning model to the portion of the image to predict a surface normal tensor of the data representing the depiction of the person, the surface normal tensor representing a surface normal for each pixel within the portion of the image; and One or more augmented reality (AR) elements are applied to the image based on the surface normal tensor.

20. A non-transitory computer-readable storage medium having instructions stored thereon, wherein when the instructions are executed by a processor of a client device, the processor performs operations comprising: receiving an image, the image comprising data representing a depiction of a person; generating a segmentation of said data representing said person depicted in said image; extracting a portion of the image corresponding to a segmentation of the data representing the person depicted in the image; applying a machine learning model to the portion of the image to predict a surface normal tensor of the data representing the depiction of the person, the surface normal tensor representing a surface normal for each pixel within the portion of the image; as well as One or more augmented reality (AR) elements are applied to the image based on the surface normal tensor.

Citation Information

Cited By

  • Multi-SoC hand-tracking platform

    US12429953B2