Patent Description:
Many mobile electronic devices, such as smartphones and tablet computers, include cameras that can be used to capture still and video images. While convenient, cameras on mobile electronic devices typically suffer from a number of shortcomings that reduce their image quality. Various machine learning algorithms can be used in a number of image processing-related applications to improve the quality of images captured using mobile electronic devices or other devices. For example, different neural networks may be trained and then used to perform different image processing tasks to improve the quality of captured images. As a particular example, a neural network may be trained and used to blur specific portions of captured images.

<NPL> introduces the problem of estimating the real world depth of elements in a scene captured with different field of views.

A method according to claim <NUM> includes obtaining a first image of a scene using a first image sensor of an electronic device and a second image of the scene using a second image sensor of the electronic device. The method also includes generating a first feature map from the first image and a second feature map from the second image. The method further includes generating a third feature map based on the first feature map, the second feature map, and an asymmetric search window. The method additionally includes generating a depth map by restoring spatial resolution to the third feature map.

This disclosure provides an asymmetric normalized correlation layer for deep neural network feature matching.

In a first embodiment, a method as defined by claim <NUM> of the claims appended hereto is provided.

In a second embodiment, an electronic device as defined by claim <NUM> of the claims appended hereto is provided.

In a third embodiment, a non-transitory machine-readable medium as defined by claim <NUM> of the claims appended hereto is provided.

The terms "transmit", "receive", and "communicate", as well as derivatives thereof, encompass both direct and indirect communication. The terms "include" and "comprise", as well as derivatives thereof, mean inclusion without limitation. The phrase "associated with", as well as derivatives thereof, means to include, be included within, interconnect with, contain, be contained within, connect to or with, couple to or with, be communicable with, cooperate with, interleave, juxtapose, be proximate to, be bound to or with, have, have a property of, have a relationship to or with, or the like.

As used here, terms and phrases such as "have", "may have", "include", or "may include" a feature (like a number, function, operation, or component such as a part) indicate the existence of the feature and do not exclude the existence of other features. Also, as used here, 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 (<NUM>) including at least one A, (<NUM>) including at least one B, or (<NUM>) including at least one A and at least one B. Further, as used here, the terms "first" and "second" may modify various components regardless of 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 different user devices from each other, regardless of the order or importance of the devices. A first component may be denoted a second component and vice versa without departing from the scope of this disclosure.

It will be understood that, when an element (such as a first element) is referred to as being (operatively or communicatively) "coupled with/to" or "connected with/to" another element (such as a second element), it can be coupled or connected with/to the other element directly or via a third element. In contrast, it will be understood that, when an element (such as a first element) is referred to as being "directly coupled with/to" or "directly connected with/to" another element (such as a second element), no other element (such as a third element) intervenes between the element and the other element.

As used here, the phrase "configured (or set) to" may be interchangeably used with the phrases "suitable for", "having the capacity to", "designed to", "adapted to", "made to", or "capable of" depending on the circumstances. The phrase "configured (or set) to" does not essentially mean "specifically designed in hardware to". Rather, the phrase "configured to" may mean that a device can perform an operation together with another device or parts. For example, the phrase "processor configured (or set) to perform A, B, and C" may mean a generic-purpose processor (such as a CPU or application processor) that may perform the operations by executing one or more software programs stored in a memory device or a dedicated processor (such as an embedded processor) for performing the operations.

The terms and phrases as used here are provided merely to describe some embodiments of this disclosure but not to limit the scope of other embodiments of this disclosure. It is to be understood that the singular forms "a", "an", and "the" include plural references unless the context clearly dictates otherwise. All terms and phrases, including technical and scientific terms and phrases, used here have the same meanings as commonly understood by one of ordinary skill in the art to which the embodiments of this disclosure belong. It will be further understood that terms and phrases, such as those defined in commonly-used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined here. In some cases, the terms and phrases defined here may be interpreted to exclude embodiments of this disclosure.

Examples of an "electronic device" according to embodiments of this disclosure may include at least one of a smartphone, 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 clothes, an electronic bracelet, an electronic necklace, an electronic accessory, an electronic tattoo, a smart mirror, or a smart watch). Other examples of an electronic device include a smart home appliance. Examples of the smart home appliance may include at least one of a television, a digital video disc (DVD) player, an audio player, a refrigerator, an air conditioner, a cleaner, an oven, a microwave oven, a washer, a drier, an air cleaner, a set-top box, a home automation control panel, a security control panel, a TV box (such as SAMSUNG HOMESYNC, APPLETV, or GOOGLE TV), a smart speaker or speaker with an integrated digital assistant (such as SAMSUNG GALAXY HOME, APPLE HOMEPOD, or AMAZON ECHO), a gaming console (such as an XBOX, PLAYSTATION, or NINTENDO), an electronic dictionary, an electronic key, a camcorder, or an electronic picture frame. Still other examples of an electronic device include at least one of various medical devices (such as diverse portable medical measuring devices (like a blood sugar measuring device, a heartbeat measuring device, or a body temperature measuring device), a magnetic resonance angiography (MRA) device, a magnetic resonance imaging (MRI) device, a computed tomography (CT) device, an imaging device, or an ultrasonic device), a navigation device, a global positioning system (GPS) receiver, an event data recorder (EDR), a flight data recorder (FDR), an automotive infotainment device, a sailing electronic device (such as a sailing navigation device or a gyro compass), avionics, security devices, vehicular head units, industrial or home robots, automatic teller machines (ATMs), point of sales (POS) devices, or Internet of Things (IoT) devices (such as a bulb, various sensors, electric or gas meter, sprinkler, fire alarm, thermostat, street light, toaster, fitness equipment, hot water tank, heater, or boiler). Other examples of an electronic device include at least one part of a piece of furniture or building/structure, an electronic board, an electronic signature receiving device, a projector, or various measurement devices (such as devices for measuring water, electricity, gas, or electromagnetic waves). Note that, according to various embodiments of this disclosure, an electronic device may be one or a combination of the above-listed devices. According to some embodiments of this disclosure, the electronic device may be a flexible electronic device. The electronic device disclosed here is not limited to the above-listed devices and may include new electronic devices depending on the development of technology.

In the following description, electronic devices are described with reference to the accompanying drawings, according to various embodiments of this disclosure. As used here, the term "user" may denote a human or another device (such as an artificial intelligent electronic device) using the electronic device.

Definitions for other certain words and phrases may be provided throughout this patent document.

None of the description in this application should be read as implying that any particular element, step, or function is an essential element that must be included in the claim scope. The scope of patented subject matter is defined only by the claims.

<FIG>, discussed below, and the various embodiments of this disclosure are described with reference to the accompanying drawings. However, it should be appreciated that this disclosure is not limited to these embodiments and all changes and/or equivalents or replacements thereto also belong to the scope of this disclosure. The same or similar reference denotations may be used to refer to the same or similar elements throughout the specification and the drawings.

As noted above, many mobile electronic devices, such as smartphones and tablet computers, include cameras that can be used to capture still and video images. However, cameras on mobile electronic devices typically suffer from a number of shortcomings as compared to digital single lens reflect (DSLR) cameras. For example, DSLR cameras can create a soft focus effect (also known as the Bokeh effect) due to changes in the depth of field (DoF) of a captured image. The Bokeh effect can be created by using a lens with a wide aperture in a DSLR camera, which causes a softness or blurring outside of a particular depth of field in which a subject in an image is focused. Cameras on mobile electronic devices are often unable to selectively blur a portion of an image that is outside of a particular depth of field, since most cameras on mobile electronic devices generate an image where the entire image is in focus.

Various machine learning algorithms can be used in a number of image processing-related applications, including applications that computationally (rather than optically) create the Bokeh effect in images captured using mobile electronic devices or other devices. For example, different neural networks can be trained and used to perform different image processing tasks to improve the quality of captured images. Each neural network is typically trained to perform a specific task. For instance, in the image processing realm, different neural networks can be trained to recognize types of scenes or objects in the scenes, identify depths of objects in scenes, segment images based on objects in scenes, or generate high dynamic range (HDR) images, Bokeh images, or super-resolution images.

Embodiments of this disclosure describe various techniques to create the Bokeh effect and other image processing effects in images captured using mobile electronic devices or other devices. As described in more detail below, a synthetic graphics engine can be used to generate training data with particular characteristics. The synthetic graphics engine is used to generate training data that is tailored for specific mobile electronic devices or other devices. An evaluation methodology can be used to test the quality of a depth map (or a disparity map), which can be generated by a neural network that is trained using the training data. Depth or disparity maps can be used to identify depth in a scene, which (in some cases) allows more distant portions of an image of the scene to be computationally blurred to provide the Bokeh effect. In some embodiments, a wavelet synthesis neural network (WSN) architecture can be used to generate high-definition depth maps. To generate high-definition depth maps, the WSN architecture includes an invertible wavelet layer and a normalized correlation layer. The invertible wavelet layer is applied to iteratively decompose and synthesize feature maps, and the normalized correlation layer is used for robust dense feature matching that is coupled to the specifications of a camera (including a baseline distance between multiple cameras and calibration accuracy when images from multiple cameras are calibrated).

Additional details regarding a neural network architecture that includes an asymmetric normalized layer are provided below. It should be noted here that while a feature map that is generated based on the invertible wavelet layer and the asymmetric normalized layer is often described as being used to perform specific image processing tasks, the neural network architecture provided in this disclosure is not limited to use with these specific image processing tasks or to use with image processing in general. Rather, the asymmetric normalized layer of a neural network may be used in any suitable system to perform feature matching.

<FIG> illustrates an example network configuration <NUM> including an electronic device in accordance with this disclosure. The embodiment of the network configuration <NUM> shown in <FIG> is for illustration only. Other embodiments of the network configuration <NUM> could be used without departing from the scope of this disclosure.

According to embodiments of this disclosure, an electronic device <NUM> is included in the network configuration <NUM>. The electronic device <NUM> can include at least one of a bus <NUM>, a processor <NUM>, a memory <NUM>, an input/output (I/O) interface <NUM>, a display <NUM>, a communication interface <NUM>, or one or more sensors <NUM>. In some embodiments, the electronic device <NUM> may exclude at least one of these components or may add at least one other component. The bus <NUM> includes a circuit for connecting the components <NUM>-<NUM> with one another and for transferring communications (such as control messages and/or data) between the components.

The processor <NUM> includes one or more of a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), or a communication processor (CP). The processor <NUM> is able to perform control on at least one of the other components of the electronic device <NUM> and/or perform an operation or data processing relating to communication. In some embodiments, the processor <NUM> processes image data using a neural network architecture to perform feature matching using an invertible wavelet layer and an asymmetric normalized correlation layer to generate a single feature map from multiple images of scenes. This can be done to support various image processing functions, such as to create the Bokeh effect in an image.

The memory <NUM> can include a volatile and/or non-volatile memory. For example, the memory <NUM> can store commands or data related to at least one other component of the electronic device <NUM>. According to embodiments of this disclosure, the memory <NUM> can store software and/or a program <NUM>. The program <NUM> includes, for example, a kernel <NUM>, middleware <NUM>, an application programming interface (API) <NUM>, and/or an application program (or "application") <NUM>. At least a portion of the kernel <NUM>, middleware <NUM>, or API <NUM> may be denoted as an operating system (OS).

The kernel <NUM> can control or manage system resources (such as the bus <NUM>, processor <NUM>, or memory <NUM>) used to perform operations or functions implemented in other programs (such as the middleware <NUM>, API <NUM>, or application <NUM>). The kernel <NUM> provides an interface that allows the middleware <NUM>, the API <NUM>, or the application <NUM> to access the individual components of the electronic device <NUM> to control or manage the system resources. The application <NUM> includes one or more applications for image capture and image processing using a neural network architecture as discussed below. These functions can be performed by a single application or by multiple applications that each carries out one or more of these functions. The middleware <NUM> can function as a relay to allow the API <NUM> or the application <NUM> to communicate data with the kernel <NUM>, for instance. A plurality of applications <NUM> can be provided. The middleware <NUM> is able to control work requests received from the applications <NUM>, such as by allocating the priority of using the system resources of the electronic device <NUM> (like the bus <NUM>, the processor <NUM>, or the memory <NUM>) to at least one of the plurality of applications <NUM>. The API <NUM> is an interface allowing the application <NUM> to control functions provided from the kernel <NUM> or the middleware <NUM>. For example, the API <NUM> includes at least one interface or function (such as a command) for filing control, window control, image processing, or text control.

The I/O interface <NUM> serves as an interface that can, for example, transfer commands or data input from a user or other external devices to other component(s) of the electronic device <NUM>. The I/O interface <NUM> can also output commands or data received from other component(s) of the electronic device <NUM> to the user or the other external device.

The display <NUM> 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 systems (MEMS) display, or an electronic paper display. The display <NUM> can also be a depth-aware display, such as a multi-focal display. The display <NUM> is able to display, for example, various contents (such as text, images, videos, icons, or symbols) to the user. The display <NUM> can include a touchscreen and may receive, for example, a touch, gesture, proximity, or hovering input using an electronic pen or a body portion of the user.

The communication interface <NUM>, for example, is able to set up communication between the electronic device <NUM> and an external electronic device (such as a first electronic device <NUM>, a second electronic device <NUM>, or a server <NUM>). For example, the communication interface <NUM> can be connected with a network <NUM> or <NUM> through wireless or wired communication to communicate with the external electronic device. The communication interface <NUM> can be a wired or wireless transceiver or any other component for transmitting and receiving signals, such as images.

The wireless communication is able to use at least one of, for example, long term evolution (LTE), long term evolution-advanced (LTE-A), 5th generation wireless system (<NUM>), millimeter-wave or <NUM> wireless communication, Wireless USB, code division multiple access (CDMA), wideband code division multiple access (WCDMA), universal mobile telecommunication system (UMTS), wireless broadband (WiBro), or global system for mobile communication (GSM), as a cellular communication protocol. The wired connection can include, for example, at least one of a universal serial bus (USB), high definition multimedia interface (HDMI), recommended standard <NUM> (RS-<NUM>), or plain old telephone service (POTS). The network <NUM> or <NUM> includes at least one communication network, such as a computer network (like a local area network (LAN) or wide area network (WAN)), Internet, or a telephone network.

The electronic device <NUM> further includes one or more sensors <NUM> that can meter a physical quantity or detect an activation state of the electronic device <NUM> and convert metered or detected information into an electrical signal. For example, one or more sensors <NUM> can include one or more cameras or other imaging sensors for capturing images of scenes. The sensor(s) <NUM> can also include one or more buttons for touch input, a gesture sensor, a gyroscope or gyro sensor, an air pressure sensor, a magnetic sensor or magnetometer, an acceleration sensor or accelerometer, a grip sensor, a proximity sensor, a color sensor (such as a red green blue (RGB) sensor), a bio-physical sensor, a temperature sensor, a humidity sensor, an illumination sensor, an ultraviolet (UV) sensor, an electromyography (EMG) sensor, an electroencephalogram (EEG) sensor, an electrocardiogram (ECG) sensor, an infrared (IR) sensor, an ultrasound sensor, an iris sensor, or a fingerprint sensor. The sensor(s) <NUM> can further include an inertial measurement unit, which can include one or more accelerometers, gyroscopes, and other components. In addition, the sensor(s) <NUM> can include a control circuit for controlling at least one of the sensors included here. Any of these sensor(s) <NUM> can be located within the electronic device <NUM>.

The first external electronic device <NUM> or the second external electronic device <NUM> can be a wearable device or an electronic device-mountable wearable device (such as an HMD). When the electronic device <NUM> is mounted in the electronic device <NUM> (such as the HMD), the electronic device <NUM> can communicate with the electronic device <NUM> through the communication interface <NUM>. The electronic device <NUM> can be directly connected with the electronic device <NUM> to communicate with the electronic device <NUM> without involving with a separate network. The electronic device <NUM> can also be an augmented reality wearable device, such as eyeglasses, that include one or more cameras.

The first and second external electronic devices <NUM> and <NUM> and the server <NUM> each can be a device of the same or a different type from the electronic device <NUM>. According to certain embodiments of this disclosure, the server <NUM> includes a group of one or more servers. Also, according to certain embodiments of this disclosure, all or some of the operations executed on the electronic device <NUM> can be executed on another or multiple other electronic devices (such as the electronic devices <NUM> and <NUM> or server <NUM>). Further, according to certain embodiments of this disclosure, when the electronic device <NUM> should perform some function or service automatically or at a request, the electronic device <NUM>, instead of executing the function or service on its own or additionally, can request another device (such as electronic devices <NUM> and <NUM> or server <NUM>) to perform at least some functions associated therewith. The other electronic device (such as electronic devices <NUM> and <NUM> or server <NUM>) is able to execute the requested functions or additional functions and transfer a result of the execution to the electronic device <NUM>. The electronic device <NUM> can provide a requested function or service by processing the received result as it is or additionally. To that end, a cloud computing, distributed computing, or client-server computing technique may be used, for example. While <FIG> shows that the electronic device <NUM> includes the communication interface <NUM> to communicate with the external electronic device <NUM> or server <NUM> via the network <NUM> or <NUM>, the electronic device <NUM> may be independently operated without a separate communication function according to some embodiments of this disclosure.

The server <NUM> can include the same or similar components <NUM>-<NUM> as the electronic device <NUM> (or a suitable subset thereof). The server <NUM> can support to drive the electronic device <NUM> by performing at least one of operations (or functions) implemented on the electronic device <NUM>. For example, the server <NUM> can include a processing module or processor that may support the processor <NUM> implemented in the electronic device <NUM>. In some embodiments, the server <NUM> processes image data using a neural network architecture to perform feature matching using an invertible wavelet layer and an asymmetric normalized correlation layer to generate a single feature map from multiple images of scenes. This can be done to support various image processing functions, such as to create the Bokeh effect in an image.

Although <FIG> illustrates one example of a network configuration <NUM> including an electronic device <NUM>, various changes may be made to <FIG>. For example, the network configuration <NUM> could include any number of each component in any suitable arrangement. In general, computing and communication systems come in a wide variety of configurations, and <FIG> does not limit the scope of this disclosure to any particular configuration. Also, while <FIG> illustrates one operational environment in which various features disclosed in this patent document can be used, these features could be used in any other suitable system.

<FIG> illustrate an example input image and an example processing result that may be obtained using an asymmetric normalized correlation layer in a neural network in accordance with this disclosure. In this particular example, a neural network (such as a wavelet synthesis neural network) is being used to generate a depth map, which is then used to create the Bokeh effect from an original image. However, a neural network such as the wavelet synthesis neural network may be used to perform any other suitable tasks, whether or not related to image processing. For ease of explanation, the input image and processing result shown in <FIG> are described in relation to the electronic device <NUM> or the server <NUM> in the network configuration <NUM> of <FIG>. However, a neural network with an asymmetric normalized correlation layer may be used by any other suitable device(s) and in any other suitable system(s).

As shown in <FIG>, an image <NUM> to be processed by a neural network is received, such as when the image <NUM> is received from at least one camera (sensor <NUM>) of the electronic device <NUM>. In this example, the image <NUM> represents an image with a person next to a chain-link fence in the foreground, and the background includes both a field and a building. Although the person's face is obscured for privacy, the foreground and the background are all in focus, which is common with devices such as smartphones and tablet computers. In some embodiments, the image <NUM> may be produced using two images captured by two different cameras of the electronic device <NUM>. In these embodiments, the two images are calibrated to resolve any differences between the two cameras, such as the use of different lenses, different fields of view, different focuses, and the like.

As shown in <FIG>, a depth map <NUM> is generated by the neural network. The depth map <NUM> generally identifies different depths in different portions of the scene captured in the image <NUM> (or the pair of images used to produce the image <NUM>). In this example, lighter colors represent shallower or smaller depths, and darker colors represent deeper or larger depths. In some embodiments, two input images are used to generate the depth map <NUM>. For example, using two cameras that are spaced a known distance apart, each camera can capture an image of the same scene. The neural network can then compare locations of the same points of the scene in the different images to determine the disparity of those points in the images. An inverse relationship exists between the disparity of each point in the images and the depth of that point in the scene. For example, larger disparities indicate that points are closer to the electronic device <NUM>, and smaller disparities indicate that points are farther from the electronic device <NUM>. Thus, the disparities of various points in the scene can be computed and used to generate the depth map <NUM> (or the disparities can be used to generate a disparity map).

The depth map <NUM> in <FIG> identifies, on a pixel-by pixel basis, the distances between the electronic device <NUM> and different areas or portions in the scene being imaged. As illustrated here, the background is generally dark, which indicates that the background is the sufficiently far from the camera (which in some cases may be referred to as an infinite distance). That is, the disparity between common points in the background as captured in multiple images is negligible. The portions of the depth map <NUM> that are lighter includes the person and the chain-link fence, which indicates that there is a larger or more measurable disparity between common points in the foreground as captured in multiple images.

As shown in <FIG>, an image <NUM> is generated based on the image <NUM> and the depth map <NUM>. As illustrated in the image <NUM>, the background of the scene has been computationally blurred to produce the Bokeh effect in the image <NUM>, while objects in the foreground of the scene (such as the person and the chain-link fence) are in focus. The electronic device <NUM> or the server <NUM> can produce the image <NUM> by applying a variable amount of blur to the image <NUM>, where the amount of blur applied to each portion (or each pixel) of the image <NUM> is based on the depth map <NUM>. Thus, for example, maximum blurring can be applied to the pixels of the image <NUM> associated with the darkest colors in the depth map <NUM>, and minimal or no blurring can be applied to the pixels of the image <NUM> associated with the lightest colors in the depth map <NUM>.

As described in more detail below, a neural network (such as a wavelet synthesis neural network) is used to generate the depth map <NUM>, and the resulting depth map <NUM> is then used to perform some image processing function (such as Bokeh generation). The neural network includes an invertible wavelet layer and a normalized correlation layer, which are described in more detail below.

Although <FIG> illustrate one example of an input image and one example of a processing result that may be obtained using an asymmetric normalized correlation layer in a neural network, various changes may be made to these figures. For example, these figures are merely meant to illustrate one example of the type of results that could be obtained using the approaches described in this disclosure. Images of scenes can vary widely, and the results obtained using the approaches described in this patent document can also vary widely depending on the circumstances.

<FIG> illustrates an example neural network architecture <NUM> in accordance with this disclosure. For ease of explanation, the neural network architecture <NUM> is described as being implemented using the electronic device <NUM> or the server <NUM> in the network configuration <NUM> of <FIG>. However, the neural network architecture <NUM> may be used by any other suitable device(s) and in any other suitable system(s). Also, the neural network architecture <NUM> is described as being used to perform specific image processing-related tasks, such as creating the Bokeh effect in an image. However, the neural network architecture <NUM> may be used to perform any other suitable tasks, including non-image processing tasks.

As shown in <FIG>, the neural network architecture <NUM> is configured to receive and process input data, which in this example includes an input image <NUM> and an input image <NUM>. The input images <NUM> and <NUM> may be received from any suitable source(s), such as from two cameras (one or more sensors <NUM>) of the electronic device <NUM>. The neural network architecture <NUM> generally operates here to process the input images <NUM> and <NUM> and generate various outputs. In this example, the outputs include a depth map <NUM> and a Bokeh image <NUM>.

The depth map <NUM> may be similar to the depth map <NUM> of <FIG> in that it can identify (possibly on a pixel-by-pixel basis) depth in a scene being imaged. Thus, the depth map <NUM> represents apparent pixel differences between the input images <NUM> and <NUM> (for disparity) or the apparent depth of pixels in one or more images <NUM> and <NUM> (for depth). In the absence of motion, the disparity between the same point in the input images <NUM> and <NUM> is inversely proportional to depth, so a disparity map may be used when computing a depth map (or vice versa). The Bokeh image <NUM> may be similar to the image <NUM> of <FIG> in that it can include a computationally-blurred background. Thus, the Bokeh image <NUM> generally represents an image in which the background of the image has been digitally blurred, where the image is based on the input image <NUM> and/or the input image <NUM>.

In this example, the neural network architecture <NUM> includes a calibration engine <NUM>, which resolves differences between the input images <NUM> and <NUM> (such as differences based on the cameras that captured the images <NUM> and <NUM>). For example, if the camera that captured the input image <NUM> used a wide angle lens while the camera that captured the input image <NUM> used a telephoto lens, the input images <NUM> and <NUM> have captured different parts of the same scene. For instance, the input image <NUM> may represent a larger magnification of the scene as compared to the input image <NUM>. The calibration engine <NUM> modifies one or both of the input images <NUM> and <NUM> so that the images depict similar views of the scene. The calibration engine <NUM> can also calibrate the input images <NUM> and <NUM> based on other differences associated with the cameras, such as different objects of focus, different fields of view, and the like.

A neural network <NUM> receives the input images <NUM> and <NUM> (as modified by the calibration engine <NUM>) and processes the calibrated images to generate the depth map <NUM>. In this example, the two inputs to the neural network <NUM> correspond to the two input images <NUM> and <NUM> as calibrated by the calibration engine <NUM>. As described in more detail below, the neural network <NUM> generally includes feature extractors (encoder), a normalized correlation layer, and refinement layers (decoder) that are used to generate the depth map <NUM> from two or more images. In some embodiments, the neural network <NUM> also includes an invertible wavelet layer. Note that while the neural network <NUM> receives two input images here, more than two input images of a scene may also be received and processed. It should be noted that, as the number of input images that the neural network <NUM> receives increases, the fidelity of the depth map <NUM> also increases.

The feature extractors of the neural network <NUM> generally operate to extract high-level features from the calibrated input images <NUM> and <NUM> to generate two or more feature maps. The neural network <NUM> can use feature extractors that include convolution and pooling layers to reduce the spatial resolution of the input images while increasing the depth of the feature maps. In some embodiments, the neural network <NUM> uses the same number of feature extractors as the number of input images so that each feature extractor branch corresponds to one input image. For example, if two images (such as the input images <NUM> and <NUM>) are input into the neural network <NUM>, a first feature extractor can generate a first feature map corresponding to the input image <NUM>, and a second feature extractor can generate a second feature map corresponding to the input image <NUM>. In those embodiments, the input to each feature extractor is an RGB image (such as the input image <NUM> or <NUM>) or other image data. In some embodiments, the feature extractors can feed-forward intermediate feature maps to the refinement layers. In some cases, the feature maps that are generated by the feature extractors of the neural network <NUM> can include three dimensional (3D) feature maps, where the dimensions include height (H), width (W), and channel (C).

After generating the feature maps, a normalized correlation layer of the neural network <NUM> performs matching in the feature map space to generate a new feature map. For example, the normalized correlation layer may calculate the cross-correlation between two or more feature maps. In some embodiments, an asymmetric normalized correlation layer performs a normalized comparison between the feature maps. At each search direction w, the asymmetric normalized correlation layer identifies the similarity d between the two feature maps. In particular embodiments, Equation (<NUM>) below describes how the asymmetric normalized correlation layer identifies the similarity between multiple feature maps.

The new feature map generated by the normalized correlation layer can have the dimensions (H, W, C'), where C' is determined based on the size of an asymmetric search window used by the normalized correlation layer. The asymmetric search window (and correspondingly the size C') is based on the physical parameters between the cameras that capture the input images <NUM> and <NUM> being processed. In some cases, the parameter is based on the distance between the cameras. The asymmetric search window (and correspondingly the size C') is also based on the accuracy of the calibration engine <NUM>, so the value of C' decreases as the calibration engine <NUM> increases in accuracy or as the distance between the two cameras decreases.

Pooling layers may be used in the neural network <NUM> to increase receptive fields of the feature extractors so that the neural network <NUM> can have a global context or understanding of the input images <NUM> and <NUM>. Convolution layers can be used to increase the receptive fields additively, while the pooling layers can increase the receptive fields multiplicatively. Note that pooling layers can introduce information loss. For example, in a <NUM>×<NUM> max pooling layer, <NUM>% of the information may be discarded. Generally, in classification-type applications, five <NUM>×<NUM> pooling operations can be used to achieve an output stride of <NUM>, which corresponds to a significant amount of information being discarded. However, in pixel-to-pixel applications such as semantic segmentation, disparity, or optical flow estimations, the output resolution is typically the same as the input resolution. As such, more information is needed to pass through the neural network <NUM>. As a result, wavelet and inverse wavelet transforms can be used to provide both spatial resolution reduction and information preservation. Wavelet transforms are invertible and can achieve the same spatial resolution reduction effect as the pooling layer without the information loss, so wavelet and inverse wavelet transforms can be used in the neural network <NUM>. Additional details of the wavelet and inverse wavelet transforms are provided below.

The refinement layers of the neural network <NUM> restore the spatial resolution to the feature maps that are generated by the normalized correlation layer. This results in the production of the depth map <NUM>, which can be output by the neural network <NUM>. Additional details of the neural network are provided below.

In some embodiments, the neural network <NUM> also generates a confidence map associated with the depth map <NUM>. The confidence map can be obtained by applying softmax operations over the channel dimension of the feature maps. The confidence map may indicate a decrease in confidence of pixel matching in homogeneous and occluded regions of the input images <NUM> and <NUM>. The confidence map can be used in rendering for filtering, blending, or other purposes.

A renderer <NUM> is used to generate the Bokeh image <NUM> based on the depth map <NUM> and at least one of the images <NUM> and <NUM>. For example, the renderer <NUM> may generate the Bokeh image <NUM> based on a focus point <NUM>, the input image <NUM>, and the depth map <NUM>. In some embodiments, the cameras that captured the input images <NUM> and <NUM> can be designated as a main camera and a secondary camera. For instance, if a user desires to capture an image of a scene using a telephoto lens, the camera that includes the telephoto lens of the electronic device <NUM> can be designated as the main camera, while another camera of the electronic device <NUM> can be designated as the secondary camera. Similarly, if the user desires to capture an image of a scene using a wide angle lens, the camera that includes the wide angle lens of the electronic device <NUM> can be designated as the main camera, while another camera of the electronic device <NUM> (such as a camera that includes an ultra-wide angle lens) can be designated as the secondary camera. Whatever the designations, the focus point <NUM> may correspond to a position of focus within an image that is captured by the main camera. As a result, the focus point <NUM> when combined with the depth map <NUM> can identify a focal plane. The focal plane represents the distance (or depth) of desired focus by the main camera in a scene.

The renderer <NUM> also generates the Bokeh effect in the Bokeh image <NUM> by applying suitable blurring to the image <NUM>. For example, the renderer <NUM> can generate a circle of confusion (CoC) map based on the focus point <NUM> of the main camera and the depth map <NUM>. In the CoC map, the level of blurriness increases as distance from the focal plane increases. That is, content in the image <NUM> will be assigned an increasingly larger level of blurriness as the content is further from the focal plane as indicated by the depth map <NUM>. If the neural network <NUM> also generates and outputs a confidence map, the renderer <NUM> can use the confidence map when generating the Bokeh effect for the Bokeh image <NUM>. For instance, the renderer <NUM> may perform an alpha blending that mixes an in-focus image <NUM> with the CoC map using the confidence map. Since the confidence map indicates the accuracy of the pixel matching used in the creation of the depth map <NUM>, the renderer <NUM> can increase or decrease the alpha blending accordingly.

In addition to generating the Bokeh image <NUM>, the renderer <NUM> may use the focus point <NUM> and the depth map <NUM> to provide various other effects, such as variable focus, variable aperture, art Bokeh, and the like. The variable focus effect generates a new image that changes the position of the focus within the image that corresponds to the main camera. The variable aperture effect corresponds to an adjustable CoC map. The art Bokeh effect enables an adjustable kernel shape of spots of light within the image that corresponds to the main camera, such as by changing the shape of background lights within the image.

In order to generate the depth maps <NUM> for various scenes, the neural network <NUM> is trained prior to be placed into use. The training establishes the parameters of the neural network <NUM> used for performing various functions, such as generating and processing feature maps. In some embodiments, the neural network <NUM> undergoes three training stages prior to being placed into use. During a first stage of training, the neural network <NUM> can be trained using synthetic data, and weights between the feature extractors can be shared while processing extracted features from stereo images. During a second stage of training, the neural network <NUM> learns photometric mappings between cameras that capture calibrated images. Photometric discrepancies may exist due to the fact that the cameras of the electronic device <NUM> usually will have different lenses (such as a telephoto lens, a wide angle lens, an ultra-wide angle lens, and the like), different image signal processors, different settings, different tunings, and the like. During a third stage of training, the neural network <NUM> does not share the weights between the feature extractors, enabling the feature extractors to be trained with independent weights.

The various operations performed in the neural network architecture <NUM> can be implemented in any suitable manner. For example, each of the operations performed in the neural network architecture <NUM> can be implemented or supported using one or more software applications or other software instructions that are executed by at least one processor <NUM> of the electronic device <NUM> or server <NUM>. In other embodiments, at least some of the operations performed in the neural network architecture <NUM> can be implemented or supported using dedicated hardware components. In general, the operations of the neural network architecture <NUM> can be performed using any suitable hardware or any suitable combination of hardware and software/firmware instructions.

Although <FIG> illustrates one example of a neural network architecture <NUM>, various changes may be made to <FIG>. For example, the neural network architecture <NUM> can receive and process more than two input images. Also, the tasks performed using the neural network architecture <NUM> may or may not involve image processing.

<FIG> illustrates a detailed example of a neural network <NUM> including an asymmetric normalized correlation layer <NUM> in accordance with this disclosure. The neural network <NUM> shown in <FIG> may, for example, represent a more detailed view of the neural network <NUM> shown in <FIG>. For ease of explanation, the neural network <NUM> is described as being implemented using the electronic device <NUM> or the server <NUM> in the network configuration <NUM> of <FIG>. However, the neural network <NUM> may be used by any other suitable device(s) and in any other suitable system(s). Also, the neural network <NUM> is described as being used to perform specific image processing-related tasks, such as creating the Bokeh effect in an image. However, the neural network <NUM> may be used to perform any other suitable tasks, including non-image processing tasks.

As shown in <FIG>, the neural network <NUM> generally operates to receive multiple calibrated input images <NUM> and <NUM> and generate a depth map <NUM>. The calibrated input images <NUM> and <NUM> may, for example, represent the input images <NUM> and <NUM> after processing by the calibration engine <NUM>. Note that the neural network <NUM> shown here may be used to process any suitable input data and is not limited to processing image data. Also note that the neural network <NUM> may receive and process more than two calibrated images. In other embodiments, additional calibrated images can be input into the neural network <NUM>. For each additional calibrated image, an additional feature extractor can be provided in the neural network <NUM>.

In this example, the calibrated image <NUM> is input to a feature extractor <NUM>, and the calibrated image <NUM> is input to a feature extractor <NUM>. The feature extractor <NUM> generates a feature map <NUM>, such as a feature map with dimensions (H, W, C). Similarly, the feature extractor <NUM> generates a feature map <NUM>, such as a feature map with dimensions (H, W, C). In some embodiments, the feature extractors <NUM> and <NUM> utilize convolution and pooling layers to reduce the spatial resolution of the calibrated images <NUM> and <NUM> while increasing the depth of the feature maps <NUM> and <NUM>. In particular embodiments, an invertible wavelet layer performs the spatial resolution reduction.

The feature maps <NUM> and <NUM> are input into an asymmetric normalized correlation layer <NUM>. In some embodiments, the asymmetric normalized correlation layer <NUM> applies an independent random binary mask to the feature maps <NUM> and <NUM>. The binary mask blocks random pixels along the channel dimension of each of the feature maps <NUM> and <NUM>. For example, at a particular (H, W) location in each feature map <NUM> and <NUM>, the channel dimension can be blocked. The binary mask is random so that random pixels in the feature map <NUM> and random pixels in the feature map <NUM> are blocked. In some embodiments, a value of zero with a probability of <NUM> is assigned to each of the pixels that are blocked in the feature maps <NUM> and <NUM>. The binary mask can be applied to the feature maps <NUM> and <NUM> to force the asymmetric normalized correlation layer <NUM> to learn how to match features, even if a small portion of a view is blocked. Among other things, the binary mask can be used to determine the accuracy of the calibration engine <NUM>.

An asymmetric search window can be used by the asymmetric normalized correlation layer <NUM> to perform the matching between the feature maps <NUM> and <NUM>, helping to ensure that the search is asymmetric in order to maximize the search efficiency. The size of the asymmetric search window is based on the distance between the cameras that capture the input images that were calibrated to form the calibrated images <NUM> and <NUM> and the accuracy of the calibration engine <NUM>. The size of the asymmetric search window is also based on various dimensions denoted dx+, dx-, dy-, and dy+. For cameras that have a larger baseline, a larger dx+ value can be assigned to the search window. For cameras that have smaller baseline, a smaller dx+ value can be assigned to the search window. The accuracy of calibration can also change the dimensions. For instance, when the accuracy of the calibration engine <NUM> is high, the dimensions dx-, dy-, and dy+ can be set to smaller values. Additional details regarding the asymmetric search window are provided below.

The dx+ dimension is often larger than the other dimensions since dx+ is based on the physical distance between cameras, while dx-, dy-, and dy+ are based on calibration accuracy. For example, dx+ can be <NUM>, dx- can be <NUM>, dy- can be <NUM>, and dy+ can be <NUM> for a feature map spatial resolution of <NUM>×<NUM> (H×W). When dx+ is <NUM>, dx- is <NUM>, dy- is <NUM>, and dy+ is <NUM>, the size of the asymmetric search window is <NUM> since (<NUM>+<NUM>)×(<NUM>+<NUM>) equals <NUM>. It is noted that the asymmetric search window is an improvement over a symmetric search window since a symmetric search window is based on the largest dimension, which causes the size of the symmetric search window to be much larger. In some embodiments, the asymmetric normalized correlation layer <NUM> sets the size of the asymmetric search window based on the identified calibration accuracy and the physical distance between the cameras that capture images. In some cases, the physical distance between the cameras can change from image to image, as each camera may include an optical image stabilizer (OIS) that slightly moves a camera sensor to compensate for movement while capturing an image.

The size of the asymmetric search window indicates the number of search directions (u, v) for which the asymmetric normalized correlation layer <NUM> calculates a channel-normalized cross correlation. Thus, the asymmetric normalized correlation layer <NUM> can calculate the channel-normalized correlation between the feature map <NUM> and a shifted version of the feature map <NUM> to generate one channel of a new feature map <NUM>. The asymmetric normalized correlation layer <NUM> can repeat this process for all directions based on the size of the asymmetric search window. For instance, if the size of the asymmetric search window is <NUM> (based on the previous example), the asymmetric normalized correlation layer <NUM> can calculate the channel-normalized correlation between the feature map <NUM> and the shifted feature map <NUM>, where the feature map <NUM> is shifted <NUM> times to generate the new feature map <NUM>. In this example, the new feature map <NUM> will have dimensions of <NUM>×<NUM>×<NUM>.

The asymmetric normalized correlation layer <NUM> can also normalize the values of the new feature map, such as by normalizing the values to be within the range [<NUM>, <NUM>]. In some embodiments, the feature map values can be normalized by subtracting mean (average) values and dividing by the remaining variances in the input feature maps. Equations (<NUM>) and (<NUM>) below describe one possible implementation of the normalization to ensure that the output feature map is constrained to the range [<NUM>, <NUM>]. <MAT> <MAT>.

Here, <MAT> represents the output feature map in two dimensions (2D), FL and <MAT> represent the left and right input feature maps in 3D, and FL and <MAT> represent the feature maps <NUM> and <NUM>. Also, vare represents the variance of the feature map over the channel dimension, and ∈ represents a specific value (such as <NUM>-<NUM>) to prevent the possibility of dividing by zero. Equations (<NUM>) and (<NUM>) can be used for all directions (u, v) in the search window and stacked in the 2D feature maps <MAT> along the channel dimension to generate the 3D feature map <NUM>.

Note that while shown and described as processing two calibrated input images <NUM> and <NUM>, the asymmetric normalized correlation layer <NUM> is not limited to stereo matching applications. Rather, the asymmetric normalized correlation layer <NUM> can be used by any neural network that performs matching of feature maps, regardless of whether the feature maps are associated with two inputs or more than two inputs. Also, the asymmetric normalized correlation layer <NUM> can be used by any neural network to support other image processing functions or other functions. As a particular example, the asymmetric normalized correlation layer <NUM> could be applied to face verification, which matches high-level features of multiple faces.

A refinement layer <NUM> generates the depth map <NUM> by restoring spatial resolution to the generated feature map <NUM>. In this example, the feature extractor <NUM> feeds one or more intermediate feature maps <NUM> forward to the refinement layer <NUM> for use in restoring the spatial resolution to the generated feature map <NUM>. In some embodiments, an invertible wavelet layer performs the spatial resolution reduction in the feature extractor <NUM>, and the invertible wavelet layer can provide the refinement layer <NUM> with the necessary information to restore the spatial resolution to the generated feature map <NUM>.

The various operations performed in the neural network <NUM> can be implemented in any suitable manner. For example, each of the operations performed in the neural network <NUM> can be implemented or supported using one or more software applications or other software instructions that are executed by at least one processor <NUM> of the electronic device <NUM> or server <NUM>. In other embodiments, at least some of the operations performed in the neural network <NUM> can be implemented or supported using dedicated hardware components. In general, the operations of the neural network <NUM> can be performed using any suitable hardware or any suitable combination of hardware and software/firmware instructions.

Although <FIG> illustrates one detailed example of a neural network <NUM> including an asymmetric normalized correlation layer <NUM>, various changes may be made to <FIG>. For example, the neural network <NUM> may include any suitable number of convolutional layers, pooling layers, or other layers as needed or desired. Also, the neural network <NUM> can receive and process more than two input images. In addition, the tasks performed using the neural network <NUM> may or may not involve image processing.

<FIG> illustrates an example application of an invertible wavelet layer <NUM> of a neural network in accordance with this disclosure. The invertible wavelet layer <NUM> may, for example, be used in the neural network <NUM> of <FIG> or the neural network <NUM> of <FIG>. For ease of explanation, the invertible wavelet layer <NUM> is described as being implemented using the electronic device <NUM> or the server <NUM> in the network configuration <NUM> of <FIG>. However, the invertible wavelet layer <NUM> may be used by any other suitable device(s) and in any other suitable system(s). Also, the invertible wavelet layer <NUM> is described as being used to perform specific image processing-related tasks, such as creating the Bokeh effect in an image. However, the invertible wavelet layer <NUM> may be used to perform any other suitable tasks, including non-image processing tasks.

As described above, the invertible wavelet layer <NUM> can be applied to iteratively decompose and synthesize feature maps. In <FIG>, for example, the invertible wavelet layer <NUM> can be used in one or more of the feature extractors <NUM> and <NUM> to reduce the spatial resolution of the calibrated images <NUM> and <NUM> while increasing the depth of the feature maps <NUM> and <NUM>. In <FIG>, the invertible wavelet layer <NUM> receives and decomposes a feature map <NUM> into four elements, namely a low-frequency component <NUM> (such as averaged information) and three high-frequency components <NUM> (such as detailed information). The high-frequency components <NUM> can be stacked in the channel dimension to form a new feature map.

The low-frequency component <NUM> may represent a first feature map that is generated by the invertible wavelet layer <NUM>. In some cases, the low-frequency component <NUM> has dimensions of (H/<NUM>, W/<NUM>, C). The high-frequency components <NUM> may collectively represent a second feature map generated by the invertible wavelet layer <NUM>. In some cases, the high-frequency components <NUM> collectively have dimensions of (H/<NUM>, W/<NUM>, 3C). The low-frequency component <NUM> and the high-frequency components <NUM> are processed differently by the neural network <NUM> of <FIG> or the neural network <NUM> of <FIG>. For example, the neural network <NUM> or <NUM> can iteratively process the low-frequency component <NUM> to gain a global context understanding of image data without interference from local details. The high-frequency components <NUM> can be used for restoring spatial resolution of the output of the neural network <NUM> or <NUM>, such as the new feature map <NUM>.

In some embodiments, before the feature maps <NUM> and <NUM> are processed by the asymmetric normalized correlation layer <NUM> of <FIG>, the invertible wavelet layer <NUM> reduces the low-frequency component <NUM> by a factor of eight (although other reduction factors can be used). Also, in some embodiments, one or more convolution modules in the neural network <NUM> or <NUM> can have a stride of one. Further, in some embodiments, one convolution module in the neural network <NUM> or <NUM> can include more than one convolution block, where each convolution block performs a <NUM>×<NUM> convolution expansion step, a <NUM>×<NUM> depth-wise convolution step, and a <NUM>×<NUM> convolution projection step. If (after the projection) the resulting feature maps have the same number of channels as the input feature map, an additional identify branch connects the input and output feature maps.

Although <FIG> illustrates one example of an application of an invertible wavelet layer <NUM> of a neural network, various changes may be made to <FIG>. For example, any other suitable layers may be used in the neural network architecture <NUM> or in the neural network <NUM>.

<FIG> and <FIG> illustrate an example asymmetric search window <NUM> used in an asymmetric normalized correlation layer <NUM> and an example application of the asymmetric normalized correlation layer <NUM> in accordance with this disclosure. For ease of explanation, the asymmetric search window <NUM> and the asymmetric normalized correlation layer <NUM> are described as being implemented using the electronic device <NUM> or the server <NUM> in the network configuration <NUM> of <FIG>. However, the asymmetric search window <NUM> and the asymmetric normalized correlation layer <NUM> may be used by any other suitable device(s) and in any other suitable system(s). Also, the asymmetric search window <NUM> and the asymmetric normalized correlation layer <NUM> are described as being used to perform specific image processing-related tasks, such as creating the Bokeh effect in an image. However, the asymmetric search window <NUM> and the asymmetric normalized correlation layer <NUM> may be used to perform any other suitable tasks, including non-image processing tasks.

As shown in <FIG> and discussed above, the asymmetric search window <NUM> is based four dimensions, namely dimension <NUM> (dy+), dimension <NUM> (dy-), dimension <NUM> (dx-), and dimension <NUM> (dx+). The dimensions <NUM>, <NUM>, <NUM>, and <NUM> are measured from pixel <NUM> to the parameter of the asymmetric search window <NUM>. The sizes of the dimensions <NUM>, <NUM>, <NUM>, and <NUM> can be based on camera baseline distance and the accuracy of the calibration engine <NUM>. For example, if dy+ is <NUM>, dy- is <NUM>, dx- is <NUM>, and dx+ is <NUM>, the size of the asymmetric search window <NUM> is <NUM>. Given this, the asymmetric normalized correlation layer <NUM> can shift the feature map <NUM> a total of <NUM> times and perform a channel-normalized cross-correlation operation to generate the feature map <NUM>. In some embodiments, the dimensions <NUM>, <NUM>, and <NUM>, are the same size, and the dimension <NUM> is larger than the dimensions <NUM>, <NUM>, and <NUM>.

As shown in <FIG>, the asymmetric normalized correlation layer <NUM> receives a feature map <NUM> and a feature map <NUM>. The feature map <NUM> may represent the feature map <NUM> of <FIG>, and the feature map <NUM> may represent the feature map <NUM> of <FIG>. The asymmetric normalized correlation layer <NUM> randomly applies a binary mask to the feature map <NUM> to create a masked feature map <NUM>, and the asymmetric normalized correlation layer <NUM> randomly applies a binary mask to the feature map <NUM> to create a masked feature map <NUM>. As discussed above, the binary mask blocks random channel values in the feature maps <NUM> and <NUM> to produce the masked feature maps <NUM> and <NUM>. Blocking random channel values can force the neural network <NUM> or <NUM> to learn matchings even if a small portion of a view in an image is blocked.

The masked feature map <NUM> is subjected to a shifting operation <NUM>, which shifts the masked feature map <NUM> multiple times in one or more directions <NUM>. The shifting here is based on the asymmetric search window <NUM> shown in <FIG>. For each shift of the masked feature map <NUM> in a particular (u, v) direction <NUM>, multiple feature maps <NUM>, <NUM>, and <NUM> are generated. The number of times that the masked feature map <NUM> is shifted can be based on the size of the asymmetric search window <NUM>. For example, when the dimensions of the asymmetric search window <NUM> are dy+ = <NUM>, dy- = <NUM>, dx- = <NUM>, and dx+ = <NUM>, the masked feature map <NUM> is shifted <NUM> times, resulting in the production of <NUM> sets of feature maps <NUM>, <NUM>, and <NUM>. The shifting of the masked feature map <NUM> can occur in the (u, v) direction, where u is between -<NUM> and <NUM> and v is between -<NUM> and <NUM>.

To generate each set of feature maps <NUM>, <NUM>, and <NUM>, the asymmetric normalized correlation layer <NUM> can perform feature matching by calculating the inner product and the mean of the masked feature map <NUM> and the masked feature map <NUM> as shifted. For example, the asymmetric normalized correlation layer <NUM> can calculate the inner product between the masked feature map <NUM> and the shifted masked feature map <NUM> as shifted along the channel dimension to generate the feature map <NUM>. The asymmetric normalized correlation layer <NUM> can also calculate the mean of the masked feature map <NUM> along the channel dimension to generate the feature map <NUM>, and the asymmetric normalized correlation layer <NUM> can calculate the mean of the masked feature map <NUM> as shifted along the channel dimension to generate the feature map <NUM>. The collection of feature maps <NUM>, <NUM>, and <NUM> represents a single channel feature map.

The asymmetric normalized correlation layer <NUM> then normalize the feature map <NUM> using the feature maps <NUM> and <NUM> to generate a normalized feature map <NUM>. In some embodiments, the asymmetric normalized correlation layer <NUM> normalizes the feature map <NUM> using Equation (<NUM>) below.

The normalized feature map <NUM> is a 2D feature map since it corresponds to a single channel. However, by generating a normalized feature map <NUM> for each shift of the masked feature map <NUM>, the asymmetric normalized correlation layer <NUM> generates new feature maps <NUM>, <NUM>, and <NUM>, and a new normalized feature map <NUM> is generated for that shift of the masked feature map <NUM>. Each new normalized feature map <NUM> corresponds to a different channel, and the multiple normalized feature maps <NUM> can be stacked. The stacking of the normalized feature maps <NUM> adds depth and thereby forms a 3D feature map with dimensions of (H, W, C'), where C' corresponds to the number of shifts of the masked feature map <NUM> (which is based on the size of the asymmetric search window <NUM>).

The collection of normalized feature maps <NUM> may represent the new feature map <NUM> that is output to the refinement layer <NUM> of <FIG>. Note that when the invertible wavelet layer <NUM> is used to reduce the low-frequency component <NUM> by a factor as discussed above, the refinement layer <NUM> (using the high-frequency components <NUM>) operates to restore the spatial resolution to the normalized feature maps <NUM> in order to generate the depth map <NUM>.

Although <FIG> and <FIG> illustrate one example of an asymmetric search window <NUM> used in an asymmetric normalized correlation layer <NUM> and one example application of the asymmetric normalized correlation layer <NUM>, various changes may be made to <FIG> and <FIG>. For example, the size of the asymmetric search window <NUM> may vary based on the characteristics of the electronic device <NUM>, such as the physical distance between cameras and the accuracy of the calibration. Also, the asymmetric normalized correlation layer <NUM> may process any other numbers of input feature maps, which can be based on the number of input images being processed.

<FIG> illustrates an example method <NUM> for using an asymmetric normalized correlation layer for deep neural network feature matching in accordance with this disclosure. More specifically, <FIG> illustrates an example method <NUM> for generating a depth map using the asymmetric normalized correlation layer <NUM> in a neural network <NUM> or <NUM>, where the generated depth map is used to perform an image processing task. For ease of explanation, the method <NUM> of <FIG> is described as involving the use of the neural network architecture <NUM> of <FIG> in the network configuration <NUM> of <FIG>. However, the method <NUM> may involve the use of any suitable neural network architecture designed in accordance with this disclosure, and the asymmetric normalized correlation layer <NUM> may be used in any other suitable device or system.

In step <NUM>, the neural network architecture <NUM> obtains input data, such as multiple input images. The input images represent two or more images of a scene, such as images that are captured by different cameras or other image sensors of an electronic device. For example, a first image of the scene can be obtained using a first image sensor of the electronic device, and a second image of the scene can be obtained using a second image sensor of the electronic device. Note that the neural network architecture <NUM> may be implemented in an end-user device (such as an electronic device <NUM>, <NUM>, or <NUM>) and process data collected or generated by that end-user device, or the neural network architecture <NUM> may be implemented in one device (such as a server <NUM>) and process data collected or generated by another device (such as an electronic device <NUM>, <NUM>, or <NUM>).

In step <NUM>, the neural network architecture <NUM> generates a first feature map from the first image and a second feature map from the second image. For example, images <NUM> and <NUM> may be processed by the calibration engine <NUM> to modify at least one of the images <NUM> and <NUM> and produce calibrated images <NUM> and <NUM>. The calibrated images <NUM> and <NUM> can then be processed by the feature extractors <NUM> and <NUM> to produce the feature maps <NUM> and <NUM>. In some embodiments, the neural network architecture <NUM> uses separate feature extractors to generate different feature maps. For instance, the feature map <NUM> can be generated by the feature extractor <NUM>, and the feature map <NUM> can be generated by the feature extractor <NUM>. If additional input images are obtained in step <NUM>, additional feature extractors may be utilized to generate additional feature maps for those images. In some embodiments, the feature extractors operate to generate the feature maps in parallel, meaning concurrently during the same or similar period of time.

In step <NUM>, the neural network architecture <NUM> generates a third feature map based on the first feature map and the second feature map using an asymmetric search window. The size of the asymmetric search window is based on the accuracy of the calibration algorithm that calibrated the input images and the distance(s) between the cameras that captured the images. In some cases, the asymmetric search window may be longer in the horizontal direction than in the vertical direction. The size of the asymmetric search window corresponds to the number of times that the second feature map is shifted when performing the feature matching to generate the third feature map. In some embodiments, to generate the third feature map, the neural network architecture <NUM> applies a binary mask across random channels of the first and second feature maps. The binary mask can be used to identify errors in the calibration process or a level of accuracy of the calibration process when the calibrated images are generated. After the mask is applied to the second feature map, the second feature map is shifted a number of times based on the size of the asymmetric search window. For each shift of the second feature map, the neural network architecture <NUM> calculates a channel-normalized cross-correlation between the first feature map and the shifted version of the second feature map to identify channel values for the third feature map. This can occur as described above. This is repeated for each shift of the second feature map such that multiple single-channel feature maps are generated. The multiple single-channels feature maps can then be stacked to form the third feature map.

In step <NUM>, the neural network architecture <NUM> generates a depth map by restoring spatial resolution to the third feature map. For example, the neural network architecture <NUM> can restore spatial resolution to the third feature map using the refinement layer <NUM>. In some cases, the neural network architecture <NUM> can decompose the first feature map into multiple components, such as multiple high-frequency components <NUM> and a low-frequency component <NUM>. In these embodiments, the neural network architecture <NUM> may use an invertible wavelet layer to decompose the first feature map. The low-frequency component <NUM> of the first feature map provides global context of an image without interference from local details, while the high-frequency components <NUM> of the first feature map are used to restore spatial resolution to the third feature map when generating the depth map.

In step <NUM>, an image processing task is performed using the depth map. For example, the neural network architecture <NUM> can identify a focus point within one of the captured images. Based on the position of the focus point, the neural network architecture <NUM> can identify a depth plane within the depth map that corresponds to the focus position within the image. The neural network architecture <NUM> then blurs portions of the captured image based on their identified distances from the depth plane, such as by increasing a level of blurriness at larger depths. This allows the neural network architecture <NUM> to produce the Bokeh effect in the final image of the scene.

Although <FIG> illustrates one example of a method <NUM> for using an asymmetric normalized correlation layer <NUM> for deep neural network feature matching, various changes may be made to <FIG>. For example, while shown as a series of steps, various steps in <FIG> may overlap, occur in parallel, or occur any number of times. Also, the method <NUM> may process any suitable input data and is not limited to use with image processing tasks.

Claim 1:
A computer-implemented method comprising:
obtaining (<NUM>) a first image of a scene using a first image sensor of an electronic device and a second image of the scene using a second image sensor of the electronic device;
calibrating the first image and the second image by resolving differences between the first image and the second image based on the first image sensor and the second image sensor;
generating (<NUM>) a first feature map from the first image and a second feature map from the second image by reducing spatial resolution of the calibrated first image and the calibrated second image;
generating (<NUM>) a third feature map based on the first feature map and the second feature map by calculating channel-normalized cross correlation between the first feature map and the second feature map, using an asymmetric search window, wherein a size of the asymmetric search window indicates the number of search directions, wherein asymmetric dimension of the asymmetric search window is based on distance between the first image sensor and the second image sensor; and
generating (<NUM>) a depth map by restoring spatial resolution to the third feature map.