KR20230083743A - Method for providing image and electronic device supporting the same - Google Patents

Method for providing image and electronic device supporting the same Download PDF

Info

Publication number
KR20230083743A
KR20230083743A KR1020210172029A KR20210172029A KR20230083743A KR 20230083743 A KR20230083743 A KR 20230083743A KR 1020210172029 A KR1020210172029 A KR 1020210172029A KR 20210172029 A KR20210172029 A KR 20210172029A KR 20230083743 A KR20230083743 A KR 20230083743A
Authority
KR
South Korea
Prior art keywords
image
group
face
feature
groups
Prior art date
Application number
KR1020210172029A
Other languages
Korean (ko)
Inventor
안병용
김성오
오양근
이다솜
이상훈
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to KR1020210172029A priority Critical patent/KR20230083743A/en
Publication of KR20230083743A publication Critical patent/KR20230083743A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • G06T5/005
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • G06T7/0014Biomedical image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Medical Informatics (AREA)
  • Quality & Reliability (AREA)
  • Radiology & Medical Imaging (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

An electronic device according to various embodiments comprises: a memory for storing a plurality of groups corresponding to a plurality of representative facial features, respectively; and at least one processor, wherein the at least one processor may be configured to obtain a first image, detect a first region representing a face, the features of the face, and a second region requiring restoration in the first image, select a first group among the plurality of groups based on the features of the face and the plurality of representative facial features, obtain a facial region having the second region restored based on the representative facial features of the first group and the features of the face, and obtain a second image by synthesizing the facial region and the first image. Therefore, provided are a method for providing an image and an electronic device supporting the same, wherein the appearance of an actually photographed subject can be reflected more accurately on an image.

Description

이미지를 제공하는 방법 및 이를 지원하는 전자 장치{METHOD FOR PROVIDING IMAGE AND ELECTRONIC DEVICE SUPPORTING THE SAME}Method for providing an image and electronic device supporting the same {METHOD FOR PROVIDING IMAGE AND ELECTRONIC DEVICE SUPPORTING THE SAME}

본 문서의 다양한 실시예들은, 이미지를 제공하는 방법 및 이를 지원하는 전자 장치에 관한 것이다.Various embodiments of this document relate to a method for providing an image and an electronic device supporting the same.

이미지 인페인팅(image inpainting)은 이미지에서 손상되거나 가려진 부분을 복원하는 기술을 지칭한다. Image inpainting refers to a technique of restoring a damaged or obscured portion of an image.

전자 장치는, 마스크(mask) 또는 선글라스(sunglass)와 같은 액세서리에 의해 사람의 얼굴의 일부가 가려진 이미지가 획득되는 경우, 이미지 인페인팅을 이용하여, 가려진 얼굴의 일부가 복원된 이미지를 획득할 수 있다.When an image in which a part of a person's face is obscured by an accessory such as a mask or sunglasses is obtained, the electronic device may acquire an image in which the part of the face is partially restored by using image inpainting. there is.

전자 장치는, 가려진 부분(또는 손상된 부분)을 포함하는 이미지가 획득된 경우, 획득된 이미지 내에서 가려지지 않은 부분(또는 손상되지 않은 부분)에 기반하여, 인공지능 모델을 이용하여 학습된 데이터(예: 일반적인 사람 얼굴의 특징)를 이용하여, 이미지 내에서 가려진 부분을 복원할 수 있다. 또는, 전자 장치는, 가려진 부분을 포함하는 이미지가 획득된 경우, 워핑(warping) 기술을 이용하여 상기 획득된 이미지 및 참조 이미지를 매칭(matching)시키고, 매칭된 참조 이미지 내에서 상기 획득된 이미지의 가려진 부분에 대응하는 부분을 상기 획득된 이미지에서 가려지지 않은 부분과 결합함으로써, 이미지 내에서 가려진 부분을 복원할 수 있다.When an image including a occluded part (or a damaged part) is acquired, the electronic device uses the artificial intelligence model to learn data ( For example, the masked part in the image can be restored using the features of a normal human face. Alternatively, when an image including an obscured portion is acquired, the electronic device matches the obtained image and a reference image using a warping technique, and matches the obtained image within the matched reference image. The obscured portion in the image may be restored by combining the portion corresponding to the obscured portion with the non-obscured portion of the acquired image.

전자 장치에서 획득된 이미지에서 가려진 부분을 인공지능 모델을 이용하여 학습된 데이터(예: 일반적인 사람의 얼굴의 특징)를 이용하여 복원하는 경우, 상기 획득된 이미지의 대상(예: 전자 장치의 사용자의 얼굴)과 인공지능 모델의 학습에 이용된 이미지의 대상(예: 일반적인 사람의 얼굴)이 다르기 때문에, 가려진 부분이 복원된 이미지의 복원된 부분은 상기 획득된 이미지의 촬영 대상의 실제 모습과 다를 수 있다.In the case of restoring the obscured part in an image obtained from an electronic device using data learned using an artificial intelligence model (eg, general human facial features), the subject of the acquired image (eg, the user of the electronic device) face) and the subject of the image used for learning the artificial intelligence model (e.g., a general human face) are different, the restored part of the image in which the occluded part is restored may differ from the actual appearance of the subject of the acquired image. there is.

또한, 전자 장치에서 획득된 이미지에서 가려진 부분을 워핑 기술을 이용하여 복원하는 경우, 상기 획득된 이미지의 대상(예: 전자 장치의 사용자의 얼굴)의 형태(예: 전자 장치의 사용자의 얼굴이 향하는 방향에 따라 달라지는 얼굴 형태), 상기 획득된 이미지의 밝기, 및 상기 획득된 이미지의 대상의 표정 및/또는 자세를 고려하지 않기 때문에, 가려진 부분이 복원된 이미지의 품질이 저하될 수 있다.In addition, when a part obscured from an image obtained from an electronic device is restored using a warping technique, the shape of the object (eg, the face of the user of the electronic device) of the acquired image (eg, the face of the user of the electronic device is facing) Face shape that varies depending on direction), brightness of the acquired image, and facial expression and/or posture of the target of the acquired image are not considered, so the quality of the image in which the occluded part is restored may be degraded.

본 문서의 다양한 실시예들은, 전자 장치에 저장된 복수의 이미지들을 이용하여, 전자 장치에서 획득된 이미지 내에서 복원이 필요한 부분을 복원함으로써, 실제 촬영 대상(예: 전자 장치의 사용자의 얼굴)의 모습이 보다 정확히 반영된 이미지를 획득하는, 이미지를 제공하는 방법 및 이를 지원하는 전자 장치에 관한 것이다.In various embodiments of the present document, by using a plurality of images stored in an electronic device to restore a part that needs to be restored in an image acquired by the electronic device, the appearance of an actual photographed target (eg, the user's face of the electronic device). It relates to a method for obtaining a more accurately reflected image, providing an image, and an electronic device supporting the same.

본 문서가 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 문서와 관련된 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical tasks to be achieved by this document are not limited to the technical tasks mentioned above, and other technical tasks not mentioned can be clearly understood by those skilled in the art related to this document from the description below. There will be.

다양한 실시예들에 따른 전자 장치는, 복수의 대표 얼굴 특징들 각각에 대응하는 복수의 그룹들을 저장하는 메모리, 및 상기 메모리와 전기적으로 연결된 적어도 하나의 프로세서를 포함하고, 상기 적어도 하나의 프로세서는, 제 1 이미지를 획득하고, 상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하고, 상기 얼굴의 특징 및 상기 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하고, 상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하고, 및 상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하도록 구성될 수 있다.An electronic device according to various embodiments includes a memory for storing a plurality of groups corresponding to a plurality of representative facial features, and at least one processor electrically connected to the memory, the at least one processor comprising: A first image is acquired, a first region representing a face, a feature of the face, and a second region requiring restoration are detected in the first image, and the feature of the face and the plurality of regions are detected. Based on the representative facial features of, a first group is selected from among the plurality of groups, and based on the representative facial features of the first group and the facial features, a face region in which the second region is restored is obtained. and obtaining a second image by synthesizing the face region and the first image.

다양한 실시예들에 따른 전자 장치에서 이미지를 제공하는 방법은, 제 1 이미지를 획득하는 동작, 상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하는 동작, 상기 얼굴의 특징 및 상기 전자 장치의 메모리에 저장된 복수의 그룹들 각각에 대응하는 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작, 상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하는 동작, 및 상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하는 동작을 포함할 수 있다.A method for providing an image in an electronic device according to various embodiments includes an operation of acquiring a first image, a first area representing a face in the first image, characteristics of the face, and a first area in the first area. An operation of detecting a second region requiring restoration, and selecting a first group from among the plurality of groups based on the facial features and a plurality of representative facial features corresponding to each of the plurality of groups stored in the memory of the electronic device. By selecting an operation, obtaining a face area in which the second area is restored based on the representative facial features of the first group and the facial features, and synthesizing the face area and the first image, 2 may include an operation of acquiring images.

다양한 실시예에 따른 이미지를 제공하는 방법 및 이를 지원하는 전자 장치는, 전자 장치에 저장된 복수의 이미지들을 이용하여, 전자 장치에서 획득된 이미지 내에서 복원이 필요한 부분을 복원함으로써, 실제 촬영 대상(예: 전자 장치의 사용자의 얼굴)의 모습이 보다 정확히(또는 보다 유사하게) 반영된 이미지를 획득할 수 있다.A method for providing an image according to various embodiments and an electronic device supporting the same may restore a part that needs to be restored in an image acquired by the electronic device using a plurality of images stored in the electronic device, so that the actual photographing target (e.g. : An image in which a face of a user of an electronic device is more accurately (or more similarly) reflected may be obtained.

도 1은, 다양한 실시예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는, 다양한 실시예들에 따른, 전자 장치의 블록도이다.
도 3은, 다양한 실시예들에 따른, 프로세서의 블록도이다.
도 4는, 다양한 실시예들에 따른, 이미지를 제공하는 방법을 설명하는 흐름도이다.
도 5는, 다양한 실시예들에 따른, 얼굴 요소를 검출하는 방법을 설명하는 흐름도이다.
도 6은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하는 방법을 설명하는 흐름도이다.
도 7은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하거나 미리 정의된 얼굴을 포함하는 이미지를 선택하는 방법을 설명하는 흐름도이다.
도 8은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하는 방법을 설명하는 흐름도이다.
도 9는, 다양한 실시예들에 따른, 제 2 이미지를 획득하는 방법을 설명하는 흐름도이다.
도 10은, 다양한 실시예들에 따른, 제 2 이미지를 획득하는 방법을 설명하는 예시도이다.
도 11은, 다양한 실시예들에 따른, 복수의 그룹들을 관리하는 방법을 설명하는 흐름도이다.
도 12는, 다양한 실시예들에 따른, 얼굴 요소를 검출하는 방법을 설명하는 흐름도이다.
도 13은, 다양한 실시예들에 따른, 복수의 그룹들을 관리하는 방법을 설명하는 흐름도이다.
도 14a 및 도 14b는, 다양한 실시예들에 따른, 이미지를 제공하는 방법을 설명하는 예시도들이다.
1 is a block diagram of an electronic device in a network environment, according to various embodiments.
2 is a block diagram of an electronic device, according to various embodiments.
3 is a block diagram of a processor, in accordance with various embodiments.
4 is a flowchart illustrating a method of providing an image, according to various embodiments.
5 is a flow chart describing a method of detecting facial elements, according to various embodiments.
6 is a flowchart illustrating a method of selecting a group from among a plurality of groups, according to various embodiments.
7 is a flowchart illustrating a method of selecting a group from among a plurality of groups or selecting an image including a predefined face, according to various embodiments.
8 is a flowchart illustrating a method of selecting a group from among a plurality of groups, according to various embodiments.
9 is a flowchart illustrating a method of obtaining a second image, according to various embodiments.
10 is an exemplary view illustrating a method of obtaining a second image, according to various embodiments.
11 is a flowchart illustrating a method of managing a plurality of groups, according to various embodiments.
12 is a flowchart describing a method of detecting a facial element, according to various embodiments.
13 is a flowchart illustrating a method of managing a plurality of groups, according to various embodiments.
14A and 14B are exemplary diagrams illustrating a method of providing an image, according to various embodiments.

도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 1 is a block diagram of an electronic device 101 within a network environment 100, according to various embodiments.

도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제 1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제 2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108) 중 적어도 하나와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.Referring to FIG. 1 , in a network environment 100, an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or through a second network 199. It may communicate with at least one of the electronic device 104 or the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 . According to an embodiment, the electronic device 101 includes 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), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or the antenna module 197 may be included. In some embodiments, in the electronic device 101, at least one of these components (eg, the connection terminal 178) may be omitted or one or more other components may be added. In some embodiments, some of these components (eg, sensor module 176, camera module 180, or antenna module 197) are integrated into a single component (eg, display module 160). It can be.

프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일 실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일 실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.The processor 120, for example, executes software (eg, the program 140) to cause at least one other component (eg, hardware or software component) of the electronic device 101 connected to the processor 120. It can control and perform various data processing or calculations. According to one embodiment, as at least part of data processing or operation, processor 120 transfers instructions or data received from other components (e.g., sensor module 176 or communication module 190) to volatile memory 132. , processing commands or data stored in the volatile memory 132 , and storing resultant data in the non-volatile memory 134 . According to one embodiment, the processor 120 includes a main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit ( NPU: neural processing unit (NPU), image signal processor, sensor hub processor, or communication processor). For example, when the electronic device 101 includes the main processor 121 and the auxiliary processor 123, the auxiliary processor 123 may use less power than the main processor 121 or be set to be specialized for a designated function. can The secondary processor 123 may be implemented separately from or as part of the main processor 121 .

보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능 모델이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다. The secondary processor 123 may, for example, take the place of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or the main processor 121 is active (eg, running an application). ) state, together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states. According to one embodiment, the auxiliary processor 123 (eg, an image signal processor or a communication processor) may be implemented as part of other functionally related components (eg, the camera module 180 or the communication module 190). there is. According to an embodiment, the auxiliary processor 123 (eg, a neural network processing device) may include a hardware structure specialized for processing an artificial intelligence model. AI models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself where the artificial intelligence model is performed, or may be performed through a separate server (eg, the server 108). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning or reinforcement learning, but in the above example Not limited. The artificial intelligence model may include a plurality of artificial neural network layers. Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the foregoing, but is not limited to the foregoing examples. The artificial intelligence model may include, in addition or alternatively, software structures in addition to hardware structures.

메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다. The memory 130 may store various data used by at least one component (eg, the processor 120 or the sensor module 176) of the electronic device 101 . The data may include, for example, input data or output data for software (eg, program 140) and commands related thereto. The memory 130 may include volatile memory 132 or non-volatile memory 134 .

프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다. 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 .

입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다. The input module 150 may receive a command or data to be used by a component (eg, the processor 120) of the electronic device 101 from the outside of the electronic device 101 (eg, a user). The input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).

음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일 실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.The sound output module 155 may output sound signals to the outside of the electronic device 101 . The sound output module 155 may include, for example, a speaker or a receiver. The speaker can be used for general purposes such as multimedia playback or recording playback. A receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from the speaker or as part of it.

디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일 실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다. The display module 160 may visually provide information to the outside of the electronic device 101 (eg, a user). The display module 160 may include, for example, a display, a hologram device, or a projector and a control circuit for controlling the device. According to an 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 force generated by the touch.

오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일 실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.The audio module 170 may convert sound into an electrical signal or vice versa. According to an embodiment, the audio module 170 acquires sound through the input module 150, the sound output module 155, or an external electronic device connected directly or wirelessly to the electronic device 101 (eg: Sound may be output through the electronic device 102 (eg, a speaker or a headphone).

센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일 실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다. The sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, a user state), and generates an electrical signal or data value corresponding to the detected state. can do. According to one embodiment, the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an infrared (IR) sensor, a bio sensor, It may include a temperature sensor, humidity sensor, or light sensor.

인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일 실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.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 (eg, the electronic device 102). According to 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.

연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일 실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.The connection terminal 178 may include a connector through which the electronic device 101 may be physically connected to an external electronic device (eg, the 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 (eg, a headphone connector).

햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일 실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.The haptic module 179 may convert electrical signals into mechanical stimuli (eg, vibration or motion) or electrical stimuli that a user may perceive through tactile or kinesthetic senses. According to one embodiment, the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일 실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.The camera module 180 may capture still images and moving images. According to one embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.

전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일 실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.The power management module 188 may manage power supplied to the electronic device 101 . According to one embodiment, the power management module 188 may be implemented as at least part of a power management integrated circuit (PMIC), for example.

배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일 실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.The battery 189 may supply power to at least one component of the electronic device 101 . According to one embodiment, the battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.

통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일 실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제 1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제 2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다. The communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). Establishment and communication through the established communication channel may be supported. The communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication. According to one embodiment, the communication module 190 may be a wireless communication module 192 (eg, 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 (eg, a : a local area network (LAN) communication module or a power line communication module). Among these communication modules, a corresponding communication module is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a telecommunications network such as a computer network (eg, a LAN or a WAN). These various types of communication modules may be integrated as one component (eg, a single chip) or implemented as a plurality of separate components (eg, multiple chips). The wireless communication module 192 uses subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199. The electronic device 101 may be identified or authenticated.

무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제 2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일 실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.The wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, NR access technology (new radio access technology). NR access technologies include high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and access of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low latency (URLLC)). -latency communications)) can be supported. The wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example. The wireless communication module 192 uses various technologies for securing performance in a high frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), and full-dimensional multiplexing. Technologies such as input/output (FD-MIMO: full dimensional MIMO), array antenna, analog beam-forming, or large scale antenna may be supported. The wireless communication module 192 may support various requirements defined for the electronic device 101, an external electronic device (eg, the electronic device 104), or a network system (eg, the second network 199). According to one embodiment, the wireless communication module 192 may be used to realize peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency (for realizing URLLC). Example: downlink (DL) and uplink (UL) each of 0.5 ms or less, or round trip 1 ms or less) may be supported.

안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다. The antenna module 197 may transmit or receive signals or power to the outside (eg, an external electronic device). According to an embodiment, the antenna module 197 may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (eg, PCB). According to one embodiment, the antenna module 197 may include a plurality of antennas (eg, 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 is selected from the plurality of antennas by the communication module 190, for example. can be chosen A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna. According to some embodiments, other components (eg, a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module 197 in addition to the radiator.

다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일 실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.According to various embodiments, the antenna module 197 may form a mmWave antenna module. According to one embodiment, the mmWave antenna module includes a printed circuit board, an RFIC disposed on or adjacent to a first surface (eg, a lower surface) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, array antennas) disposed on or adjacent to a second surface (eg, a top surface or a side surface) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.

상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.At least some of the components are connected to each other through a communication method between peripheral devices (eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)) and signal ( e.g. commands or data) can be exchanged with each other.

일 실시예에 따르면, 명령 또는 데이터는 제 2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일 실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일 실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제 2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다. According to an embodiment, commands or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 . Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 . According to an embodiment, all or part of operations executed in the electronic device 101 may be executed in one or more external electronic devices among the external electronic devices 102 , 104 , or 108 . For example, when the electronic device 101 needs to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device 101 instead of executing the function or service by itself. Alternatively or additionally, one or more external electronic devices may be requested to perform the function or at least part of the service. One or more external electronic devices receiving the request may execute at least a part of the requested function or service or an additional function or service related to the request, and deliver the execution result to the electronic device 101 . The electronic device 101 may provide the result as at least part of a response to the request as it is or additionally processed. To this end, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing. In another embodiment, the external electronic device 104 may include an internet of things (IoT) device. Server 108 may be an intelligent server using machine learning and/or neural networks. According to one embodiment, the external electronic device 104 or server 108 may be included in the second network 199 . The electronic device 101 may be applied to intelligent services (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.

본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.Electronic devices according to various embodiments disclosed in this document may be devices of various types. The electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance. An electronic device according to an embodiment of the present document is not limited to the aforementioned devices.

본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.Various embodiments of this document and terms 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, like reference numbers may be used for like or related elements. The singular form of a noun corresponding to an item may include one item or a plurality of items, unless the relevant context clearly dictates otherwise. In this document, "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 "A Each of the phrases such as "at least one of , B, or C" may include any one of the items listed together in that phrase, or all possible combinations thereof. Terms such as "first", "second", or "first" or "secondary" may simply be used to distinguish a given component from other corresponding components, and may be used to refer to a given component in another aspect (eg, importance or order) is not limited. A (e.g., first) component is said to be "coupled" or "connected" to another (e.g., second) component, with or without the terms "functionally" or "communicatively." When mentioned, it means that the certain component may be connected to the other component directly (eg by wire), wirelessly, or through a third component.

본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일 실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다. The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logical blocks, parts, or circuits. can be used as A module may be an integrally constructed component or a minimal unit of components or a portion thereof that performs one or more functions. For example, according to one embodiment, the module may be implemented in the form of an application-specific integrated circuit (ASIC).

본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, ‘비일시적’은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.Various embodiments of this document provide one or more instructions stored in a storage medium (eg, internal memory 136 or external memory 138) readable by a machine (eg, electronic device 101). It may be implemented as software (eg, the program 140) including them. For example, a processor (eg, the processor 120 ) of a device (eg, the electronic device 101 ) may call at least one command among one or more instructions stored from a storage medium and execute it. This enables the device to be operated to perform at least one function according to the at least one command invoked. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' only means that the storage medium is a tangible device and does not contain a signal (e.g. electromagnetic wave), and this term refers to the case where data is stored semi-permanently in the storage medium. It does not discriminate when it is temporarily stored.

일 실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.According to one embodiment, the method according to various embodiments disclosed in this document may be provided by being included in a computer program product. Computer program products may be traded between sellers and buyers as commodities. A computer program product is distributed in the form of a device-readable storage medium (eg compact disc read only memory (CD-ROM)), or through an application store (eg Play Store TM ) or on two user devices ( It can be distributed (eg downloaded or uploaded) online, directly between smart phones. In the case of online distribution, at least part of the computer program product may be temporarily stored or temporarily created in a device-readable storage medium such as a manufacturer's server, an application store server, or a relay server's memory.

다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.According to various embodiments, each component (eg, module or program) of the above-described components may include a single object or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. there is. According to various embodiments, one or more components or operations among the aforementioned corresponding components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (eg modules or programs) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by a corresponding component of the plurality of components prior to the integration. . According to various embodiments, the actions performed by a module, program, or other component are executed sequentially, in parallel, iteratively, or heuristically, or one or more of the actions are executed in a different order, or omitted. or one or more other actions may be added.

도 2는, 다양한 실시예들에 따른, 전자 장치(101)의 블록도이다.2 is a block diagram of an electronic device 101 according to various embodiments.

도 2를 참조하면, 일 실시예에서, 전자 장치(101)는, 디스플레이(210), 카메라 모듈(220), 메모리(230), 및/또는 프로세서(240)를 포함할 수 있다.Referring to FIG. 2 , in one embodiment, an electronic device 101 may include a display 210, a camera module 220, a memory 230, and/or a processor 240.

일 실시예에서, 디스플레이(210)는 도 1의 디스플레이 모듈(160)에 포함될 수 있다.In one embodiment, display 210 may be included in display module 160 of FIG. 1 .

일 실시예에서, 디스플레이(210)는 다양한 화면들을 표시할 수 있다. 예를 들어, 디스플레이(210)는, 전자 장치(101)에서 카메라 어플리케이션 또는 이미지 어플리케이션(예: 갤러리(gallery) 어플리케이션)이 실행되는 동안, 이미지를 포함하는 화면을 표시할 수 있다. 다른 예를 들어, 디스플레이(210)는, 이미지에 포함된 얼굴 영역 내에서 복원이 필요한 영역을 복원하기 위한 얼굴 인페인팅(face inpainting)(이하, '얼굴 인페인팅'으로 지칭함)이 수행되는 경우, 얼굴 인페인팅을 위한 다양한 화면들(예: 도 14a 및 도 14b의 화면들(1410, 1420, 1430, 1440))을 표시할 수 있다.In one embodiment, the display 210 may display various screens. For example, the display 210 may display a screen including an image while a camera application or an image application (eg, a gallery application) is executed on the electronic device 101 . As another example, the display 210 performs face inpainting (hereinafter, referred to as 'face inpainting') for restoring a region that needs to be restored within a face region included in an image. Various screens for face inpainting (eg, screens 1410, 1420, 1430, and 1440 of FIGS. 14A and 14B) may be displayed.

일 실시예에서, 카메라 모듈(220)은 도 1의 카메라 모듈(180)에 포함될 수 있다.In one embodiment, the camera module 220 may be included in the camera module 180 of FIG. 1 .

일 실시예에서, 카메라 모듈(220)은 얼굴 인페인팅의 대상이 되는 이미지를 획득할 수 있다. 일 실시예에서, 카메라 모듈(220)을 통하여 획득되고 얼굴 인페인팅의 대상이 되는 이미지는, 정지 이미지(예: 프리뷰(preview) 이미지가 표시되는 동안 캡쳐(capture) 입력에 의해 획득된 정지 이미지) 및/또는 동적 이미지(예: 동영상, 이미지)를 포함할 수 있다.In one embodiment, the camera module 220 may obtain an image to be subjected to face inpainting. In one embodiment, the image acquired through the camera module 220 and subject to face inpainting is a still image (eg, a still image obtained by a capture input while a preview image is displayed) and/or dynamic images (eg, videos, images).

일 실시예에서, 메모리(230)는 도 1의 메모리(130)에 포함될 수 있다.In one embodiment, memory 230 may be included in memory 130 of FIG. 1 .

일 실시예에서, 메모리(230)는 이미지를 제공하는 동작의 적어도 일부를 수행하기 위한 정보를 저장할 수 있다. 메모리(230)가 저장하는, 이미지를 제공하는 동작의 적어도 일부를 수행하기 위한 정보에 대해서는, 후술하도록 한다.In one embodiment, the memory 230 may store information for performing at least part of an operation of providing an image. Information for performing at least a part of an operation of providing an image stored in the memory 230 will be described later.

일 실시예에서, 프로세서(240)는 도 1의 프로세서(120)에 포함될 수 있다.In one embodiment, processor 240 may be included in processor 120 of FIG. 1 .

일 실시예에서, 프로세서(240)는, 이미지를 제공하는 동작을 전반적으로 제어할 수 있다. 프로세서(240)는, 이미지를 제공하는 동작을 수행하기 위한 복수의 구성들을 포함할 수 있다. 프로세서(240)가 이미지를 제공하기 위하여 포함하는 복수의 구성들에 대해서는 도 3을 참조하여 설명하도록 한다. 일 실시예에서, 프로세서(240)는, 이미지를 제공하는 동작을 수행하기 위한 하나 이상의 프로세서들을 포함할 수 있다.In one embodiment, the processor 240 may overall control an operation of providing an image. The processor 240 may include a plurality of components for performing an operation of providing an image. A plurality of components included in the processor 240 to provide an image will be described with reference to FIG. 3 . In one embodiment, the processor 240 may include one or more processors for performing an operation of providing an image.

일 실시예에서, 도 2에서는 전자 장치(101)가, 디스플레이(210), 카메라 모듈(220), 메모리(230), 및/또는 프로세서(240)를 포함하는 것으로 예시하고 있지만, 이에 제한되지 않는다. 예를 들어, 전자 장치(101)는 통신 모듈(예: 도 1의 통신 모듈(190))을 더 포함할 수 있다. 전자 장치(101)가 통신 모듈을 더 포함하는 경우, 전자 장치(101)는 통신 모듈을 통하여 외부 전자 장치(예: 서버(108), 전자 장치(102), 전자 장치(104))로부터 얼굴 인페인팅을 위한 이미지를 획득할 수 있다. 다른 예를 들어, 전자 장치(101)는, 실시예에 따라, 디스플레이(210) 및/또는 카메라 모듈(220)을 포함하지 않을 수 있다.In one embodiment, the electronic device 101 is illustrated in FIG. 2 as including a display 210, a camera module 220, a memory 230, and/or a processor 240, but is not limited thereto. . For example, the electronic device 101 may further include a communication module (eg, the communication module 190 of FIG. 1 ). When the electronic device 101 further includes a communication module, the electronic device 101 performs face recognition from an external electronic device (eg, the server 108, the electronic device 102, or the electronic device 104) through the communication module. Images for painting can be obtained. For another example, the electronic device 101 may not include the display 210 and/or the camera module 220 according to embodiments.

도 3은, 다양한 실시예들에 따른, 프로세서(240)의 블록도이다.3 is a block diagram of a processor 240, in accordance with various embodiments.

도 3을 참조하면, 일 실시예에서, 프로세서(240)는, 그룹 관리부(310) 및 복원부(320)를 포함할 수 있다.Referring to FIG. 3 , in one embodiment, the processor 240 may include a group management unit 310 and a restoration unit 320 .

일 실시예에서, 그룹 관리부(310)는, 메모리(230)에 저장된 복수의 이미지들을 복수의 그룹들로 그룹화하고, 복수의 그룹들 및 복수의 그룹들에 대한 그룹 정보를 관리하기 위한 구성일 수 있다.In one embodiment, the group management unit 310 may be a component for grouping a plurality of images stored in the memory 230 into a plurality of groups and managing the plurality of groups and group information for the plurality of groups. there is.

일 실시예에서, 그룹 관리부(310)는, 제 1 얼굴 요소 검출부(311), 얼굴 그룹화부(312), 얼굴 그룹 관리부(313), 및/또는 신규 이미지 그룹 선택부(314)를 포함할 수 있다.In one embodiment, the group management unit 310 may include a first face element detection unit 311, a face grouping unit 312, a face group management unit 313, and/or a new image group selection unit 314. there is.

일 실시예에서, 얼굴 요소 검출부(311)는, 이미지 내에서 얼굴 요소를 검출(예: 추출)할 수 있다. In one embodiment, the facial element detection unit 311 may detect (eg, extract) facial elements within an image.

일 실시예에서, 얼굴 요소는, 이미지 내에서 얼굴을 나타내는 얼굴 영역(예: 얼굴 전체 영역), 얼굴 영역 내에서 복원이 필요한 영역, 및 얼굴의 특징을 포함할 수 있다. 이하에서, 설명의 편의를 위하여, 이미지에 포함된 얼굴 영역(예: 얼굴 전체 영역)을 '제 1 영역'으로 지칭하고, 얼굴 영역 내에서 복원이 필요한 영역을 '제 2 영역'으로 지칭하고, 얼굴 영역(제 1 영역) 내에서 복원이 필요한 영역(제 2 영역)을 제외한 영역(예: 가려지지 않은 영역)을 '제 3 영역'으로 지칭하기로 한다.In an embodiment, the face element may include a face region representing a face in an image (eg, an entire face region), a region within the face region that needs to be restored, and facial features. Hereinafter, for convenience of description, a face region included in an image (eg, the entire face region) is referred to as a 'first region', and a region requiring restoration within the face region is referred to as a 'second region', An area (eg, an unoccluded area) excluding the area requiring restoration (the second area) within the face area (first area) will be referred to as a 'third area'.

일 실시예에서, 제 2 영역(얼굴 영역 내에서 복원이 필요한 영역)은, 영역 내에서 검출된 특징의 신뢰도가 지정된 신뢰도 이하인 영역일 수 있다. 예를 들어, 제 1 영역 내에서 일정한 크기를 가지는 벡터(vector) 형태로 얼굴의 특징이 추출될 수 있다. 상기 추출된 얼굴의 특징에 대응하는 벡터 및 메모리(230)에 저장된 기준(reference) 벡터들 간 유사도(예: 유사도의 평균 및/또는 최소 값)에 기반하여, 상기 추출된 얼굴의 특징의 신뢰도를 결정할 수 있다. 제 2 영역은 제 1 영역 내에서 상기 결정된 신뢰도가 상기 지정된 신뢰도 이하인 영역을 지칭할 수 있다. 일 실시예에서, 제 2 영역은, 제 1 영역 내에서, 사람의 얼굴 일부가 마스크 또는 선글라스와 같은 액세서리 및/또는 사람의 손, 머리카락과 같은 인체에 의해 가려진 영역을 포함할 수 있다. 다른 예를 들어, 제 2 영역은, 제 1 영역 내에서 이미지를 구성하는 데이터의 일부가 소실 및/또는 손상된 영역을 포함할 수 있다. 다만, 제 2 영역의 예시는 전술한 예시들에 제한되지 않는다.In an embodiment, the second region (a region in the face region requiring restoration) may be a region in which the reliability of a feature detected within the region is less than or equal to a specified reliability level. For example, facial features may be extracted in the form of a vector having a constant size within the first region. Based on the degree of similarity between the vector corresponding to the extracted facial feature and the reference vectors stored in the memory 230 (eg, the average and/or minimum value of similarity), the reliability of the extracted facial feature is determined. can decide The second region may refer to a region in which the determined reliability level is equal to or less than the designated reliability level in the first region. In an embodiment, the second region may include a region in which a portion of a person's face is covered by an accessory such as a mask or sunglasses and/or a human body such as a person's hand or hair, within the first region. For another example, the second area may include an area in which part of data constituting the image in the first area is lost and/or damaged. However, examples of the second area are not limited to the above examples.

일 실시예에서, 제 1 얼굴 요소 검출부(311)는, 인공지능 모델(GAN(generative adversarial network))을 이용하여, 이미지 내에서 얼굴 요소를 검출할 수 있다. 예를 들어, 제 1 얼굴 요소 검출부(311)는, style GAN 기반 Pixel2Style2Pixel 및/또는 face identity disentanglement를 이용하여, 이미지 내에서 얼굴 요소를 검출할 수 있다.In an embodiment, the first facial element detector 311 may detect facial elements in an image using a generative adversarial network (GAN). For example, the first face element detector 311 may detect a face element in an image using style GAN-based Pixel2Style2Pixel and/or face identity disentanglement.

일 실시예에서, 제 1 얼굴 요소 검출부(311)는, 얼굴의 특징을, 사람의 얼굴에 고유한 특징(identity feature)(이하, '얼굴의 제 1 특징'으로 지칭함)과, 이미지 획득 시 환경 및/또는 얼굴의 상태를 반영한 특징(이하, '얼굴의 제 2 특징'으로 지칭함)(또는 'attribute feature'로도 지칭됨)으로 분류하여 검출할 수 있다.In one embodiment, the first facial element detector 311 may determine facial features, an identity feature of a person's face (hereinafter, referred to as a 'first facial feature'), and an environment when acquiring an image. And/or a feature reflecting the state of the face (hereinafter, referred to as 'second facial feature') (or also referred to as 'attribute feature') may be classified and detected.

일 실시예에서, 얼굴의 제 1 특징은, 사람의 얼굴에 고유한(예: 모든 사람의 얼굴이 공통적으로 가진), 귀, 눈, 코, 및 입의 형태, 피부 톤(tone), 및/또는 수염의 형태를 포함할 수 있다. 다만, 얼굴의 제 1 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the first feature of the face is the shape of the ears, eyes, nose, and mouth, skin tone, and/or that is unique to a person's face (eg, that all human faces have in common). Or it may include the form of a beard. However, the first feature of the face is not limited to the above examples.

일 실시예에서, 얼굴의 제 2 특징은, 이미지 획득 시 환경(예: 피사체의 주변의 조명(또는 밝기)) 및/또는 이미지 획득 시 사람(피사체)의 상태(예: 사람의 자세, 사람(예: 얼굴)의 표정)와 같이, 이미지 획득 시 마다 변경될 수 있는 특징을 포함할 수 있다. 예를 들어, 얼굴의 제 2 특징은, 이미지 획득 시 전자 장치(101)(예: 카메라 모듈(220))에 대한 얼굴의 상대적인 방향을 포함할 수 있다. 다만, 얼굴의 제 2 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the second feature of the face may be the environment at the time of image acquisition (eg, lighting (or brightness) around the subject) and/or the state of the person (subject) at the time of image acquisition (eg, the person's posture, the person ( It can include features that can change each time an image is acquired, such as facial expression). For example, the second feature of the face may include a relative direction of the face to the electronic device 101 (eg, the camera module 220) when acquiring an image. However, the second feature of the face is not limited to the above examples.

전술한 예시들에서, 그룹 관리부(310)에 포함된 제 1 얼굴 요소 검출부(311)가 얼굴의 특징으로서, 얼굴의 제 1 특징 및 얼굴의 제 2 특징을 검출하는 것으로 예시하고 있지만, 일 실시예에서, 그룹 관리부(310)에 포함된 제 1 얼굴 요소 검출부(311)는, 메모리(230)에 저장된 모든 이미지들 각각에서, 얼굴의 제 2 특징을 검출함 없이, 얼굴의 제 1 특징만을 검출할 수도 있다.In the above examples, the first facial element detection unit 311 included in the group management unit 310 is illustrated as detecting the first facial feature and the second facial feature as facial features, but in one embodiment , the first facial element detector 311 included in the group management unit 310 may detect only the first feature of the face from each of all images stored in the memory 230 without detecting the second feature of the face. may be

일 실시예에서, 제 1 얼굴 요소 검출부(311)는, 메모리(230)에 저장된 모든 이미지들(예: 갤러리 어플리케이션과 관련된 모든 이미지들) 각각에 대하여, 얼굴 요소를 검출하는 동작을 수행할 수 있다. 예를 들어, 제 1 얼굴 요소 검출부(311)는, 얼굴 인페인팅을 위한 어플리케이션 설치 시(또는 얼굴 인페인팅을 위한 어플리케이션 설치 후, 얼굴 인페인팅을 위한 어플리케이션 실행 시) 또는 주기적으로, 메모리(230)에 저장된 모든 이미지들 각각에 대하여, 얼굴 요소를 검출하는 동작을 수행할 수 있다.In one embodiment, the first facial element detector 311 may perform an operation of detecting a facial element for each of all images stored in the memory 230 (eg, all images related to the gallery application). . For example, the first face element detection unit 311 detects the memory 230 when an application for face inpainting is installed (or when an application for face inpainting is executed after installing an application for face inpainting) or periodically. For each of all images stored in , an operation of detecting a face element may be performed.

일 실시예에서, 제 1 얼굴 요소 검출부(311)는, 이미지 획득 시, 획득된 이미지에 대하여 얼굴 요소를 검출하는 동작을 수행할 수 있다. 예를 들어, 제 1 얼굴 요소 검출부(311)는, 카메라 모듈(220)을 통하여 이미지가 획득되는 경우, 획득된 이미지에 대하여 얼굴 요소를 검출하는 동작을 수행할 수 있다. 다만, 제 1 얼굴 요소 검출부(311)는, 복원부(320)에 포함된 제 2 얼굴 요소 검출부(321)에서 이미지에 대한 얼굴 요소를 검출하는 동작이 수행된 이미지(예: 얼굴 인페인팅의 결과 이미지)에 대해서는, 별도로 얼굴 요소를 검출하는 동작을 수행하지 않을 수 있다.In an embodiment, the first facial element detector 311 may perform an operation of detecting facial elements in the acquired image when obtaining an image. For example, when an image is acquired through the camera module 220, the first facial element detector 311 may perform an operation of detecting a facial element in the acquired image. However, the first facial element detecting unit 311 is an image in which an operation of detecting facial elements of an image has been performed by the second facial element detecting unit 321 included in the restoring unit 320 (eg, the result of face inpainting). image), an operation of separately detecting a face element may not be performed.

일 실시예에서, 제 1 얼굴 요소 검출부(311)는, 이미지 내에서 얼굴 영역이 존재하지 않는 경우, 또는 이미지 내에서 얼굴 영역에 대한 복원이 필요한 영역의 비율이 지정된 비율 이상인 경우, 이미지 내에서 얼굴의 특징을 획득(예: 추출)하는 동작을 수행하지 않을 수 있다. 예를 들어, 제 1 얼굴 요소 검출부(311)는, 이미지 내에서 얼굴 영역이 존재하고, 이미지 내에서 얼굴 영역에 대한 복원이 필요한 영역의 비율이 지정된 비율 미만인 경우에만, 이미지 내에서 얼굴의 특징을 획득(예: 추출)하는 동작을 수행할 수 있다. 제 1 얼굴 요소 검출부(311)가 이미지 내에서 얼굴의 특징을 추출하는 동작을 수행하지 않은 경우, 얼굴 그룹화부(312), 얼굴 그룹 관리부(313), 및 신규 이미지 그룹 선택부(314)는 동작하지 않을 수 있다.In one embodiment, the first face element detector 311 detects a face in an image when a face region does not exist in the image or when a ratio of a region requiring restoration to a face region in the image is greater than or equal to a specified ratio. An operation of acquiring (eg, extracting) a feature of may not be performed. For example, the first facial element detector 311 detects facial features in an image only when a face region exists in the image and a ratio of a region requiring restoration to the face region in the image is less than a specified ratio. Acquiring (eg, extracting) operations can be performed. When the first face element detection unit 311 does not perform an operation of extracting facial features from an image, the face grouping unit 312, the face group management unit 313, and the new image group selection unit 314 operate may not

일 실시예에서, 얼굴 그룹화부(312)는, 메모리(230)에 저장된 모든 이미지들(예: 갤러리 어플리케이션과 관련된 모든 이미지들) 각각에 대하여 얼굴 요소가 검출된 경우, 메모리(230)에 저장된 모든 이미지들을 복수의 그룹들(이하, '복수의 그룹들'로 지칭함)로 그룹화(예: 분류)할 수 있다. 예를 들어, 얼굴 그룹화부(312)는, 메모리(230)에 저장된 전체 이미지들 중에서, 얼굴 요소가 검출된 이미지들을 복수의 그룹들로 그룹화할 수 있다.In one embodiment, the face grouping unit 312, when a face element is detected for each of all images (eg, all images related to the gallery application) stored in the memory 230, all stored in the memory 230 Images may be grouped (eg, classified) into a plurality of groups (hereinafter referred to as 'a plurality of groups'). For example, the face grouping unit 312 may group images in which face elements are detected among all images stored in the memory 230 into a plurality of groups.

일 실시예에서, 얼굴 그룹화부(312)는, 이미지들(예: 얼굴 요소가 검출된 이미지들) 각각의 제 1 특징들에 기반하여, 이미지들을 복수의 그룹들로 그룹화할 수 있다. 일 실시예에서, 얼굴 그룹화부(312)는, 지정된 알고리즘을 이용하여, 유사한 제 1 특징을 가지는 하나 이상의 이미지들이 동일한 그룹에 포함되도록, 이미지들을 복수의 그룹들로 그룹화할 수 있다. 예를 들어, 얼굴 그룹화부(312)는, 지정된 알고리즘(예: K-평균 군집화 알고리즘)을 이용하여, 동일한 그룹에 포함되는 하나 이상의 이미지들의 제 1 특징들 간 유사도가 지정된 유사도 이상이 되도록, 이미지들을 복수의 그룹들로 그룹화할 수 있다.In an embodiment, the face grouping unit 312 may group the images into a plurality of groups based on first characteristics of each of the images (eg, images in which face elements are detected). In one embodiment, the face grouping unit 312 may group the images into a plurality of groups so that one or more images having a similar first feature are included in the same group by using a specified algorithm. For example, the face grouping unit 312 uses a designated algorithm (eg, a K-means clustering algorithm) so that the similarity between the first features of one or more images included in the same group is greater than or equal to the designated similarity. can be grouped into a plurality of groups.

일 실시예에서, 얼굴 그룹 관리부(313)는 복수의 그룹들을 관리할 수 있다.In one embodiment, the face group management unit 313 may manage a plurality of groups.

일 실시예에서, 얼굴 그룹 관리부(313)는, 복수의 그룹들 각각에 대하여, 그룹 정보를 획득(예: 산출)할 수 있다. 일 실시예에서, 그룹 정보는, 그룹 특징(group feature)(이하, '그룹의 대표 얼굴 특징'과 혼용함), 그룹의 대표 이미지, 및/또는 그룹의 크기를 포함할 수 있다.In an embodiment, the face group management unit 313 may obtain (eg, calculate) group information for each of a plurality of groups. In one embodiment, the group information may include a group feature (hereinafter, mixed with 'representative facial feature of the group'), a representative image of the group, and/or a size of the group.

일 실시예에서, 얼굴 그룹 관리부(313)는, 동일한 그룹에 속하는 하나 이상의 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여, 그룹의 대표 얼굴 특징을 획득할 수 있다.In an embodiment, the face group management unit 313 may obtain representative facial features of a group based on first features and weights of faces of one or more images belonging to the same group.

일 실시예에서, 얼굴 그룹 관리부(313)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지 내에서 얼굴의 각도(또는 얼굴이 향하는 방향) 및/또는 이미지의 해상도에 기반하여, 가중치들을 설정(예: 부여)할 수 있다. 예를 들어, 얼굴 그룹 관리부(313)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지에 포함된 얼굴이 카메라 모듈(220)의 정면을 향할수록(예: 얼굴이 향하는 방향 및 카메라 모듈(220)이 향하는 방향이 평행할수록) 및/또는 이미지의 해상도가 높을수록, 이미지에 대하여 높은 가중치를 설정할 수 있다.In one embodiment, the face group management unit 313 sets weights for one or more images belonging to the same group based on the angle of the face in the image (or the direction the face faces) and/or the resolution of the image. (e.g. granted). For example, with respect to one or more images belonging to the same group, the face group management unit 313 increases the face included in the image toward the front of the camera module 220 (eg, the direction the face faces and the camera module ( 220) is parallel) and/or the resolution of the image is higher, a higher weight may be set for the image.

일 실시예에서, 얼굴 그룹 관리부(313)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지 내에서 얼굴의 각도, 이미지의 해상도, 및/또는 이미지가 얼굴 인페인팅에 이용된 이미지(예: 이미지가 얼굴 인페인팅의 결과 이미지)인지 여부에 기반하여, 가중치들을 설정(예: 부여)할 수 있다. 예를 들어, 얼굴 그룹 관리부(313)는, 복원부(320)에서 수행되는 얼굴 인페인팅의 결과 이미지(예: 후술할 도 4의 동작 409에서 획득된 제 2 이미지)에 대하여, 동일한 그룹에 속하는 다른 이미지에 비하여 높은 가중치를 설정(또는 가중치 값을 추가)할 수 있다.In one embodiment, the face group management unit 313 may determine, for one or more images belonging to the same group, the angle of the face in the image, the resolution of the image, and/or the image used for face inpainting (eg: Based on whether the image is a result image of face inpainting), weights may be set (eg, assigned). For example, the face group management unit 313 determines that an image resulting from face inpainting performed by the restoration unit 320 (eg, a second image obtained in operation 409 of FIG. 4 to be described later) belongs to the same group. You can set a higher weight than other images (or add a weight value).

일 실시예에서, 얼굴 그룹 관리부(313)는, 아래 [수학식 1]과 같이, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들에 대한 가중 평균을 이용하여, 그룹 특징을 획득(예: 산출)할 수 있다.In one embodiment, the face group management unit 313 obtains a group feature (eg: can be calculated).

[수학식 1][Equation 1]

Figure pat00001
Figure pat00001

[수학식 1]에서, G 는 그룹에 포함된 이미지들의 개수를 나타내고, FG 는 그룹 특징(예: 그룹의 대표 얼굴 특징)을 나타내고, Fi는 이미지의 얼굴의 제 1 특징을 나타내고, Wi는 이미지의 가중치를 나타낼 수 있다.In [Equation 1], G Represents the number of images included in the group, F G denotes a group feature (eg, a representative facial feature of the group), F i denotes a first face feature of the image, and W i denotes a weight of the image.

일 실시예에서, 얼굴 그룹 관리부(313)는, 동일한 그룹에 포함된 이미지들 중에서, 가장 높은 가중치를 가지는 이미지(예: 가장 높은 가중치가 설정된 이미지)를, 그룹의 대표 이미지로 결정(예: 설정)할 수 있다.In one embodiment, the face group management unit 313 determines (eg, sets an image having the highest weight) an image having the highest weight (eg, an image with the highest weight set) as a representative image of the group among images included in the same group. )can do.

일 실시예에서, 얼굴 그룹 관리부(313)는, 복수의 그룹들 각각에 포함된 이미지들의 개수(예: 해당 그룹에 포함된 이미지의 개수), 또는 메모리(230)에 저장된 전체 이미지들의 개수(또는 복수의 그룹들에 포함된 전체 이미지들의 개수)에 대한 해당 그룹에 포함된 이미지의 개수의 비율을, 해당 그룹의 크기로서 결정(예: 설정)할 수 있다.In one embodiment, the face group management unit 313 may determine the number of images included in each of the plurality of groups (eg, the number of images included in the corresponding group), or the total number of images stored in the memory 230 (or A ratio of the number of images included in the corresponding group to the total number of images included in the plurality of groups may be determined (eg, set) as the size of the corresponding group.

일 실시예에서, 얼굴 그룹 관리부(313)는, 복원부(320)로, 복수의 그룹들에 대한 그룹 정보를 전달할 수 있다. 예를 들어, 얼굴 그룹 관리부(313)는, 복원부(320)로부터 요청을 수신하는 경우, 복수의 그룹들에 대한 그룹 정보를 복원부(320)로 전달할 수 있다.In an embodiment, the face group management unit 313 may transmit group information on a plurality of groups to the restoration unit 320 . For example, when receiving a request from the restoration unit 320, the face group management unit 313 may transfer group information on a plurality of groups to the restoration unit 320.

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 이미지가 입력되는 경우, 복수의 그룹들 중에서 상기 입력된 이미지가 포함될 그룹을 선택할 수 있다. In one embodiment, when an image is input, the new image group selector 314 may select a group to include the input image from among a plurality of groups.

일 실시예에서, 신규 이미지 그룹 선택부(314)로 입력되는 이미지는, 갤러리 어플리케이션에 새롭게 추가된 이미지(예: 갤러리 어플리케이션이 관리를 시작한 이미지)일 수 있다. 예를 들어, 신규 이미지 그룹 선택부(314)로 입력되는 이미지는, 카메라 모듈(220)을 통하여 획득된 이미지 또는 외부 전자 장치(예: 서버(108), 전자 장치(102), 전자 장치(104))로부터 획득된 이미지(예: 카메라 모듈(220)를 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지인 경우)일 수 있다. 다른 예를 들어, 신규 이미지 그룹 선택부(314)로 입력되는 이미지는, 얼굴 인페인팅이 수행된 이미지(얼굴 인페인팅의 결과 이미지)를 포함할 수 있다.In an embodiment, an image input to the new image group selector 314 may be an image newly added to the gallery application (eg, an image managed by the gallery application). For example, an image input to the new image group selector 314 may be an image obtained through the camera module 220 or an external electronic device (eg, server 108, electronic device 102, electronic device 104 )) (for example, an image acquired through the camera module 220 or obtained from an external electronic device and immediately stored in the memory 230 without face inpainting). For another example, an image input to the new image group selector 314 may include an image on which face inpainting is performed (a result image of face inpainting).

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 신규 이미지 그룹 선택부(314)로 이미지가 입력되는 경우, 입력된 이미지(이하, '입력된 이미지'로 지칭함)가 얼굴 인페인팅(예: 복원부(320)에서 수행되는 얼굴 인페인팅)이 수행된 이미지(이하, '얼굴 인페인팅의 결과 이미지'로 지칭함)인지 여부를 확인할 수 있다. In one embodiment, the new image group selection unit 314, when an image is input to the new image group selection unit 314, the input image (hereinafter referred to as 'input image') is face inpainting (eg : It is possible to check whether the face inpainting performed by the restoration unit 320 is an image (hereinafter, referred to as 'result image of face inpainting').

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 입력된 이미지와 관련된 플래그(flag)에 기반하여, 입력된 이미지가 얼굴 인페인팅의 결과 이미지에 해당하는지 여부를 확인할 수 있다. 예를 들어, 신규 이미지 그룹 선택부(314)는, 입력된 이미지와 관련된 플래그가 입력된 이미지가 얼굴 인페인팅이 수행된 이미지임을 나타내는 경우, 입력된 이미지가 얼굴 인페인팅의 결과 이미지에 해당하는 것으로 확인할 수 있다. 다른 예를 들어, 신규 이미지 그룹 선택부(314)는, 입력된 이미지와 관련된 플래그가 입력된 이미지가 얼굴 인페인팅이 수행되지 않은 이미지임을 나타내거나, 입력된 이미지와 관련된 플래그가 존재하지 않는 경우, 입력된 이미지가 카메라 모듈(220)을 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지에 해당하는 것으로 확인할 수 있다.In an embodiment, the new image group selector 314 may check whether the input image corresponds to the resultant image of face inpainting based on a flag related to the input image. For example, the new image group selector 314 determines that the input image corresponds to the resulting image of face inpainting when a flag related to the input image indicates that the input image is an image in which face inpainting has been performed. You can check. For another example, the new image group selector 314 may indicate that a flag related to the input image indicates that the input image is an image on which face inpainting has not been performed, or a flag related to the input image does not exist. After the input image is acquired through the camera module 220 or acquired from an external electronic device, it can be confirmed that it corresponds to the image stored in the memory 230 without face inpainting.

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 입력된 이미지가 얼굴 인페인팅의 결과 이미지인 것으로 확인된 경우, 입력된 이미지와 관련된 얼굴 인페인팅을 수행하는 동안 선택되었던 그룹을, 입력된 이미지가 포함될 그룹으로 선택할 수 있다. 일 실시예에서, 신규 이미지 그룹 선택부(314)는, 입력된 이미지와 관련된 플래그에 기반하여, 입력된 이미지에 대한 얼굴 인페인팅이 수행되는 동안 선택된 그룹(예: 후술할 동작 405에서 선택된 제 1 그룹)을 입력된 이미지가 포함될 그룹으로 결정할 수 있다. 예를 들어, 신규 이미지 그룹 선택부(314)는, 입력된 이미지가 얼굴 인페인팅의 결과 이미지에 해당하는 경우, 입력된 이미지와 관련된 얼굴 인페인팅이 수행되는 동안, 입력된 이미지를 획득하기 위하여 선택되었던 그룹을 나타내는 플래그에 기반하여, 입력된 이미지와 관련된 얼굴 인페인팅이 수행되는 동안 입력된 이미지를 획득하기 위하여 선택되었던 그룹을 입력된 이미지가 포함될 그룹으로 결정할 수 있다.In one embodiment, the new image group selection unit 314 selects a group selected while performing face inpainting related to the input image when it is confirmed that the input image is the result image of face inpainting. You can select as a group to include images. In an embodiment, the new image group selector 314 selects a selected group (eg, a first group selected in operation 405 to be described later) while face inpainting is performed on the input image, based on a flag related to the input image. group) may be determined as a group to include the input image. For example, the new image group selection unit 314 selects an input image to obtain an input image while face inpainting related to the input image is performed when the input image corresponds to a result image of face inpainting. Based on the flag indicating the selected group, a group selected to obtain an input image while face inpainting related to the input image is performed may be determined as a group to include the input image.

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 입력된 이미지가 얼굴 인페인팅의 결과 이미지가 아닌 것으로 확인된 경우(예: 카메라 모듈(220)를 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지인 경우), 입력된 이미지의 얼굴의 제 1 특징 및 복수의 그룹들의 대표 얼굴 특징들(예: 입력된 이미지의 얼굴의 제 1 특징과, 복수의 그룹들의 대표 얼굴 특징들 각각 간 유사도)을 비교할 수 있다. 신규 이미지 그룹 선택부(314)는, 복수의 그룹들 중에서, 복수의 그룹들의 대표 얼굴 특징들 중에서 입력된 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징을 가지는 그룹(예: 복수의 그룹들의 대표 얼굴 특징들 중에서 입력된 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징과, 입력된 이미지의 얼굴의 제 1 특징 간 유사도가 지정된 유사도 이상인 경우, 상기 가장 유사한 대표 얼굴 특징에 대응하는 그룹)을, 입력된 이미지가 포함될 그룹으로 선택할 수 있다. In one embodiment, the new image group selector 314 determines that the input image is not the result image of face inpainting (eg, obtained through the camera module 220 or obtained from an external electronic device). In the case of an image directly stored in the memory 230 without face inpainting), the first feature of the face of the input image and representative facial features of a plurality of groups (eg, the first feature of the face of the input image and the plurality of face features of the input image) The similarity between each of the representative facial features of the groups) may be compared. The new image group selector 314 selects a group having a representative facial feature most similar to a first feature of the face of the input image among the representative facial features of the plurality of groups (e.g., of the plurality of groups) among the plurality of groups. If the similarity between the representative facial feature most similar to the first facial feature of the input image among the representative facial features and the first facial feature of the input image is equal to or greater than the specified similarity, a group corresponding to the most similar representative facial feature) can be selected as a group to include the input image.

일 실시예에서, 신규 이미지 그룹 선택부(314)는, 입력된 이미지를 선택된 그룹에 포함시키고, 선택된 그룹 및 선택된 그룹에 대한 그룹 정보(예: 선택된 그룹의 그룹 특징, 그룹의 대표 이미지, 및/또는 그룹의 크기)를 갱신할 수 있다. 신규 이미지 그룹 선택부(314)는, 복수의 그룹들의 대표 얼굴 특징들 중에서 입력된 이미지의 얼굴의 제 1 특징과 유사한 대표 얼굴 특징을 가지는 그룹이 없는 경우(예: 복수의 그룹들의 대표 얼굴 특징들 중에서 입력된 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징과, 입력된 이미지의 얼굴의 제 1 특징 간 유사도가 지정된 유사도 미만인 경우), 이전에 획득된 복수의 그룹들 외에 새로운 그룹을 획득(예: 생성)하고, 새로운 그룹에 입력된 이미지를 포함시킬 수 있다. 이러한 경우, 신규 이미지 그룹 선택부(314)는, 새로운 그룹에 대하여 그룹 정보(예: 새로운 그룹의 그룹 특징, 그룹의 대표 이미지, 및/또는 그룹의 크기)를 획득(예: 생성)하고 관리할 수 있다.In one embodiment, the new image group selection unit 314 includes the input image in the selected group, and includes the selected group and group information on the selected group (eg, group characteristics of the selected group, representative image of the group, and / or group size). The new image group selector 314 is configured to select a representative facial feature of a plurality of groups when there is no group having a representative facial feature similar to the first feature of the face of the input image (e.g., the representative facial features of the plurality of groups). If the similarity between the representative facial feature most similar to the first facial feature of the input image and the first facial feature of the input image is less than the specified similarity), a new group is obtained in addition to the previously obtained plurality of groups ( e.g. create), and include the entered image in a new group. In this case, the new image group selector 314 acquires (eg creates) and manages group information (eg, group characteristics of the new group, representative image of the group, and/or size of the group) for the new group. can

일 실시예에서, 그룹 관리부(310)는 전자 장치의 백그라운드(background)에서 동작할 수 있다. 예를 들어, 그룹 관리부(310)는, 얼굴 인페인팅을 위한 어플리케이션 설치 시 또는 주기적으로, 메모리(230)에 저장된 모든 이미지들 각각에 대하여, 얼굴 요소를 검출하는 동작을 포함하는 동작들을 수행할 수 있다. 다른 예를 들어, 일 실시예에서, 그룹 관리부(310)(예: 제 1 얼굴 요소 검출부(311))는, 이미지 획득 시 마다, 획득된 이미지에 대하여 얼굴 요소를 검출하는 동작을 포함하는 동작들을 수행할 수 있다.In one embodiment, the group management unit 310 may operate in the background of the electronic device. For example, the group management unit 310 may perform operations including an operation of detecting a face element for each of all images stored in the memory 230 when an application for face inpainting is installed or periodically. there is. For another example, in one embodiment, the group management unit 310 (eg, the first facial element detection unit 311) performs operations including an operation of detecting a facial element in the acquired image whenever an image is acquired. can be done

일 실시예에서, 복원부(320)는 이미지에 대한 얼굴 인페인팅을 수행할 수 있다. 일 실시예에서, 복원부(320)는, 제 2 얼굴 요소 검출부(321), 입력 이미지 그룹 선택부(324), 기본 얼굴 관리부(323), 얼굴 특징 결합부(324), 얼굴 영역 생성부, 및/또는 합성부(326)를 포함할 수 있다.In one embodiment, the reconstruction unit 320 may perform face inpainting on the image. In one embodiment, the restoration unit 320 includes a second facial element detection unit 321, an input image group selection unit 324, a basic face management unit 323, a facial feature combining unit 324, a face area generating unit, and/or a synthesis unit 326 .

일 실시예에서, 제 2 얼굴 요소 검출부(321)는, 이미지 내에서 얼굴 요소를 검출(예: 추출)할 수 있다. 예를 들어, 제 2 얼굴 요소 검출부(321)는, 카메라 모듈(220)을 통하여 획득된(또는 외부 전자 장치(예: 서버(108), 전자 장치(102), 전자 장치(104))로부터 획득된) 이미지 또는 메모리(230)에 저장된 이미지들 중에서 사용자 입력에 기반하여 이미지가 선택된 이미지에 대하여, 얼굴 인페인팅을 수행하기 위한 사용자 입력을 수신할 수 있다. 제 2 얼굴 요소 검출부(321)는, 얼굴 인페인팅을 수행하기 위한 사용자 입력이 수신된 경우, 상기 획득된 이미지 또는 상기 선택된 이미지(이하, 상기 획득된 이미지 또는 상기 선택된 이미지를 '제 1 이미지'로 지칭함) 내에서, 제 1 영역(이미지 내에서 얼굴을 나타내는 얼굴 영역), 제 2 영역(얼굴 영역 내에서 복원이 필요한 영역), 및/또는 얼굴의 특징을 검출할 수 있다.In one embodiment, the second facial element detection unit 321 may detect (eg, extract) facial elements within an image. For example, the second facial element detector 321 is acquired through the camera module 220 (or obtained from an external electronic device (eg, server 108, electronic device 102, or electronic device 104)). A user input for performing face inpainting may be received with respect to a selected) image or an image selected based on a user input from among images stored in the memory 230 . When a user input for performing face inpainting is received, the second facial element detection unit 321 designates the obtained image or the selected image (hereinafter, the acquired image or the selected image as a 'first image'). ), a first region (a face region representing a face in an image), a second region (a region within the face region that needs to be restored), and/or facial features may be detected.

일 실시예에서, 제 2 얼굴 요소 검출부(321)는, 인공지능 모델(GAN(generative adversarial network))을 이용하여, 제 1 이미지 내에서 얼굴 요소를 검출할 수 있다.In an embodiment, the second facial element detector 321 may detect facial elements in the first image by using a generative adversarial network (GAN).

일 실시예에서, 제 2 얼굴 요소 검출부(321)는, 제 1 이미지의 얼굴의 특징을, 얼굴의 제 1 특징(사람의 얼굴에 고유한 특징) 및 얼굴의 제 2 특징(이미지 획득 시 환경 및/또는 얼굴의 상태를 반영한 특징)으로 분류하여 검출할 수 있다.In one embodiment, the second facial element detector 321 determines the facial features of the first image, the first facial features (characteristics unique to a human face) and the second facial features (environmental and / or features reflecting the state of the face) can be classified and detected.

일 실시예에서, 얼굴의 제 1 특징은, 사람의 얼굴에 고유한(예: 모든 사람의 얼굴이 공통적으로 가진), 귀, 눈, 코, 및 입의 형태, 피부 톤(tone), 및/또는 수염의 형태를 포함할 수 있다. 다만, 얼굴의 제 1 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the first feature of the face is the shape of the ears, eyes, nose, and mouth, skin tone, and/or that is unique to a person's face (eg, that all human faces have in common). Or it may include the form of a beard. However, the first feature of the face is not limited to the above examples.

일 실시예에서, 얼굴의 제 2 특징은, 이미지 획득 시 환경(예: 피사체의 주변의 조명(또는 밝기)) 및/또는 이미지 획득 시 사람(피사체)의 상태(예: 사람의 자세, 사람(예: 얼굴)의 표정)와 같이, 이미지 획득 시 마다 변경될 수 있는 특징을 포함할 수 있다. 예를 들어, 얼굴의 제 2 특징은, 이미지 획득 시 전자 장치(101)(예: 카메라 모듈(220))에 대한 얼굴의 상대적인 방향을 포함할 수 있다. 다만, 얼굴의 제 2 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the second feature of the face may be the environment at the time of image acquisition (eg, lighting (or brightness) around the subject) and/or the state of the person (subject) at the time of image acquisition (eg, the person's posture, the person ( It can include features that can change each time an image is acquired, such as facial expression). For example, the second feature of the face may include a relative direction of the face to the electronic device 101 (eg, the camera module 220) when acquiring an image. However, the second feature of the face is not limited to the above examples.

일 실시예에서, 제 2 얼굴 요소 검출부(321)는, 제 1 이미지의 제 1 특징을 제 2 영역의 제 1 특징 및 제 3 영역(예: 얼굴 영역 내에서 복원이 필요한 제 2 영역을 제외한 영역, 또는 얼굴 영역 내에서 가려지지 않은 영역)의 제 1 특징으로 분류하여 검출할 수 있다.In an exemplary embodiment, the second facial element detector 321 converts the first feature of the first image into the first feature of the second area and the third area (eg, the area within the face area excluding the second area that needs to be restored). .

일 실시예에서, 제 2 얼굴 요소 검출부(321)는, 제 1 이미지 내에서 얼굴 영역이 존재하지 않는 경우, 또는 제 1 이미지 내에서 얼굴 영역에 대한 복원이 필요한 영역의 비율이 지정된 비율 미만인 경우, 제 1 이미지 내에서 얼굴의 특징을 획득(예: 추출)하는 동작을 수행하지 않을 수 있다. 예를 들어, 제 2 얼굴 요소 검출부(321)는, 제 1 이미지 내에서 얼굴 영역이 존재하고, 제 1 이미지 내에서 얼굴 영역에 대한 복원이 필요한 영역의 비율이 지정된 비율 이상인 경우에만, 제 1 이미지 내에서 얼굴의 특징을 획득(예: 추출)하는 동작을 수행할 수 있다. 제 2 얼굴 요소 검출부(321)가 제 1 이미지 내에서 얼굴의 특징을 추출하는 동작을 수행하지 않은 경우, 입력 이미지 그룹 선택부(322), 기본 얼굴 관리부(323), 얼굴 특징 결합부(324), 얼굴 영역 획득부(325), 및 합성부(326)는 동작하지 않을 수 있다.In one embodiment, the second facial element detector 321 determines whether a face region does not exist in the first image or a ratio of a region requiring restoration to the face region in the first image is less than a specified ratio. An operation of obtaining (eg, extracting) facial features in the first image may not be performed. For example, the second face element detector 321 detects the first image only when a face region exists in the first image and the ratio of the region requiring reconstruction to the face region in the first image is greater than or equal to a specified ratio. It is possible to perform an operation of obtaining (eg, extracting) facial features in When the second facial element detection unit 321 does not perform an operation of extracting facial features from the first image, the input image group selection unit 322, the basic face management unit 323, and the facial feature combining unit 324 , the face area obtaining unit 325, and the synthesizing unit 326 may not operate.

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 그룹 관리부(310)로부터 수신된 복수의 그룹들에 대한 그룹 정보에 기반하여, 제 1 이미지에 포함된 얼굴 영역을 복원하기 위한 그룹을 선택할 수 있다.In an embodiment, the input image group selector 322 selects a group for reconstructing a face region included in the first image, based on group information on a plurality of groups received from the group manager 310. can

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 그룹 관리부(310)로부터, 복수의 그룹들 각각에 대한 그룹 정보(예: 그룹 특징, 그룹의 대표 이미지, 및/또는 그룹의 크기)를 수신할 수 있다.In one embodiment, the input image group selector 322 receives group information (eg, group characteristics, representative image of the group, and/or size of the group) from the group management unit 310 for each of the plurality of groups. can receive

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 제 1 이미지의 얼굴의 제 1 특징 및 복수의 그룹들에 대응하는 그룹 특징들(예: 대표 얼굴 특징들) 간 유사도, 및/또는 복수의 그룹들의 그룹 크기들에 기반하여, 하나 이상의 후보 그룹들을 결정할 수 있다.In one embodiment, the input image group selection unit 322 determines the similarity between the first feature of the face of the first image and group features (eg, representative facial features) corresponding to the plurality of groups, and/or a plurality of Based on the group sizes of the groups of , one or more candidate groups may be determined.

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서, 제 1 이미지의 얼굴의 제 3 영역(예: 얼굴 영역 내에서 복원이 필요한 제 2 영역을 제외한 영역, 또는 얼굴 영역 내에서 가려지지 않은 영역)의 제 1 특징에 대응하는 특징들(예: 대표 얼굴 특징에서 제 1 이미지의 가려지지 않은 영역에 대응하는 얼굴 부위의 특징)을 확인할 수 있다. 예를 들어, 입력 이미지 그룹 선택부(322)는, 제 1 이미지의 얼굴의 제 3 영역이 대표 얼굴 특징으로서, 귀, 눈, 및 코의 형태를 포함하는 경우(예: 제 1 이미지 내에서 입이 마스크에 의해 가려진 경우), 각각 귀, 눈, 코, 및/또는 입의 형태를 포함하는 대표 얼굴 특징들에서, 입의 형태를 제외한(예: 대표 얼굴 특징들 각각에서, 제 1 이미지 내에서 마스크에 의해 가려진 입에 대응하는 입의 형태를 제외한), 귀, 눈, 및 코의 형태를 확인할 수 있다.In one embodiment, the input image group selector 322 selects a third area of the face of the first image (eg, a second region requiring restoration within the face region) from among representative facial features corresponding to a plurality of groups. Features corresponding to the first feature (e.g., a feature of a face part corresponding to an unobscured region of the first image in the representative facial feature) may be identified. there is. For example, when the third region of the face of the first image includes the shape of the ears, eyes, and nose as representative facial features, the input image group selector 322 selects the mouth in the first image. in the first image, excluding the shape of the mouth (e.g., in each of the representative facial features) Except for the shape of the mouth corresponding to the mouth covered by the mask), the shape of the ears, eyes, and nose can be confirmed.

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들을 산출할 수 있다.In an embodiment, the input image group selector 322 may select features corresponding to a first feature of a third region of the face of the first image from among representative facial features respectively corresponding to a plurality of groups; Similarities between the first features of the third region of the face of one image may be calculated.

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 상기 산출된 유사도들 및/또는 복수의 그룹들의 그룹 크기들에 기반하여, 하나 이상의 후보 그룹들을 결정할 수 있다. 예를 들어, 입력 이미지 그룹 선택부(322)는, 상기 산출된 유사도가 지정된 유사도 이상이고 그룹 크기가 지정된 크기 이상인 하나 이상의 후보 그룹들을 결정할 수 있다. In an embodiment, the input image group selector 322 may determine one or more candidate groups based on the calculated similarities and/or group sizes of the plurality of groups. For example, the input image group selector 322 may determine one or more candidate groups whose calculated similarity is greater than or equal to a specified similarity and whose group size is greater than or equal to a specified size.

일 실시예에서, 입력 이미지 그룹 선택부(322)가 상기 산출된 유사도들에 기반하여 하나 이상의 후보 그룹들을 결정함으로써, 제 1 이미지의 얼굴과 유사한 얼굴을 포함하는 이미지에 기반하여, 얼굴 인페인팅 동작을 수행할 수 있다. 일 실시예에서, 입력 이미지 그룹 선택부(322)가 복수의 그룹들의 그룹 크기들에 기반하여 하나 이상의 후보 그룹들을 결정함으로써, 다른 그룹에 비하여 촬영 빈도가 높았던 그룹의 이미지에 기반하여 얼굴 인페인팅 동작을 수행할 수 있다.In one embodiment, the face inpainting operation is performed based on an image including a face similar to the face of the first image by determining one or more candidate groups based on the calculated similarities by the input image group selector 322. can be performed. In an embodiment, the input image group selection unit 322 determines one or more candidate groups based on group sizes of a plurality of groups, thereby performing a face inpainting operation based on images of a group whose photographing frequency is higher than that of other groups. can be performed.

다만, 하나 이상의 그룹들을 결정하는 방법은 전술한 예시에 제한되지 않는다. 예를 들어, 입력 이미지 그룹 선택부(322)는, 그룹의 크기를 고려함 없이, 상기 유사도들 중에서 높은 유사도를 가지는 하나 이상의 후보 그룹들을 결정할 수 있다.However, a method of determining one or more groups is not limited to the above-described example. For example, the input image group selector 322 may determine one or more candidate groups having a high similarity among the similarities without considering the size of the group.

일 실시예에서, 입력 이미지 그룹 선택부(322)는, 상기 결정된 하나 이상의 후보 그룹들에 각각 대응하는 대표 이미지들을 디스플레이(210)를 통하여 표시할 수 있다. 일 실시예에서, 입력 이미지 그룹 선택부(322)는, 디스플레이(210)를 통하여 상기 하나 이상의 후보 그룹들에 대응하는 대표 이미지들을 표시하는 동안, 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 제 1 이미지의 얼굴 인페인팅을 위한 그룹으로서 선택할 수 있다.In an embodiment, the input image group selector 322 may display representative images respectively corresponding to the determined one or more candidate groups through the display 210 . In one embodiment, while displaying representative images corresponding to the one or more candidate groups through the display 210, the input image group selector 322 selects a group corresponding to a representative image selected based on a user input. It can be selected as a group for face inpainting of the first image.

전술한 예시들에서는 입력 이미지 그룹 선택부(322)가 하나 이상의 후보 그룹들을 결정하고, 결정된 하나 이상의 후보 그룹들 중에서 사용자에 의해 선택된 그룹을 제 1 이미지의 얼굴 인페인팅을 위한 그룹으로 선택하는 것으로 예시하고 있지만 이에 제한되지 않는다. 예를 들어, 입력 이미지 그룹 선택부(322)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들을 산출할 수 있다. 입력 이미지 그룹 선택부(322)는, 상기 유사도들 중에서 가장 높은 유사도를 가지는 그룹(예: 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도가 가장 큰 그룹)을 제 1 이미지의 얼굴 인페인팅을 위한 그룹으로서 선택할 수 있다.In the above examples, the input image group selector 322 determines one or more candidate groups and selects a group selected by the user from among the determined one or more candidate groups as a group for face inpainting of the first image. but is not limited to For example, the input image group selector 322 selects each of the features corresponding to the first feature of the third area of the face of the first image from among the representative facial features corresponding to the plurality of groups, and the first Similarities between the first features of the third region of the face of the image may be calculated. The input image group selection unit 322 selects a group having the highest similarity among the similarities (eg, a feature corresponding to a first feature of a third area of the face of the first image from among representative facial features of the group, and a first A group having the greatest similarity between the first features of the third region of the face of the image) may be selected as a group for face inpainting of the first image.

일 실시예에서, 기본 얼굴 관리부(323)는, 미리 정의된 얼굴을 포함하는 이미지들을 관리할 수 있다. 예를 들어, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들이 모두 지정된 유사도 미만일 수 있다. 이러한 경우, 기본 얼굴 관리부(323)는, 미리 정의된 얼굴(예: 마네킹(mannequin) 모델의 얼굴, 연예인의 얼굴, 사람의 일반적인 얼굴)을 포함하는 하나 이상의 이미지들을 결정할 수 있다(예: 미리 정의된 얼굴을 포함하는 하나의 이상의 이미지들을 하나 이상의 후보 그룹들로서 결정할 수 있다). 기본 얼굴 관리부(323)는, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 디스플레이(210)를 통하여 표시할 수 있다. 일 실시예에서, 기본 얼굴 관리부(323)는, 디스플레이(210)를 통하여 상기 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 표시하는 동안, 상기 표시된 하나 이상의 이미지들 중에서, 사용자 입력에 기반하여 제 1 이미지의 얼굴 인페인팅을 위한 이미지를 선택할 수 있다.In one embodiment, the basic face management unit 323 may manage images including a predefined face. For example, among the representative facial features corresponding to the plurality of groups, each of the features corresponding to the first feature of the third region of the face of the first image and the first feature of the third region of the face of the first image All of the similarities between features may be less than the specified similarity. In this case, the basic face manager 323 may determine one or more images including a predefined face (eg, a mannequin model face, a celebrity face, and a normal human face) (eg, a predefined face). One or more images including the face may be determined as one or more candidate groups). The basic face management unit 323 may display one or more images including a predefined face through the display 210 . In one embodiment, while displaying one or more images including the predefined face through the display 210, the basic face management unit 323 selects a first, based on a user input, from among the one or more displayed images. You can select an image for face inpainting of an image.

일 실시예에서, 기본 얼굴 관리부(323)는, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들 각각의 얼굴 특징들을 획득 및 관리할 수 있다.In one embodiment, the basic face management unit 323 may acquire and manage facial features of each of one or more images including a predefined face.

일 실시예에서, 얼굴 특징 결합부(324)는, 입력 이미지 그룹 선택부(322)에서 선택된 그룹(이하, '선택된 그룹'으로 지칭함)의 대표 얼굴 특징 및 제 1 이미지의 얼굴 특징을 결합하여, 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징을 획득할 수 있다.In one embodiment, the facial feature combiner 324 combines the representative facial features of the group selected by the input image group selector 322 (hereinafter referred to as 'selected group') and the facial features of the first image, Facial features for obtaining a face region in which the second region is reconstructed may be obtained.

일 실시예에서, 얼굴 특징 결합부(324)는, 제 1 이미지의 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징과, 선택된 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징을 결합함으로써, 제 1 이미지의 제 2 영역이 복원된 제 1 영역을 획득하기 위한 얼굴의 특징을 구성할 수 있다. 예를 들어, 얼굴 특징 결합부(324)는, 제 1 이미지 내에서 가려지지 않은 제 3 영역의 제 1 특징(예: 제 1 이미지 내에서 코 및 입이 가려진 경우, 제 1 이미지 내에서 가려지지 않은 귀 및 눈의 형태), 제 1 이미지의 제 2 특징(예: 귀 및 눈이 향하는 방향, 표정, 및 주변 조명)과, 선택된 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징(예: 코 및 입의 형태)을 결합하여, 제 1 이미지의 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징을 구성할 수 있다.In an exemplary embodiment, the facial feature combiner 324 applies a first feature of a third region of the first image, a second feature of the first image, and a second region of the first image among representative facial features of the selected group. By combining the corresponding first features, a second region of the first image may constitute facial features to obtain a reconstructed first region. For example, the facial feature combiner 324 may use the first feature of the third region that is not covered in the first image (eg, when the nose and mouth are covered in the first image, the facial feature combiner 324 is not covered in the first image). shape of ears and eyes), second features of the first image (eg, direction of ears and eyes, facial expressions, and ambient lighting) and representative facial features of the selected group corresponding to the second region of the first image. By combining the first features (eg, the shape of the nose and the mouth), the second region of the first image may constitute a face feature for obtaining a reconstructed face region.

일 실시예에서, 얼굴 영역 획득부(325)는, 얼굴 특징 결합부(324)에서 획득된, 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징에 기반하여, 인공신경망(예: GAN)을 이용하여, 제 2 영역이 복원된 얼굴 영역을 획득할 수 있다. 예를 들어, 얼굴 영역 획득부(325)는, 인공 신경망으로, 제 1 이미지 내에서 가려지지 않은 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징과, 선택된 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징을 입력할 수 있다. 얼굴 영역 획득부(325)는, 인공 신경망의 출력 이미지의 제 3 영역(예: 인공 신경망의 출력 이미지 내에서 제 1 이미지의 제 3 영역에 대응하는 영역)이 제 1 이미지의 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징이 적용된 결과이고, 인공 신경망의 출력 이미지의 제 2 영역(예: 인공 신경망의 출력 이미지 내에서 제 1 이미지의 제 2 영역에 대응하는 영역)이 상기 선택된 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징 및 제 1 이미지의 제 2 특징이 적용된 결과인, 얼굴 영역을 포함하는 출력 이미지를 획득할 수 있다.In an embodiment, the face region acquisition unit 325 may use an artificial neural network (eg, GAN) based on facial features for acquiring a face region in which the second region is restored, acquired by the facial feature combiner 324. ), a face region in which the second region is restored may be obtained. For example, the face region acquiring unit 325 obtains a first feature of a third area that is not covered in the first image, a second feature of the first image, and a representative facial feature of the selected group, using an artificial neural network. A first feature corresponding to the second area of 1 image may be input. The face area acquisition unit 325 determines that the third area of the output image of the artificial neural network (eg, the area corresponding to the third area of the first image within the output image of the artificial neural network) is the third area of the third area of the first image. The first feature and the second feature of the first image are applied, and the second region of the output image of the artificial neural network (eg, the region corresponding to the second region of the first image in the output image of the artificial neural network) is the selected group. An output image including a face region, which is a result of applying a first feature corresponding to a second region of the first image and a second feature of the first image, among representative facial features of , may be obtained.

일 실시예에서, 합성부(326)는, 제 1 이미지 및 얼굴 영역 획득부(325)를 통하여 얼굴 영역(예: 인공 신경망의 출력 이미지)를 합성함으로써, 제 2 영역이 복원된 얼굴 영역을 포함하는 결과 이미지(이하, '제 2 이미지'로 지칭함)를 획득할 수 있다. 예를 들어, 합성부(326)는, 얼굴 영역 획득부(325)를 통하여 획득된 이미지 내에서 얼굴 영역을 추출(예: 크롭(crop))하고, 제 1 이미지 내에서 얼굴 영역을 제외한 나머지 영역을 추출한 후, 상기 추출된 얼굴 영역 및 상기 나머지 영역을 결합(예: 스티칭(stitching))함으로써, 제 2 이미지를 획득할 수 있다.In an embodiment, the synthesis unit 326 synthesizes the first image and the face area (eg, the output image of the artificial neural network) through the face area acquisition unit 325, so that the second area includes the restored face area. A resulting image (hereinafter, referred to as a 'second image') may be obtained. For example, the synthesis unit 326 extracts (eg, crops) a face region from the image acquired through the face region acquisition unit 325, and extracts the remaining region from the first image except for the face region. After extracting , a second image may be obtained by combining (eg, stitching) the extracted face region and the remaining region.

일 실시예에서, 전술한 예시들에서는, 신규 이미지 그룹 선택부(314)에서 선택된 그룹의 대표 얼굴 특징 및 제 1 이미지의 얼굴 특징에 기반하여, 제 2 이미지를 획득하는 동작을 예시하고 있지만, 이에 제한되지 않는다. 예를 들어, 얼굴 특징 결합부(324), 얼굴 영역 획득부(325), 및/ 합성부(326)는, 전술한 예시들과 동일 또는 유사한 방식을 이용하여, 기본 얼굴 관리부(323)에서 관리되는, 하나 이상의 이미지들 각각의 미리 정의된 얼굴들의 특징들 및 제 1 이미지의 얼굴 특징에 기반하여, 제 2 이미지를 획득할 수 있다.In one embodiment, the above examples illustrate an operation of obtaining a second image based on the representative facial features of the group selected by the new image group selection unit 314 and the facial features of the first image. Not limited. For example, the facial feature combiner 324, the face region obtainer 325, and/or the synthesizer 326 are managed by the basic face manager 323 using the same or similar method as the above examples. The second image may be obtained based on the facial features of the first image and features of predefined faces of each of the one or more images.

일 실시예에서, 합성부(326)는, 제 2 이미지와 관련된 플래그를 획득(예: 생성)할 수 있다. 예를 들어, 합성부(326)는, 제 2 이미지가 얼굴 인페인팅의 결과 이미지임을 나타내는 플래그 및/또는 제 2 이미지와 관련된 얼굴 인페인팅이 수행되는 동안 선택된 그룹(예: 후술할 동작 405에서 결정된 제 1 그룹)을 나타내는 플래그를 획득할 수 있다. In one embodiment, the synthesis unit 326 may obtain (eg, generate) a flag related to the second image. For example, the synthesis unit 326 may use a flag indicating that the second image is a result image of face inpainting and/or a group selected while face inpainting related to the second image is being performed (eg, determined in operation 405 to be described later). A flag representing the first group) may be obtained.

일 실시예에서, 복원부(320)(예: 합성부(326))는, 제 2 이미지가 획득된 경우, 획득된 제 2 이미지 및 제 2 이미지와 관련된 플래그를 그룹 관리부(310)로 전달할 수 있다.In one embodiment, the restoration unit 320 (eg, the synthesis unit 326), when the second image is obtained, may transfer the obtained second image and a flag related to the second image to the group management unit 310. there is.

다양한 실시예들에 따른 전자 장치(101)는, 복수의 대표 얼굴 특징들 각각에 대응하는 복수의 그룹들을 저장하는 메모리(230), 및 상기 메모리(230)와 전기적으로 연결된 적어도 하나의 프로세서(예: 프로세서(240))를 포함하고, 상기 적어도 하나의 프로세서는, 제 1 이미지를 획득하고, 상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하고, 상기 얼굴의 특징 및 상기 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하고, 상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하고, 및 상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하도록 구성될 수 있다.The electronic device 101 according to various embodiments includes a memory 230 storing a plurality of groups corresponding to each of a plurality of representative facial features, and at least one processor electrically connected to the memory 230 (eg, : a processor 240), wherein the at least one processor obtains a first image, and in the first image, a first area representing a face, a feature of the face, and a first area in the first area A second region requiring restoration is detected, a first group is selected from among the plurality of groups based on the facial features and the plurality of representative facial features, and the representative facial features of the first group and the face are selected. It may be configured to obtain a second image by acquiring a face region in which the second region is reconstructed based on the characteristics of and synthesizing the face region and the first image.

다양한 실시예에서, 상기 얼굴의 특징은 제 1 특징 및 제 2 특징을 포함하고, 상기 제 1 특징은 사람의 얼굴에 고유한 특징을 포함하고, 상기 제 2 특징은 상기 제 1 이미지 획득 시 환경 및/또는 상기 얼굴의 상태를 반영한 특징을 포함할 수 있다.In various embodiments, the facial feature includes a first feature and a second feature, the first feature includes a feature unique to a human face, and the second feature includes an environment and a second feature when the first image is acquired. / or a feature reflecting the state of the face may be included.

다양한 실시예에서, 상기 메모리(230)는 상기 복수의 그룹들 각각에 대응하는 복수의 그룹 정보를 저장하고, 상기 복수의 그룹 정보는, 상기 복수의 대표 얼굴 특징들, 상기 복수의 그룹들 각각에 대응하는 대표 이미지들, 및 그룹 크기들을 포함하고, 상기 복수의 대표 얼굴 특징들은, 상기 복수의 그룹들 각각에서, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여 획득되고, 상기 대표 이미지들은, 상기 복수의 그룹들 각각에서, 상기 동일한 그룹에 포함된 상기 이미지들 중에서, 상기 가중치들 중 가장 높은 가중치를 가지는 이미지이고, 상기 그룹 크기들 각각은, 상기 복수의 그룹들 각각에 대하여, 그룹에 포함된 이미지들의 개수, 또는 상기 메모리(230)에 저장된 전체 이미지들의 개수에 대한 상기 그룹에 포함된 이미지의 개수의 비율이고, 및 상기 가중치들 각각은, 상기 이미지들 각각에서, 얼굴의 각도, 이미지의 해상도, 및/또는 상기 이미지가 얼굴 인페인팅(face inpainting)의 결과 이미지인지 여부에 기반하여, 설정될 수 있다.In various embodiments, the memory 230 stores a plurality of group information corresponding to each of the plurality of groups, and the plurality of group information includes the plurality of representative facial features and each of the plurality of groups. corresponding representative images and group sizes, wherein the plurality of representative facial features are obtained based on first features and weights of faces of images included in the same group in each of the plurality of groups; , The representative images are images having the highest weight among the weights among the images included in the same group in each of the plurality of groups, and each of the group sizes is For , the ratio of the number of images included in the group or the number of images included in the group to the total number of images stored in the memory 230, and each of the weights, in each of the images, It can be set based on the angle of the face, the resolution of the image, and/or whether the image is a result image of face inpainting.

다양한 실시예에서, 상기 전자 장치(101)는 디스플레이(210)를 더 포함하고, 상기 적어도 하나의 프로세서는, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 하나 이상의 후보 그룹들을 결정하고, 상기 디스플레이(210)를 통하여, 상기 대표 이미지들 중에서, 상기 하나 이상의 후보 그룹들에 대응하는 하나 이상의 대표 이미지들을 표시하고, 및 상기 하나 이상의 대표 이미지들 중에서 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 상기 제 1 그룹으로서 선택하도록 구성될 수 있다.In various embodiments, the electronic device 101 further includes a display 210, and the at least one processor, based on the face feature, the plurality of representative facial features, and the group sizes, One or more candidate groups are determined from among the plurality of groups, one or more representative images corresponding to the one or more candidate groups are displayed among the representative images through the display 210, and the one or more representative images are displayed. A group corresponding to a representative image selected based on a user input among images may be selected as the first group.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하고, 상기 유사도들 중에서 지정된 유사도 이상인 유사도가 존재하는지 여부를 결정하고, 및 상기 지정된 유사도 이상인 유사도가 존재하는 경우, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 상기 하나 이상의 후보 그룹들을 결정하도록 구성될 수 있다.In various embodiments, the at least one processor calculates similarities between the facial feature and each of the plurality of representative facial features, determines whether a similarity greater than or equal to a specified similarity exists among the similarities, and When a similarity equal to or greater than the similarity exists, the one or more candidate groups may be determined from among the plurality of groups based on the face feature, the plurality of representative facial features, and the group sizes.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 지정된 유사도 이상인 유사도가 존재하지 않는 경우, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 상기 디스플레이(210)를 통하여 표시하고, 및 상기 하나 이상의 이미지들 중에서 사용자 입력에 기반하여 선택된 이미지를 상기 제 1 그룹으로서 선택하도록 더 구성될 수 있다.In various embodiments, the at least one processor displays one or more images including a predefined face through the display 210 when there is no similarity greater than or equal to the specified similarity, and displays the one or more images It may be further configured to select an image selected based on a user input as the first group.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하고, 및 상기 유사도들 중에서 가장 큰 유사도를 가지는 대표 얼굴 특징에 대응하는 그룹을 상기 제 1 그룹으로서 선택하도록 구성될 수 있다.In various embodiments, the at least one processor calculates similarities between the facial feature and each of the plurality of representative facial features, and selects a group corresponding to the representative facial feature having the greatest similarity among the similarities. may be configured to select as a first group.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 제 1 영역에서 상기 제 2 영역을 제외한 제 3 영역의 상기 제 1 특징 및 상기 제 1 이미지의 제 2 특징과, 상기 제 1 그룹에 대응하는 대표 얼굴 특징을 이용하여, 상기 제 2 영역이 복원된 상기 얼굴 영역을 획득하도록 구성될 수 있다.In various embodiments, the at least one processor may determine the first feature of a third region excluding the second region from the first region and the second feature of the first image, and a representative corresponding to the first group. It may be configured to obtain the facial region in which the second region is reconstructed using facial features.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 메모리(230)에 저장된 복수의 이미지들에 포함된 얼굴 특징들을 검출하고, 상기 검출된 얼굴 특징들에 기반하여, 상기 복수의 이미지들을 상기 복수의 그룹들로 그룹화하고, 및 상기 복수의 그룹들에 대응하는 상기 복수의 그룹 정보를 획득하도록 더 구성될 수 있다.In various embodiments, the at least one processor detects facial features included in a plurality of images stored in the memory 230, and converts the plurality of images into the plurality of images based on the detected facial features. group into groups, and obtain the plurality of group information corresponding to the plurality of groups.

다양한 실시예에서, 상기 적어도 하나의 프로세서는, 상기 제 2 이미지가 획득된 후, 상기 제 2 이미지를 상기 제 1 그룹에 포함시키고, 상기 제 2 이미지에 포함된 얼굴 영역의 특징에 기반하여 상기 제 1 그룹을 갱신하도록 더 구성될 수 있다.In various embodiments, the at least one processor may include the second image in the first group after the second image is obtained, and may include the second image in the first group based on a feature of a face region included in the second image. It can be further configured to update 1 group.

도 4는, 다양한 실시예들에 따른, 이미지를 제공하는 방법을 설명하는 흐름도(400)이다.4 is a flowchart 400 describing a method of presenting an image, according to various embodiments.

일 실시예에서, 도 4는 프로세서(240)(예: 복원부(320))가 이미지에 대한 얼굴 인페인팅을 수행하는 방법을 설명하는 흐름도일 수 있다.In one embodiment, FIG. 4 may be a flowchart illustrating a method of performing face inpainting on an image by the processor 240 (eg, the restoration unit 320).

도 4를 참조하면, 동작 401에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지를 획득할 수 있다. 예를 들어, 프로세서(240)는 카메라 모듈(220)을 통하여 획득된 이미지를 제 1 이미지로서 획득할 수 있다. 다른 예를 들어, 프로세서(240)는, 메모리(230)에 저장된 이미지들 중에서 선택된 이미지(예: 갤러리 어플리케이션과 관련된 이미지들 중에서 사용자에 의해 선택된 이미지)를 제 1 이미지로서 획득할 수 있다. 또 다른 예를 들어, 프로세서(240)는, 외부 전자 장치(예: 서버(108), 전자 장치(102), 전자 장치(104)))로부터 수신된 이미지를 제 1 이미지로서 획득할 수 있다.Referring to FIG. 4 , in operation 401, in an embodiment, the processor 240 may acquire a first image. For example, the processor 240 may acquire an image acquired through the camera module 220 as a first image. For another example, the processor 240 may acquire an image selected from among images stored in the memory 230 (eg, an image selected by a user from among images related to a gallery application) as the first image. For another example, the processor 240 may acquire an image received from an external electronic device (eg, the server 108 , the electronic device 102 , or the electronic device 104 ) as the first image.

일 실시예에서, 제 1 이미지는, 정지 이미지(예: 프리뷰(preview) 이미지가 표시되는 동안 캡쳐(capture) 입력에 의해 획득된 정지 이미지) 및/또는 동적 이미지(예: 동영상, 이미지)를 포함할 수 있다.In one embodiment, the first image includes a still image (eg, a still image obtained by a capture input while a preview image is displayed) and/or a dynamic image (eg, video, image). can do.

동작 403에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역(예: 제 1 이미지에 포함된 얼굴의 전체 영역), 얼굴의 특징, 및 제 1 영역 내에서 복원이 필요한 제 2 영역(예: 제 1 이미지 내에서 가려진 영역)을 검출할 수 있다.In operation 403, in one embodiment, the processor 240 determines, within the first image, a first area representing a face (eg, an entire area of the face included in the first image), features of the face, and the first area. A second region (eg, a region hidden in the first image) that needs to be restored may be detected.

일 실시예에서, 제 2 영역은, 영역 내에서 검출된 특징의 신뢰도가 지정된 신뢰도 이하인 영역일 수 있다. 일 실시예에서, 제 2 영역은, 제 1 영역 내에서, 사람의 얼굴 일부가 마스크 또는 선글라스와 같은 액세서리 및/또는 사람의 손, 머리카락과 같은 인체에 의해 가려진 영역을 포함할 수 있다. 다른 예를 들어, 제 2 영역은, 제 1 영역 내에서 제 1 이미지를 구성하는 데이터의 일부가 소실 및/또는 손상된 영역을 포함할 수 있다. 다만, 제 2 영역의 예시는 전술한 예시들에 제한되지 않는다.In one embodiment, the second region may be a region in which the reliability of a feature detected within the region is less than or equal to a specified reliability level. In an embodiment, the second region may include a region in which a portion of a person's face is covered by an accessory such as a mask or sunglasses and/or a human body such as a person's hand or hair, within the first region. For another example, the second area may include an area in which part of data constituting the first image is lost and/or damaged in the first area. However, examples of the second area are not limited to the above examples.

일 실시예에서, 프로세서(240)는, 인공지능 모델(GAN(generative adversarial network))을 이용하여, 이미지 내에서 얼굴 요소를 검출할 수 있다. 예를 들어, 프로세서(240)는, style GAN 기반 Pixel2Style2Pixel 및/또는 face identity disentanglement를 이용하여, 제 1 이미지 내에서 얼굴 요소를 검출할 수 있다.In an embodiment, the processor 240 may detect facial elements in an image using a generative adversarial network (GAN) model. For example, the processor 240 may detect a face element in the first image using style GAN-based Pixel2Style2Pixel and/or face identity disentanglement.

일 실시예에서, 프로세서(240)는, 얼굴의 특징을, 사람의 얼굴에 고유한 얼굴의 제 1 특징과, 이미지 획득 시 환경 및/또는 얼굴의 상태를 반영한 얼굴의 제 2 특징으로 분류하여 검출할 수 있다.In one embodiment, the processor 240 classifies and detects facial features into a first facial feature unique to a person's face and a second facial feature reflecting the environment and/or facial state at the time of image acquisition. can do.

일 실시예에서, 얼굴의 제 1 특징은, 사람의 얼굴에 고유한(예: 모든 사람이 공통적으로 가진), 귀, 눈, 코, 및 입의 형태, 피부 톤(tone), 및/또는 수염의 형태를 포함할 수 있다. 다만, 얼굴의 제 1 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the first feature of the face is the shape of the ears, eyes, nose, and mouth, skin tone, and/or facial hair that is unique to a person's face (eg, that all people have in common). may include the form of However, the first feature of the face is not limited to the above examples.

일 실시예에서, 얼굴의 제 2 특징은, 이미지 획득 시 환경(예: 피사체의 주변의 조명(또는 밝기)) 및/또는 이미지 획득 시 사람(피사체)의 상태(예: 사람의 자세, 사람의 표정)와 같이, 이미지 획득 시 마다 변경될 수 있는 특징을 포함할 수 있다. 예를 들어, 얼굴의 제 2 특징은, 이미지 획득 시 전자 장치(101)(예: 카메라 모듈(220))에 대한 얼굴의 상대적인 방향을 포함할 수 있다. 다만, 얼굴의 제 2 특징은 전술한 예시들에 제한되지 않는다.In one embodiment, the second feature of the face may be the environment at the time of image acquisition (eg, the lighting (or brightness) of the subject's surroundings) and/or the state of the person (subject) at the time of image acquisition (eg, the person's posture, the person's facial expression), it may include features that can change each time an image is acquired. For example, the second feature of the face may include a relative direction of the face to the electronic device 101 (eg, the camera module 220) when acquiring an image. However, the second feature of the face is not limited to the above examples.

일 실시예에서, 프로세서(240)는, 제 1 이미지의 제 1 특징을 제 2 영역의 제 1 특징 및 제 3 영역(예: 얼굴 영역 내에서 복원이 필요한 제 2 영역을 제외한 영역, 또는 얼굴 영역 내에서 가려지지 않은 영역)의 제 1 특징으로 분류하여 검출할 수 있다.In one embodiment, the processor 240 converts the first feature of the first image into the first feature of the second area and the third area (eg, a face area excluding the second area requiring reconstruction, or a face area). It can be detected by classifying it as the first feature of the unoccluded region within the region).

일 실시예에서, 프로세서(240)는, 제 1 이미지 내에서 얼굴이 존재하는지 여부 및/또는 제 1 영역에 대한 제 2 영역의 비율에 기반하여, 얼굴의 특징을 검출할 수 있다. 이하, 도 5를 참조하여, 프로세서(240)가 제 1 이미지 내에서 얼굴이 존재하는지 여부 및/또는 제 1 영역에 대한 제 2 영역의 비율에 기반하여, 얼굴의 특징을 검출하는 동작에 대하여 설명하도록 한다.In an embodiment, the processor 240 may detect facial features based on whether a face exists in the first image and/or a ratio of the second area to the first area. Hereinafter, referring to FIG. 5 , an operation of the processor 240 detecting facial features based on whether or not a face exists in the first image and/or the ratio of the second area to the first area will be described. let it do

도 5는, 다양한 실시예들에 따른, 얼굴 요소를 검출하는 방법을 설명하는 흐름도(500)이다. 예를 들어, 도 5는, 복원부(320)의 제 2 얼굴 요소 검출부(321)에서 얼굴 요소를 검출하는 방법을 설명하기 위한 흐름도일 수 있다.5 is a flowchart 500 describing a method of detecting facial elements, in accordance with various embodiments. For example, FIG. 5 may be a flowchart for explaining a method of detecting facial elements in the second facial element detecting unit 321 of the restoring unit 320 .

도 5를 참조하면, 동작 501에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지 내에서 제 1 영역이 존재하는지 여부를 결정할 수 있다. 예를 들어, 프로세서(240)는, 제 1 이미지 내에서 제 1 영역(얼굴 영역)이 검출되지 않는 경우, 제 1 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정할 수 있다. 프로세서(240)는, 제 1 이미지 내에서 제 1 영역이 검출된 경우, 제 1 이미지 내에서 제 1 영역이 존재하는 것으로 결정할 수 있다. 다른 예를 들어, 프로세서(240)는, 제 1 이미지 내에서 검출된 제 1 영역의 크기(예: 면적)가 지정된 영역의 크기(예: 면적) 보다 작은 경우, 제 1 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정할 수 있다. 프로세서(240)는, 제 1 이미지 내에서 검출된 제 1 영역의 크기가 지정된 영역의 크기 이상인 경우, 제 1 이미지 내에서 제 1 영역이 존재하는 것으로 결정할 수 있다. Referring to FIG. 5 , in operation 501, in an embodiment, the processor 240 may determine whether a first region exists in the first image. For example, when the first area (face area) is not detected in the first image, the processor 240 may determine that the first area does not exist in the first image. When the first area is detected in the first image, the processor 240 may determine that the first area exists in the first image. As another example, the processor 240 may, when the size (eg area) of the first region detected in the first image is smaller than the size (eg area) of the designated region, the first region in the first image It can be determined that this does not exist. The processor 240 may determine that the first region exists in the first image when the size of the first region detected in the first image is greater than or equal to the size of the designated region.

일 실시예에서, 프로세서(240)는, 동작 501에서 제 1 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정된 경우, 제 1 이미지에 대한 얼굴 인페인팅을 위한 동작(예: 동작 405 내지 동작 409)을 수행하지 않을 수 있다.In one embodiment, when it is determined in operation 501 that the first region does not exist in the first image, the processor 240 performs an operation for face inpainting on the first image (eg, operations 405 to 409). may not perform.

동작 503에서, 일 실시예에서, 프로세서(240)는, 동작 501에서 제 1 이미지 내에서 제 1 영역이 존재하는 것으로 결정된 경우, 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 이상인지 여부를 확인할 수 있다.In operation 503, in one embodiment, if it is determined in operation 501 that the first area exists in the first image, the processor 240 determines whether the ratio of the second area to the first area is greater than or equal to the specified ratio. You can check.

일 실시예에서, 프로세서(240)는, 동작 503에서 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인 것으로 확인된 경우, 제 1 이미지에 대한 얼굴 인페인팅을 위한 동작(예: 동작 405 내지 동작 409)을 수행하지 않을 수 있다.In an embodiment, when it is determined in operation 503 that the ratio of the second area to the first area is less than a specified ratio, the processor 240 performs an operation for face inpainting on the first image (eg, operations 405 to 405). Operation 409) may not be performed.

동작 505에서, 일 실시예에서, 프로세서(240)는, 동작 503에서 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 이상인 것으로 확인된 경우, 제 1 이미지 내에서 얼굴의 특징을 검출할 수 있다.In operation 505, in one embodiment, the processor 240 may detect facial features in the first image when it is determined in operation 503 that the ratio of the second area to the first area is greater than or equal to the specified ratio. .

다만, 동작 501 내지 동작 505는 제 1 이미지 내에서 얼굴 요소를 검출하는 동작에 대한 예시들이며, 제 1 이미지 내에서 얼굴 요소를 검출하는 동작은 이에 제한되지 않는다. 예를 들어, 프로세서(240)는, 제 1 영역에 대한 제 2 영역의 비율과 무관하게(예: 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인 경우에도), 제 1 이미지 내에서 얼굴의 특징을 검출할 수 있다.However, operations 501 to 505 are examples of operations for detecting facial elements within the first image, and operations for detecting facial elements within the first image are not limited thereto. For example, the processor 240 extracts a face from the first image regardless of the ratio of the second area to the first area (eg, even when the ratio of the second area to the first area is less than a specified ratio). features can be detected.

동작 405에서, 일 실시예에서, 프로세서(240)는, 얼굴의 특징 및 복수의 대표 얼굴 특징들에 기반하여, 복수의 그룹들 중에서 제 1 그룹을 선택할 수 있다.In operation 405, in one embodiment, the processor 240 selects a first group from among the plurality of groups based on the facial feature and the plurality of representative facial features.

일 실시예에서, 프로세서(240)는, 복수의 그룹들에 대한 그룹 정보에 기반하여, 제 1 이미지에 포함된 얼굴 영역(예: 제 2 영역)을 복원하기 위한 제 1 그룹을 선택할 수 있다.In an embodiment, the processor 240 may select a first group for reconstructing a face region (eg, a second region) included in the first image, based on group information about a plurality of groups.

일 실시예에서, 복수의 그룹들 각각에 대한 그룹 정보는, 복수의 그룹들 각각의 그룹 특징(대표 얼굴 특징), 그룹의 대표 이미지, 및/또는 그룹의 크기를 포함할 수 있다.In an embodiment, the group information for each of the plurality of groups may include a group feature (representative facial feature) of each of the plurality of groups, a representative image of the group, and/or a size of the group.

일 실시예에서, 그룹 특징은, 전술한 [수학식 1]과 같이, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들에 대한 가중 평균을 이용하여, 산출될 수 있다. 일 실시예에서, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지 내에서 얼굴의 각도, 이미지의 해상도, 및/또는 이미지가 얼굴 인페인팅의 결과 이미지인지 여부에 기반하여, 가중치들이 설정(예: 부여)될 수 있다.In one embodiment, the group feature may be calculated using a weighted average of first face features of images included in the same group, as in [Equation 1] described above. In one embodiment, for one or more images belonging to the same group, weights are set (e.g., based on the angle of a face in the image, the resolution of the image, and/or whether the image is a result image of face inpainting). can be granted).

일 실시예에서, 그룹의 대표 이미지는, 동일한 그룹에 포함된 이미지들 중에서, 가장 높은 가중치를 가지는 이미지(예: 가장 높은 가중치가 설정된 이미지)가, 그룹의 대표 이미지로 결정(예: 설정)될 수 있다.In one embodiment, among images included in the same group, an image having the highest weight (eg, an image with the highest weight set) is determined (eg, set) as the representative image of the group. can

일 실시예에서, 그룹의 크기는, 복수의 그룹들 각각에 포함된 이미지들의 개수(예: 해당 그룹에 포함된 이미지의 개수), 또는 메모리(230)에 저장된 전체 이미지들의 개수(또는 복수의 그룹들에 포함된 전체 이미지들의 개수)에 대한 해당 그룹에 포함된 이미지의 개수의 비율이, 해당 그룹의 크기로서 결정(예: 설정)될 수 있다.In one embodiment, the size of the group may be the number of images included in each of a plurality of groups (eg, the number of images included in the corresponding group), or the total number of images stored in the memory 230 (or a plurality of groups). A ratio of the number of images included in the corresponding group to the total number of images included in the corresponding group may be determined (eg, set) as the size of the corresponding group.

이하, 도 6 내지 도 8을 참조하여, 프로세서(240)가 복수의 그룹들 중에서 제 1 그룹(또는 미리 정의된 얼굴)을 선택하는 방법들에 대하여 설명하도록 한다.Hereinafter, with reference to FIGS. 6 to 8 , methods for the processor 240 to select a first group (or a predefined face) from among a plurality of groups will be described.

도 6은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하는 방법을 설명하는 흐름도(600)이다.6 is a flowchart 600 describing a method of selecting a group from among a plurality of groups, according to various embodiments.

도 6을 참조하면, 동작 601에서, 일 실시예에서, 프로세서(240)는, 복수의 그룹들에 대한 정보(예: 복수의 그룹들 각각에 대한 그룹 정보)를 획득할 수 있다. 프로세서(240)가 복수의 그룹들에 대한 정보를 획득하는 동작에 대해서는 전술한 바 있으므로, 상세한 설명은 생략하기로 한다.Referring to FIG. 6 , in operation 601, in an embodiment, the processor 240 may obtain information about a plurality of groups (eg, group information about each of a plurality of groups). Since the operation of obtaining information on a plurality of groups by the processor 240 has been described above, a detailed description thereof will be omitted.

동작 603에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지에 포함된 얼굴의 특징 및 복수의 대표 얼굴 특징들을 비교함으로써, 복수의 그룹들 중에서 하나 이상의 후보 그룹들을 결정할 수 있다.In operation 603, the processor 240 may determine one or more candidate groups from among the plurality of groups by comparing the facial features included in the first image and the plurality of representative facial features.

일 실시예에서, 프로세서(240)는, 제 1 이미지의 얼굴의 제 1 특징 및 복수의 그룹들에 대응하는 그룹 특징들(예: 대표 얼굴 특징들) 각각 간 유사도들, 및/또는 복수의 그룹들의 그룹 크기들에 기반하여, 하나 이상의 후보 그룹들을 결정할 수 있다. In one embodiment, the processor 240 determines the similarities between the first feature of the face of the first image and group features (eg, representative facial features) corresponding to the plurality of groups, and/or the plurality of groups. Based on the group sizes of s, one or more candidate groups may be determined.

일 실시예에서, 프로세서(240)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서, 제 1 이미지의 얼굴의 제 3 영역(예: 얼굴 영역 내에서 복원이 필요한 제 2 영역을 제외한 영역, 또는 얼굴 영역 내에서 가려지지 않은 영역)의 제 1 특징에 대응하는 특징들(예: 대표 얼굴 특징에서 제 1 이미지의 가려지지 않은 영역에 대응하는 얼굴 부위의 특징)을 확인할 수 있다. 예를 들어, 프로세서(240)는, 제 1 이미지의 얼굴의 제 3 영역이 대표 얼굴 특징으로서, 귀, 눈, 및 코의 형태를 포함하는 경우(예: 제 1 이미지 내에서 입이 마스크에 의해 가려진 경우), 각각 귀, 눈, 코, 및/또는 입의 형태를 포함하는 대표 얼굴 특징들에서, 입의 형태를 제외한(예: 대표 얼굴 특징들 각각에서, 제 1 이미지 내에서 마스크에 의해 가려진 입에 대응하는 입의 형태를 제외한), 귀, 눈, 및 코의 형태를 확인할 수 있다.In an embodiment, the processor 240 selects a third region of the face of the first image (eg, a region excluding the second region that needs to be restored within the face region), among the representative facial features corresponding to the plurality of groups. , or a non-occluded area within the facial area) corresponding to the first feature (eg, a feature of a facial part corresponding to the non-occluded area of the first image in the representative facial features) may be identified. For example, the processor 240 may determine if the third region of the face of the first image includes the shape of ears, eyes, and nose as representative facial features (eg, the mouth in the first image is masked by a mask). occluded), from representative facial features including the shape of the ears, eyes, nose, and/or mouth, respectively, excluding the shape of the mouth (e.g., from each of the representative facial features, occluded by a mask in the first image). Except for the shape of the mouth corresponding to the mouth), the shape of the ears, eyes, and nose can be confirmed.

일 실시예에서, 프로세서(240)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들을 산출할 수 있다.In an embodiment, the processor 240 may select features corresponding to the first feature of the third region of the face of the first image among the representative facial features respectively corresponding to the plurality of groups, and the face of the first image. It is possible to calculate similarities between the first features of the third area of .

일 실시예에서, 프로세서(240)는, 상기 산출된 유사도들 및/또는 복수의 그룹들의 그룹 크기들에 기반하여, 하나 이상의 후보 그룹들을 결정할 수 있다. 예를 들어, 프로세서(240)는, 상기 산출된 유사도가 지정된 유사도 이상이고 그룹 크기가 지정된 크기 이상인 하나 이상의 후보 그룹들을 결정할 수 있다.In an embodiment, the processor 240 may determine one or more candidate groups based on the calculated similarities and/or group sizes of the plurality of groups. For example, the processor 240 may determine one or more candidate groups whose calculated similarity is greater than or equal to a specified similarity and whose group size is greater than or equal to a specified size.

일 실시예에서, 프로세서(240)가 상기 산출된 유사도들에 기반하여 하나 이상의 후보 그룹들을 결정함으로써, 제 1 이미지의 얼굴과 유사한 얼굴을 포함하는 이미지에 기반하여, 얼굴 인페인팅 동작을 수행할 수 있다. 일 실시예에서, 프로세서(240)가 복수의 그룹들의 그룹 크기들에 기반하여 하나 이상의 후보 그룹들을 결정함으로써, 다른 그룹에 비하여 촬영 빈도가 높았던 그룹의 이미지에 기반하여 얼굴 인페인팅 동작을 수행할 수 있다.In an embodiment, the processor 240 may perform a face inpainting operation based on an image including a face similar to that of the first image by determining one or more candidate groups based on the calculated similarities. there is. In an embodiment, the processor 240 may determine one or more candidate groups based on the group sizes of the plurality of groups, thereby performing a face inpainting operation based on an image of a group whose photographing frequency was higher than that of other groups. there is.

다만, 하나 이상의 그룹들을 결정하는 방법은 전술한 예시에 제한되지 않는다. 예를 들어, 프로세서(240)는, 그룹의 크기를 고려함 없이, 상기 유사도들 중에서 높은 유사도를 가지는 하나 이상의 후보 그룹들을 결정할 수 있다. However, a method of determining one or more groups is not limited to the above-described example. For example, the processor 240 may determine one or more candidate groups having a high similarity among the similarities without considering the size of the group.

동작 605에서, 일 실시예에서, 프로세서(240)는, 하나 이상의 후보 그룹들의 대표 이미지들을 디스플레이(210)를 통하여 표시할 수 있다. 예를 들어, 프로세서(240)는, 상기 결정된 하나 이상의 후보 그룹들에 각각 대응하는 대표 이미지들을 디스플레이(210)를 통하여 표시할 수 있다. In operation 605 , in one embodiment, the processor 240 may display representative images of one or more candidate groups through the display 210 . For example, the processor 240 may display representative images respectively corresponding to the determined one or more candidate groups through the display 210 .

동작 607에서, 일 실시예에서, 사용자 입력에 기반하여, 하나 이상의 후보 그룹들 중에서 제 1 그룹을 선택할 수 있다. 예를 들어, 프로세서(240)는, 디스플레이(210)를 통하여 상기 하나 이상의 후보 그룹들에 대응하는 대표 이미지들을 표시하는 동안, 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 제 1 이미지의 얼굴 인페인팅을 위한 제 1 그룹으로서 선택할 수 있다.In operation 607 , in one embodiment, a first group may be selected from one or more candidate groups based on a user input. For example, while displaying representative images corresponding to the one or more candidate groups through the display 210, the processor 240 selects a group corresponding to a representative image selected based on a user input as a face of the first image. It can be selected as the first group for inpainting.

도 7은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하거나 미리 정의된 얼굴을 포함하는 이미지를 선택하는 방법을 설명하는 흐름도(700)이다.7 is a flowchart 700 illustrating a method of selecting a group or selecting an image including a predefined face from among a plurality of groups, according to various embodiments.

도 7을 참조하면, 동작 701에서, 일 실시예에서, 프로세서(240)는, 복수의 그룹들에 대한 정보(예: 복수의 그룹들 각각에 대한 그룹 정보)를 획득할 수 있다. 동작 701은, 동작 601과 적어도 일부가 동일 또는 유사하므로, 상세한 설명은 생략하기로 한다.Referring to FIG. 7 , in operation 701, in an embodiment, the processor 240 may obtain information about a plurality of groups (eg, group information about each of a plurality of groups). Since operation 701 is at least partially the same as or similar to operation 601, a detailed description thereof will be omitted.

동작 703에서, 일 실시예에서, 프로세서(240)는, 복수의 대표 얼굴 특징들 중에서, 제 1 이미지에 포함된 얼굴의 특징(예: 얼굴의 제 1 특징)에 대응하는 대표 얼굴 특징이 존재하는지 여부를 결정할 수 있다.In operation 703, in one embodiment, the processor 240 determines whether a representative facial feature corresponding to a facial feature (eg, a first facial feature) included in the first image exists among a plurality of representative facial features. can decide whether

일 실시예에서, 프로세서(240)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들을 산출할 수 있다.In an embodiment, the processor 240 may select features corresponding to the first feature of the third region of the face of the first image among the representative facial features respectively corresponding to the plurality of groups, and the face of the first image. It is possible to calculate similarities between the first features of the third area of .

일 실시예에서, 프로세서(240)는, 상기 유사도들이 모두 지정된 유사도 미만인 경우, 제 1 이미지에 포함된 얼굴의 특징에 대응하는 대표 얼굴 특징이 존재하지 않는 것으로 결정할 수 있다. 프로세서(240)는, 상기 유사도들 중에서 지정된 유사도 이상인 유사도가 존재하는 경우, 제 1 이미지에 포함된 얼굴의 특징에 대응하는 대표 얼굴 특징이 존재하는 것으로 결정할 수 있다.In one embodiment, the processor 240 may determine that a representative facial feature corresponding to a facial feature included in the first image does not exist when all of the similarities are less than a specified similarity. The processor 240 may determine that a representative facial feature corresponding to a facial feature included in the first image exists when a similarity level greater than or equal to a designated similarity level exists among the similarities.

동작 703에서 제 1 이미지에 포함된 얼굴에 대응하는 대표 얼굴 특징이 존재하는 것으로 결정된 경우, 동작 705에서, 일 실시예에서, 프로세서(240)는, 복수의 그룹들 중 하나 이상의 후보 그룹들을 결정할 수 있다. 예를 들어, 프로세서(240)는, 제 1 이미지의 얼굴의 제 1 특징 및 복수의 그룹들에 대응하는 그룹 특징들(예: 대표 얼굴 특징들) 각각 간 유사도들, 및/또는 복수의 그룹들의 그룹 크기들에 기반하여, 하나 이상의 후보 그룹들을 결정할 수 있다. When it is determined in operation 703 that there is a representative facial feature corresponding to a face included in the first image, in operation 705, in an embodiment, the processor 240 may determine one or more candidate groups among a plurality of groups. there is. For example, the processor 240 may determine similarities between a first feature of a face of a first image and group features (eg, representative facial features) corresponding to a plurality of groups, and/or values of a plurality of groups. Based on the group sizes, one or more candidate groups may be determined.

동작 707에서, 일 실시예에서, 프로세서(240)는, 하나 이상의 후보 그룹들의 대표 이미지들을 디스플레이(210)를 통하여 표시할 수 있다. 예를 들어, 프로세서(240)는, 상기 결정된 하나 이상의 후보 그룹들에 각각 대응하는 대표 이미지들을 디스플레이(210)를 통하여 표시할 수 있다.In operation 707 , in one embodiment, the processor 240 may display representative images of one or more candidate groups through the display 210 . For example, the processor 240 may display representative images respectively corresponding to the determined one or more candidate groups through the display 210 .

동작 709에서, 일 실시예에서, 사용자 입력에 기반하여, 하나 이상의 후보 그룹들 중에서 제 1 그룹을 선택할 수 있다. 예를 들어, 프로세서(240)는, 디스플레이(210)를 통하여 상기 하나 이상의 후보 그룹들에 대응하는 대표 이미지들을 표시하는 동안, 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 제 1 이미지의 얼굴 인페인팅을 위한 제 1 그룹으로서 선택할 수 있다.In operation 709 , in one embodiment, a first group may be selected from one or more candidate groups based on a user input. For example, while displaying representative images corresponding to the one or more candidate groups through the display 210, the processor 240 selects a group corresponding to a representative image selected based on a user input as a face of the first image. It can be selected as the first group for inpainting.

동작 703에서 제 1 이미지에 포함된 얼굴에 대응하는 대표 얼굴 특징이 존재하지 않는 것으로 결정된 경우, 동작 711에서, 일 실시예에서, 프로세서(240)는, 미리 정의된 얼굴(예: 마네킹(mannequin) 모델의 얼굴, 연예인의 얼굴, 사람의 일반적인 얼굴)을 포함하는 하나 이상의 이미지들을 디스플레이(210)를 통하여 표시할 수 있다.If it is determined in operation 703 that there is no representative facial feature corresponding to the face included in the first image, in operation 711, in one embodiment, the processor 240 selects a predefined face (eg, a mannequin). One or more images including a face of a model, a face of an entertainer, and a general face of a person may be displayed through the display 210 .

일 실시예에서, 프로세서(240)는, 제 1 이미지에 포함된 얼굴에 대응하는 대표 얼굴 특징이 존재하지 않는 것으로 결정된 경우, 제 1 이미지에 포함된 얼굴에 대응하는 대표 얼굴 특징이 존재하지 않음을 나타내는 정보(예: 메시지(message))를 디스플레이(210)를 통하여 표시할 수 있다.In one embodiment, the processor 240 determines that there is no representative facial feature corresponding to the face included in the first image when it is determined that there is no representative facial feature corresponding to the face included in the first image. Indicated information (eg, a message) may be displayed through the display 210 .

동작 713에서, 일 실시예에서, 프로세서(240)는, 사용자 입력에 기반하여, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들 중에서, 제 1 이미지의 얼굴 인페인팅을 위하여 이용될 이미지(예: 하나의 이미지)를 선택할 수 있다. 예를 들어, 프로세서(240)는, 사용자 입력에 기반하여, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들 중에서, 선택된 이미지를 제 1 그룹으로서 선택할 수 있다In operation 713, in one embodiment, the processor 240 selects an image (eg, one image to be used for face inpainting of the first image) from among one or more images including a predefined face, based on the user input. image) can be selected. For example, the processor 240 may select, as a first group, a selected image from among one or more images including a predefined face, based on a user input.

도 8은, 다양한 실시예들에 따른, 복수의 그룹들 중에서 그룹을 선택하는 방법을 설명하는 흐름도(800)이다.8 is a flowchart 800 describing a method of selecting a group from among a plurality of groups, according to various embodiments.

도 8을 참조하면, 동작 801에서, 일 실시예에서, 프로세서(240)는, 복수의 그룹들에 대한 정보(예: 복수의 그룹들 각각에 대한 그룹 정보)를 획득할 수 있다. 동작 801은, 동작 601과 적어도 일부가 동일 또는 유사하므로, 상세한 설명은 생략하기로 한다.Referring to FIG. 8 , in operation 801, in an embodiment, the processor 240 may obtain information about a plurality of groups (eg, group information about each of a plurality of groups). Since operation 801 is at least partially the same as or similar to operation 601, a detailed description thereof will be omitted.

동작 803에서, 일 실시예에서, 프로세서(240)는, 얼굴의 특징 및 복수의 대표 얼굴 특징들을 비교함으로써, 복수의 그룹들 중에서 제 1 그룹을 선택할 수 있다.At operation 803, in one embodiment, the processor 240 may select a first group from among the plurality of groups by comparing the facial features and the plurality of representative facial features.

일 실시예에서, 프로세서(240)는, 복수의 그룹들에 각각 대응하는 대표 얼굴 특징들 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징들 각각과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도들을 산출할 수 있다. 프로세서(240)는, 상기 유사도들 중에서 가장 큰 유사도를 가지는 그룹(예: 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징에 대응하는 특징과, 제 1 이미지의 얼굴의 제 3 영역의 제 1 특징 간 유사도가 가장 큰 그룹)을 제 1 이미지의 얼굴 인페인팅을 위한 제 1 그룹으로서 선택할 수 있다.In an embodiment, the processor 240 may select features corresponding to the first feature of the third region of the face of the first image among the representative facial features respectively corresponding to the plurality of groups, and the face of the first image. It is possible to calculate similarities between the first features of the third area of . The processor 240 selects a group having the greatest similarity among the similarities (e.g., a feature corresponding to the first feature of the third area of the face of the first image among the representative facial features of the group and the face of the first image). A group having the greatest similarity between the first features of the third region) may be selected as the first group for face inpainting of the first image.

동작 407에서, 일 실시예에서, 프로세서(240)는, 제 1 그룹의 대표 얼굴 특징 및 얼굴의 특징에 기반하여, 제 1 이미지의 제 2 영역이 복원된 얼굴 영역을 획득할 수 있다.In operation 407, according to an embodiment, the processor 240 may obtain a facial region in which the second region of the first image is reconstructed, based on the representative facial features and facial features of the first group.

동작 409에서, 일 실시예에서, 프로세서(240)는, 동작 407에서 제 2 영역이 복원된 얼굴 영역 및 제 1 이미지를 합성함으로써, 제 2 이미지(제 2 영역이 복원된 얼굴 영역을 포함하는 결과 이미지)를 획득할 수 있다.In operation 409, in one embodiment, the processor 240 generates a second image (a result in which the second area includes the reconstructed face area) by synthesizing the first image and the second area of the reconstructed face area in operation 407. image) can be obtained.

이하, 도 9를 참조하여, 동작 407 및 동작 409에 대하여, 상세히 설명하도록 한다.Hereinafter, operations 407 and 409 will be described in detail with reference to FIG. 9 .

도 9는, 다양한 실시예들에 따른, 제 2 이미지를 획득하는 방법을 설명하는 흐름도(900)이다.9 is a flowchart 900 describing a method of obtaining a second image, according to various embodiments.

도 9를 참조하면, 동작 901에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지의 제 3 영역의 특징 및 제 1 그룹(동작 405를 통하여 선택된 제 1 그룹)의 대표 얼굴 특징을 확인할 수 있다. 예를 들어, 프로세서(240)는, 제 1 이미지의 제 3 영역(예: 제 1 이미지 내에서 가려지지 않은 제 3 영역)의 제 1 특징 및 제 2 특징과, 제 1 그룹에 대응하는 대표 얼굴 특징(예: 제 1 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 특징)을 확인할 수 있다.Referring to FIG. 9 , in operation 901, in one embodiment, the processor 240 determines features of a third region of the first image and representative facial features of a first group (the first group selected through operation 405). can For example, the processor 240 may determine the first and second features of a third region of the first image (eg, a third region that is not covered in the first image) and a representative face corresponding to the first group. A feature (eg, a feature corresponding to the second area of the first image among the representative facial features of the first group) may be identified.

동작 903에서, 일 실시예에서, 프로세서(240)는, 제 1 이미지의 제 3 영역의 특징 및 제 1 그룹의 대표 얼굴 특징을 이용하여, 제 1 이미지의 제 2 영역이 복원된 얼굴 영역을 획득할 수 있다.In operation 903, in one embodiment, the processor 240 obtains a face region in which the second region of the first image is reconstructed using the features of the third region of the first image and the representative facial features of the first group. can do.

일 실시예에서, 프로세서(240)는, 제 1 그룹의 대표 얼굴 특징 및 제 1 이미지의 얼굴 특징을 결합하여, 제 1 이미지의 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징을 획득할 수 있다.In an embodiment, the processor 240 combines the representative facial features of the first group and the facial features of the first image to obtain facial features to obtain a facial region from which a second region of the first image is reconstructed. can do.

일 실시예에서, 프로세서(240)는, 제 1 이미지의 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징과, 선택된 제 1 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징을 결합함으로써, 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징을 구성할 수 있다. 예를 들어, 프로세서(240)는, 제 1 이미지 내에서 가려지지 않은 제 3 영역의 제 1 특징(예: 제 1 이미지 내에서 코 및 입이 가려진 경우, 제 1 이미지 내에서 가려지지 않은 귀 및 눈의 형태), 제 1 이미지의 제 2 특징(예: 귀 및 눈이 향하는 방향, 표정, 및 주변 조명)과, 제 1 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징(예: 코 및 입의 형태)을 결합하여, 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징을 구성할 수 있다.In an embodiment, the processor 240 may correspond to a first feature of a third region of the first image, a second feature of the first image, and a second region of the first image among the selected representative facial features of the first group. By combining the first features of the second region, it is possible to configure facial features for obtaining a face region in which the second region is reconstructed. For example, the processor 240 determines the first feature of the third region that is not occluded in the first image (eg, if the nose and mouth are occluded in the first image, the ears and shape of the eyes), second features of the first image (eg, direction of ears and eyes, facial expression, and ambient lighting) and representative facial features of the first group corresponding to the second area of the first image. By combining features (eg, nose and mouth shapes), facial features may be configured to obtain a face region in which the second region is reconstructed.

일 실시예에서, 프로세서(240)는, 제 2 영역이 복원된 얼굴 영역을 획득하기 위한 얼굴의 특징에 기반하여, 인공신경망(예: GAN)을 이용하여, 제 2 영역이 복원된 얼굴 영역을 획득할 수 있다. 예를 들어, 프로세서(240)는, 인공 신경망으로, 제 1 이미지 내에서 가려지지 않은 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징과, 제 1 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 제 1 특징을 입력할 수 있다. 프로세서(240)는, 인공 신경망의 출력 이미지의 제 3 영역(예: 인공 신경망의 출력 이미지 내에서 제 1 이미지의 제 3 영역에 대응하는 영역)이 제 1 이미지의 제 3 영역의 제 1 특징 및 제 1 이미지의 제 2 특징이 적용된 결과이고, 인공 신경망의 출력 이미지의 제 2 영역(예: 인공 신경망의 출력 이미지 내에서 제 1 이미지의 제 2 영역에 대응하는 영역)이 제 1 그룹의 대표 얼굴 특징 중에서 제 1 이미지의 제 2 영역에 대응하는 특징 및 제 1 이미지의 제 2 특징이 적용된 결과인, 얼굴 영역을 포함하는 출력 이미지를 획득할 수 있다.In an embodiment, the processor 240 determines the facial region from which the second region is reconstructed, using an artificial neural network (eg, GAN), based on facial features for acquiring the face region from which the second region is reconstructed. can be obtained For example, the processor 240, by means of an artificial neural network, selects a first feature of a third area that is not covered in a first image, a second feature of the first image, and a first image among representative facial features of the first group. A first feature corresponding to the second area of can be input. The processor 240 determines that the third area of the output image of the artificial neural network (eg, the area corresponding to the third area of the first image in the output image of the artificial neural network) is the first feature of the third area of the first image and It is the result of applying the second feature of the first image, and the second area of the output image of the artificial neural network (eg, the area corresponding to the second area of the first image within the output image of the artificial neural network) is the representative face of the first group. Among the features, a feature corresponding to the second region of the first image and an output image including the face region as a result of applying the second feature of the first image may be obtained.

동작 905에서, 일 실시예에서, 프로세서(240)는, 얼굴 영역(예: 인공 신경망의 출력 이미지) 및 제 1 이미지를 합성함으로써, 제 2 영역이 복원된 얼굴 영역을 포함하는 제 2 이미지를 획득할 수 있다. 예를 들어, 프로세서(240)는, 인공 신경망의 출력 이미지 내에서 얼굴 영역을 추출(예: 크롭(crop))하고, 제 1 이미지 내에서 얼굴 영역을 제외한 나머지 영역을 추출한 후, 상기 추출된 얼굴 영역 및 상기 나머지 영역을 결합(예: 스티칭(stitching))함으로써, 제 2 이미지를 획득할 수 있다.In operation 905, in one embodiment, the processor 240 obtains a second image including the reconstructed face region by synthesizing the face region (eg, an output image of the artificial neural network) and the first image. can do. For example, the processor 240 extracts (eg, crops) a face region from an output image of the artificial neural network, extracts the remaining region except for the face region from the first image, and then extracts the extracted face. The second image may be obtained by combining (eg, stitching) the area and the remaining area.

일 실시예에서, 전술한 예시들에서는, 프로세서(240)가 제 1 그룹의 대표 얼굴 특징 및 제 1 이미지의 얼굴 특징에 기반하여, 제 2 이미지를 획득하는 동작을 예시하고 있지만, 이에 제한되지 않는다. 예를 들어, 프로세서(240)는, 전술한 예시들과 동일 또는 유사한 방식을 이용하여, 동작 713을 통하여 선택된, 미리 정의된 얼굴을 포함하는 이미지의 미리 정의된 얼굴의 특징 및 제 1 이미지의 얼굴 특징에 기반하여, 제 2 이미지를 획득할 수 있다.In one embodiment, in the above examples, the processor 240 illustrates an operation of acquiring a second image based on the representative facial features of the first group and the facial features of the first image, but is not limited thereto. . For example, the processor 240, using the same or similar method as the foregoing examples, selects through operation 713 a predefined face feature of an image including a predefined face and a face of the first image. Based on the feature, a second image may be obtained.

일 실시예에서, 프로세서(240)는, 제 2 이미지와 관련된 플래그를 획득(예: 생성)할 수 있다. 예를 들어, 프로세서(240)는, 제 2 이미지가 얼굴 인페인팅의 결과 이미지임을 나타내는 플래그 및/또는 제 2 이미지와 관련된 얼굴 인페인팅이 수행되는 동안 선택된 그룹(예: 동작 405에서 결정된 제 1 그룹)을 나타내는 플래그를 획득할 수 있다. In one embodiment, the processor 240 may obtain (eg, generate) a flag related to the second image. For example, the processor 240 may set a flag indicating that the second image is a result image of face inpainting and/or a group selected while performing face inpainting related to the second image (eg, the first group determined in operation 405). ) can be obtained.

도 4에 도시하지는 않았지만, 일 실시예에서, 프로세서(240)는, 제 2 이미지가 획득된 경우, 제 2 이미지 및 제 2 이미지와 관련된 플래그를 메모리(230)에 저장할 수 있다. 일 실시예에서, 프로세서(240)는, 제 2 이미지가 획득된 경우, 제 2 이미지를 디스플레이(210)를 통하여 표시할 수 있다.Although not shown in FIG. 4 , in one embodiment, when the second image is obtained, the processor 240 may store the second image and a flag related to the second image in the memory 230 . In one embodiment, the processor 240 may display the second image through the display 210 when the second image is acquired.

도 10은, 다양한 실시예들에 따른, 제 2 이미지를 획득하는 방법을 설명하는 예시도(1000)이다.10 is an exemplary diagram 1000 illustrating a method of obtaining a second image, according to various embodiments.

도 10을 참조하면, 일 실시예에서, 이미지 1(1010)은 복원이 필요한 제 2 영역을 포함하는 제 1 영역(1011)이 검출되는 이미지를 나타낼 수 있다.Referring to FIG. 10 , in one embodiment, image 1 1010 may represent an image in which a first region 1011 including a second region requiring restoration is detected.

일 실시예에서, 프로세서(240)는, 이미지 1(1010)로부터 검출된, 제 1 영역(1021)에 대응하는 제 1 영역(1021)을 포함하는 이미지 2(1020)(예: 이미지 1(1010)에서 제 1 영역(1021)이 마스킹된(masked) 제 1 영역(1021)을 포함하는 이미지)를 획득할 수 있다.In one embodiment, processor 240 generates image 2 1020 (e.g., image 1 1010) including a first region 1021 corresponding to first region 1021, detected from image 1 1010. ), an image including the first region 1021 in which the first region 1021 is masked) may be obtained.

일 실시예에서, 이미지 3(1030)는, 이미지 1(1010)의 제 2 영역이 복원된 얼굴 영역(1031)을 포함하는 이미지를 나타낼 수 있다.In one embodiment, image 3 1030 may represent an image including a face region 1031 in which the second region of image 1 1010 is reconstructed.

일 실시예에서, 프로세서(240)는, 이미지 2(1020) 및 이미지 3(1030)에 기반하여, 제 2 영역이 복원된 얼굴 영역(1031)을 포함하는 이미지 4(1040)을 획득할 수 있다. 예를 들어, 프로세서(240)는, 이미지 3(1030) 내에서 이미지 2(1020)의 제 1 영역(1021)에 대응하는 얼굴 영역(1031)을 추출(예: 크롭)함으로써, 제 2 영역이 복원된 얼굴 영역(1031)을 포함하는 이미지 4(1040)을 획득할 수 있다.In an embodiment, the processor 240 may obtain image 4 1040 including the face region 1031 in which the second region is reconstructed, based on image 2 1020 and image 3 1030. . For example, the processor 240 extracts (eg, crops) the face region 1031 corresponding to the first region 1021 of image 2 1020 from image 3 1030 to obtain a second region. Image 4 1040 including the reconstructed face region 1031 may be obtained.

일 실시예에서, 프로세서(240)는, 이미지 1(1010) 및 이미지 4(1040)을 합성함으로써, 이미지 5(결과 이미지)(1050)을 획득할 수 있다. 예를 들어, 프로세서(240)는, 이미지 1(1010) 내에서 제 1 영역(1011)을 제외한 나머지 영역(예: 몸통(1012)을 포함하는 영역) 및 이미지 4(1040) 내에서 얼굴 영역(1031)을 결합(예: 스티칭(stitching))함으로써, 이미지 5(결과 이미지)(1050)을 획득할 수 있다.In one embodiment, the processor 240 may obtain image 5 (result image) 1050 by compositing image 1 1010 and image 4 1040 . For example, the processor 240 may perform other regions except for the first region 1011 in image 1 (1010) (eg, a region including the torso 1012) and a face region (in image 4 1040). 1031) may be combined (eg, stitched) to obtain image 5 (result image) 1050.

도 11은, 다양한 실시예들에 따른, 복수의 그룹들을 관리하는 방법을 설명하는 흐름도(1100)이다.11 is a flowchart 1100 describing a method of managing a plurality of groups, according to various embodiments.

일 실시예에서, 도 11은 프로세서(240)(예: 그룹 관리부(310))가 복수의 그룹들을 획득하고, 복수의 그룹들에 대한 그룹 정보를 획득하는 방법을 설명하는 흐름도일 수 있다.In one embodiment, FIG. 11 may be a flowchart illustrating a method of acquiring a plurality of groups and acquiring group information on the plurality of groups by the processor 240 (eg, the group management unit 310).

도 11을 참조하면, 동작 1101에서, 일 실시예에서, 프로세서(240)는, 메모리(230)에 저장된 복수의 이미지들 각각에 대하여 얼굴 요소를 검출할 수 있다.Referring to FIG. 11 , in operation 1101, in an embodiment, the processor 240 may detect a face element for each of a plurality of images stored in the memory 230.

일 실시예에서, 프로세서(240)는, 메모리(230)에 저장된 모든 이미지들(예: 갤러리 어플리케이션과 관련된 모든 이미지들) 각각에 대하여, 얼굴 요소를 검출할 수 있다. 예를 들어, 프로세서(240)는, 얼굴 인페인팅을 위한 어플리케이션 설치 시(또는 얼굴 인페인팅을 위한 어플리케이션 설치 후, 얼굴 인페인팅을 위한 어플리케이션 실행 시) 또는 주기적으로, 메모리(230)에 저장된 모든 이미지들 각각에 대하여, 얼굴 요소를 검출하는 동작을 수행할 수 있다.In one embodiment, the processor 240 may detect a face element for each of all images stored in the memory 230 (eg, all images related to the gallery application). For example, the processor 240, when the application for face inpainting is installed (or after installing the application for face inpainting, when the application for face inpainting is executed) or periodically, all images stored in the memory 230 For each of them, an operation of detecting a face element may be performed.

일 실시예에서, 프로세서(240)는, 복수의 이미지들 각각(이하, 복수의 이미지들 각각을 '제 3 이미지'로 지칭함)에서, 얼굴을 나타내는 제 1 영역(예: 제 1 이미지에 포함된 얼굴의 전체 영역), 얼굴의 특징, 및 제 1 영역 내에서 복원이 필요한 제 2 영역(예: 제 1 이미지 내에서 가려진 영역)을 검출할 수 있다.In one embodiment, the processor 240, in each of the plurality of images (hereinafter, each of the plurality of images will be referred to as a 'third image'), a first area representing a face (eg, included in the first image) The entire face region), facial features, and a second region requiring restoration within the first region (eg, a region hidden in the first image) may be detected.

일 실시예에서, 프로세서(240)는, 인공지능 모델(GAN(generative adversarial network))을 이용하여, 제 3 이미지 내에서 얼굴 요소를 검출할 수 있다.In an embodiment, the processor 240 may detect a face element in the third image using a generative adversarial network (GAN) model.

일 실시예에서, 프로세서(240)는, 얼굴의 특징을, 사람의 얼굴에 고유한 얼굴의 제 1 특징과, 이미지 획득 시 환경 및/또는 얼굴의 상태를 반영한 얼굴의 제 2 특징으로 분류하여 검출할 수 있다. 일 실시예에서, 프로세서(240)는, 복수의 그룹들을 관리하기 위하여, 제 3 이미지 내에서, 얼굴의 제 2 특징을 검출함 없이, 얼굴의 제 1 특징만을 검출할 수도 있다.In one embodiment, the processor 240 classifies and detects facial features into a first facial feature unique to a person's face and a second facial feature reflecting the environment and/or facial state at the time of image acquisition. can do. In one embodiment, the processor 240 may detect only the first feature of the face in the third image without detecting the second feature of the face in order to manage the plurality of groups.

일 실시예에서, 프로세서(240)는, 제 3 이미지 내에서 얼굴이 존재하는지 여부 및/또는 제 1 영역에 대한 제 2 영역의 비율에 기반하여, 얼굴의 특징을 검출할 수 있다. 이하, 도 12를 참조하여, 프로세서(240)가 제 1 이미지 내에서 얼굴이 존재하는지 여부 및/또는 제 1 영역에 대한 제 2 영역의 비율에 기반하여, 얼굴의 특징을 검출하는 동작에 대하여 설명하도록 한다.In an embodiment, the processor 240 may detect facial features based on whether a face exists in the third image and/or a ratio of the second area to the first area. Hereinafter, with reference to FIG. 12, an operation of the processor 240 to detect facial features based on whether or not a face exists in the first image and/or the ratio of the second area to the first area will be described. let it do

도 12는, 다양한 실시예들에 따른, 얼굴 요소를 검출하는 방법을 설명하는 흐름도(1200)이다. 예를 들어, 도 12는, 그룹 관리부(310)의 제 1 얼굴 요소 검출부(311)에서 얼굴 요소를 검출하는 방법을 설명하기 위한 흐름도일 수 있다.12 is a flowchart 1200 describing a method of detecting facial elements, in accordance with various embodiments. For example, FIG. 12 may be a flowchart for explaining a method of detecting facial elements in the first facial element detector 311 of the group management unit 310 .

도 12를 참조하면, 동작 1201에서, 일 실시예에서, 프로세서(240)는, 제 3 이미지 내에서(메모리(230)에 저장된 복수의 이미지들 각각에서) 제 1 영역이 존재하는지 여부를 결정할 수 있다. 예를 들어, 프로세서(240)는, 제 3 이미지 내에서 제 1 영역(얼굴 영역)이 검출되지 않는 경우, 제 3 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정할 수 있다. 프로세서(240)는, 제 3 이미지 내에서 제 1 영역이 검출된 경우, 제 3 이미지 내에서 제 1 영역이 존재하는 것으로 결정할 수 있다. 다른 예를 들어, 프로세서(240)는, 제 3 이미지 내에서 검출된 제 1 영역의 크기(예: 면적)가 지정된 영역의 크기(예: 면적) 보다 작은 경우, 제 3 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정할 수 있다. 프로세서(240)는, 제 3 이미지 내에서 검출된 제 1 영역의 크기가 지정된 영역의 크기 이상인 경우, 제 3 이미지 내에서 제 1 영역이 존재하는 것으로 결정할 수 있다. Referring to FIG. 12 , in operation 1201, in one embodiment, processor 240 may determine whether a first region exists in a third image (in each of a plurality of images stored in memory 230). there is. For example, when the first area (face area) is not detected in the third image, the processor 240 may determine that the first area does not exist in the third image. When the first area is detected in the third image, the processor 240 may determine that the first area exists in the third image. As another example, the processor 240 may, when the size (eg area) of the first area detected in the third image is smaller than the size (eg area) of the designated area, the first area in the third image. It can be determined that this does not exist. The processor 240 may determine that the first region exists in the third image when the size of the first region detected in the third image is greater than or equal to the size of the designated region.

일 실시예에서, 프로세서(240)는, 동작 1201에서 제 3 이미지 내에서 제 1 영역이 존재하지 않는 것으로 결정된 경우, 제 3 이미지에 대한 얼굴의 특징을 검출하는 동작을 수행하지 않을 수 있다.In an embodiment, when it is determined in operation 1201 that the first region does not exist in the third image, the processor 240 may not perform an operation of detecting facial features of the third image.

동작 1203에서, 일 실시예에서, 프로세서(240)는, 동작 1201에서 제 3 이미지 내에서 제 1 영역이 존재하는 것으로 결정된 경우, 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인지 여부를 확인할 수 있다.In operation 1203, in one embodiment, if it is determined in operation 1201 that the first area exists in the third image, the processor 240 determines whether the ratio of the second area to the first area is less than the specified ratio. You can check.

일 실시예에서, 프로세서(240)는, 동작 1203에서 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 이상인 것으로 확인된 경우, 제 3 이미지에 대한 얼굴의 특징을 검출하는 동작을 수행하지 않을 수 있다.In an embodiment, when it is determined in operation 1203 that the ratio of the second area to the first area is greater than or equal to the specified ratio, the processor 240 may not perform an operation of detecting facial features of the third image. there is.

동작 1205에서, 일 실시예에서, 프로세서(240)는, 동작 1203에서 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인 것으로 확인된 경우, 제 3 이미지 내에서 얼굴의 특징을 검출할 수 있다.In operation 1205, in one embodiment, when it is determined in operation 1203 that the ratio of the second area to the first area is less than a specified ratio, the processor 240 may detect facial features in the third image. .

다만, 동작 1201 내지 동작 1205는 제 3 이미지 내에서 얼굴 요소를 검출하는 동작에 대한 예시들이며, 제 3 이미지 내에서 얼굴 요소를 검출하는 동작은 이에 제한되지 않는다. 예를 들어, 프로세서(240)는, 제 1 영역에 대한 제 2 영역의 비율과 무관하게(예: 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인 경우에도), 제 3 이미지 내에서 얼굴의 특징을 검출할 수 있다.However, operations 1201 to 1205 are examples of operations for detecting facial elements in the third image, and operations for detecting facial elements in the third image are not limited thereto. For example, the processor 240 may select a face in the third image regardless of the ratio of the second area to the first area (eg, even when the ratio of the second area to the first area is less than a specified ratio). features can be detected.

동작 1103에서, 일 실시예에서, 프로세서(240)는, 메모리(230)에 저장된 복수의 이미지들(예: 메모리(230)에 저장된 전체 이미지들) 중에서, 얼굴 요소(예: 제 1 영역(얼굴 영역))가 검출된 이미지들을 그룹화함으로써, 복수의 그룹들을 획득할 수 있다.In operation 1103, in one embodiment, the processor 240 selects a face element (eg, a first region (face) from among a plurality of images (eg, all images stored in the memory 230) stored in the memory 230. A plurality of groups may be obtained by grouping the images in which the region)) is detected.

일 실시예에서, 프로세서(240)는, 이미지들(예: 얼굴 요소가 검출된 이미지들) 각각의 제 1 특징들에 기반하여, 이미지들을 복수의 그룹들로 그룹화할 수 있다. 일 실시예에서, 프로세서(240)는, 지정된 알고리즘을 이용하여, 유사한 제 1 특징을 가지는 하나 이상의 이미지들이 동일한 그룹에 포함되도록, 이미지들을 복수의 그룹들로 그룹화할 수 있다. 예를 들어, 프로세서(240)는, 지정된 알고리즘(예: K-평균 군집화 알고리즘)을 이용하여, 동일한 그룹에 포함되는 하나 이상의 이미지들의 제 1 특징들 간 유사도가 지정된 유사도 이상이 되도록, 이미지들을 복수의 그룹들로 그룹화할 수 있다.In an embodiment, the processor 240 may group the images into a plurality of groups based on first characteristics of each of the images (eg, images in which facial elements are detected). In one embodiment, the processor 240 may group the images into a plurality of groups using a specified algorithm so that one or more images having a similar first characteristic are included in the same group. For example, the processor 240, by using a designated algorithm (eg, K-means clustering algorithm), selects a plurality of images such that the similarity between the first features of one or more images included in the same group is greater than or equal to the designated similarity. can be grouped into groups of

동작 1105에서, 일 실시예에서, 프로세서(240)는, 복수의 그룹들 각각의 그룹 정보를 획득(예: 산출)할 수 있다. 일 실시예에서, 그룹 정보는, 그룹 특징(그룹의 대표 얼굴 특징), 그룹의 대표 이미지, 및/또는 그룹의 크기를 포함할 수 있다.In operation 1105, in one embodiment, the processor 240 may obtain (eg, calculate) group information of each of a plurality of groups. In an embodiment, the group information may include a group feature (representative facial feature of the group), a representative image of the group, and/or a size of the group.

일 실시예에서, 프로세서(240)는, 동일한 그룹에 속하는 하나 이상의 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여, 그룹의 대표 얼굴 특징을 획득할 수 있다.In an embodiment, the processor 240 may obtain a representative facial feature of a group based on first facial features and weights of one or more images belonging to the same group.

일 실시예에서, 프로세서(240)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지 내에서 얼굴의 각도(또는 얼굴이 향하는 방향) 및/또는 이미지의 해상도에 기반하여, 가중치들을 설정(예: 부여)할 수 있다. 예를 들어, 프로세서(240)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 얼굴이 카메라 모듈(220)의 정면을 향할수록(예: 얼굴이 향하는 방향 및 카메라 모듈(220)이 향하는 방향이 평행할수록) 및/또는 이미지의 해상도가 높을수록, 이미지에 대하여 높은 가중치를 설정할 수 있다.In one embodiment, the processor 240 sets weights (e.g., for one or more images belonging to the same group) based on the angle of a face in the image (or the direction the face is facing) and/or the resolution of the image. : granted) can be given. For example, with respect to one or more images belonging to the same group, the processor 240 may determine the face toward the front of the camera module 220 (eg, the direction in which the face faces and the direction in which the camera module 220 faces). parallel) and/or the higher the resolution of the image, the higher the weight can be set for the image.

일 실시예에서, 프로세서(240)는, 동일한 그룹에 속하는 하나 이상의 이미지들에 대하여, 이미지 내에서 얼굴의 각도, 이미지의 해상도, 및/또는 이미지가 얼굴 인페인팅에 이용된 이미지인지 여부에 기반하여, 가중치들을 설정(예: 부여)할 수 있다. 예를 들어, 프로세서(240)는, 얼굴 인페인팅에 이용되었던 이미지(예: 도 4의 동작 405에서 선택된 제 1 그룹의 대표 이미지)에 대하여, 동일한 그룹에 속하는 다른 이미지에 비하여 높은 가중치를 설정(또는 가중치 값을 추가)할 수 있다.In one embodiment, the processor 240, for one or more images belonging to the same group, based on the angle of the face in the image, the resolution of the image, and / or whether the image is an image used for face inpainting , weights can be set (eg, assigned). For example, the processor 240 sets a higher weight for the image used for face inpainting (eg, the representative image of the first group selected in operation 405 of FIG. 4) than other images belonging to the same group ( or add weight values).

일 실시예에서, 프로세서(240)는, 전술한 [수학식 1]과 같이, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들에 대한 가중 평균을 이용하여, 그룹 특징을 획득(예: 산출)할 수 있다.In one embodiment, the processor 240 obtains a group feature (eg, calculates )can do.

일 실시예에서, 프로세서(240)는, 동일한 그룹에 포함된 이미지들 중에서, 가장 높은 가중치를 가지는 이미지(예: 가장 높은 가중치가 설정된 이미지)를, 그룹의 대표 이미지로 결정(예: 설정)할 수 있다.In one embodiment, the processor 240 determines (eg, sets) an image having the highest weight (eg, an image with the highest weight set) among images included in the same group as a representative image of the group. can

일 실시예에서, 프로세서(240)는, 복수의 그룹들 각각에 포함된 이미지들의 개수(예: 해당 그룹에 포함된 이미지의 개수), 또는 메모리(230)에 저장된 전체 이미지들의 개수(또는 복수의 그룹들에 포함된 전체 이미지들의 개수)에 대한 해당 그룹에 포함된 이미지의 개수의 비율을, 해당 그룹의 크기로서 결정(예: 설정)할 수 있다.In one embodiment, the processor 240 may determine the number of images included in each of a plurality of groups (eg, the number of images included in the corresponding group), or the total number of images stored in the memory 230 (or a plurality of images). A ratio of the number of images included in the corresponding group to the total number of images included in the groups may be determined (eg, set) as the size of the corresponding group.

일 실시예에서, 프로세서(240)는, 동작 1101 내지 동작 1105를 백그라운드(background)에서 수행할 수 있다. 예를 들어, 프로세서(240)는, 얼굴 인페인팅을 위한 어플리케이션 설치 시 또는 주기적으로, 메모리(230)에 저장된 모든 이미지들 각각에 대하여, 얼굴 요소를 검출하는 동작을 포함하는 동작들(예: 동작 1101 내지 동작 1105)을 수행할 수 있다.In one embodiment, the processor 240 may perform operations 1101 to 1105 in the background. For example, the processor 240 performs operations including an operation of detecting a face element for each of all images stored in the memory 230 when an application for face inpainting is installed or periodically (eg, an operation Operations 1101 to 1105) may be performed.

도 13은, 다양한 실시예들에 따른, 복수의 그룹들을 관리하는 방법을 설명하는 흐름도(1300)이다.13 is a flowchart 1300 describing a method of managing a plurality of groups, according to various embodiments.

일 실시예에서, 도 13은 프로세서(240)(예: 그룹 관리부(310))가 이미지 획득 시, 획득된 이미지(이하, 프로세서(240)(예: 그룹 관리부(310))가 획득하는 이미지를 '제 4 이미지'로 지칭함)를 이전에 획득된 복수의 그룹들 또는 새로운 그룹에 포함시킴으로써, 복수의 그룹들을 관리하는 방법을 설명하는 흐름도일 수 있다.In one embodiment, FIG. 13 illustrates an acquired image (hereinafter, an image acquired by the processor 240 (eg, the group manager 310) when the processor 240 (eg, the group manager 310) acquires the image. Referred to as a 'fourth image') in a previously obtained plurality of groups or a new group, it may be a flowchart explaining a method of managing a plurality of groups.

도 13을 참조하면, 동작 1301에서, 일 실시예에서, 프로세서(240)는, 제 4 이미지를 획득할 수 있다. 일 실시예에서, 제 4 이미지는, 갤러리 어플리케이션에 새롭게 추가된 이미지(예: 갤러리 어플리케이션이 관리를 시작한 이미지)일 수 있다. 예를 들어, 제 4 이미지는, 카메라 모듈(220)을 통하여 획득된 이미지 또는 외부 전자 장치로부터 획득된 이미지(예: 카메라 모듈(220)를 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지인 경우)일 수 있다. 다른 예를 들어, 제 4 이미지는 얼굴 인페인팅이 수행된 이미지(얼굴 인페인팅의 결과 이미지로서 제 2 이미지)를 포함할 수 있다. Referring to FIG. 13 , in operation 1301, in an embodiment, the processor 240 may obtain a fourth image. In one embodiment, the fourth image may be an image newly added to the gallery application (eg, an image managed by the gallery application). For example, the fourth image is an image acquired through the camera module 220 or an image acquired from an external electronic device (eg, obtained through the camera module 220 or acquired from an external electronic device without face inpainting). It may be an image stored in the memory 230 immediately). For another example, the fourth image may include an image on which face inpainting has been performed (a second image as a result image of face inpainting).

동작 1303에서, 일 실시예에서, 프로세서(240)는, 제 4 이미지가 제 2 이미지에 해당하는지 여부를 확인할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지가 얼굴 인페인팅이 수행된 이미지인지, 또는 카메라 모듈(220)를 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지인지를 확인할 수 있다.In operation 1303, in one embodiment, the processor 240 may determine whether the fourth image corresponds to the second image. For example, the processor 240 determines whether the fourth image is an image on which face inpainting has been performed, or is obtained through the camera module 220 or obtained from an external electronic device and then directly stored in the memory 230 without face inpainting. You can check whether the image is saved.

일 실시예에서, 프로세서(240)는, 제 4 이미지와 관련된 플래그(flag)에 기반하여, 제 4 이미지가 제 2 이미지에 해당하는지 여부를 확인할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지와 관련된 플래그가 제 4 이미지가 얼굴 인페인팅이 수행된 이미지임을 나타내는 경우, 제 4 이미지가 제 2 이미지에 해당하는 것으로 확인할 수 있다. 다른 예를 들어, 프로세서(240)는, 제 4 이미지와 관련된 플래그가 제 4 이미지가 얼굴 인페인팅이 수행되지 않은 이미지임을 나타내거나, 제 4 이미지와 관련된 플래그가 존재하지 않는 경우, 제 4 이미지가 카메라 모듈(220)을 통하여 획득되거나 외부 전자 장치로부터 획득된 후 얼굴 인페인팅 없이 곧바로 메모리(230)에 저장된 이미지에 해당하는 것으로 확인할 수 있다.In an embodiment, the processor 240 may determine whether the fourth image corresponds to the second image based on a flag related to the fourth image. For example, if the flag associated with the fourth image indicates that the fourth image is an image on which face inpainting has been performed, the processor 240 may determine that the fourth image corresponds to the second image. For another example, if the flag related to the fourth image indicates that the fourth image is an image on which face inpainting has not been performed or the flag related to the fourth image does not exist, the fourth image is displayed. After being acquired through the camera module 220 or obtained from an external electronic device, it can be confirmed that the image corresponds to the image stored in the memory 230 without face inpainting.

동작 1303에서 제 4 이미지가 제 2 이미지에 해당하는 경우, 동작 1305에서, 일 실시예에서, 프로세서(240)는, 제 4 이미지를 포함하도록 결정된 그룹을 갱신할 수 있다.If the fourth image corresponds to the second image in operation 1303, in operation 1305, the processor 240 may update the determined group to include the fourth image.

일 실시예에서, 프로세서(240)는, 제 4 이미지가 제 2 이미지에 해당하는 경우, 제 4 이미지와 관련된 플래그에 기반하여, 제 4 이미지와 관련된 얼굴 인페인팅이 수행되는 동안 선택된 그룹(예: 동작 405에서 결정된 제 1 그룹)을 제 4 이미지가 포함될 그룹으로 결정할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지가 제 2 이미지에 해당하는 경우, 제 4 이미지와 관련된 얼굴 인페인팅이 수행되는 동안 제 4 이미지를 획득하기 위하여 선택되었던 그룹을 나타내는 플래그에 기반하여, 제 4 이미지에 대한 얼굴 인페인팅이 수행되는 동안 제 4 이미지를 획득하기 위하여 선택되었던 그룹을 제 4 이미지가 포함될 그룹으로 결정할 수 있다.In one embodiment, the processor 240, when the fourth image corresponds to the second image, based on the flag associated with the fourth image, the selected group (eg: The first group determined in operation 405) may be determined as a group to include the fourth image. For example, if the fourth image corresponds to the second image, the processor 240 may perform face inpainting related to the fourth image based on a flag indicating a group selected to obtain the fourth image. , while face inpainting of the fourth image is being performed, a group selected to acquire the fourth image may be determined as a group to include the fourth image.

일 실시예에서, 프로세서(240)는, 제 4 이미지를 상기 결정된 그룹으로 포함시키고, 상기 결정된 그룹을 갱신할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지 및 상기 결정된 그룹에 이전에 포함되었던 하나 이상의 이미지들에 기반하여, 상기 결정된 그룹의 대표 얼굴 특징, 상기 그룹의 대표 이미지, 및/ 상기 결정된 그룹의 크기를 갱신할 수 있다.In one embodiment, the processor 240 may include the fourth image as the determined group and update the determined group. For example, the processor 240 may perform a representative facial feature of the determined group, a representative image of the group, and/or a representative facial feature of the determined group, based on the fourth image and one or more images previously included in the determined group. Size can be updated.

동작 1303에서 제 4 이미지가 제 2 이미지에 해당하지 않는 경우, 동작 1307에서, 일 실시예에서, 프로세서(240)는, 제 4 이미지 내에서 얼굴 요소를 검출할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지에 대하여, 동작 1101의 얼굴 요소를 검출하는 동작과 적어도 일부가 동일 또는 유사한 동작을 수행할 수 있다.If the fourth image does not correspond to the second image in operation 1303, in operation 1307, the processor 240 may detect a face element in the fourth image. For example, the processor 240 may perform an operation at least partially the same as or similar to the operation of detecting the face element of operation 1101 with respect to the fourth image.

동작 1309에서, 일 실시예에서, 프로세서(240)는, 검출된 얼굴 요소에 기반하여, 제 4 이미지가 포함될 그룹을 결정할 수 있다. In operation 1309, in one embodiment, the processor 240 may determine a group to include the fourth image based on the detected facial elements.

일 실시예에서, 프로세서(240)는, 제 4 이미지의 얼굴의 제 1 특징 및 복수의 그룹들의 대표 얼굴 특징들(예: 입력된 이미지의 얼굴의 제 1 특징과, 복수의 그룹들의 대표 얼굴 특징들 각각 간 유사도들)을 비교할 수 있다. 프로세서(240)는, 복수의 그룹들 중에서, 복수의 그룹들의 대표 얼굴 특징들 중에서 제 4 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징을 가지는 그룹(예: 복수의 그룹들의 대표 얼굴 특징들 중에서 입력된 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징과, 입력된 이미지의 얼굴의 제 1 특징 간 유사도가 지정된 유사도 이상인 경우, 상기 가장 유사한 대표 얼굴 특징에 대응하는 그룹)을, 제 4 이미지가 포함될 그룹으로 선택할 수 있다.In an embodiment, the processor 240 may select a first facial feature of the fourth image and representative facial features of a plurality of groups (eg, the first facial feature of the input image and representative facial features of a plurality of groups). similarities between each of them) can be compared. The processor 240 may select, among a plurality of groups, a group having a representative facial feature most similar to the first feature of the face of the fourth image among the representative facial features of the plurality of groups (eg, the representative facial features of the plurality of groups). If the similarity between the representative facial feature most similar to the first facial feature of the input image and the first facial feature of the input image is equal to or greater than the specified similarity, a group corresponding to the most similar representative facial feature) is selected as a fourth You can select as a group to include images.

일 실시예에서, 프로세서(240)는, 복수의 그룹들의 대표 얼굴 특징들 중에서 제 4 이미지의 얼굴의 제 1 특징과 유사한 대표 얼굴 특징을 가지는 그룹이 없는 경우(예: 복수의 그룹들의 대표 얼굴 특징들 중에서 제 4 이미지의 얼굴의 제 1 특징과 가장 유사한 대표 얼굴 특징과, 제 4 이미지의 얼굴의 제 1 특징 간 유사도가 지정된 유사도 미만인 경우), 이전에 획득된 복수의 그룹들 외에 새로운 그룹을 획득(예: 생성)하고, 새로운 그룹에 제 4 이미지를 포함시킬 수 있다.In an embodiment, the processor 240 may, among the representative facial features of a plurality of groups, determine if there is no group having a representative facial feature similar to the first feature of the face of the fourth image (eg, a representative facial feature of the plurality of groups). If the similarity between the representative facial feature most similar to the first facial feature of the fourth image and the first facial feature of the fourth image is less than the specified similarity), a new group is obtained in addition to the previously obtained plurality of groups (eg, create), and include the fourth image in the new group.

동작 1311에서, 일 실시예에서, 프로세서(240)는, 제 4 이미지를 포함하도록 결정된 그룹을 갱신할 수 있다. 예를 들어, 프로세서(240)는, 제 4 이미지 및 상기 결정된 그룹에 이전에 포함되었던 하나 이상의 이미지들에 기반하여, 상기 결정된 그룹의 대표 얼굴 특징, 상기 그룹의 대표 이미지, 및/ 상기 결정된 그룹의 크기를 갱신할 수 있다.In operation 1311, in one embodiment, the processor 240 may update the determined group to include the fourth image. For example, the processor 240 may perform a representative facial feature of the determined group, a representative image of the group, and/or a representative facial feature of the determined group based on the fourth image and one or more images previously included in the determined group. Size can be updated.

일 실시예에서, 프로세서(240)는, 새로운 그룹이 획득된 경우, 새로운 그룹에 대하여 그룹 정보(예: 새로운 그룹의 그룹 특징, 그룹의 대표 이미지, 및/또는 그룹의 크기)를 획득하고 관리할 수 있다.In one embodiment, the processor 240, when a new group is acquired, acquires and manages group information (eg, group characteristics of the new group, representative image of the group, and/or size of the group) for the new group. can

도 14a 및 도 14b는, 다양한 실시예들에 따른, 이미지를 제공하는 방법을 설명하는 예시도들이다.14A and 14B are exemplary diagrams illustrating a method of providing an image, according to various embodiments.

도 14a 및 도 14b를 참조하면, 일 실시예에서, 프로세서(240)는, 메모리(230)에 저장된 복수의 이미지들 중에서 이미지가 선택된 경우, 선택된 이미지를 디스플레이(210)를 통하여 표시할 수 있다. 프로세서(240)는, 사용자 입력에 기반하여, 선택된 이미지를 편집하기 위한 화면을 디스플레이(210)를 통하여 표시할 수 있다.Referring to FIGS. 14A and 14B , in one embodiment, when an image is selected from among a plurality of images stored in the memory 230, the processor 240 may display the selected image through the display 210. The processor 240 may display a screen for editing the selected image through the display 210 based on a user input.

일 실시예에서, 프로세서(240)는, 선택된 이미지가 얼굴 영역을 포함하는 경우, 얼굴 영역을 편집하기 위한 오브젝트(예: 아이콘)을 포함하는, 선택된 이미지를 편집하기 위한 화면을 디스플레이(210)를 통하여 표시할 수 있다. 예를 들어, 도 14a에서, 프로세서(240)는, 선택된 이미지(1411)가 얼굴 영역(1412)를 포함하는 경우, 얼굴 영역(1412)을 편집하기 위한 오브젝트(1414)를 포함하는, 선택된 이미지(1411)를 편집하기 위한 화면(1410)을 디스플레이(210)를 통하여 표시할 수 있다.In one embodiment, when the selected image includes the face region, the processor 240 displays a screen for editing the selected image including an object (eg, an icon) for editing the face region 210 . can be displayed through For example, in FIG. 14A , if the selected image 1411 includes the face area 1412, the processor 240 includes the object 1414 for editing the face area 1412, the selected image ( A screen 1410 for editing 1411) may be displayed through the display 210 .

일 실시예에서, 프로세서(240)는, 얼굴 영역을 편집하기 위한 오브젝트(예: 오브젝트(1414))에 대한 사용자 입력이 수신된 경우, 얼굴 영역을 편집하기 위한 화면을 디스플레이(210)를 통하여 표시할 수 있다.In one embodiment, the processor 240 displays a screen for editing the face region through the display 210 when a user input for an object (eg, object 1414) for editing the face region is received. can do.

일 실시예에서, 프로세서(240)는, 선택된 이미지 내에 포함된 얼굴 영역이 복원이 필요한 제 2 영역을 포함하는 경우(예: 선택된 이미지 내에 포함된 얼굴 영역이 복원이 필요한 제 2 영역이 검출된 경우), 얼굴 인페인팅을 위한 오브젝트(예: 아이콘)을 포함하는 화면을 디스플레이(210)를 통하여 표시할 수 있다. 예를 들어, 도 14a에서, 프로세서(240)는, 선택된 이미지(1411) 내에 포함된 얼굴 영역(1412)이 복원이 필요한 제 2 영역(1413)을 포함하는 경우, 얼굴 영역을 편집하기 위한 복수의 오브젝트들(예: 눈 크기를 변경하기 위한 오브젝트(1425-1), 얼굴 영역의 잡티 제거를 위한 오브젝트(1425-2), 얼굴 영역 뒷 배경을 흐르게 하기 위한 오브젝트(1425-3))과 함께, 얼굴 인페인팅을 위한 오브젝트(1425)을 포함하는 화면(1420)을 디스플레이(210)를 통하여 표시할 수 있다. 다만, 얼굴 영역을 편집하기 위한 복수의 오브젝트들(1425-1, 1425-2, 1425-3)은 전술한 예시들에 제한되지 않는다. 일 실시예에서, 프로세서는, 프로세서(240)는, 선택된 이미지 내에 포함된 얼굴 영역이 복원이 필요한 제 2 영역을 포함하지 않는 경우, 얼굴 인페인팅을 위한 오브젝트(예: 오브젝트(1425))를 디스플레이(210)를 통하여 표시하지 않을 수 있다.In one embodiment, the processor 240, when the face region included in the selected image includes a second region that needs to be restored (eg, when the face region included in the selected image has a second region that needs to be restored is detected) ), and a screen including an object (eg, an icon) for face inpainting may be displayed through the display 210 . For example, in FIG. 14A , when the face region 1412 included in the selected image 1411 includes the second region 1413 that needs to be restored, the processor 240 executes a plurality of steps for editing the face region. Along with objects (e.g., object 1425-1 for changing eye size, object 1425-2 for removing blemishes in the face area, object 1425-3 for flowing the background behind the face area), A screen 1420 including an object 1425 for face inpainting may be displayed through the display 210 . However, the plurality of objects 1425-1, 1425-2, and 1425-3 for editing the face area are not limited to the above examples. In one embodiment, the processor 240 displays an object for face inpainting (eg, the object 1425) when the face region included in the selected image does not include the second region requiring restoration. It may not be displayed through (210).

일 실시예에서, 프로세서는, 선택된 이미지 내에서 제 1 영역(얼굴 영역)에 대한 제 2 영역(복원이 필요한 제 2 영역)의 비율이 지정된 비율 이상인 경우, 얼굴 인페인팅을 위한 오브젝트(예: 오브젝트(1425))를 디스플레이(210)를 통하여 표시할 수 있다. 일 실시예에서, 프로세서는, 선택된 이미지 내에서 제 1 영역에 대한 제 2 영역의 비율이 지정된 비율 미만인 경우, 얼굴 인페인팅을 위한 오브젝트(예: 오브젝트(1425))를 디스플레이(210)를 통하여 표시하지 않을 수 있다. In one embodiment, the processor, when the ratio of the second area (the second area to be restored) to the first area (face area) in the selected image is greater than or equal to a specified ratio, the object (eg, object for face inpainting) (1425)) may be displayed through the display 210. In one embodiment, the processor displays an object for face inpainting (eg, object 1425) through the display 210 when the ratio of the second area to the first area in the selected image is less than a specified ratio. may not

일 실시예에서, 프로세서(240)는, 선택된 이미지 내에서 복수의 얼굴 영역들이 검출된 경우, 복수의 얼굴 영역들을 각각 나타내는(또는 복수의 얼굴 영역들에 대응하는) 복수의 오브젝트들(예: 제 1 색상(예: 흰색)을 가지며 얼굴 영역들 각각에 표시되는 원형 링(ring) 형태의 오브젝트들)을 복수의 얼굴 영역들 상에 디스플레이(210)를 통하여 표시할 수 있다. 프로세서(240)는, 복수의 얼굴 영역들을 각각 나타내는 복수의 오브젝트들 중에서, 사용자 입력에 의해 하나의 오브젝트가 선택된 경우, 선택된 오브젝트를 디스플레이(210)를 통하여 표시하고(예: 선택된 오브젝트가 사용자 입력에 의해 선택됨을 나타내기 위하여, 선택된 오브젝트를 제 1 색상(예: 횐색)과 다른 제 2 색상(예: 노란색)으로 표시), 선택된 오브젝트를 제외한 나머지 오브젝트들을 디스플레이(210)를 통하여 표시하지 않을 수 있다. 예를 들어, 프로세서(240)는, 화면(1420)에 포함된 오브젝트(1424)와 같이, 사용자 입력에 의해 선택된(또는 선택된 이미지 내에서 하나의 얼굴 영역이 검출된 경우, 사용자 입력 없이 자동적으로 선택된) 오브젝트를 디스플레이(210)를 통하여 표시할 수 있다. 일 실시예에서, 프로세서(240)는, 선택된 오브젝트(예: 오브젝트(1424))에 대응하는 얼굴 영역을, 얼굴 인페인팅의 대상이 되는 얼굴 영역으로서 결정할 수 있다.In one embodiment, when a plurality of face regions are detected in the selected image, the processor 240 creates a plurality of objects (eg, a first Circular ring-shaped objects having one color (eg, white) and displayed on each of the face regions may be displayed on the plurality of face regions through the display 210 . When one object is selected from among a plurality of objects representing a plurality of face regions, the processor 240 displays the selected object through the display 210 (eg, the selected object responds to the user input) In order to indicate selection by the selected object, the selected object may be displayed in a second color (eg, yellow) different from the first color (eg, white), and other objects other than the selected object may not be displayed through the display 210. . For example, the processor 240, such as the object 1424 included in the screen 1420, is selected by a user input (or when one face region is detected in the selected image, the object 1424 is automatically selected without a user input). ) objects may be displayed through the display 210 . In one embodiment, the processor 240 may determine a face region corresponding to the selected object (eg, the object 1424) as a face region to be subjected to face inpainting.

일 실시예에서, 프로세서(240)는, 얼굴 인페인팅을 위한 오브젝트(예: 오브젝트(1425))에 대한 사용자 입력에 기반하여, 얼굴 영역(예: 얼굴 영역(1412))에 대한 얼굴 인페인팅을 수행할 수 있다.In one embodiment, the processor 240 performs face inpainting on a face area (eg, the face area 1412) based on a user input for an object (eg, the object 1425) for face inpainting. can be done

일 실시예에서, 프로세서(240)는, 얼굴 인페인팅을 위한 오브젝트(예: 오브젝트(1425))에 대한 사용자 입력에 기반하여, 하나 이상의 후보 그룹들의 대표 이미지들(예: 동작 605의 하나 이상의 그룹들의 대표 이미지들)을 포함하는 화면을 디스플레이(210)를 통하여 표시할 수 있다. 예를 들어, 프로세서(240)는, 얼굴 인페인팅을 위한 오브젝트(1425)에 대한 입력에 기반하여, 하나 이상의 후보 그룹들의 대표 이미지들(1434, 1435, 1436)를 포함하는 화면(1430)를 디스플레이(210)를 통하여 표시할 수 있다.In an embodiment, the processor 240 selects representative images of one or more candidate groups (eg, one or more groups of operation 605) based on a user input for an object (eg, object 1425) for face inpainting. A screen including representative images) may be displayed through the display 210 . For example, the processor 240 displays a screen 1430 including representative images 1434, 1435, and 1436 of one or more candidate groups based on the input of the object 1425 for face inpainting. It can be displayed through (210).

일 실시예에서, 프로세서(240)는, 하나 이상의 후보 그룹들의 대표 이미지들(예: 하나 이상의 후보 그룹들의 대표 이미지들(1434, 1435, 1436)) 중에서, 사용자 입력에 기반하여, 얼굴 영역(예: 얼굴 영역(1412))을 복원하기 위하여 이용될 대표 이미지를 선택할 수 있다. 예를 들어, 프로세서(240)는, 하나 이상의 후보 그룹들의 대표 이미지들(1434, 1435, 1436) 중에서, 사용자 입력에 기반하여, 얼굴 영역(1412)을 복원하기 위하여 대표 이미지(1434)를 선택할 수 있다.In an embodiment, the processor 240 selects a face region (eg, representative images 1434, 1435, and 1436 of one or more candidate groups) of one or more candidate groups based on a user input. : A representative image to be used to reconstruct the face region 1412) may be selected. For example, the processor 240 may select a representative image 1434 from among representative images 1434, 1435, and 1436 of one or more candidate groups to reconstruct the face region 1412 based on a user input. there is.

일 실시예에서, 프로세서(240)는, 대표 이미지(예: 대표 이미지(1434))가 선택된 경우, 전술한 동작들(예: 동작 405 내지 동작 409)을 통하여, 얼굴 인페인팅의 결과 이미지를 획득할 수 있다. 예를 들어, 프로세서(240)는, 대표 이미지(1434)가 선택된 경우, 전술한 동작들(예: 동작 405 내지 동작 409)을 통하여, 복원이 필요한 제 2 영역(1413)이 복원된 얼굴 영역(1442)를 포함하는 얼굴 인페인팅의 결과 이미지(1441)를 획득할 수 있다.In one embodiment, when a representative image (eg, representative image 1434) is selected, the processor 240 obtains a result image of face inpainting through the above-described operations (eg, operations 405 to 409). can do. For example, when the representative image 1434 is selected, the processor 240, through the above-described operations (eg, operations 405 to 409), determines that the second region 1413 that needs to be restored is the restored face region ( A result image 1441 of face inpainting including 1442 may be acquired.

다양한 실시예들에 따른 전자 장치(101)에서 이미지를 제공하는 방법은, 제 1 이미지를 획득하는 동작, 상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하는 동작, 상기 얼굴의 특징 및 상기 전자 장치(101)의 메모리(230)에 저장된 복수의 그룹들 각각에 대응하는 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작, 상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하는 동작, 및 상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하는 동작을 포함할 수 있다.A method of providing an image in an electronic device 101 according to various embodiments includes an operation of acquiring a first image, a first area representing a face in the first image, characteristics of the face, and the first image. Based on an operation of detecting a second region within the region that needs to be restored, the facial feature and a plurality of representative facial features corresponding to each of a plurality of groups stored in the memory 230 of the electronic device 101, an operation of selecting a first group from among the plurality of groups, an operation of obtaining a face region in which the second region is restored based on the representative facial features of the first group and the facial features, and the facial region and An operation of obtaining a second image by synthesizing the first image may be included.

다양한 실시예에서, 상기 얼굴의 특징은 제 1 특징 및 제 2 특징을 포함하고, 상기 제 1 특징은 사람의 얼굴에 고유한 특징을 포함하고, 상기 제 2 특징은 상기 제 1 이미지 획득 시 환경 및/또는 상기 얼굴의 상태를 반영한 특징을 포함할 수 있다.In various embodiments, the facial feature includes a first feature and a second feature, the first feature includes a feature unique to a human face, and the second feature includes an environment and a second feature when the first image is acquired. / or a feature reflecting the state of the face may be included.

다양한 실시예에서, 상기 메모리(230)는 상기 복수의 그룹들 각각에 대응하는 복수의 그룹 정보를 저장하고, 상기 복수의 그룹 정보는, 상기 복수의 대표 얼굴 특징들, 상기 복수의 그룹들 각각에 대응하는 대표 이미지들, 및 그룹 크기들을 포함하고, 상기 복수의 대표 얼굴 특징들은, 상기 복수의 그룹들 각각에서, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여 획득되고, 상기 대표 이미지들은, 상기 복수의 그룹들 각각에서, 상기 동일한 그룹에 포함된 상기 이미지들 중에서, 상기 가중치들 중 가장 높은 가중치를 가지는 이미지이고, 상기 그룹 크기들 각각은, 상기 복수의 그룹들 각각에 대하여, 그룹에 포함된 이미지들의 개수, 또는 상기 메모리(230)에 저장된 전체 이미지들의 개수에 대한 상기 그룹에 포함된 이미지의 개수의 비율이고, 및 상기 가중치들 각각은, 상기 이미지들 각각에서, 얼굴의 각도, 이미지의 해상도, 및/또는 상기 이미지가 얼굴 인페인팅의 결과 이미지인지 여부에 기반하여, 설정될 수 있다.In various embodiments, the memory 230 stores a plurality of group information corresponding to each of the plurality of groups, and the plurality of group information includes the plurality of representative facial features and each of the plurality of groups. corresponding representative images and group sizes, wherein the plurality of representative facial features are obtained based on first features and weights of faces of images included in the same group in each of the plurality of groups; , The representative images are images having the highest weight among the weights among the images included in the same group in each of the plurality of groups, and each of the group sizes is For , the ratio of the number of images included in the group or the number of images included in the group to the total number of images stored in the memory 230, and each of the weights, in each of the images, It may be set based on the angle of the face, the resolution of the image, and/or whether the image is the result image of face inpainting.

다양한 실시예에서, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작은, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 하나 이상의 후보 그룹들을 결정하는 동작, 상기 전자 장치(101)의 디스플레이(210)를 통하여, 상기 대표 이미지들 중에서, 상기 하나 이상의 후보 그룹들에 대응하는 하나 이상의 대표 이미지들을 표시하는 동작, 및 상기 하나 이상의 대표 이미지들 중에서 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 상기 제 1 그룹으로서 선택하는 동작을 포함할 수 있다.In various embodiments, the operation of selecting a first group from among the plurality of groups may include one or more of the plurality of groups based on the facial features, the plurality of representative facial features, and the group sizes. Determining candidate groups, displaying one or more representative images corresponding to the one or more candidate groups among the representative images through the display 210 of the electronic device 101, and An operation of selecting a group corresponding to a representative image selected based on a user input from among images as the first group.

다양한 실시예에서, 상기 하나 이상의 후보 그룹들을 결정하는 동작은, 상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하는 동작, 상기 유사도들 중에서 지정된 유사도 이상인 유사도가 존재하는지 여부를 결정하는 동작, 및 상기 지정된 유사도 이상인 유사도가 존재하는 경우, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 상기 하나 이상의 후보 그룹들을 결정하는 동작을 포함할 수 있다.In various embodiments, the determining of the one or more candidate groups may include calculating similarities between the facial feature and each of the plurality of representative facial features, and determining whether a similarity greater than or equal to a designated similarity among the similarities exists. determining the one or more candidate groups from among the plurality of groups based on the facial features, the plurality of representative facial features, and the group sizes, when a similarity equal to or greater than the designated similarity exists; Actions may be included.

다양한 실시예에서, 상기 방법은 상기 지정된 유사도 이상인 유사도가 존재하지 않는 경우, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 상기 디스플레이(210)를 통하여 표시하는 동작, 및 상기 하나 이상의 이미지들 중에서 사용자 입력에 기반하여 선택된 이미지를 상기 제 1 그룹으로서 선택하는 동작을 더 포함하는 방법.In various embodiments, the method may include an operation of displaying one or more images including a predefined face through the display 210 when there is no similarity greater than or equal to the specified similarity, and a user input among the one or more images. and selecting the selected image as the first group based on.

다양한 실시예에서, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작은, 상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하는 동작, 및 상기 유사도들 중에서 가장 큰 유사도를 가지는 대표 얼굴 특징에 대응하는 그룹을 상기 제 1 그룹으로서 선택하는 동작을 포함할 수 있다.In various embodiments, the operation of selecting a first group from among the plurality of groups may include an operation of calculating similarities between the facial feature and each of the plurality of representative facial features; An operation of selecting a group corresponding to a representative facial feature as the first group.

다양한 실시예에서, 상기 제 2 영역이 복원된 얼굴 영역을 획득하는 동작은, 상기 제 1 영역에서 상기 제 2 영역을 제외한 제 3 영역의 상기 제 1 특징 및 상기 제 1 이미지의 제 2 특징과, 상기 제 1 그룹에 대응하는 대표 얼굴 특징을 이용하여, 상기 제 2 영역이 복원된 상기 얼굴 영역을 획득하는 동작을 포함할 수 있다.In various embodiments, the obtaining of the face region in which the second region is reconstructed may include the first feature of a third region excluding the second region from the first region and the second feature of the first image; The method may further include obtaining the face region in which the second region is restored using the representative facial feature corresponding to the first group.

다양한 실시예에서, 상기 방법은, 상기 메모리(230)에 저장된 복수의 이미지들에 포함된 얼굴 특징들을 검출하는 동작, 상기 검출된 얼굴 특징들에 기반하여, 상기 복수의 이미지들을 상기 복수의 그룹들로 그룹화하는 동작, 및 상기 복수의 그룹들에 대응하는 상기 복수의 그룹 정보를 획득하는 동작을 더 포함할 수 있다.In various embodiments, the method may include an operation of detecting facial features included in a plurality of images stored in the memory 230, and combining the plurality of images into the plurality of groups based on the detected facial features. It may further include an operation of grouping into , and an operation of obtaining the plurality of group information corresponding to the plurality of groups.

다양한 실시예에서, 상기 방법은, 상기 제 2 이미지가 획득된 후, 상기 제 2 이미지를 상기 제 1 그룹에 포함시키고, 상기 제 2 이미지에 포함된 얼굴 영역의 특징에 기반하여 상기 제 1 그룹을 갱신하는 동작을 더 포함할 수 있다.In various embodiments, the method may include, after the second image is obtained, include the second image in the first group, and select the first group based on a feature of a face region included in the second image. An update operation may be further included.

또한, 상술한 본 문서의 실시예에서 사용된 데이터의 구조는 컴퓨터로 읽을 수 있는 기록매체에 여러 수단을 통하여 기록될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드 디스크 등), 광학적 판독 매체(예를 들면, CD-ROM, DVD 등)와 같은 저장매체를 포함한다.In addition, the structure of data used in the above-described embodiments of this document can be recorded on a computer-readable recording medium through various means. The computer-readable recording medium includes storage media such as magnetic storage media (eg, ROM, floppy disk, hard disk, etc.) and optical reading media (eg, CD-ROM, DVD, etc.).

101 : 전자 장치 108 : 서버101: electronic device 108: server

Claims (20)

전자 장치에 있어서,
복수의 대표 얼굴 특징들 각각에 대응하는 복수의 그룹들을 저장하는 메모리; 및
상기 메모리와 전기적으로 연결된 적어도 하나의 프로세서를 포함하고,
상기 적어도 하나의 프로세서는,
제 1 이미지를 획득하고,
상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하고,
상기 얼굴의 특징 및 상기 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하고,
상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하고, 및
상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하도록 구성된 전자 장치.
In electronic devices,
a memory for storing a plurality of groups corresponding to each of a plurality of representative facial features; and
at least one processor electrically connected to the memory;
The at least one processor,
Acquiring a first image;
In the first image, detecting a first area representing a face, features of the face, and a second area that needs to be restored within the first area;
Selecting a first group from among the plurality of groups based on the facial feature and the plurality of representative facial features;
Obtaining a facial region in which the second region is reconstructed based on the representative facial feature of the first group and the facial feature; and
An electronic device configured to acquire a second image by synthesizing the face region and the first image.
제 1 항에 있어서,
상기 얼굴의 특징은 제 1 특징 및 제 2 특징을 포함하고,
상기 제 1 특징은 사람의 얼굴에 고유한 특징을 포함하고,
상기 제 2 특징은 상기 제 1 이미지 획득 시 환경 및/또는 상기 얼굴의 상태를 반영한 특징을 포함하는 전자 장치.
According to claim 1,
The facial features include a first feature and a second feature,
The first feature includes a feature unique to a human face,
The second feature includes a feature reflecting an environment and/or a state of the face when the first image is acquired.
제 2 항에 있어서,
상기 메모리는 상기 복수의 그룹들 각각에 대응하는 복수의 그룹 정보를 저장하고,
상기 복수의 그룹 정보는, 상기 복수의 대표 얼굴 특징들, 상기 복수의 그룹들 각각에 대응하는 대표 이미지들, 및 그룹 크기들을 포함하고,
상기 복수의 대표 얼굴 특징들은, 상기 복수의 그룹들 각각에서, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여 획득되고,
상기 대표 이미지들은, 상기 복수의 그룹들 각각에서, 상기 동일한 그룹에 포함된 상기 이미지들 중에서, 상기 가중치들 중 가장 높은 가중치를 가지는 이미지이고,
상기 그룹 크기들 각각은, 상기 복수의 그룹들 각각에 대하여, 그룹에 포함된 이미지들의 개수, 또는 상기 메모리에 저장된 전체 이미지들의 개수에 대한 상기 그룹에 포함된 이미지의 개수의 비율이고, 및
상기 가중치들 각각은, 상기 이미지들 각각에서, 얼굴의 각도, 이미지의 해상도, 및/또는 상기 이미지가 얼굴 인페인팅(face inpainting)의 결과 이미지인지 여부에 기반하여, 설정되는 전자 장치.
According to claim 2,
The memory stores a plurality of group information corresponding to each of the plurality of groups,
The plurality of group information includes the plurality of representative facial features, representative images corresponding to each of the plurality of groups, and group sizes;
The plurality of representative facial features are obtained based on first features and weights of faces of images included in the same group in each of the plurality of groups,
The representative images, in each of the plurality of groups, are images having the highest weight among the weights among the images included in the same group,
Each of the group sizes is a ratio of the number of images included in the group to the number of images included in the group or the total number of images stored in the memory, for each of the plurality of groups, and
Each of the weights is set based on a face angle, a resolution of the image, and/or whether the image is a resultant image of face inpainting in each of the images.
제 3 항에 있어서,
디스플레이를 더 포함하고,
상기 적어도 하나의 프로세서는,
상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 하나 이상의 후보 그룹들을 결정하고,
상기 디스플레이를 통하여, 상기 대표 이미지들 중에서, 상기 하나 이상의 후보 그룹들에 대응하는 하나 이상의 대표 이미지들을 표시하고, 및
상기 하나 이상의 대표 이미지들 중에서 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 상기 제 1 그룹으로서 선택하도록 구성된 전자 장치.
According to claim 3,
Including more displays,
The at least one processor,
determine one or more candidate groups from among the plurality of groups based on the facial feature, the plurality of representative facial features, and the group sizes;
Displaying one or more representative images corresponding to the one or more candidate groups among the representative images through the display; and
An electronic device configured to select a group corresponding to a representative image selected based on a user input from among the one or more representative images as the first group.
제 4 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하고,
상기 유사도들 중에서 지정된 유사도 이상인 유사도가 존재하는지 여부를 결정하고, 및
상기 지정된 유사도 이상인 유사도가 존재하는 경우, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 상기 하나 이상의 후보 그룹들을 결정하도록 구성된 전자 장치.
According to claim 4,
The at least one processor,
calculating similarities between the facial feature and each of the plurality of representative facial features;
determining whether there is a similarity greater than or equal to a designated similarity among the similarities, and
An electronic device configured to determine the one or more candidate groups from among the plurality of groups based on the face feature, the plurality of representative facial features, and the group sizes, when a similarity equal to or greater than the designated similarity exists.
제 5 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 지정된 유사도 이상인 유사도가 존재하지 않는 경우, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 상기 디스플레이를 통하여 표시하고, 및
상기 하나 이상의 이미지들 중에서 사용자 입력에 기반하여 선택된 이미지를 상기 제 1 그룹으로서 선택하도록 더 구성된 전자 장치.
According to claim 5,
The at least one processor,
If there is no similarity greater than or equal to the specified similarity, displaying one or more images including a predefined face through the display, and
The electronic device further configured to select an image selected based on a user input from among the one or more images as the first group.
제 3 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하고, 및
상기 유사도들 중에서 가장 큰 유사도를 가지는 대표 얼굴 특징에 대응하는 그룹을 상기 제 1 그룹으로서 선택하도록 구성된 전자 장치.
According to claim 3,
The at least one processor,
calculating similarities between the facial feature and each of the plurality of representative facial features; and
An electronic device configured to select, as the first group, a group corresponding to a representative facial feature having the greatest similarity among the similarities.
제 2 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 제 1 영역에서 상기 제 2 영역을 제외한 제 3 영역의 상기 제 1 특징 및 상기 제 1 이미지의 제 2 특징과, 상기 제 1 그룹에 대응하는 대표 얼굴 특징을 이용하여, 상기 제 2 영역이 복원된 상기 얼굴 영역을 획득하도록 구성된 전자 장치.
According to claim 2,
The at least one processor,
The second region is restored using the first feature of the third region excluding the second region from the first region, the second feature of the first image, and the representative facial feature corresponding to the first group. An electronic device configured to acquire the face region.
제 3 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 메모리에 저장된 복수의 이미지들에 포함된 얼굴 특징들을 검출하고,
상기 검출된 얼굴 특징들에 기반하여, 상기 복수의 이미지들을 상기 복수의 그룹들로 그룹화하고, 및
상기 복수의 그룹들에 대응하는 상기 복수의 그룹 정보를 획득하도록 더 구성된 전자 장치.
According to claim 3,
The at least one processor,
detecting facial features included in a plurality of images stored in the memory;
grouping the plurality of images into the plurality of groups based on the detected facial features; and
The electronic device further configured to obtain the plurality of group information corresponding to the plurality of groups.
제 9 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 제 2 이미지가 획득된 후, 상기 제 2 이미지를 상기 제 1 그룹에 포함시키고, 상기 제 2 이미지에 포함된 얼굴 영역의 특징에 기반하여 상기 제 1 그룹을 갱신하도록 더 구성된 전자 장치.
According to claim 9,
The at least one processor,
After the second image is obtained, the electronic device is further configured to include the second image in the first group and update the first group based on a feature of a face region included in the second image.
전자 장치에서 이미지를 제공하는 방법에 있어서,
제 1 이미지를 획득하는 동작;
상기 제 1 이미지 내에서, 얼굴을 나타내는 제 1 영역, 상기 얼굴의 특징, 및 상기 제 1 영역 내에서 복원이 필요한 제 2 영역을 검출하는 동작;
상기 얼굴의 특징 및 상기 전자 장치의 메모리에 저장된 복수의 그룹들 각각에 대응하는 복수의 대표 얼굴 특징들에 기반하여, 상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작;
상기 제 1 그룹의 대표 얼굴 특징 및 상기 얼굴의 특징에 기반하여, 상기 제 2 영역이 복원된 얼굴 영역을 획득하는 동작; 및
상기 얼굴 영역 및 상기 제 1 이미지를 합성함으로써, 제 2 이미지를 획득하는 동작을 포함하는 방법.
A method for providing an image in an electronic device,
obtaining a first image;
detecting, within the first image, a first area representing a face, features of the face, and a second area within the first area that needs to be restored;
selecting a first group from among the plurality of groups based on the facial feature and a plurality of representative facial features corresponding to each of the plurality of groups stored in a memory of the electronic device;
obtaining a face region in which the second region is restored, based on the representative facial features of the first group and the facial features; and
and acquiring a second image by synthesizing the face region and the first image.
제 11 항에 있어서,
상기 얼굴의 특징은 제 1 특징 및 제 2 특징을 포함하고,
상기 제 1 특징은 사람의 얼굴에 고유한 특징을 포함하고,
상기 제 2 특징은 상기 제 1 이미지 획득 시 환경 및/또는 상기 얼굴의 상태를 반영한 특징을 포함하는 방법.
According to claim 11,
The facial features include a first feature and a second feature,
The first feature includes a feature unique to a human face,
The second feature includes a feature reflecting an environment and/or a state of the face when the first image is acquired.
제 12 항에 있어서,
상기 메모리는 상기 복수의 그룹들 각각에 대응하는 복수의 그룹 정보를 저장하고,
상기 복수의 그룹 정보는, 상기 복수의 대표 얼굴 특징들, 상기 복수의 그룹들 각각에 대응하는 대표 이미지들, 및 그룹 크기들을 포함하고,
상기 복수의 대표 얼굴 특징들은, 상기 복수의 그룹들 각각에서, 동일한 그룹에 포함된 이미지들의 얼굴의 제 1 특징들 및 가중치들에 기반하여 획득되고,
상기 대표 이미지들은, 상기 복수의 그룹들 각각에서, 상기 동일한 그룹에 포함된 상기 이미지들 중에서, 상기 가중치들 중 가장 높은 가중치를 가지는 이미지이고,
상기 그룹 크기들 각각은, 상기 복수의 그룹들 각각에 대하여, 그룹에 포함된 이미지들의 개수, 또는 상기 메모리에 저장된 전체 이미지들의 개수에 대한 상기 그룹에 포함된 이미지의 개수의 비율이고, 및
상기 가중치들 각각은, 상기 이미지들 각각에서, 얼굴의 각도, 이미지의 해상도, 및/또는 상기 이미지가 얼굴 인페인팅의 결과 이미지인지 여부에 기반하여, 설정되는 방법.
According to claim 12,
The memory stores a plurality of group information corresponding to each of the plurality of groups,
The plurality of group information includes the plurality of representative facial features, representative images corresponding to each of the plurality of groups, and group sizes;
The plurality of representative facial features are obtained based on first features and weights of faces of images included in the same group in each of the plurality of groups,
The representative images, in each of the plurality of groups, are images having the highest weight among the weights among the images included in the same group,
Each of the group sizes is a ratio of the number of images included in the group to the number of images included in the group or the total number of images stored in the memory, for each of the plurality of groups, and
Each of the weights is set based on, in each of the images, an angle of a face, a resolution of the image, and/or whether the image is a result image of face inpainting.
제 13 항에 있어서,
상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작은,
상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 하나 이상의 후보 그룹들을 결정하는 동작;
상기 전자 장치의 디스플레이를 통하여, 상기 대표 이미지들 중에서, 상기 하나 이상의 후보 그룹들에 대응하는 하나 이상의 대표 이미지들을 표시하는 동작; 및
상기 하나 이상의 대표 이미지들 중에서 사용자 입력에 기반하여 선택된 대표 이미지에 대응하는 그룹을 상기 제 1 그룹으로서 선택하는 동작을 포함하는 방법.
According to claim 13,
The operation of selecting a first group from among the plurality of groups,
determining one or more candidate groups from among the plurality of groups based on the face feature, the plurality of representative facial features, and the group sizes;
displaying one or more representative images corresponding to the one or more candidate groups among the representative images through a display of the electronic device; and
and selecting, as the first group, a group corresponding to a representative image selected based on a user input from among the one or more representative images.
제 14 항에 있어서,
상기 하나 이상의 후보 그룹들을 결정하는 동작은,
상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하는 동작;
상기 유사도들 중에서 지정된 유사도 이상인 유사도가 존재하는지 여부를 결정하는 동작; 및
상기 지정된 유사도 이상인 유사도가 존재하는 경우, 상기 얼굴의 특징, 상기 복수의 대표 얼굴 특징들, 및 상기 그룹 크기들에 기반하여, 상기 복수의 그룹들 중에서 상기 하나 이상의 후보 그룹들을 결정하는 동작을 포함하는 방법.
15. The method of claim 14,
The operation of determining the one or more candidate groups,
calculating similarities between the facial feature and each of the plurality of representative facial features;
determining whether there is a similarity greater than or equal to a designated similarity among the similarities; and
Determining the one or more candidate groups from among the plurality of groups based on the facial features, the plurality of representative facial features, and the group sizes, when a similarity equal to or greater than the specified similarity exists. method.
제 15 항에 있어서,
상기 지정된 유사도 이상인 유사도가 존재하지 않는 경우, 미리 정의된 얼굴을 포함하는 하나 이상의 이미지들을 상기 디스플레이를 통하여 표시하는 동작; 및
상기 하나 이상의 이미지들 중에서 사용자 입력에 기반하여 선택된 이미지를 상기 제 1 그룹으로서 선택하는 동작을 더 포함하는 방법.
According to claim 15,
displaying one or more images including a predefined face through the display when there is no similarity greater than or equal to the designated similarity; and
The method further comprising selecting an image selected based on a user input from among the one or more images as the first group.
제 13 항에 있어서,
상기 복수의 그룹들 중에서 제 1 그룹을 선택하는 동작은,
상기 얼굴의 특징과 상기 복수의 대표 얼굴 특징들 각각 간 유사도들을 산출하는 동작; 및
상기 유사도들 중에서 가장 큰 유사도를 가지는 대표 얼굴 특징에 대응하는 그룹을 상기 제 1 그룹으로서 선택하는 동작을 포함하는 방법.
According to claim 13,
The operation of selecting a first group from among the plurality of groups,
calculating similarities between the facial feature and each of the plurality of representative facial features; and
and selecting, as the first group, a group corresponding to a representative facial feature having the greatest similarity among the similarities.
제 12 항에 있어서,
상기 제 2 영역이 복원된 얼굴 영역을 획득하는 동작은,
상기 제 1 영역에서 상기 제 2 영역을 제외한 제 3 영역의 상기 제 1 특징 및 상기 제 1 이미지의 제 2 특징과, 상기 제 1 그룹에 대응하는 대표 얼굴 특징을 이용하여, 상기 제 2 영역이 복원된 상기 얼굴 영역을 획득하는 동작을 포함하는 방법.
According to claim 12,
The operation of acquiring the face region in which the second region is restored,
The second region is restored using the first feature of the third region excluding the second region from the first region, the second feature of the first image, and the representative facial feature corresponding to the first group. A method comprising obtaining the face region that has been selected.
제 13 항에 있어서,
상기 메모리에 저장된 복수의 이미지들에 포함된 얼굴 특징들을 검출하는 동작;
상기 검출된 얼굴 특징들에 기반하여, 상기 복수의 이미지들을 상기 복수의 그룹들로 그룹화하는 동작; 및
상기 복수의 그룹들에 대응하는 상기 복수의 그룹 정보를 획득하는 동작을 더 포함하는 방법.
According to claim 13,
detecting facial features included in a plurality of images stored in the memory;
grouping the plurality of images into the plurality of groups based on the detected facial features; and
The method further comprising obtaining the plurality of group information corresponding to the plurality of groups.
제 19 항에 있어서,
상기 제 2 이미지가 획득된 후, 상기 제 2 이미지를 상기 제 1 그룹에 포함시키고, 상기 제 2 이미지에 포함된 얼굴 영역의 특징에 기반하여 상기 제 1 그룹을 갱신하는 동작을 더 포함하는 방법.
According to claim 19,
After the second image is acquired, including the second image in the first group and updating the first group based on a feature of a face region included in the second image.
KR1020210172029A 2021-12-03 2021-12-03 Method for providing image and electronic device supporting the same KR20230083743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210172029A KR20230083743A (en) 2021-12-03 2021-12-03 Method for providing image and electronic device supporting the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210172029A KR20230083743A (en) 2021-12-03 2021-12-03 Method for providing image and electronic device supporting the same

Publications (1)

Publication Number Publication Date
KR20230083743A true KR20230083743A (en) 2023-06-12

Family

ID=86770272

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210172029A KR20230083743A (en) 2021-12-03 2021-12-03 Method for providing image and electronic device supporting the same

Country Status (1)

Country Link
KR (1) KR20230083743A (en)

Similar Documents

Publication Publication Date Title
US20230076342A1 (en) Method and apparatus for providing image
US20230005227A1 (en) Electronic device and method for offering virtual reality service
CN113705302A (en) Training method and device for image generation model, computer equipment and storage medium
CN114282035A (en) Training and searching method, device, equipment and medium of image searching model
US12026816B2 (en) Method for providing avatar and electronic device supporting the same
US20230260280A1 (en) Electronic device for displaying ar object and method thereof
KR20220036679A (en) Electronic device providing augmented reality contents and method of operation thereof
KR20220153209A (en) Method for processing image and electronic device supporting the same
KR20230083743A (en) Method for providing image and electronic device supporting the same
KR20220101783A (en) Method for providing contents creation function and electronic device supporting the same
KR20220102420A (en) Electronic device for upscailing image and method for controlling the same
US20230306668A1 (en) Electronic device and method for managing information for creating avatar of electronic device
KR20230010493A (en) Method for providing avatar and electronic devcie supporting the same
EP4380174A1 (en) Electronic device for acquiring image at moment intended by user and control method therefor
US20230386254A1 (en) Electronic device, operating method of electronic device, and recording medium
US12073852B2 (en) Electronic device and method for automatically generating edited video
EP4380170A1 (en) Electronic device and method for automatically generating edited video
KR20230020701A (en) Method and apparatus for applying visual effect and setting tag to captured image
US20230343367A1 (en) Image processing method and electronic device supporting same
KR20220153988A (en) Electronic device, and method for capturing image in electronic device
KR20230020328A (en) Electronic device for modifying an image and method thereof
KR20230072353A (en) Electronic device for obtaining image of user-intented moment and method for controlling the same
KR20240058729A (en) Electronic device and method for acquiring an image with a changed rendering style
KR20240058727A (en) Electronic device and method of operating the same
KR20230009713A (en) Electronic device and operation method thereof