Electronic device for processing image and method thereof
The electronic device processes images by using depth maps to create a virtual space for foreground and background elements, addressing the limitations of two-dimensional images and reducing computational load and hole areas, thus enhancing the zoom operation and spatial perception.
Patent Information
- Application Number
- PCT/KR2024/001217
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-01-25
- Publication Date
- 2024-09-26
AI Technical Summary
Current image processing technologies limit the sense of space in two-dimensional images, particularly when applying zoom operations, and generate significant computational overhead and hole areas during post-processing.
An electronic device with a processor that obtains a depth map from image data, identifies foreground and background areas, and places them in a virtual space, determining a movement path for a virtual camera to generate a post-processed image with a three-dimensional effect while minimizing hole areas.
The solution effectively conveys a sense of space in two-dimensional images with reduced computational effort and minimizes hole areas, enhancing the zoom operation experience.
Smart Images

Figure KR2024001217_26092024_PF_FP
Abstract
Description
Electronic device for processing images and method thereof
[0001] The present disclosure relates to an electronic device for processing an image and a method thereof.
[0002] An electronic device that processes images can apply various effects to images (e.g., images captured by a digital camera). For example, the electronic device can apply various filters in real time to a stream of captured image frames output by the camera and display the results on a display. As another example, the electronic device can generate a post-processed image by applying image effects (e.g., bokeh effects or filter effects) to images captured by the camera through an image editing application (e.g., a gallery application or a photo editor application).
[0003] Images captured by a camera can be composed of two-dimensional or three-dimensional images. If the captured images are not processed and stored as three-dimensional images but instead composed as two-dimensional images, the viewing experience of the generated images may be limited to two-dimensional forms. Electronic devices can perform zooming operations to enlarge or reduce the image to allow for a more vivid viewing experience.
[0004] The above information may be provided as background art to aid in understanding the present disclosure. No claim or determination is made as to whether any of the above is applicable as prior art in connection with the present disclosure.
[0005] An electronic device according to one embodiment may include a memory storing instructions and at least one processor configured to execute the instructions. The at least one processor may be configured to obtain a depth map from image data including information about an image. The at least one processor may be configured to identify a foreground area and a background area within the image based on the depth map. The at least one processor may be configured to determine a depth value for each of a plurality of points of interest for the depth map. The at least one processor may be configured to place a background image corresponding to the background area within a virtual space based on the determined depth value. The at least one processor may be configured to place a foreground image corresponding to the foreground area within the virtual space. The at least one processor may be configured to obtain a post-processed image obtained by capturing the foreground image and the background image disposed within the virtual space while a virtual camera moves along a movement path within the virtual space.
[0006] A method of operating an electronic device according to one embodiment may include an operation of obtaining a depth map from image data including information about an image. The method may include an operation of identifying a foreground area and a background area within the image based on the depth map. The method may include an operation of determining a depth value for each of a plurality of points of interest for the depth map. The method may include an operation of placing a background image corresponding to the background area within a virtual space based on the determined depth value. The method may include an operation of placing a foreground image corresponding to the foreground area within the virtual space. The method may include an operation of obtaining a post-processed image obtained by capturing the foreground image and the background image placed within the virtual space while a virtual camera moves along a movement path within the virtual space.
[0007] An electronic device according to one embodiment may include a memory for storing instructions and at least one processor configured to execute the instructions. The at least one processor may be configured to obtain a depth map from image data including information about an image. The at least one processor may be configured to identify a foreground area and a background area within the image based on the depth map. The at least one processor may be configured to place a background image corresponding to the background area and a foreground image corresponding to the foreground area within a virtual space based on the determined depth value. The at least one processor may be configured to determine the movement path based on whether a hole area excluding an area where the foreground image or the background image is captured appears within the post-processed image or an area of the hole area. The at least one processor may be configured to obtain a post-processed image in which the foreground image and the background image are captured while a virtual camera moves along a movement path within the virtual space.
[0008] In one embodiment, a computer-readable recording medium may have recorded thereon a computer program that causes the electronic device to perform the operation or method described above.
[0009] FIG. 1 is a block diagram of an electronic device within a network environment according to various embodiments.
[0010] FIG. 2 is a block diagram illustrating a camera module according to various embodiments.
[0011] FIG. 3 is a block diagram illustrating an electronic device according to one embodiment.
[0012] FIG. 4 is a flowchart illustrating a process by which an electronic device acquires a post-processed image according to one embodiment.
[0013] FIG. 5 is a flowchart illustrating a process of setting multiple areas by an electronic device according to one embodiment.
[0014] FIG. 6 is a drawing for explaining an example of a criterion for determining the size or quantity of a plurality of areas by an electronic device according to one embodiment.
[0015] FIG. 7 conceptually illustrates a process by which an electronic device generates a post-processed image according to one embodiment.
[0016] FIG. 8 conceptually illustrates a path along which a virtual camera moves within a virtual space according to one embodiment.
[0017] FIG. 9 illustrates at least a portion of a process by which an electronic device, according to one embodiment, obtains a post-processed image based on a virtual space in which a foreground image and a background image are placed.
[0018] FIG. 10 conceptually illustrates an operation of an electronic device according to one embodiment to stretch a background image.
[0019] FIG. 11 illustrates an example of a process for an electronic device to add pixel values to a background image according to one embodiment.
[0020] FIG. 12 is a flowchart illustrating a process by which an electronic device acquires a post-processed image according to one embodiment.
[0021] FIG. 13 illustrates an example of a movement path determined by an electronic device according to one embodiment.
[0022] FIG. 14 conceptually illustrates a method for an electronic device to generate a post-processed image according to one embodiment.
[0023] FIG. 1 is a block diagram of an electronic device (101) within a network environment (100) according to various embodiments. Referring to FIG. 1, in the network environment (100), the electronic device (101) may communicate with the electronic device (102) via a first network (198) (e.g., a short-range wireless communication network), or may communicate with at least one of the electronic device (104) or the server (108) via a second network (199) (e.g., a long-range wireless communication network). In one embodiment, the electronic device (101) may communicate with the electronic device (104) via the server (108). According to one embodiment, the electronic device (101) may include a processor (120), a memory (130), an input module (150), an audio output module (155), a display module (160), an audio module (170), a sensor module (176), an interface (177), a connection terminal (178), a haptic module (179), a camera module (180), a power management module (188), a battery (189), a communication module (190), a subscriber identification module (196), or an antenna module (197). In some embodiments, the electronic device (101) may omit at least one of these components (e.g., the connection terminal (178)), or may have one or more other components added. In some embodiments, some of these components (e.g., the sensor module (176), the camera module (180), or the antenna module (197)) may be integrated into one component (e.g., the display module (160)).
[0024] The processor (120) may, for example, execute software (e.g., a program (140)) to control at least one other component (e.g., a hardware or software component) of the electronic device (101) connected to the processor (120) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (120) may store commands or data received from other components (e.g., a sensor module (176) or a communication module (190)) in a volatile memory (132), process the commands or data stored in the volatile memory (132), and store result data in a non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., a central processing unit or an application processor) or an auxiliary processor (123) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (121). For example, when the electronic device (101) includes the main processor (121) and the auxiliary processor (123), the auxiliary processor (123) may be configured to use less power than the main processor (121) or to be specialized for a given function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as a part thereof.
[0025] The auxiliary processor (123) may control at least a portion of functions or states associated with at least one component (e.g., a display module (160), a sensor module (176), or a communication module (190)) of the electronic device (101), for example, on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (123) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (180) or a communication module (190)). In one embodiment, the auxiliary processor (123) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or can be performed through a separate server (e.g., server (108)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.
[0026] The memory (130) can store various data used by at least one component (e.g., processor (120) or sensor module (176)) of the electronic device (101). The data can include, for example, software (e.g., program (140)) and input data or output data for commands related thereto. The memory (130) can include volatile memory (132) or non-volatile memory (134).
[0027] The program (140) may be stored as software in the memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).
[0028] The input module (150) can receive commands or data to be used in a component of the electronic device (101) (e.g., a processor (120)) from an external source (e.g., a user) of the electronic device (101). The input module (150) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0029] The audio output module (155) can output audio signals to the outside of the electronic device (101). The audio output module (155) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.
[0030] The display module (160) can visually provide information to an external party (e.g., a user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling the device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.
[0031] The audio module (170) can convert sound into an electrical signal, or vice versa, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150), output sound through the sound output module (155), or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (101).
[0032] The sensor module (176) can detect the operating status (e.g., power or temperature) of the electronic device (101) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (176) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0033] The interface (177) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (101) to an external electronic device (e.g., the electronic device (102)). In one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0034] The connection terminal (178) may include a connector through which the electronic device (101) may be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0035] The haptic module (179) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. According to one embodiment, the haptic module (179) can include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
[0036] The camera module (180) can capture still images and videos. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0037] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
[0038] A battery (189) may power at least one component of the electronic device (101). In one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0039] The communication module (190) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may operate independently from the processor (120) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (194) (e.g., a local area network (LAN) communication module, or a power line communication module). Among these communication modules, the corresponding communication module can communicate with an external electronic device (104) via a first network (198) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (199) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules can be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can verify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) by using subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (196).
[0040] The wireless communication module (192) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). The NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and connection of multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (192) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (192) can support various technologies for securing performance in a high-frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), an external electronic device (e.g., the electronic device (104)), or a network system (e.g., the second network (199)). According to one embodiment, the wireless communication module (192) can support a peak data rate (e.g., 20 Gbps or more) for eMBB realization, a loss coverage (e.g., 164 dB or less) for mMTC realization, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC realization.
[0041] The antenna module (197) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (197) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (198) or the second network (199), may be selected from the plurality of antennas, for example, by the communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device via the at least one selected antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (197).
[0042] According to various embodiments, the antenna module (197) may form a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high-frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high-frequency band.
[0043] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).
[0044] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) via a server (108) connected to a second network (199). Each of the external electronic devices (102 or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations executed in the electronic device (101) may be executed in one or more of the external electronic devices (102, 104, or 108). For example, when the electronic device (101) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (101) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (101) may provide an ultra-low latency service by using distributed computing or mobile edge computing, for example. In another embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server utilizing machine learning and / or a neural network. According to one embodiment, the external electronic device (104) or the server (108) may be included in the second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0045] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.
[0046] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.
[0047] The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0048] Various embodiments of the present document may be implemented as software (e.g., a program (140)) including one or more instructions stored in a storage medium (e.g., an internal memory (136) or an external memory (138)) readable by a machine (e.g., an electronic device (101)). For example, a processor (e.g., a processor (120)) of the machine (e.g., an electronic device (101)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.
[0049] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as a computer program product. The computer program product may be traded between sellers and buyers as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or may be provided through an application store (e.g., Play Store). TM ) or directly between two user devices (e.g., smart phones), online distribution (e.g., downloading or uploading). In the case of online distribution, at least a portion of the computer program product may be at least temporarily stored or temporarily created in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.
[0050] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and placed in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In such a case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. According to various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
[0051] FIG. 2 is a block diagram (200) illustrating a camera module (180) according to various embodiments. Referring to FIG. 2, the camera module (180) may include a lens assembly (210), a flash (220), an image sensor (230), an image stabilizer (240), a memory (250) (e.g., a buffer memory), or an image signal processor (260). The lens assembly (210) may collect light emitted from a subject that is a target of image capturing. The lens assembly (210) may include one or more lenses. According to one embodiment, the camera module (180) may include a plurality of lens assemblies (210). In this case, the camera module (180) may form, for example, a dual camera, a 360-degree camera, or a spherical camera. Some of the plurality of lens assemblies (210) may have the same lens properties (e.g., angle of view, focal length, autofocus, f-number, or optical zoom), or at least one lens assembly may have one or more lens properties that are different from the lens properties of the other lens assemblies. A lens assembly (210) may include, for example, a wide-angle lens or a telephoto lens.
[0052] The flash (220) can emit light used to enhance light emitted or reflected from a subject. According to one embodiment, the flash (220) can include one or more light-emitting diodes (e.g., red-green-blue (RGB) LED, white LED, infrared LED, or ultraviolet LED), or a xenon lamp. The image sensor (230) can acquire an image corresponding to the subject by converting light emitted or reflected from the subject and transmitted through the lens assembly (210) into an electrical signal. According to one embodiment, the image sensor (230) can include one image sensor selected from among image sensors having different properties, such as an RGB sensor, a black and white (BW) sensor, an IR sensor, or a UV sensor, a plurality of image sensors having the same property, or a plurality of image sensors having different properties. Each image sensor included in the image sensor (230) can be implemented using, for example, a CCD (charged coupled device) sensor or a CMOS (complementary metal oxide semiconductor) sensor.
[0053] The image stabilizer (240) can move at least one lens or image sensor (230) included in the lens assembly (210) in a specific direction or control the operating characteristics of the image sensor (230) (e.g., adjusting the read-out timing, etc.) in response to the movement of the camera module (180) or the electronic device (101) including the same. This allows compensating for at least some of the negative effects of the movement on the captured image. In one embodiment, the image stabilizer (240) can detect such movement of the camera module (180) or the electronic device (101) using a gyro sensor (not shown) or an acceleration sensor (not shown) disposed inside or outside the camera module (180). In one embodiment, the image stabilizer (240) can be implemented as, for example, an optical image stabilizer. The memory (250) can temporarily store at least a portion of the image acquired through the image sensor (230) for the next image processing task. For example, when image acquisition is delayed due to the shutter, or when multiple images are acquired at high speed, the acquired original image (e.g., a Bayer-patterned image or a high-resolution image) is stored in the memory (250), and a corresponding copy image (e.g., a low-resolution image) can be previewed through the display module (160). Thereafter, when a specified condition is satisfied (e.g., a user input or a system command), at least a portion of the original image stored in the memory (250) can be acquired and processed, for example, by the image signal processor (260). According to one embodiment, the memory (250) can be configured as at least a portion of the memory (130) or as a separate memory that operates independently therefrom.
[0054] The image signal processor (260) can perform one or more image processing operations on an image acquired through an image sensor (230) or an image stored in a memory (250). The one or more image processing operations may include, for example, depth map generation, 3D modeling, panorama generation, feature extraction, image synthesis, or image compensation (e.g., noise reduction, resolution adjustment, brightness adjustment, blurring, sharpening, or softening). Additionally or alternatively, the image signal processor (260) may perform control (e.g., exposure time control, read-out timing control, etc.) for at least one of the components included in the camera module (180) (e.g., image sensor (230)). An image processed by the image signal processor (260) may be stored back in the memory (250) for further processing or provided to an external component of the camera module (180) (e.g., memory (130), display module (160), electronic device (102), electronic device (104), or server (108)). According to one embodiment, the image signal processor (260) may include at least one of the processors (120). It may be configured as a separate processor that is configured as a part of the processor (120) or operates independently of the processor (120). If the image signal processor (260) is configured as a separate processor from the processor (120), at least one image processed by the image signal processor (260) may be displayed through the display module (160) as is or after undergoing additional image processing by the processor (120).
[0055] According to one embodiment, the electronic device (101) may include a plurality of camera modules (180), each having different properties or functions. In this case, for example, at least one of the plurality of camera modules (180) may be a wide-angle camera, and at least another may be a telephoto camera. Similarly, at least one of the plurality of camera modules (180) may be a front camera, and at least another may be a rear camera.
[0056] FIG. 3 is a block diagram illustrating an electronic device (101) according to one embodiment.
[0057] An electronic device (101) according to one embodiment may include at least one processor (120) and a memory (130). The memory (130) may store executable instructions. The at least one processor (120) may execute instructions stored in the memory (130) to perform operations or control components of the electronic device (101) to operate. The electronic device (101) according to one embodiment may further include components other than the components illustrated in FIG. 3. For example, the electronic device (101) may further include at least one of a display (e.g., a display module (160) of FIG. 1) that displays a screen under the control of at least one processor (120), a camera (e.g., a camera module (180) of FIG. 1 or 2) that captures an image to obtain image data, or a communication module (e.g., a communication module (190) of FIG. 1) that communicates with an external device.
[0058] In one embodiment, the memory (130) may store image data including information about an image. For example, the image data may include data acquired by capturing an image with a camera (e.g., the camera module (180) of FIG. 1 or 2) or data received from an external device. At least one processor (120) may acquire a depth map for the image from the image data. The depth map may refer to a set of depth values for each pixel constituting the image. For example, the depth map may include an image that represents the relative distance values for each pixel existing in the image in grayscale format. The method for acquiring the depth map may be implemented in various ways. For example, the at least one processor (120) may calculate each depth value through an image processing method or may acquire the depth map through a deep learning technique.
[0059] In the present disclosure, "depth" in an image may refer to three-dimensional spatial information about a subject captured within a two-dimensional image. For example, depth may refer to a value corresponding to the distance between an electronic device capturing an image and the subject, but the specific value may be defined in various ways.
[0060] In one embodiment, at least one processor (120) may identify a foreground region and a background region within an image based on a depth map. The foreground region may be a region within the image where a main subject (e.g., a person) is captured. For example, the at least one processor (120) may identify a region having a depth value greater than a depth value of a region where an object is captured as a background region. Methods for identifying the foreground region and the background region may be implemented in various ways. The operation of distinguishing the foreground region and the background region may be referred to as segmentation.
[0061] At least one processor (120) may place a foreground image corresponding to a foreground area and a background image corresponding to a background area within a virtual space. At least one processor (120) may place the background image within the virtual space based on a depth value. For example, at least one processor (120) may place a point or area of the background image corresponding to a point or area with a small depth value at a point corresponding to a small depth from a designated point (e.g., a starting point from which a virtual camera starts shooting). At least one processor (120) may place a point or area of the background image corresponding to a point or area with a large depth value at a point corresponding to a large depth from a designated point (e.g., a starting point from which a virtual camera starts shooting). The background image may be placed in a non-planar form within the virtual space.
[0062] At least one processor (120) can obtain a post-processed image corresponding to the result of capturing a foreground image and a background image placed in a virtual space while a virtual camera moves along a trajectory in the virtual space. At least one processor (120) can store the post-processed image in the memory (130). In one embodiment, at least one processor (120) can be configured to perform an operation of an electronic device (e.g., the electronic device (101) of FIG. 1 or 3). In this document, it can be understood that the operation of the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) is performed through the control of at least one processor (120). A position in the virtual space (e.g., the position of the virtual camera, the position of the foreground image, the position of the background image) can be expressed as a coordinate value.
[0063] FIG. 4 is a flowchart (400) illustrating a process by which an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) acquires a post-processed image according to one embodiment.
[0064] According to one embodiment, in operation 410, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may obtain a depth map based on image data including information about an image. The method for obtaining the depth map may be implemented in various ways. For example, the electronic device (101) may obtain a depth map for a two-dimensional image using a convolutional neural network (CNN). However, the method for obtaining the depth map is not limited thereto.
[0065] According to one embodiment, in operation 420, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can identify a foreground area and a background area within an image based on the acquired depth map. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a foreground image corresponding to an image within the foreground area. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a background image corresponding to an image within the background area.
[0066] According to one embodiment, in operation 431, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may divide the depth map into a plurality of regions. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may set grid cells that divide the depth map into a plurality of rectangular regions. In one embodiment, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may divide the entire region of the depth map into regions of uniform size. In another embodiment, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may divide regions of different sizes within the depth map. For example, regions with a large difference in depth value from surrounding regions may be divided into regions of large size, and regions with a small difference in depth value may be divided into regions of small size. However, the present invention is not limited thereto.
[0067] According to one embodiment, in operation 432, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a depth value for each of a plurality of points of interest associated with a plurality of regions. For example, if a grid cell is set that divides the depth map into M x N rectangular regions (M and N are natural numbers), the plurality of points of interest may be vertices of the plurality of rectangular regions. The depth value for each of the plurality of points of interest may be a depth value corresponding to the position of the point of interest in the depth map. Alternatively, the depth value for each of the plurality of points of interest may be a value (e.g., an average value) calculated from depth values included in surrounding regions that include the position of the point of interest in the depth map. For example, among the depth values corresponding to the vertices of grid cells that are points of interest, a depth value corresponding to a vertex of a grid cell located in an area excluded from a background image (e.g., a foreground area) may be a value obtained by interpolating depth values of its surrounding pixels. However, the present invention is not limited thereto.
[0068] According to one embodiment, in operation 433, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may place a background image in the virtual space based on depth values for points of interest. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may warp the background image based on depth values for points of interest. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may place the background image in the virtual space so that points with small depth values protrude and points with large depth values are recessed.
[0069] According to one embodiment, in operation 433, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may blur the background image based on depth values for points of interest. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may apply a blur effect with a high intensity to an area around a point of interest having a large depth value, and may apply a blur effect with a low intensity to an area around a point of interest having a small depth value.
[0070] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may enlarge a background image in an outer direction of the image. In order to achieve a three-dimensional zoom effect by moving the virtual camera while taking a picture, the movement distance of the virtual camera may need to be secured. To secure the movement distance of the virtual camera, if the background image is not large enough, the background image may be enlarged in an outer direction of the image. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may enlarge the background image by a ratio of about 10 to 15%.
[0071] According to one embodiment, in operation 440, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may place a foreground image within a virtual space. The foreground image may be placed so that the foreground image is closer to the virtual camera than the background image within the virtual space. In one embodiment, operation 440 may be omitted if the foreground image is not identifiable due to the absence of a foreground object within the image. In FIG. 4, operations 431 to 433 and operation 440 are illustrated as being performed in parallel, but the order of operations illustrated in FIG. 4 is not limited. For example, operation 440 may be performed before operation 431 or after operation 433.
[0072] According to one embodiment, in operation 450, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may capture a post-processed image by capturing a foreground image and / or a background image positioned within a virtual space through a virtual camera. The electronic device may capture the post-processed image while moving the virtual camera along a movement path. The movement path may be a path along which the virtual camera is moved so that the image appears three-dimensionally zoomed in. For example, the movement path may be a predetermined path within the virtual space. Since the foreground image and the background image are separately positioned within the virtual space, a hole area (e.g., an area between the foreground image and the background image) where the foreground image or the background image is not captured may be captured depending on the position of the virtual camera. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path that prevents the hole area from appearing or reduces the hole area. Alternatively, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may modify the foreground image or the background image to prevent the hole area from appearing or to reduce the hole area. In one embodiment, the operation of modifying the image (foreground image or background image) and the operation of determining the movement path may be implemented in various ways. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may perform an image processing operation to remove the hole area that occurs along the movement path after determining the movement path of the virtual camera. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may also determine the movement path of the virtual camera based on the foreground image and the background image on which image processing for removing the hole area has been performed.For example, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may determine a movement path of a virtual camera after performing some image processing operations, and may perform the remaining image processing operations based on the determined movement path.
[0073] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may limit the performance of an operation of acquiring a post-processed image according to the process illustrated in the flowchart (400). For example, if the separation of the foreground area and the background area from the image data is not clear in operation 420, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may display a notification message indicating that the post-processed image cannot be generated through a display (e.g., the display module (160) of FIG. 1). For example, if the ratio of the background area identified in operation 420 within the image is less than a threshold, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may display a notification message indicating that the post-processed image cannot be generated through a display (e.g., the display module (160) of FIG. 1). For example, if a hole image appearing in the post-processed image generated in operation 450 is not removed (e.g., if there are multiple objects positioned at distant locations within the image), the electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) may display a notification message indicating that the post-processed image cannot be generated through a display (e.g., the display module (160) of FIG. 1).
[0074] FIG. 5 is a flowchart (500) illustrating a process by which an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) sets multiple regions according to one embodiment. For example, the operations illustrated in the flowchart (500) of FIG. 5 may be performed in operation 431 of FIG. 4. FIG. 6 is a diagram illustrating an example of a criterion for determining the size or quantity of multiple regions by an electronic device according to one embodiment.
[0075] In one embodiment, in operation 510, a boundary line separating two areas may be detected. For example, referring to FIG. 6, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may detect a boundary line (620) between an area (611) in which a house is photographed and an area (612) in which the sky is photographed within an image (600). For example, the electronic device (e.g., electronic device (101) of FIG. 1 or 3) may detect the boundary line (620) based on a high frequency component of the image.
[0076] According to one embodiment, in operation 520, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine the size of each of the plurality of regions based on the difference in depth values for regions on both sides of the boundary line. Referring to FIG. 6, since the difference in depth values between the region (611) where the house is photographed and the region (612) where the sky is photographed is large, the image may be distorted when warping the image by dividing it into regions of small size (a large number of regions). In one embodiment, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may divide the image into regions having a large area (e.g., a small grid number, 2 x 2) when the depth difference between both sides of the boundary line is large, and may divide the image into regions having a small area (e.g., a large grid number, 50 x 50) when the depth difference is small. According to one embodiment, the size of each of the plurality of regions may be a predetermined value.
[0077] FIG. 7 conceptually illustrates a process by which an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) generates a post-processed image according to one embodiment.
[0078] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a depth map (710) from an image (700). The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a foreground image (721-1) and a background image (722) from the image (700) based on the depth map (710). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can identify a foreground area corresponding to the foreground image (721-1) and a background area corresponding to the background image (722) within the image (700) based on image processing or deep learning techniques.
[0079] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can divide a depth map (710) into a plurality of regions. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine a depth value for each of a plurality of points of interest associated with the plurality of regions. For example, referring to FIG. 7, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can set grid cells that divide the depth map (710) into regions (731). The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine the vertices of each region of the grid cell as points of interest (733).
[0080] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can place a foreground image (721-1) and a background image (722) within a virtual space (750). The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a background image (742-1) that three-dimensionally constructs the background image (722) based on depth values for each point of interest. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a three-dimensionally constructed background image (742-1) by warping the background image (722) only with depth values for points of interest, without three-dimensionally constructing the background image (722) based on all depth values included in a depth map. An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can place a foreground image (721-1) and a three-dimensionally configured background image (742-1) within a virtual space (750) based on a depth value. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can place the foreground image (721-1) and the background image (742-1) farther apart as the difference between the depth value for the foreground image (721-1) and the depth value for the background image (742-1) becomes larger.
[0081] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may acquire images of a foreground image (721-1) and a background image (742-2) placed in a virtual space (750) through a virtual camera (751). The virtual camera (751) may be an operating system, an application module, or other program that generates images of a virtual subject within a three-dimensional virtual space. The program that configures the virtual camera (751) may be stored in a memory (e.g., the memory (130) of FIG. 1 or 3) of the electronic device (e.g., the electronic device (101) of FIG. 1 or 3).
[0082] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can acquire images by capturing a foreground image (721-1) and a background image (742-2) while moving a virtual camera (751) within a virtual space (750). The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine a movement path for capturing the foreground image (721-1) and the background image (742-2) while moving the virtual camera (751).
[0083] FIG. 8 conceptually illustrates a path along which a virtual camera (e.g., a virtual camera (751) of FIG. 7) moves within a virtual space (e.g., a virtual space (750) of FIG. 7) according to one embodiment.
[0084] In one embodiment, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may determine a start point and an end point of a movement path within a virtual space (e.g., virtual space (750) of FIG. 7) to determine a movement path along which a virtual camera (e.g., virtual camera (751) of FIG. 7) moves. For example, the start point of the movement path may be a point (830) located in a direction perpendicular to a plane (810) on which a background area is placed from a center point (813) of a background image (e.g., background image (741-2) of FIG. 7).
[0085] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path that causes a virtual camera (e.g., the virtual camera (751) of FIG. 7) to move to a point where the foreground image does not move outside the frame of an image captured by the virtual camera (e.g., the virtual camera (751) of FIG. 7). When the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) determines a point (841) that has moved from a point (830) toward a center point (813) of a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7) as an end point, an area (811) where the foreground image is removed may appear in the image captured by the virtual camera (e.g., the virtual camera (751) of FIG. 7). Accordingly, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine the point (842) moved toward the center point (821) of the foreground image (820) placed in the virtual space (e.g., the virtual space (750) of FIG. 7) as the end point.
[0086] In one embodiment, when determining a movement path for a zoom-in operation, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine an end point of the movement path within a range in which the foreground image (820) appears entirely or in a specified proportion or more within an image captured by a virtual camera (e.g., the virtual camera (751) of FIG. 7). Conversely, when determining a movement path for a zoom-out operation, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a start point of the movement path within a range in which the foreground image (820) appears entirely or in a specified proportion or more within an image captured by a virtual camera (e.g., the virtual camera (751) of FIG. 7).
[0087] However, the method for determining the start and end points of the movement path of a virtual camera (e.g., the virtual camera (751) of FIG. 7) is not limited thereto. For example, the start and end points may be determined as locations directly input by the user.
[0088] FIG. 9 is a flowchart (900) illustrating at least a portion of a process for obtaining a post-processed image based on a virtual space (e.g., a virtual space (750) of FIG. 7) in which a foreground image (e.g., a foreground image (721-1, 721-2) of FIG. 7) and a background image (e.g., a background image (722, 742-1, 742-2) of FIG. 7) of an electronic device (e.g., an electronic device (101) of FIG. 1 or 3)) are arranged, according to one embodiment. For example, the operations illustrated in FIG. 9 may be performed in operation 450 of FIG. 4.
[0089] According to one embodiment, in operation 910, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path of a virtual camera (e.g., the virtual camera (751) of FIG. 7). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path of the virtual camera (e.g., the virtual camera (751) of FIG. 7) such that a hole area, which is an area where a foreground image (e.g., the foreground images (721-1, 721-2) of FIG. 7) and a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7) do not appear in an image captured by the virtual camera (e.g., the virtual camera (751) of FIG. 7), does not appear or its area is reduced (or minimized). However, the method for determining the movement path is not limited thereto. For example, an electronic device (e.g., an electronic device (101) of FIG. 1 or 3) can determine a path directly input by a user as a movement path of a virtual camera (e.g., a virtual camera (751) of FIG. 7).
[0090] According to one embodiment, at operation 920, the electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) may modify at least one of a foreground image (e.g., the foreground image (721-1) of FIG. 7) or a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7). In operation 920, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may modify at least one of a foreground image (e.g., the foreground image (721-1) of FIG. 7) or a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7) to reduce a hole area appearing in an image captured by a virtual camera (e.g., the virtual camera (751) of FIG. 7). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may further perform at least one of a background stretching operation, an inpainting operation, or an object enlargement operation. The background stretching operation may mean an operation of reducing a hole area by stretching a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7) toward a foreground area. The inpainting operation may mean an operation of reducing a hole area by stretching an image (e.g., the background images (722, 742-1, 742-2) of FIG. 7) toward a foreground area. An operation of reducing a hole area by filling a pixel value in an area where a foreground area has been removed in an image (700) may refer to an operation of enlarging an object image (e.g., foreground images (721-1, 721-2) of FIG. 7).
[0091] FIG. 10 conceptually illustrates a background stretching operation in which an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment stretches a background image.
[0092] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may capture an image of a background image (1000) and a foreground image (1010) through a virtual camera (e.g., the virtual camera (751) of FIG. 7), and an empty hole area (1030) may appear in the captured image. To reduce the hole area appearing in the captured image, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may stretch the background image (1000) in a direction (1040) corresponding to the foreground area.
[0093] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a point to move pixels of a background image to expand the background image (1000). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may set a cost function for points of interest of grid cells set in a depth map, and determine a movement point that minimizes a value of the cost function. Alternatively, for example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may linearly move pixels included in the background image (1000) toward a foreground area. The cost function may include a mathematical formula used to calculate a position to which points of interest will move. The cost function may be configured as a mathematical formula to achieve at least one of the following objectives: maintaining a distance between points of interest or maintaining a linear shape of a plurality of areas (e.g., grid cells). The cost function may include a mathematical formula for generating interest points that reduce the distance between interest points within the hole area and increase the spacing between other interest points. An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may use the cost function to determine a movement position to reduce the size of the hole area while reducing distortion of the background image. For example, the cost function may be configured as in Mathematical Formula 1 below.
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100] In one embodiment, the electronic device (101) minimizes the cost function according to Equation 1 x i,j , y i,j Based on the coordinates (x i,j , y i,j ) can be used to determine the location where the point of interest will move. In the above mathematical expression 1, l v,(i,j) and l h,(i,j) are the target segment lengths in the vertical and horizontal directions, and L is a constant. l v,(i,j) and l h,(i,j) can be configured to be enlarged in the background area and reduced in the foreground area. However, mathematical expression 1 is an example of a cost function and is not limited thereto.
[0101] FIG. 11 illustrates an example of an inpainting operation in which an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment adds pixel values to a background image (e.g., the background images (722, 742-1, 742-2) of FIG. 7).
[0102] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain an image (1110) of a scene including an object (1111) captured. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can obtain a background image (1120) composed of an empty area (1121) where the object (1111) is captured from the image (1110).
[0103] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine an area (1131) to which a pixel value should be added for a background image (1130). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine an area (1131) to which a pixel value should be added by accumulating areas captured in an image acquired through a virtual camera (e.g., the virtual camera (751) of FIG. 7) along a movement path determined in operation 910 of FIG. 9 among empty areas (1121).
[0104] In one embodiment, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may obtain a post-processed image (1140) in which pixel values are added based on surrounding pixel values to an area where pixel values are to be added.
[0105] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may enlarge a foreground image (e.g., the foreground images (721-1, 721-2) of FIG. 7) to reduce a hole area appearing in an image captured by a virtual camera (e.g., the virtual camera (751) of FIG. 7). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may enlarge the foreground image (e.g., the foreground images (721-1, 721-2) of FIG. 7) by a ratio of about 10 to 15%.
[0106] FIG. 12 is a flowchart (1200) illustrating a process by which an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) acquires a post-processed image according to one embodiment.
[0107] According to one embodiment, in operation 1210, an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) may obtain a depth map based on image data including information about an image. As described above with respect to operation 410 of FIG. 4, a method of obtaining a depth map may be implemented in various ways.
[0108] According to one embodiment, in operation 1220, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may identify a foreground area and a background area within an image based on the acquired depth map. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may acquire a foreground image corresponding to the foreground area and a background image corresponding to the background area.
[0109] According to one embodiment, in operation 1230, an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) may place a foreground image and a background image within a virtual space. In operation 1210, the background image placed within the virtual space may be three-dimensionally warped based on a depth map.
[0110] According to one embodiment, in operation 1240, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path of the virtual camera based on the foreground image and the background image arranged in the virtual space. In one embodiment, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a movement path that minimizes an area in which a hole area appears in an image captured by the virtual camera. For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may determine a start depth, which is a depth of a starting point at which the virtual camera (e.g., the virtual camera (751) of FIG. 7) moves, and an end depth, which is a depth of an ending point. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may set a transit point at which a hole area appearing in an image acquired through the virtual camera (e.g., the virtual camera (751) of FIG. 7) is minimized among points having a reference depth between the start depth and the end depth. An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can set one or more waypoints for one or more reference depths. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine a movement path that passes through the one or more waypoints.
[0111] According to one embodiment, in operation 1250, an electronic device (e.g., electronic device (101) of FIG. 1 or FIG. 3) may acquire a post-processed image in which a virtual camera (e.g., virtual camera (751) of FIG. 7) captures at least a portion of a foreground image and a background image while moving along a determined movement path.
[0112] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may perform an image processing operation to minimize a hole area appearing in an area captured by a virtual camera (e.g., the virtual camera (751) of FIG. 7). For example, the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may perform at least one of a background stretching operation, an inpainting operation, or an object magnification operation on a foreground image or a background image.
[0113] FIG. 13 illustrates an example of a movement path determined by an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) according to one embodiment.
[0114] In one embodiment, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may determine a movement path of a virtual camera (e.g., virtual camera (751) of FIG. 7) within a virtual space as a straight path (1350-1). In one embodiment, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) may also determine a movement path of a virtual camera (e.g., virtual camera (751) of FIG. 7) as a curved path (1350-2).
[0115] In one embodiment, an electronic device (e.g., the electronic device (101) of FIG. 1 or 3) can determine a start depth (1310-1, 1310-2) for a start point of a movement path of a virtual camera (e.g., the virtual camera (751) of FIG. 7) and a final depth (1320-1, 1320-2) for an end point. When the electronic device (e.g., the electronic device (101) of FIG. 1 or 3) captures a foreground image and a background image at points having a reference depth (1330-1, 1330-2) between the start depth (1310-1, 1310-2) and the final depth (1320-1, 1320-2), the electronic device can determine an area where a hole region appears. An electronic device (e.g., an electronic device (101) of FIG. 1 or 3) can determine a transit point (1340-1, 1340-2) at which an area where a hole region appears is minimized. In one embodiment, an electronic device (e.g., an electronic device (101) of FIG. 1 or 3) can determine a movement path (1350-1, 1350-2) passing through the transit points (1340-1, 1340-2).
[0116] However, the method for determining the movement path described above is merely an example, and the method for determining the movement path can be implemented in various ways. For example, an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) may determine a starting point and an ending point, and determine a line connecting the starting point and the ending point as the movement path.
[0117] FIG. 14 conceptually illustrates a method by which an electronic device (e.g., the electronic device (101) of FIG. 1 or FIG. 3) generates a post-processed image according to one embodiment.
[0118] In one embodiment, an electronic device (e.g., electronic device (101) of FIG. 1 or 3) can perform a depth extraction operation (1420) on an image (1410). The electronic device (e.g., electronic device (101) of FIG. 1 or 3) can obtain a depth map through the depth extraction operation (1420).
[0119] An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment may perform segmentation (1430) of a foreground area and a background area in which a main subject is captured within an image (1410) based on a depth map. An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment may perform operation 1440 of setting grid cells for the depth map and determining depth values for the grid cells.
[0120] An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment may perform operation 1450 of placing separated foreground images and background images within a three-dimensional virtual space based on depth values for grid cells. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may perform operation 1460 of determining a movement path of a virtual camera for capturing the foreground images and background images placed within the three-dimensional virtual space.
[0121] An electronic device (e.g., the electronic device (101) of FIG. 1 or 3) according to one embodiment may perform operation 1470 of modifying an image (e.g., a foreground image or a background image) so that a hole area is reduced in an image captured through a virtual camera. The electronic device (e.g., the electronic device (101) of FIG. 1 or 3) may perform operation 1480 of generating an image frame including a scene in which the modified image (e.g., the foreground image or the background image) is captured while moving along a movement path.
[0122] The flowcharts disclosed in this document are intended to illustrate a combination of operations performed by an electronic device (e.g., the electronic device (101) of FIG. 1 or 3), and are not intended to limit the order in which each operation is performed. For example, operation 910 of FIG. 9 may be performed as an operation of determining a movement path that minimizes a hole area based on at least one of the modified foreground image or the modified background image after performing operation 920 of modifying at least one of the foreground image or the background image. Although the image modifying operations have been described individually, two or more operations may be performed in combination. For example, the inpainting operation of FIG. 11 may be performed on a modified image obtained as a result of performing the background stretching operation illustrated in FIG. 10.
[0123] An electronic device and an operating method thereof according to one embodiment relate to a technical problem in which a sense of space that occurs when approaching an object in a three-dimensional space is not expressed even when a zoom operation is performed on a two-dimensional image.
[0124] An electronic device and an operating method thereof according to one embodiment relate to a technical task for reducing the amount of computation occurring in the process of generating a post-processed image having a sense of space from a two-dimensional image.
[0125] An electronic device and an operating method thereof according to one embodiment relate to a technical problem of removing or reducing a hole area that occurs in a process of generating a post-processed image having a sense of space from a two-dimensional image.
[0126] The technical problems to be achieved in this document are not limited to the technical problems mentioned above, and other technical problems not mentioned can be clearly understood by a person having ordinary skill in the technical field to which the present invention belongs from the description of this disclosure.
[0127] An electronic device according to one embodiment may include a memory storing instructions and at least one processor configured to execute the instructions. The at least one processor may be configured to obtain a depth map from image data including information about an image. The at least one processor may be configured to identify a foreground area and a background area within the image based on the depth map. The at least one processor may be configured to determine a depth value for each of a plurality of points of interest for the depth map. The at least one processor may be configured to place a background image corresponding to the background area within a virtual space based on the determined depth value. The at least one processor may be configured to place a foreground image corresponding to the foreground area within the virtual space. The at least one processor may be configured to obtain a post-processed image obtained by capturing the foreground image and the background image disposed within the virtual space while a virtual camera moves along a movement path within the virtual space.
[0128] In one embodiment, the plurality of points of interest may be associated with a plurality of regions that define the depth map. The at least one processor may be configured to detect a boundary between two regions from the image and determine a size of each of the plurality of regions or a quantity of the plurality of regions based on a difference in depth values for the two regions.
[0129] According to one embodiment, the at least one processor may be configured to determine the size of each of the plurality of regions to be a larger size or to determine the quantity of the plurality of regions to be a smaller value as the difference in the depth values increases.
[0130] In one embodiment, the plurality of regions may have a rectangular shape. The depth values for the plurality of points of interest may include an average value of the depth values for surrounding regions including the vertices of the plurality of regions.
[0131] According to one embodiment, the at least one processor may be configured to determine the movement path based on whether a hole area appears in the post-processed image excluding an area in which the foreground image appears and an area in which the background image appears, or based on an area of the hole area.
[0132] According to one embodiment, the at least one processor may be configured to obtain a first modified background image in which at least a portion of the background area is stretched toward the foreground area.
[0133] In one embodiment, the at least one processor may be configured to move at least a portion of the background region based on a point that minimizes a value of a cost function for the plurality of points of interest.
[0134] According to one embodiment, the at least one processor may be configured to obtain a second modified background image by adding pixel values to the first modified background image based on a hole area appearing in an image in which the first modified background image and the foreground image are captured and arranged in the virtual space along the movement path, and to capture the foreground image and the second modified background image while moving the virtual camera to obtain the post-processed image.
[0135] According to one embodiment, the at least one processor may be configured to enlarge the size of the foreground image and capture the enlarged foreground image and the background image while moving the virtual camera to obtain the post-processed image.
[0136] In one embodiment, the at least one processor may be configured to enlarge the size of the background image and obtain the post-processed image based on a result of enlarging the background image.
[0137] In one embodiment, the at least one processor may be configured to determine whether to generate the post-processed image based on the placement of the foreground area within the image.
[0138] In one embodiment, the at least one processor may be configured to determine an intensity of a bokeh effect for each region of the background image based on depth values for the plurality of points of interest, and to apply the bokeh effect to the background image based on the determined intensity.
[0139] A method of operating an electronic device according to one embodiment may include an operation of obtaining a depth map from image data including information about an image. The method may include an operation of identifying a foreground area and a background area within the image based on the depth map. The method may include an operation of determining a depth value for each of a plurality of points of interest for the depth map. The method may include an operation of placing a background image corresponding to the background area within a virtual space based on the determined depth value. The method may include an operation of placing a foreground image corresponding to the foreground area within the virtual space. The method may include an operation of obtaining a post-processed image obtained by capturing the foreground image and the background image placed within the virtual space while a virtual camera moves along a movement path within the virtual space.
[0140] In one embodiment, the method may further include detecting a boundary between two regions from the image, determining sizes of a plurality of regions that separate the image based on a difference in depth values for the two regions, and determining points of interest associated with the plurality of regions.
[0141] The method may include an operation of determining the size of each of the plurality of regions, wherein the larger the difference in the depth values, the smaller the size of each of the plurality of regions.
[0142] An electronic device according to one embodiment may include a memory for storing instructions and at least one processor configured to execute the instructions. The at least one processor may be configured to obtain a depth map from image data including information about an image. The at least one processor may be configured to identify a foreground area and a background area within the image based on the depth map. The at least one processor may be configured to place a background image corresponding to the background area and a foreground image corresponding to the foreground area within a virtual space based on the determined depth value. The at least one processor may be configured to determine the movement path based on whether a hole area excluding an area where the foreground image or the background image is captured appears within the post-processed image or an area of the hole area. The at least one processor may be configured to obtain a post-processed image in which the foreground image and the background image are captured while a virtual camera moves along a movement path within the virtual space.
[0143] In one embodiment, the at least one processor may be configured to determine a transit point, among points having a depth between a start depth and a final depth associated with the movement path within the virtual space, where a hole area excluding an area where the foreground image appears and an area where the background image appears in the post-processed image is minimized, and to determine the movement path so as to pass through the transit point.
[0144] In one embodiment, the at least one processor may be configured to determine the movement path based on a point at which the foreground image does not leave the post-processed image.
[0145] In one embodiment, the at least one processor may be configured to divide the depth map into a plurality of regions, determine a depth value for each of a plurality of points of interest associated with the plurality of regions, and place a background image corresponding to the background region and a foreground image corresponding to the foreground region within the virtual space based on the determined depth value.
[0146] In one embodiment, the at least one processor may be configured to determine the movement path so as to pass through a point that minimizes a value of a cost function for the plurality of points of interest.
[0147] In one embodiment, a computer-readable recording medium may have recorded thereon a computer program that causes the electronic device to perform the operation or method described above.
[0148] According to one embodiment, an electronic device configured to obtain a post-processed image expressing a three-dimensional sense of space from a two-dimensional image and a method of operating the same can be provided.
[0149] According to one embodiment, an electronic device and an operating method thereof configured to obtain a post-processed image having a sense of space from a two-dimensional image through an image processing process having a relatively small amount of computation may be provided.
[0150] According to one embodiment, an electronic device and a method of operating the same may be provided that are configured to obtain a post-processed image in which a hole area is removed or reduced and a sense of space is provided.
[0151] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure belongs from the description below.
[0152] The methods according to the embodiments described in the claims or specification of the present disclosure may be implemented in the form of hardware, software, or a combination of hardware and software.
[0153] When implemented in software, a computer-readable storage medium storing one or more programs (software modules) may be provided. The one or more programs stored in the computer-readable storage medium are configured for execution by one or more processors within an electronic device. The one or more programs include instructions that cause the electronic device to execute methods according to embodiments described in the claims or specification of the present disclosure.
[0154] In the present disclosure, the functions or operations performed by the electronic device may be performed by one or more processors executing one or more instructions stored in a memory. The functions or operations of the electronic device mentioned in the present disclosure may be performed by one processor executing one or more instructions, or may be performed by a combination of multiple processors executing one or more instructions. The processor mentioned in the present disclosure may be understood to include circuitry for performing calculations or controlling other components of the electronic device. For example, the one or more processors may include a central processing unit (CPU), a microprocessor unit (MPU), an application processor (AP), a communication processor (CP), a neural processing unit (NPU), a system on a chip (SoC), or an integrated circuit (IC) configured to execute one or more instructions. The one or more processors may be configured to perform the operations of the electronic device described above.
[0155] In the present disclosure, a program (software module, software) may be stored in a non-volatile memory including a random access memory (RAM), a flash memory, a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a magnetic disc storage device, a compact disc ROM (CD-ROM), digital versatile discs (DVDs) or other forms of optical storage devices, a magnetic cassette. Or, it may be stored in a memory formed by a combination of some or all of these. The memory may be formed by a single storage medium, or may be formed by a combination of a plurality of storage media. The one or more commands may be stored in a single storage medium, or may be distributed and stored in a plurality of storage media.
[0156] These programs (software modules, software) may be stored in a random access memory, a non-volatile memory including a flash memory, a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a magnetic disc storage device, a compact disc ROM (CD-ROM), a digital versatile disc (DVD) or other forms of optical storage, a magnetic cassette, or a memory formed by a combination of some or all of these. In addition, each configuration memory may be included in multiple numbers.
[0157] Additionally, the program may be stored on an attachable storage device that is accessible via a communication network such as the Internet, an intranet, a local area network (LAN), a wide LAN (WLAN), or a storage area network (SAN), or a combination thereof. Such a storage device may be connected to a device performing an embodiment of the present disclosure via an external port. Additionally, a separate storage device on the communication network may be connected to a device performing an embodiment of the present disclosure.
[0158] In the specific embodiments of the present disclosure described above, components included in the disclosure are expressed in the singular or plural form, depending on the specific embodiment presented. However, the singular or plural expressions are selected to suit the presented situation for convenience of explanation, and the present disclosure is not limited to singular or plural components. Components expressed in the plural form may be composed of singular elements, or components expressed in the singular form may be composed of plural elements.
[0159] Additionally, in the present disclosure, terms such as “part”, “module”, etc. may refer to a hardware component such as a processor or circuit, and / or a software component executed by a hardware component such as a processor.
[0160] A "component" or "module" may be implemented by a program stored in an addressable storage medium and executed by a processor. For example, a "component" or "module" may be implemented by components such as software components, object-oriented software components, class components, and task components, as well as processes, functions, attributes, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuitry, data, databases, data structures, tables, arrays, and variables.
[0161] The specific implementations described in this disclosure are merely exemplary and do not limit the scope of the present disclosure in any way. For the sake of brevity, descriptions of conventional electronic components, control systems, software, and other functional aspects of the systems may be omitted.
[0162] Additionally, in the present disclosure, “comprising at least one of a, b, or c” may mean “comprising only a, comprising only b, comprising only c, comprising both a and b, comprising both b and c, comprising both a and c, or comprising all of a, b, and c.”
[0163] While the detailed description of this disclosure has described specific embodiments, it should be understood that various modifications are possible without departing from the scope of this disclosure. Therefore, the scope of this disclosure should not be limited to the described embodiments, but should be defined not only by the scope of the claims described below, but also by equivalents thereof.
Claims
1. In electronic devices, Memory for storing instructions; and comprising at least one processor, The above instructions are executed by the at least one processor, causing the electronic device to: Obtain a depth map from image data containing information about the image, Identifying foreground and background regions within the image based on the depth map, Determining depth values of multiple interest points for the above depth map, Based on the determined depth values, a background image corresponding to the background area is placed in the virtual space, A foreground image corresponding to the foreground area is placed within the virtual space, An electronic device that obtains a post-processed image by capturing the foreground image and the background image placed within the virtual space while the virtual camera moves along a movement path within the virtual space.
2. In claim 1, The above multiple points of interest are associated with multiple regions that separate the depth map, At least one processor of the above, Detect the boundary between two regions from the above image, An electronic device configured to determine the size of each of the plurality of regions or the quantity of the plurality of regions based on the difference in depth values for the two regions.
3. In claim 2, At least one processor of the above, An electronic device configured to determine the size of each of the plurality of regions as a larger size or to determine the quantity of the plurality of regions as a smaller value as the difference in the depth values increases.
4. In claim 2, The above multiple areas have a rectangular shape, An electronic device, wherein the depth values for the plurality of points of interest include an average value of depth values for surrounding areas including vertices of the plurality of areas.
5. In claim 1, At least one processor of the above, An electronic device configured to determine the movement path based on whether a hole area appears in the post-processed image excluding an area in which the foreground image appears and an area in which the background image appears, or based on the area of the hole area.
6. In claim 1, At least one processor of the above, An electronic device configured to obtain a first modified background image in which at least a portion of the background area is stretched toward the foreground area.
7. In claim 6, At least one processor of the above, An electronic device configured to move at least a portion of the background area based on a point that minimizes a value of a cost function for the plurality of points of interest.
8. In claim 1, At least one processor of the above, Based on the hole area appearing in the image in which the first modified background image and the foreground image are captured and arranged in the virtual space along the movement path, a second modified background image is obtained by adding pixel values to the first modified background image, An electronic device configured to capture the foreground image and the second modified background image placed within the virtual space while moving the virtual camera to obtain the post-processed image.
9. In claim 1, At least one processor of the above, Enlarge the size of the foreground image above, An electronic device configured to capture the enlarged foreground image and the background image while moving the virtual camera to obtain the post-processed image.
10. In claim 1, At least one processor of the above, Enlarge the size of the above background image, An electronic device configured to obtain the post-processed image based on the result of enlarging the background image.
11. In claim 1, At least one processor of the above, An electronic device configured to determine whether to generate the post-processed image based on the arrangement of the foreground area within the image.
12. In claim 1, At least one processor of the above, Determine the intensity of the bokeh effect for each area of the background image based on the depth values for the plurality of points of interest, An electronic device configured to apply a bokeh effect to the background image based on the determined intensity.
13. In the method of operating an electronic device, An operation of obtaining a depth map from image data containing information about the image; An operation of identifying a foreground area and a background area within the image based on the depth map; An operation for determining depth values of a plurality of interest points for the above depth map; An operation of placing a background image corresponding to the background area within a virtual space based on the determined depth value; An action of placing a foreground image corresponding to the foreground area within the virtual space; A method comprising an action of obtaining a post-processed image by capturing the foreground image and the background image placed within the virtual space while the virtual camera moves along a movement path within the virtual space.
14. In claim 13, An operation of detecting a boundary between two regions from the above image; An operation of determining the sizes of a plurality of regions that distinguish the image based on the difference in depth values for the two regions; and A method further comprising the action of determining said points of interest associated with said plurality of regions.
15. In claim 14, A method wherein the operation of determining the size of each of the plurality of regions includes an operation of determining the size of each of the plurality of regions to a smaller size as the difference in the depth values increases.
Citation Information
Patent Citations
3D image generating device, 3D image generating method, and program
JP7170052B2
Method for Generating Depth Image
KR101681766B1
Method of holl-filling, recording medium and apparatus for performing the method
KR101781942B1
Method, apparatus and recording medium for generating mask and both-eye images for three-dimensional image
KR101994472B1
Method for converting 2 dimensional video image into stereoscopic video
KR1020120073466A
