Method and electronic device for face undistortion in a digital image using multiple imaging sensors
Through multiple imaging sensors and deep learning technology, perspective distortion in selfie photos is eliminated, solving the problem of facial distortion in selfie photos on mobile devices, achieving a natural facial appearance and improved user experience, and avoiding the use of depth sensors and complex algorithms. Equipment complexity.
Patent Information
- Application Number
- CN202380019303.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-31
- Filing Date
- 2023-01-27
- Publication Date
- 2024-09-03
AI Technical Summary
Selfie photos taken on mobile devices often cause facial perspective distortion due to arm-length shooting, resulting in an unattractive facial appearance and an unsatisfactory user experience. Existing technologies require the use of depth sensors and complex algorithms, increasing device complexity.
Using multiple imaging sensors and an end-to-end differentiable deep learning pipeline, the disparity estimation neural network and the repair neural network are used to generate undistorted images, eliminate perspective distortion, and do not require pre-generated depth maps.
Significantly improves facial distortion correction for selfie photos without increasing device complexity and using depth sensors, providing a natural facial appearance and enhanced user experience.
Smart Images

Figure CN118591818A
Abstract
Description
Technical Field
[0001] The present disclosure relates generally to imaging systems and more particularly to systems and methods for performing facial undistortion in digital images using multiple imaging sensors. Background Art
[0002] With recent advances in mobile device camera technology, it has become common for mobile device users to take "selfies." Since a selfie is, by definition, an image of the user taken by the user, selfie photos are typically taken at an arm's length distance. This small distance can cause perspective distortion of the face that appears in the selfie. For example, in many selfies, the face appears narrower and the nose enlarged compared to the actual face. Perspective distortion of the face can result in an unattractive facial appearance in selfies. This can also result in an unsatisfactory user experience when capturing selfies and during handheld video calls. Summary of the invention
[0003] The present disclosure provides a system and method for performing facial undistortion in digital images using multiple imaging sensors.
[0004] In an embodiment, a method includes aligning landmark points between a plurality of distorted images to generate a plurality of aligned images, wherein the plurality of distorted images exhibit perspective distortion in at least one face appearing in the plurality of distorted images. The method also includes obtaining a depth map using a disparity estimation neural network that receives the plurality of aligned images as input. The method also includes generating a warp field using a selected one of the plurality of aligned images. The method also includes performing a two-dimensional (2D) image projection on the selected aligned image using the depth map and the warp field to generate an undistorted image. In addition, the method includes filling in one or more missing pixels in the undistorted image using a repair neural network to generate a final undistorted image.
[0005] In an embodiment, the electronic device includes at least one memory configured to store instructions. The electronic device also includes at least one processor configured to align landmark points between multiple distorted images to generate multiple aligned images when executing the instructions, wherein the multiple distorted images exhibit perspective distortion in at least one face appearing in the multiple distorted images. The at least one processor is also configured to obtain a depth map using a disparity estimation neural network that receives multiple aligned images as input when executing the instructions. The at least one processor is also configured to generate a warp field using a selected one of the multiple aligned images when executing the instructions. The at least one processor is also configured to perform 2D image projection on the selected aligned image using the depth map and the warp field to generate an undistorted image when executing the instructions. In addition, the at least one processor is configured to use a repair neural network to fill in one or more missing pixels in the undistorted image to generate a final undistorted image when executing the instructions.
[0006] In an embodiment, a machine-readable medium includes instructions that, when executed, cause at least one processor of an electronic device to align landmarks between a plurality of distorted images to generate a plurality of aligned images, wherein the plurality of distorted images exhibit perspective distortion in at least one face appearing in the plurality of distorted images. The medium also includes instructions that, when executed, cause at least one processor to obtain a depth map using a disparity estimation neural network that receives a plurality of aligned images as input. The medium also includes instructions that, when executed, cause at least one processor to generate a warp field using a selected one of the plurality of aligned images. The medium also includes instructions that, when executed, cause at least one processor to perform 2D image projection on the selected aligned image using the depth map and the warp field to generate an undistorted image. In addition, the medium includes instructions that, when executed, cause at least one processor to fill in one or more missing pixels in the undistorted image using a repair neural network to generate a final undistorted image.
[0007] In an embodiment, a method includes identifying landmark points on a facial portion of a person appearing in an undistorted ground truth image. The method also includes generating a three-dimensional (3D) facial model that fits the landmark points of the facial portion, wherein the 3D facial model includes depth information of the face. The method also includes performing a perspective projection using the undistorted ground truth image and the depth information of the facial portion to generate left distorted image pixel locations and right distorted image pixel locations. The method also includes generating a left warp field and a right warp field based on the left distorted image pixel locations and the right distorted image pixel locations. In addition, the method includes performing a 2D image projection of the undistorted ground truth image using the 3D facial model and the left and right warp fields to generate a stereo image pair.
[0008] Other technical features may be apparent to those skilled in the art from the following drawings, descriptions and claims.
[0009] Before proceeding to the following inventive mode, it may be beneficial to set forth the definitions of certain words and phrases used throughout this patent document. The terms "send," "receive," and "communicate" and their derivatives include direct and indirect communications. The terms "include" and "comprises" and their derivatives are meant to include, but are not limited to, this. The term "or" is inclusive, meaning and / or. The phrase "associated with..." and its derivatives are meant to include, be included in, be interconnected with, include, be contained in, be connected to or connected with, be coupled to or coupled with, be communicable with, collaborate with, be intertwined, be juxtaposed, be close to, be bound to or bound with, have, have the nature of, have a relationship with, etc.
[0010] In addition, the various functions described below can be implemented or supported by one or more computer programs, each of which is formed by a computer-readable program code and embodied in a computer-readable medium. The terms "application" and "program" refer to one or more computer programs, software components, instruction sets, processes, functions, objects, classes, instances, related data or a portion thereof suitable for implementation in a suitable computer-readable program code. The phrase "computer-readable program code" includes any type of computer code, including source code, object code and executable code. The phrase "computer-readable medium" includes any type of medium that can be accessed by a computer, such as a read-only memory (ROM), a random access memory (RAM), a hard drive, a compact disk (CD), a digital video disk (DVD) or any other type of memory. Computer-readable media do not include wired, wireless, optical or other communication links that transmit transient electrical signals or other signals. Computer-readable media include media that can permanently store data and media that can store data and then rewrite data, such as rewritable optical disks or erasable memory devices.
[0011] As used herein, terms and phrases such as "having", "may have", "include" or "may include" a feature (such as a number, function, operation or component such as a part) indicate the presence of the feature and do not exclude the presence of other features. In addition, as used herein, the phrases "A or B", "at least one of A and / or B" or "one or more of A and / or B" may include all possible combinations of A and B. For example, "A or B", "at least one of A and B" and "at least one of A or B" may indicate all of the following: (1) including at least one A, (2) including at least one B or (3) including at least one A and at least one B. In addition, as used herein, the terms "first" and "second" may modify various components regardless of their importance and do not limit the components. These terms are only used to distinguish one component from another. For example, a first user device and a second user device may indicate user devices that are different from each other, regardless of the order or importance of the devices. Without departing from the scope of the present disclosure, a first component may be represented as a second component and vice versa.
[0012] It should be understood that when an element (such as a first element) is referred to as being “coupled” / “coupled to” or “connected” / “connected to” another element (such as a second element) (operably or communicatively) with another element (such as a second element), it may be coupled or connected / coupled or connected to the other element directly or via a third element. Conversely, it should be understood that when an element (such as a first element) is referred to as being “directly coupled” / “directly coupled to” or “directly connected” / “directly connected to” another element (such as a second element), there are no other elements (such as a third element) between the element and the other element.
[0013] As used herein, the phrase "configured (or set) to" may be used interchangeably with the phrases "suitable for," "capable of," "designed to," "suitable for," "manufactured to," or "capable of," depending on the circumstances. The phrase "configured (or set) to" does not inherently mean "specially designed in hardware to." On the contrary, the phrase "configured to" may indicate that a device may perform an operation together with another device or component. For example, the phrase "a processor configured (or set) to perform A, B, and C" may indicate a general-purpose processor (such as a CPU or application processor) that may perform operations by executing one or more software programs stored in a memory device, or a dedicated processor (such as an embedded processor) for performing operations.
[0014] The terms and phrases used herein are only used to describe some embodiments of the present disclosure, rather than to limit the scope of other embodiments of the present disclosure. It should be understood that the singular forms "one", "an" and "the" include plural references unless the context clearly states otherwise. All terms and phrases used herein (including technical and scientific terms and phrases) have the same meanings as those generally understood by those of ordinary skill in the art to which the embodiments of the present disclosure belong. It will be further understood that terms and phrases (such as those defined in commonly used dictionaries) should be interpreted as having meanings consistent with their meanings in the context of the relevant art, and will not be interpreted in an idealized or overly formal sense, unless explicitly defined herein. In some cases, the terms and phrases defined herein may be interpreted as excluding embodiments of the present disclosure.
[0015] Examples of "electronic devices" according to embodiments of the present disclosure may include at least one of a smart phone, a tablet personal computer (PC), a mobile phone, a video phone, an e-book reader, a desktop PC, a laptop computer, a netbook computer, a workstation, a personal digital assistant (PDA), a portable multimedia player (PMP), an MP3 player, a mobile medical device, a camera, or a wearable device (such as smart glasses, a head mounted device (HMD), electronic clothing, an electronic bracelet, an electronic necklace, an electronic accessory, an electronic tattoo, a smart mirror, or a smart watch). Other examples of electronic devices include smart home appliances. Examples of smart home appliances may include a television, a digital video disc (DVD) player, an audio player, a refrigerator, an air conditioner, a vacuum cleaner, an oven, a microwave, a washing machine, a dryer, an air purifier, a set-top box, a home automation control panel, a security control panel, a TV box (such as Samsung HOMESYNC, APPLE TV, or GOOGLE TV), a smart speaker or a speaker with an integrated digital assistant (such as Samsung GALAXY HOME, APPLE HOMEPOD, or AMAZON ECHO), a game console (such as XBOX, PLAYSTATION, or NINTENDO), an electronic dictionary, an electronic key, a camera, or at least one of an electronic photo frame. Other examples of electronic devices include various medical devices (such as various portable medical measuring devices (such as blood sugar measuring devices, heart rate measuring devices, or body temperature measuring devices), magnetic resource angiography (MRA) devices, magnetic resource imaging (MRI) devices, computed tomography (CT) devices, imaging devices, or ultrasound devices), navigation devices, global positioning system (GPS) receivers, event data recorders (EDR), flight data recorders (FDR), automotive infotainment devices, navigation electronic devices (such as navigation navigation devices or gyrocompasses), avionics equipment, security equipment, vehicle head units, industrial or household robots, automatic teller machines (ATMs), point of sale (POS) devices, or Internet of Things (IoT) devices (such as light bulbs, various sensors, electricity meters or gas meters, sprinkler heads, fire alarms, thermostats, street lights, toasters, fitness equipment, hot water tanks, heaters, or boilers). Other examples of electronic devices include at least a portion of a piece of furniture or a building / structure, an electronic board, an electronic signature receiving device, a projector, or various measuring devices (such as devices for measuring water, electricity, gas, or electromagnetic waves). Note that according to various embodiments of the present disclosure, the electronic device may be one or a combination of the devices listed above. In an embodiment, the electronic device may be a flexible electronic device. The electronic device disclosed herein is not limited to the devices listed above, and may include new electronic devices depending on the development of technology.
[0016] In the following description, an electronic device is described with reference to the accompanying drawings according to various embodiments of the present disclosure. As used herein, the term "user" may refer to a person using an electronic device or another device (such as an artificial intelligence electronic device).
[0017] Definitions for certain other words and phrases may be provided throughout this patent document. Those of ordinary skill in the art should understand that in many, if not most instances, such definitions apply to prior, as well as future uses of such defined words and phrases.
[0018] Nothing in the description of this application should be interpreted as implying that any particular element, step, or function is an essential element that must be included in the scope of the claims. The scope of the patented subject matter is limited only by the claims. Applicants understand that any other terms, including but not limited to "mechanism", "module", "device", "unit", "component", "element", "member", "device", "machine", "system", "processor" or "controller" are used in the claims to refer to structures known to those skilled in the relevant art. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] For a more complete understanding of the present disclosure and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings, wherein like reference numerals represent like parts:
[0020] FIG1 illustrates an example network configuration including electronic devices according to the present disclosure;
[0021] 2A-2G illustrate an example training framework for face undistortion in digital images using multiple imaging sensors according to the present disclosure;
[0022] FIG3 illustrates an example process for performing facial undistortion in a digital image using multiple imaging sensors in accordance with the present disclosure;
[0023] 4A-4C illustrate examples of benefits that may be achieved using one or more embodiments of the present disclosure;
[0024] FIG5 illustrates an example method for facial undistortion in digital images using multiple imaging sensors according to the present disclosure; and
[0025] FIG. 6 illustrates an example method for generating and using training data according to the present disclosure. DETAILED DESCRIPTION
[0026] 1 to 6 discussed below and various embodiments of the present disclosure are described with reference to the accompanying drawings. However, it should be understood that the present disclosure is not limited to these embodiments, and all changes and / or equivalents or replacements thereof also belong to the scope of the present disclosure.
[0027] As discussed above, with recent developments in mobile device camera technology, it has become common for mobile device users to take "selfies". By definition, since a selfie is an image of the user taken by the user, selfie photos are usually taken at arm's length. This small distance can cause perspective distortion of the face that appears in the selfie. For example, in many selfies, the face appears narrower and the nose is enlarged compared to the actual face. Here, perspective distortion is distinguished from other types of image distortion such as those caused by sensor noise or failure. Perspective distortion of the face can result in an unattractive facial appearance in the selfie. This can also result in an unsatisfactory user experience when capturing selfies and during handheld video calls. Some techniques have been developed to fix perspective distortion in selfies. However, these techniques are implemented after capture and require a depth map of the subject. Therefore, these techniques require additional complex algorithms and / or depth sensors, both of which increase the complexity of smartphones or other mobile devices.
[0028] The present disclosure provides systems and methods for undistorting faces in digital images using multiple imaging sensors. As described in more detail below, the disclosed systems and methods receive distorted image pairs captured using multiple imaging sensors and correct perspective distortion of faces in the images without using a pre-generated depth map. In an embodiment, the disclosed systems and methods use an end-to-end differentiable deep learning pipeline to correct perspective distortion. In addition, the disclosed systems and methods allow for variable distances between multiple imaging sensors as well as variable focal lengths and sensor gains. Compared to the prior art, the disclosed embodiments achieve significant improvements in facial distortion correction without the need for the use of depth sensors. Note that while some of the embodiments discussed below are described in the context of use in consumer electronic devices (such as smart phones or tablet computers), this is merely an example. It should be understood that the principles of the present disclosure can be implemented in any number of other suitable contexts.
[0029] FIG1 illustrates an example network configuration 100 including electronic devices according to the present disclosure. The embodiment of the network configuration 100 shown in FIG1 is for illustration only. Other embodiments of the network configuration 100 may be used without departing from the scope of the present disclosure.
[0030] According to an embodiment of the present disclosure, an electronic device 101 is included in a network configuration 100. The electronic device 101 may include at least one of a bus 110, a processor 120, a memory 130, an input / output (I / O) interface 150, a display 160, a communication interface 170, or a sensor 180. In an embodiment, the electronic device 101 may exclude at least one of these components, or may add at least one other component. The bus 110 includes circuits for connecting the components 120-180 to each other and for transmitting communications (such as control messages and / or data) between the components.
[0031] The processor 120 includes one or more of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). The processor 120 is capable of controlling at least one of the other components of the electronic device 101 and / or performing communication-related operations or data processing. In an embodiment, the processor 120 may be a graphics processor unit (GPU). As described in more detail below, the processor 120 may use multiple cameras or other imaging sensors to perform one or more operations for performing facial undistortion in a digital image.
[0032] The memory 130 may include volatile and / or non-volatile memory. For example, the memory 130 may store commands or data related to at least one other component of the electronic device 101. According to an embodiment of the present disclosure, the memory 130 may store software and / or programs 140. The programs 140 include, for example, a kernel 141, middleware 143, an application programming interface (API) 145, and / or an application program (or "application") 147. At least a portion of the kernel 141, the middleware 143, or the API 145 may be represented as an operating system (OS).
[0033] The kernel 141 may control or manage system resources (such as the bus 110, processor 120, or memory 130) for executing operations or functions implemented in other programs (such as the middleware 143, API 145, or application 147). The kernel 141 provides an interface that allows the middleware 143, API 145, or application 147 to access various components of the electronic device 101 to control or manage system resources. As discussed below, the application 147 may use multiple cameras or other imaging sensors to support one or more functions for performing facial undistortion in digital images. These functions may be performed by a single application or multiple applications, each of which performs one or more of these functions. For example, the middleware 143 may be used as a relay to allow the API 145 or application 147 to transmit data to the kernel 141. Multiple applications 147 may be provided. The middleware 143 is capable of controlling work requests received from the application 147, such as by assigning a priority for using the system resources (such as the bus 110, processor 120, or memory 130) of the electronic device 101 to at least one of the multiple applications 147. The API 145 is an interface that allows the application 147 to control functions provided from the kernel 141 or the middleware 143. For example, the API 145 includes at least one interface or function (such as a command) for archive control, window control, image processing, or text control.
[0034] The I / O interface 150 serves as an interface that can, for example, transmit commands or data input from a user or other external device to other components (or multiple components) of the electronic device 101. The I / O interface 150 can also output commands or data received from other components (or multiple components) of the electronic device 101 to the user or other external devices.
[0035] The display 160 includes, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a quantum dot light emitting diode (QLED) display, a microelectromechanical system (MEMS) display, or an electronic paper display. The display 160 may also be a depth perception display, such as a multi-focal display. The display 160 is capable of displaying, for example, various contents (such as text, images, videos, icons, or symbols) to the user. The display 160 may include a touch screen and may receive, for example, a touch, gesture, proximity, or hovering input using an electronic pen or a body part of the user.
[0036] For example, the communication interface 170 can establish communication between the electronic device 101 and an external electronic device (such as the first electronic device 102, the second electronic device 104, or the server 106). For example, the communication interface 170 can be connected to the network 162 or 164 through wireless or wired communication to communicate with the external electronic device. The communication interface 170 can be a wired or wireless transceiver or any other component for sending and receiving signals.
[0037] Wireless communication can use, for example, long term evolution (LTE), long term evolution-advanced (LTE-A), fifth generation wireless system (5G), millimeter wave or 60 GHz wireless communication, wireless USB, code division multiple access (CDMA), wideband code division multiple access (WCDMA), universal mobile telecommunications system (UMTS), wireless broadband (WiBro) or global system for mobile communications (GSM) as a cellular communication protocol. Wired connection can include, for example, at least one of universal serial bus (USB), high-definition multimedia interface (HDMI), recommended standard 232 (RS-232) or plain old telephone service (POTS). Network 162 or 164 includes at least one communication network, such as a computer network (such as a local area network (LAN) or a wide area network (WAN)), the Internet, or a telephone network.
[0038] The electronic device 101 also includes one or more sensors 180, which can measure physical quantities or detect the activation state of the electronic device 101 and convert the measured or detected information into electrical signals. For example, one or more sensors 180 include one or more cameras or other imaging sensors for capturing images of scenes. The sensor (or multiple) 180 may also include one or more buttons for touch input, gesture sensors, gyroscopes or gyro sensors, air pressure sensors, magnetic sensors or magnetometers, acceleration sensors or accelerometers, grip sensors, proximity sensors, color sensors (such as red, green, and blue (RGB) sensors), biophysical sensors, temperature sensors, humidity sensors, illumination sensors, ultraviolet (UV) sensors, electromyography (EMG) sensors, electroencephalography (EEG) sensors, electrocardiography (ECG) sensors, infrared (IR) sensors, ultrasonic sensors, iris sensors, or fingerprint sensors. The sensor (or multiple) 180 may also include an inertial measurement unit, which may include one or more accelerometers, gyroscopes, and other components. In addition, the sensor (or multiple) 180 may include a control circuit for controlling at least one of the sensors included here. Any of these sensor(s) 180 may be located within the electronic device 101 .
[0039] The first external electronic device 102 or the second external electronic device 104 may be a wearable device or a wearable device (such as an HMD) in which the electronic device can be installed. When the electronic device 101 is installed in the electronic device 102 (such as an HMD), the electronic device 101 may communicate with the electronic device 102 through the communication interface 170. The electronic device 101 may be directly connected to the electronic device 102 to communicate with the electronic device 102 without involving a separate network. The electronic device 101 may also be an augmented reality wearable device including one or more imaging sensors, such as glasses.
[0040] The first external electronic device 102 and the second external electronic device 104 and the server 106 can all be devices of the same or different types as the electronic device 101. In an embodiment, the server 106 includes a group of one or more servers. In an embodiment, all or some of the operations performed on the electronic device 101 can be performed on another one or more other electronic devices (such as electronic devices 102 and 104 or server 106). In an embodiment, when the electronic device 101 should automatically or upon request perform a certain function or service, the electronic device 101 can request another device (such as electronic devices 102 and 104 or server 106) to perform at least some functions associated with it, rather than performing the function or service alone or additionally. Other electronic devices (such as electronic devices 102 and 104 or server 106) can perform the requested function or additional function and transmit the execution result to the electronic device 101. The electronic device 101 can provide the requested function or service by processing the received result as is or additionally. To this end, for example, cloud computing, distributed computing or client-server computing technology can be used. Although FIG. 1 illustrates that the electronic device 101 includes the communication interface 170 to communicate with the external electronic device 104 or the server 106 via the network 162 or 164 , according to an embodiment of the present disclosure, the electronic device 101 may independently operate without a separate communication function.
[0041] The server 106 may include components 110-180 (or a suitable subset thereof) that are the same or similar to the electronic device 101. The server 106 may support driving the electronic device 101 by performing at least one of the operations (or functions) implemented on the electronic device 101. For example, the server 106 may include a processing module or processor that may support the processor 120 implemented in the electronic device 101. As described in more detail below, the server 106 may perform one or more operations to support techniques for performing facial undistortion in digital images using multiple cameras or other imaging sensors.
[0042] Although FIG. 1 shows an example of a network configuration 100 including an electronic device 101, various changes may be made to FIG. 1. For example, network configuration 100 may include any number of each component in any suitable arrangement. In general, computing and communication systems have a variety of configurations, and FIG. 1 does not limit the scope of the present disclosure to any particular configuration. In addition, although FIG. 1 shows an operating environment in which various features disclosed in this patent document may be used, these features may be used in any other suitable system.
[0043] 2A to 2G illustrate an example training framework 200 for face undistortion in digital images using multiple imaging sensors according to the present disclosure. For ease of explanation, the framework 200 is described as being implemented using one or more components of the electronic device 101 described above. However, this is merely an example, and the framework 200 may be implemented using any other suitable device (or devices), such as when implemented using the server 106.
[0044] As shown in FIG. 2A , the framework 200 includes a training data generation process 220 and a training process 240. As described in more detail below, the training data generation process 220 is performed to generate training data (in the form of training stereo pairs 218 a-218 b) that can be used in the training process 240. The framework 200 provides many advantages or benefits over existing training techniques. Correction of perspective distortion typically requires a depth map of the face, but the framework 200 does not require a depth map as input. Existing depth map techniques do not provide sufficient resolution on facial areas. For example, such a depth map may not provide a clear indication of where certain facial elements (such as eyes, nose, ears, chin, etc.) are located. Therefore, it is difficult to use these depth maps to correct facial distortion. As described in more detail below, the framework 200 generates a suitable depth map that can be used in the training process 240.
[0045] Starting from the training data generation process 220, the electronic device 101 obtains at least one ground truth image 202. The ground truth image 202 represents a "clean" image of a person's face that does not include distortion. Each ground truth image 202 can be obtained in any suitable manner. For example, the electronic device 101 can obtain the ground truth image 202 from an image database. Using the ground truth image 202 as input, the electronic device 101 performs a two-dimensional (2D) landmark detection process 204 to identify specific landmarks on the face shown in the ground truth image 202 (such as the outline of the eyes, nose, nostrils, lip corners, jaw line, etc.).
[0046] FIG2B illustrates an example of a 2D landmark detection process 204. As shown in FIG2B , using the 2D landmark detection process 204, the electronic device 101 obtains a set of key points on the ground truth image 202, referred to as landmark points 250. The landmark points 250 may correspond to a predefined set of locations for fitting a facial model to the ground truth image 202. As shown in FIG2B , the landmark points 250 may include locations such as eyebrows, eye corners, lip corners, chin contours, etc. The 2D landmark detection process 204 represents any suitable landmark detection technique, including learning-based or non-learning-based techniques. In some cases, the 2D landmark detection process 204 may be mathematically expressed as follows:
[0047] (1)
[0048] in, represents the 2D mark detection process 204, represents the ground truth image 202, represents each of the landmark points 250, Indicates the number of marker points 250.
[0049] Using the set of landmark points 250 as input, the electronic device 101 performs a weak perspective three-dimensional (3D) facial model fitting process 206 to generate a 3D model of the face in the ground truth image 202, wherein the 3D model can account for the landmark points 250. Here, a weak perspective model refers to using a virtual camera or other virtual imaging sensor that is relatively far away from the subject, thereby having weaker perspective distortion (compared to a relatively close virtual imaging sensor, which would generate stronger perspective distortion). Figure 2C shows additional details of an example weak perspective 3D facial model fitting process 206. As shown in Figure 2C, the facial model 252 is a 3D projection obtained using the weak perspective 3D facial model fitting process 206. Point C represents the optical center of the camera system, which is used to measure the distance of the subject from the camera. Parameters Represents the average distance of the subject from the optical center of the camera system.
[0050] The 3D model 252 may be represented by a set of facial model parameters obtained by projecting corresponding landmark points of the 3D model 252 onto the facial portion of the ground truth image 202 and minimizing the distance between the landmark points 250 and the projected landmark points of the 3D model 252. When projecting the landmark points from the 3D model to the 2D image plane, the weak perspective 3D facial model fitting process 206 assumes that the distance between the subject and the imaging sensor is large. That is, a weak perspective model is assumed because the ground truth image 202 is distortion-free, so the ground truth image 202 is assumed to be acquired at a large distance. Therefore, the relative depth of the facial features is negligible compared to the distance from the imaging sensor to the subject. The projection of each landmark point 250 may be represented by:
[0051] (2)
[0052] in, and represents the coordinates of the marker points on the 3D model 252, and represents the average subject-to-sensor distance. Note that is a constant and much larger than and For example, in an embodiment, yes and At least one hundred times the value of , but other multiples are possible. It should also be noted that for the sake of mathematical simplicity and without loss of generality, the focal length is assumed to be equal to a constant value of 1 (in whatever units are used).
[0053] The weak perspective 3D face model fitting process 206 represents any suitable technique for generating a 3D model of a face from a given input image under the assumption that the camera-to-subject distance is large. In an embodiment, the weak perspective 3D face model fitting process 206 uses the FLAME model technique to generate the 3D model, but other techniques are possible and within the scope of the present disclosure.
[0054] After the weak perspective 3D facial model adaptation process 206, the electronic device 101 performs a weak to strong perspective transformation process 208, which simulates moving the virtual imaging sensor closer to the subject. The electronic device 101 also uses the depth information of all pixels of the input ground truth image from the fitted 3D model 252 to reproject all pixels of the input ground truth image, thereby generating a stronger perspective distortion model (because perspective distortion is stronger at closer distances). Using the weak to strong perspective transformation process 208, the electronic device 101 obtains new pixel positions of a distorted image with the appearance of being captured from a short distance. In an embodiment, the electronic device 101 uses a strong perspective model, which can be represented by the following (assuming the focal length is 1):
[0055] (3)
[0056] in, represents the 3D position of the marker point on the 3D model 252 relative to the camera optical center (origin) C, and represents the new 2D position of the pixel in the distorted image. In equation (3), the denominator is variable and can be changed for each landmark point. The value of can be much smaller than that in equation (2) This is because the virtual imaging sensor has been moved closer to the subject.
[0057] In some cases, the calculation using equation (3) can be performed twice in the weak-to-strong perspective transformation process 208, once for each distorted image of the training stereo pair 218a-218b. As discussed in more detail below, each image of the training stereo pair 218a-218b represents an image taken from a different imaging sensor of an electronic device (such as a dual imaging sensor smartphone or other electronic device having a left imaging sensor and a right imaging sensor). Each imaging sensor inherently has a different origin C, as shown in FIG2C, because the imaging sensors are disposed at different locations on the electronic device.
[0058] After the weak-to-strong perspective transformation process 208, the electronic device 101 performs a virtual imaging sensor transformation process 210 and a depth calculation process 212. The virtual imaging sensor transformation process 210 is performed to obtain new distance values for the distorted image using the depth values from the 3D model 252. The electronic device 101 may perform any suitable virtual imaging sensor transformation process 210. The depth calculation process 212 is performed to convert the distance units (such as meters, centimeters, inches, etc.) of the depth values into pixels.
[0059] After the depth calculation process 212, the electronic device 101 performs a warp field generation process 214 to generate a warp field corresponding to the left imaging sensor and the right imaging sensor. FIG2D shows an example of a warp field 254 generated by the warp field generation process 214. As shown in FIG2D, the warp field 254 represents a 2D to 2D mapping of pixels between the undistorted ground truth image 202 and the distorted image obtained in the weak to strong perspective transformation process 208. In the warp field generation process 214, the electronic device 101 can calculate the undistorted pixel position obtained in the weak perspective 3D face model fitting process 206. and the distorted pixel position obtained in the weak to strong perspective transformation process 208 Each warp field 254 is generated by taking the difference between . Mathematically, this can be expressed as follows: .
[0060] (4)
[0061] Difference Vector It can be used to obtain the new position of the pixel in the distorted image plane. In the warp field generation process 214, the electronic device 101 calculates the left warp field 254 corresponding to the left imaging sensor and the right warp field 254 corresponding to the right imaging sensor. Each warp field 254 can be based on a different origin C, as shown in FIG. 2C, because the left imaging sensor and the right imaging sensor are set at different positions.
[0062] After the electronic device 101 generates the warp field 254, the electronic device 101 performs a 2D image projection process 216 on the ground truth image 202 to generate a training stereo pair 218a-218b, wherein the training stereo pair 218a-218b is a distorted image that can be used for training. FIG. 2E shows an example of a 2D image projection process 216. As shown in FIG. 2E, the electronic device 101 projects the ground truth image 202 twice, once using the left warp field 254 and once using the right warp field 254. Each projection produces one of the training stereo pairs 218a-218b. The left training image 218a and the right training image 218b exhibit perspective distortion that is not present in the ground truth image 202. The 2D image projection process 216 represents any suitable technique for 2D image projection using a warp field.
[0063] 2A, the training data generation process 220 is shown to produce training stereo pairs 218a-218b. The training stereo pairs 218a-218b may in turn be used as input to a training process 240, which is performed to generate a predicted image 238. The training process 240 will now be described in more detail.
[0064] In the training process 240, the electronic device 101 obtains one or more pairs of distorted images 222a-222b, which represent two distorted images (such as a left distorted image and a right distorted image) that exhibit perspective distortion in the face shown in the distorted images 222a-222b. Each pair of distorted images 222a-222b can represent a training stereo pair 218a-218b generated during the training data generation process 220. Using the distorted images 222a-222b as input, the electronic device 101 performs a 2D baseline normalization process 224 to account for variable parameter differences that may occur between different imaging sensors. For example, the stereo imaging sensor used during training may be different from the imaging sensor used to generate the ground truth image 202. Different imaging sensors and devices may exhibit parameter differences, such as sensor sensitivity, calibration, focal length, and baseline distance between imaging sensors in a given device. The electronic device 101 performs a 2D baseline normalization process 224 to remove any baseline differences or "parallax" that exist between the distorted images 222a-222b, thereby "normalizing" the distorted images 222a-222b.
[0065] In some cases, the 2D baseline normalization process 224 removes baseline parallax by aligning a subset of the landmark points 250 identified during the training data generation process 220, such as only the nostrils of the face. Using the subset of the landmark points 250, the face can be aligned between the distorted images 222a-222b so that the landmark points 250 appear at nearby locations in the 2D grid. The 2D baseline normalization process 224 can use one or more transformations, such as an affine transformation, to align the images. The affine transformation can rotate the image (such as to account for sensor alignment), scale the image (such as to account for focal length differences), and translate the image (such as to account for baseline distance differences). This can be expressed mathematically as follows:
[0066] (5)
[0067] Among them, y represents the coordinates of the transformation point, and x represents the coordinates of the input point. represents the matrix that models rotation and scaling, and Represents a vector that models the translation.
[0068] FIG2F illustrates an example of a 2D baseline normalization process 224. As shown in FIG2F, the electronic device 101 performs a 2D baseline normalization process 224 on an input image 256, where the input image 256 may represent one of the distorted images 222a-222b. The resulting image 258 exhibits one or more transformations, such as rotation, scaling, and translation. The resulting transformations depicted in the resulting images 256a-256b are exaggerated as shown, but this illustrates the types of transformations that may occur.
[0069] The 2D baseline normalization process 224 may also take into account brightness differences between sensors. For example, the 2D baseline normalization process 224 may use histogram equalization to make the images of the distorted images 222a-222b have similar brightness. Of course, histogram equalization is only an example technique for equalizing brightness between images, and any other suitable technique may be used.
[0070] After the 2D baseline normalization process 224, the electronic device 101 uses the distorted images 222a-222b to train the disparity estimation network 226. The disparity estimation network 226 is a deep learning network (DNN), such as a convolutional neural network (CNN). A deep learning network may need to be trained using a large amount (such as tens, hundreds, or thousands) of training data in order to perform at a high level of accuracy. Therefore, the electronic device 101 partially performs a training process 240 to train the disparity estimation network 226. The disparity estimation network 226 accepts the distorted images 222a-222b as input, and for each pair, obtains (or predicts) a depth map 244 (such as in pixels). Each depth map 244 is a mapping of how far the subject represented by each pixel is from the imaging sensor. The disparity estimation network 226 represents any suitable deep learning network or other machine learning model that is trained to obtain (or predict) a depth map using distorted images. Each depth map 244 represents the depth of each pixel in the associated distorted image 222a-222b. In an embodiment, the disparity estimation network 226 includes multiple layers, which may include one or more encoder layers, decoder layers, etc.
[0071] After obtaining the depth map 244 using the disparity estimation network 226, the electronic device 101 performs a depth calculation process 228 to convert the disparity from pixel units to physical distance units (such as meters, centimeters, inches, etc.) using one or more parameters of the imaging sensor model. In essence, the depth calculation process 228 rescales the depth map 244 into different units to make the depth map 244 more suitable for downstream processes.
[0072] After the electronic device 101 uses the disparity estimation network 226 to obtain the depth map 244, the electronic device 101 performs a virtual imaging sensor transformation process 230 to "virtually" move the virtual imaging sensor farther away from the subject. Moving the virtual imaging sensor farther corresponds to a reduction in perspective distortion as described above. In an embodiment, the virtual imaging sensor transformation process 230 includes adding a constant distance vector to each pixel in a selected one of the distorted images 222a-222b (such as the distorted image 222a). After the virtual imaging sensor transformation process 230, the electronic device 101 performs a warp field generation process 232 using the selected distorted image 222a to generate a warp field. The warp field generation process 232 is similar to the warp field generation process 214 of the training data generation process 220 discussed above, except that the warp field generated in the warp field generation process 232 is used to eliminate the distortion in the distorted image 222a (as opposed to the warp field 254, which is used to introduce distortion into the ground truth image 202). Using the depth map 244 and the warp field generated in the warp field generation process 232, the electronic device 101 performs a 2D image projection process 234 on the distorted image 222a to generate an undistorted image 260, an example of which is shown in FIG2G. The 2D image projection process 234 is similar to the 2D image projection process 216 of the training data generation process 220 discussed above.
[0073] As shown in FIG2G , the undistorted image 260 generated using the 2D image projection process 216 may include one or more unfilled areas (or “holes”) 262, which represent missing pixels in the undistorted image 260. The holes 262 may appear because the projection of the distorted image onto the undistorted image may result in differences that cannot be fully reconciled during the 2D image projection process 216. For example, as the virtual imaging sensor moves further away from the subject, additional areas around the subject may be brought into view. To address this issue, the electronic device 101 implements a repair network 236 to “fill” the holes 262 in the undistorted image 260. FIG2G illustrates an example use of the repair network 236. As shown in FIG2G , the repair network 236 receives the undistorted image 260 with the holes 262 and generates a predicted image 238 without the holes 262. The repair network 236 represents any suitable learning network or other machine learning model that is trained to perform repair to fill holes in an image. In an embodiment, the repair network 236 is a deep learning network, such as a CNN. In an embodiment, the electronic device 101 may partially perform the training process 240 to train the repair network 236 .
[0074] The predicted image 238 represents a prediction of what is actually shown in the ground truth image 202. However, the prediction may not be completely accurate, especially in the early stages of training. Therefore, the training process 240 is performed iteratively, and a loss 242 can be calculated for each iteration. The loss 242 is calculated to represent the difference between the ground truth image 202 and the predicted image 238. The electronic device 101 can calculate the loss 242 using any suitable image quality metric, such as L1, structural similarity index (SSIM), multi-scale SSIM (MS-SSIM), etc. An example of a loss function is given below:
[0075] (6)
[0076] in, represents the value of the i-th pixel in the ground truth image 202, and Represents the value of the i-th pixel in the predicted image 238. Of course, this is just an example, and other loss functions may be used for calculation. Once the loss 242 is calculated, the electronic device 101 uses the loss 242 to tune one or more network weights. For example, in the training process 240, both the disparity estimation network 226 and the restoration network 236 include weights that are updated based on the calculated loss 242 (such as via a back-propagation algorithm). Once the weights are updated, the electronic device 101 may perform another iteration of the training process 240, and the iterations may continue until the loss 242 is acceptably small or until one or more other criteria are met (such as a specified amount of time has passed or a specified number of training iterations have been completed).
[0077] Although Figures 2A to 2G illustrate one example of a training framework 200 for undistorting faces in digital images using multiple imaging sensors and associated details, various changes may be made to Figures 2A to 2G. For example, although the framework 200 is described using various examples of machine learning models and tasks, other embodiments may include other machine learning models and / or other tasks. In addition, although shown as a particular sequence of operations, the various operations shown in Figures 2A to 2G may overlap, occur in parallel, occur in a different order, or occur any number of times (including zero times). In addition, the specific operations shown in Figures 2A to 2G are merely examples, and other techniques may be used to perform each of the operations shown in Figures 2A to 2G.
[0078] FIG3 shows an example process 300 for performing face undistortion in a digital image using multiple imaging sensors according to the present disclosure. For ease of explanation, process 300 is described as being implemented using one or more components of electronic device 101, in which case electronic device 101 may represent a consumer electronic device such as a smartphone. However, this is merely an example, and process 300 may be implemented using any other suitable device (or devices), such as when implemented using server 106.
[0079] As shown in FIG3 , process 300 uses many of the same components and operations as training process 240 of framework 200 . In this example, electronic device 101 obtains two images 302a-302b of a scene, which show faces of people in the scene. For example, electronic device 101 may include dual imaging sensors 180, and images 302a-302b may be captured simultaneously by dual imaging sensors 180 of electronic device 101. Each of images 302a-302b may be a selfie captured by a user of electronic device 101, and may include a certain amount of perspective distortion, including around the user's face.
[0080] Using the images 302a-302b as input, the electronic device 101 performs a 2D baseline normalization process 224 to account for parameter differences that may occur between the dual imaging sensors of the electronic device 101. For example, the electronic device 101 may perform a 2D baseline normalization process 224 to remove any baseline parallax that exists between the images 302a-302b, thereby aligning the images 302a-302b. After the 2D baseline normalization process 224, the electronic device 101 provides the aligned images 302a-302b as input to the disparity estimation network 226. The disparity estimation network uses the aligned images 302a-302b to obtain (or predict) a depth map 244, for example, in units of pixels. The electronic device 101 also performs a depth calculation process 228 to convert the disparity from pixel units to physical distance units (such as meters, centimeters, inches, etc.).
[0081] The electronic device 101 performs a virtual imaging sensor transformation process 230 to "virtually" make the subject in the images 302a-302b appear farther away. After the virtual imaging sensor transformation process 230, the electronic device 101 performs a warp field generation process 232 to generate a warp field that is used to eliminate distortion in a selected one of the images 302a-302b (such as image 302a). Using the warp field generated in the warp field generation process 232, the electronic device 101 performs a 2D image projection process 234 on the image 302a to generate an undistorted image 260. The electronic device 101 implements a restoration network 236 to fill any holes 262 (such as missing pixels) in the undistorted image 260 and generate a final undistorted image 304. The final undistorted image 304 can be output, saved, displayed to a user of the electronic device 101, provided as input to another image processing technique, or used in any other suitable manner.
[0082] Although FIG. 3 shows one example of a process 300 for performing facial undistortion in a digital image using multiple imaging sensors, various changes may be made to FIG. 3. For example, although images 302a-302b are described as being captured by imaging sensor 180 of electronic device 101, images 302a-302b may be captured by dual imaging sensors of another device and later sent to electronic device 101. In addition, although shown as a specific sequence of operations, the various operations shown in FIG. 3 may overlap, occur in parallel, occur in a different order, or occur any number of times (including zero). In addition, the specific operations shown in FIG. 3 are merely examples, and other techniques may be used to perform each of the operations shown in FIG. 3.
[0083] Note that the operations and functions shown in Figures 2A to 3 can be implemented in the electronic device 101, the server 106, or other devices in any suitable manner. For example, in an embodiment, one or more software applications or other software instructions executed by the processor 120 of the electronic device 101, the server 106, or other device can be used to implement or support the operations and functions shown in Figures 2A to 3. In other embodiments, dedicated hardware components can be used to implement or support at least some of the operations and functions shown in Figures 2A to 3. In general, the operations and functions shown in Figures 2A to 3 can be performed using any suitable hardware or any suitable combination of hardware and software / firmware instructions.
[0084] Figures 4A to 4C show examples of benefits that can be achieved using one or more embodiments of the present disclosure. In Figures 4A and 4B, images 401 and 402 are captured simultaneously by two imaging sensors of a dual imaging sensor smartphone. As shown in Figures 4A and 4B, images 401 and 402 exhibit perspective distortion. For example, the subject's face is too narrow, while the subject's nose and mouth are exaggerated. In Figure 4C, image 403 is obtained by performing the face undistortion process 300 using the disparity estimation network 226 and the restoration network 236 that have been trained using the training process 240. As shown in Figure 4C, the resulting image 403 shows the subject's face without distortion; for example, the mouth and nose appear undistorted in Figure 4C. Note that for privacy reasons, the subject's eyes have been hidden in images 401-403.
[0085] Although Figures 4A to 4C illustrate examples of benefits that can be achieved using one or more embodiments of the present disclosure, various changes may be made to Figures 4A to 4C. For example, images of many scenes may be captured from different distances and angles under different lighting conditions, and these figures do not limit the scope of the present disclosure. These figures are intended only to illustrate example types of benefits that may be obtained using the above-described techniques.
[0086] FIG5 shows an example method 500 for undistorting faces in digital images using multiple imaging sensors according to the present disclosure. For ease of explanation, the method 500 shown in FIG5 is described as involving the use of the electronic device 101 shown in FIG1 and the process 300 shown in FIG3. However, the method 500 shown in FIG5 can be used with any other suitable electronic device (such as the server 106) and any suitable process.
[0087] As shown in FIG5 , at step 502 , the marker points are aligned between the multiple distorted images to generate multiple aligned images. This may include, for example, the electronic device 101 aligning the marker points 250 between the distorted images 222a-222b to generate multiple aligned images 222a-222b. The multiple distorted images exhibit perspective distortion in at least one face appearing in the multiple distorted images. At step 504 , a disparity estimation neural network that receives the multiple aligned images as input is used to obtain (or predict) a depth map. This may include, for example, the electronic device 101 using the disparity estimation network 226 to obtain (or predict) a depth map 244 , wherein the disparity estimation network 226 receives the multiple aligned images 222a-222b as input.
[0088] At step 506, a selected one of the plurality of alignment images is used to generate a warp field. This may include, for example, the electronic device 101 performing a warp field generation process 232 using a selected one of the plurality of alignment images 222a-222b to generate a warp field 254. At step 508, a 2D image projection is performed on the selected alignment image using the depth map and the warp field to generate an undistorted image. This may include, for example, the electronic device 101 performing a 2D image projection process 234 to generate an undistorted image 260. At step 510, one or more missing pixels are filled in the undistorted image using a repair neural network to generate a final undistorted image. This may include, for example, the electronic device 101 implementing a repair network 236 to fill in one or more missing pixels in the undistorted image 260 to generate a final undistorted image 304.
[0089] Although Figure 5 shows one example of a method 500 for performing facial undistortion in a digital image using multiple imaging sensors, various changes may be made to Figure 5. For example, although shown as a series of steps, the various steps in Figure 5 may overlap, occur in parallel, occur in a different order, or occur any number of times.
[0090] FIG6 shows an example method 600 for generating and using training data according to the present disclosure. For ease of explanation, the method 600 shown in FIG6 is described as involving the use of the electronic device 101 shown in FIG1 and the framework 200 shown in FIG2A to FIG2G. However, the method 600 shown in FIG6 can be used with any other suitable electronic device (such as server 106) and any suitable process.
[0091] As shown in FIG6 , at step 602, a landmark point is identified on a facial part of a person appearing in an undistorted ground truth image. This may include, for example, the electronic device 101 identifying a landmark point 250 on a facial part of a person appearing in the ground truth image 202. At step 604, a 3D facial model fitting the landmark points of the facial part is generated. This may include, for example, the electronic device 101 generating a 3D model 252, wherein the 3D model 252 fits the landmark points 250 of the facial part. The 3D facial model includes depth information of the facial part.
[0092] At step 606, a strong perspective projection is performed using the undistorted ground truth image and the depth information of the facial portion to generate left distorted image pixel locations and right distorted image pixel locations. This may include, for example, the electronic device 101 performing a weak to strong perspective transformation process 208 using the ground truth image 202 and the depth information of the facial portion to generate left and right distorted image pixel locations. . At step 608, left and right warp fields are generated based on the left and right distorted image pixel positions. This may include, for example, the electronic device 101 generating the left and right warp fields 254 based on the left and right distorted image pixel positions. At step 610, 2D image projection is performed on the undistorted ground truth image using the 3D facial model and the left and right warp fields to generate a stereo image pair. This may include, for example, the electronic device 101 performing a 2D image projection process 216 on the ground truth image 202 using the 3D model 252 and the left and right warp fields 254 to generate a training stereo pair 218a-218b.
[0093] Although Figure 6 shows one example of a method 600 for generating and using training data, various changes may be made to Figure 6. For example, although shown as a series of steps, the various steps in Figure 6 may overlap, occur in parallel, occur in a different order, or occur any number of times.
[0094] Although the present disclosure has been described with reference to various exemplary embodiments, various changes and modifications may be suggested to one skilled in the art. The present disclosure is intended to encompass such changes and modifications as fall within the scope of the appended claims.
Claims
1. A method 500 for undistorting faces in digital images, include: aligning landmark points between a plurality of distorted images to generate a plurality of aligned images, wherein the plurality of distorted images exhibit perspective distortion in at least one face appearing in the plurality of distorted images (502); obtaining a depth map using a disparity estimation neural network that receives as input the plurality of aligned images (504); generating a warp field using a selected one of a plurality of alignment images (506); performing a two-dimensional (2D) image projection on the selected alignment image using the depth map and the warp field to generate an undistorted image (508); as well as One or more missing pixels in the undistorted image are filled using an inpainting neural network to generate a final undistorted image (510).
2. The method according to claim 1, in, The disparity estimation neural network and the inpainting neural network are trained by adjusting weights based on a loss value determined according to a difference between an undistorted ground truth image and a predicted image generated using the disparity estimation neural network and the inpainting neural network.
3. The method according to any one of claims 1 and 2, in, The multiple distorted images are captured by the dual imaging sensor 180 of the electronic device 101 .
4. The method according to any one of claims 1 to 3, further comprising: include: Prior to generating the warp field, one or more subjects in the selected alignment image are virtually made farther away by adding a constant distance vector to each pixel in the selected alignment image.
5. The method according to any one of claims 1 to 4, in, The marker points are aligned to correct for baseline parallax between the plurality of distorted images caused by differences in at least one of: sensor sensitivity, calibration, focus, and baseline distance between imaging sensors.
6. The method according to any one of claims 1 to 5, in, The landmarks are aligned using an affine transformation.
7. The method according to any one of claims 1 to 6, further comprising: include: Histogram equalization is used to adjust the brightness difference between the multiple distorted images so that the multiple distorted images have similar brightness.
8. An electronic device 101 for undistorting a face in a digital image, include: at least one memory 130, configured to store instructions; as well as At least one processor 120, when executing the instructions, is configured to: aligning the landmark points between a plurality of distorted images to generate a plurality of aligned images, wherein the plurality of distorted images exhibit perspective distortion in at least one face appearing in the plurality of distorted images; Obtaining a depth map using a disparity estimation neural network that receives as input a plurality of aligned images; generating a warp field using a selected one of a plurality of alignment images; performing a two-dimensional (2D) image projection of the selected alignment image using the depth map and the warp field to generate an undistorted image; and An inpainting neural network is used to fill in one or more missing pixels in the undistorted image to produce the final undistorted image.
9. The electronic device 101 according to claim 8, in, The disparity estimation neural network and the inpainting neural network are trained by adjusting weights based on a loss value determined according to a difference between an undistorted ground truth image and a predicted image generated using the disparity estimation neural network and the inpainting neural network.
10. The electronic device 101 according to any one of claims 8 and 9, in, The plurality of distorted images include images captured by a dual imaging sensor 108 of the electronic device 101 or another electronic device.
11. The electronic device 101 according to any one of claims 8 to 10, in, The at least one processor is further configured to: Prior to generating the warp field, one or more subjects in the selected alignment image are virtually made farther away by adding a constant distance vector to each pixel in the selected alignment image.
12. The electronic device 101 according to any one of claims 8 to 11, in, At least one processor is configured to align the landmark points to correct for baseline parallax between the plurality of distorted images caused by differences in at least one of: sensor sensitivity, calibration, focus, and a baseline distance between the imaging sensors.
13. The electronic device 101 according to any one of claims 8 to 12, in, At least one processor is configured to align the landmark points using an affine transformation.
14. The electronic device 101 according to any one of claims 8 to 13, in, When executing the instructions, the at least one processor is further configured to use histogram equalization to adjust brightness differences between the plurality of distorted images so that the plurality of distorted images have similar brightness.
15. A machine-readable medium comprising instructions, which when executed cause at least one processor 120 of an electronic device 101 to implement the method according to any one of claims 1 to 7.
