KR102389304B1 - Method and device for image inpainting considering the surrounding information - Google Patents

Method and device for image inpainting considering the surrounding information Download PDF

Info

Publication number
KR102389304B1
KR102389304B1 KR1020200134397A KR20200134397A KR102389304B1 KR 102389304 B1 KR102389304 B1 KR 102389304B1 KR 1020200134397 A KR1020200134397 A KR 1020200134397A KR 20200134397 A KR20200134397 A KR 20200134397A KR 102389304 B1 KR102389304 B1 KR 102389304B1
Authority
KR
South Korea
Prior art keywords
image
processor
pixels
information
neural network
Prior art date
Application number
KR1020200134397A
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 KR1020200134397A priority Critical patent/KR102389304B1/en
Priority to PCT/KR2021/012505 priority patent/WO2022080681A1/en
Application granted granted Critical
Publication of KR102389304B1 publication Critical patent/KR102389304B1/en

Links

Images

Classifications

    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/001Image restoration
    • G06T5/005Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/60
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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/20081Training; Learning
    • 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/20084Artificial neural networks [ANN]

Abstract

An operating method for the learning of an image inpainting model comprises the steps of: generating a first image by adding a separate object to an original image; classifying objects included in the first image based on information on each pixel of the first image using a first artificial neural network for classifying objects; removing the separate object from the first image; setting a border between a second object and a third object in a first area corresponding to the removed separate object in the first image; restoring the first area based on the pixel information of the second object and the third object using a second artificial neural network for restoring an image, and generating a restored image; calculating difference values between the pixels of the original image and the restored image; and updating the weight vector of the second artificial neural network for restoring an image based on the difference values of the pixels of the original image and the restored image. Therefore, provided is an easier image inpainting service to a user.

Description

주변 영역을 고려한 이미지 인페인팅 방법 및 디바이스{METHOD AND DEVICE FOR IMAGE INPAINTING CONSIDERING THE SURROUNDING INFORMATION}Image inpainting method and device considering the surrounding area

본 발명은 주변 영역을 고려한 이미지 인페인팅 방법 및 디바이스에 관한 것으로서, 보다 구체적으로, 인공 신경망을 사용하는 이미지 인페인팅 방법에 관한 것이다.The present invention relates to an image inpainting method and device in consideration of a surrounding area, and more particularly, to an image inpainting method using an artificial neural network.

이미지 인페인팅(image inpainting) 기술은 손상된 예술 작품 등의 복원으로부터 시작된 기술로, 현재 이미지 인페인팅 기술은 그림, 사진, 동영상 등의 이미지에서 손상된 부분을 복원하거나 이미지 중에서 일부분을 제거하는 것과 같은 다양한 용도로 사용된다.Image inpainting technology is a technology that started with the restoration of damaged works of art, etc. Currently, image inpainting technology has various uses, such as restoring damaged parts of images, such as paintings, photos, and videos, or removing parts from images. is used as

이미지 중에서 복원할 영역이 존재하는 경우에 이미지 인페인팅 기술은 이미지의 복원할 영역의 경계 부분에 인접한 배경 이미지 영역의 픽셀들(주변 영역의 픽셀들)을 보정하고, 보정된 픽셀들로 복원할 영역을 채우는 기술이다. 여기서 배경 이미지 영역은 원본 이미지에서 복원할 영역을 제외한 나머지 영역을 의미할 수 있다. When there is a region to be restored in the image, the image inpainting technique corrects pixels of the background image region adjacent to the boundary of the region to be restored (pixels in the peripheral region) of the image, and uses the corrected pixels to restore the region to be restored technology to fill Here, the background image area may mean an area other than the area to be restored from the original image.

다만, 이미지 인페인팅 기술은 전문적인 이미지 편집자에 의해 수행되는 경우가 대부분이며, 전문적인 이미지 편집자에게도 이미지 인페인팅을 위한 편집 동작은 고도의 집중도를 요구하는 작업일 수 있다. 따라서, 생활 속에서 촬영한 이미지의 이미지 인페인팅이 필요한 일반인들은 이미지 인페인팅 기술을 이용하기 어려운 문제점이 있다. However, in most cases, the image inpainting technique is performed by a professional image editor, and even for a professional image editor, the editing operation for image inpainting may be a task that requires a high degree of concentration. Therefore, there is a problem in that it is difficult to use image inpainting technology for ordinary people who need image inpainting of images taken in their daily life.

이렇듯, 이미지 인페인팅 기술에 대한 접근성을 높이고, 이미지 인페인팅의 정확도를 높이기 위해서, 인공지능 기반 이미지 인페인팅 방법과 이미지 인페인팅 방법을 수행하는 디바이스 및 어플리케이션 등을 제공하는 것이 필요하게 되었다.As such, in order to increase accessibility to image inpainting technology and to increase the accuracy of image inpainting, it is necessary to provide an artificial intelligence-based image inpainting method and a device and application for performing the image inpainting method.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은 이미지 인페인팅을 수행하는 디바이스의 인공 신경망 및 가중치 벡터를 업데이트함으로써, 이미지 인페인팅을 위한 인공 신경망의 학습 방법을 제공함에 있다.An object of the present invention to solve the above problems is to provide a learning method of an artificial neural network for image inpainting by updating an artificial neural network and a weight vector of a device performing image inpainting.

상기와 같은 문제점을 해결하기 위한 본 발명의 또 다른 목적은 제거된 이미지의 주변 영역의 객체를 이용하여 본래 이미지를 복원하는 방법을 제공하는데 있다.Another object of the present invention to solve the above problems is to provide a method of restoring an original image using an object in a peripheral area of the removed image.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 이미지 인페인팅 모델의 학습을 위한 동작 방법은, 원본 이미지에 별도의 객체를 추가하여, 제1 이미지를 생성하는 단계, 객체 구분을 위한 제1 인공 신경망을 이용하여, 상기 제1 이미지에 포함된 객체들을 상기 제1 이미지의 픽셀들 각각의 정보에 기초하여 구분하는 단계, 상기 제1 이미지에서 상기 별도의 객체를 제거하는 단계, 상기 제1 이미지에서, 상기 제거된 별도의 객체에 상응하는 제1 영역에서의 제2 객체와 제3 객체 간의 경계를 설정하는 단계, 이미지 복원을 위한 제2 인공 신경망을 이용하여, 상기 제1 영역을 상기 제2 객체 및 상기 제3 객체의 픽셀 정보를 기초로 복원하고, 복원된 이미지를 생성하는 단계, 상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 산출하는 단계 및 상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 기초로 상기 이미지 복원을 위한 상기 제2 인공 신경망의 가중치 벡터를 업데이트하는 단계를 포함할 수 있다.In order to achieve the above object, an operating method for learning an image inpainting model according to an embodiment of the present invention includes the steps of adding a separate object to an original image to generate a first image; Using an artificial neural network to classify objects included in the first image based on information on each pixel of the first image, removing the separate object from the first image, and the first image In the step of setting a boundary between a second object and a third object in the first area corresponding to the removed separate object, using a second artificial neural network for image restoration, the first area is divided into the second Restoring based on pixel information of an object and the third object, generating a restored image, calculating a difference value between pixels of the original image and the restored image, and the original image and the restored image The method may include updating a weight vector of the second artificial neural network for image reconstruction based on the difference value of the pixels.

여기서, 상기 제1 영역에서의 제2 객체와 제3 객체 간의 경계를 설정하는 단계는, Here, the step of setting a boundary between the second object and the third object in the first area comprises:

상기 제2 객체 및 상기 제3 객체 각각의 픽셀 정보 및 상기 제2 객체 및 상기 제3 객체 각각의 속성 정보 중 적어도 하나의 정보를 기초로 설정할 수 있다.It may be set based on at least one of pixel information of each of the second object and the third object, and attribute information of each of the second object and the third object.

여기서, 상기 복원된 이미지를 생성하는 단계 이후, 상기 제2 객체의 적어도 일부의 영역의 픽셀 정보를 기초로 상기 제2 객체의 패턴 정보를 분석하는 단계 및 상기 경계에 의해 구분되는 상기 제1 영역 중 적어도 일부의 영역에 상기 제2 객체의 패턴을 오버랩하는 단계를 포함할 수 있다.Here, after generating the reconstructed image, analyzing pattern information of the second object based on pixel information of at least a portion of the region of the second object, and among the first region divided by the boundary The method may include overlapping the pattern of the second object in at least a partial area.

여기서, 상기 복원된 이미지를 생성하는 단계 이후, 상기 제1 이미지를 포함하는 동영상에서, 별도의 제2 이미지를 획득하는 단계, 상기 제2 이미지에서, 상기 제1 영역에 대응되는 픽셀들의 집합인 제1 픽셀 그룹의 정보를 획득하는 단계 및 상기 제1 이미지의 상기 제1 영역에 상기 제1 픽셀 그룹을 오버랩하는 단계를 포함할 수 있다.Here, after the step of generating the restored image, obtaining a separate second image from the moving picture including the first image, in the second image, the second image being a set of pixels corresponding to the first area The method may include obtaining information of one pixel group and overlapping the first pixel group in the first area of the first image.

여기서, 상기 제1 픽셀 그룹을 보정하는 단계를 포함하고, 상기 픽셀들을 오버랩하는 단계는, 상기 보정된 픽셀들을 상기 제1 영역에 오버랩할 수 있다.Here, the step of compensating the first pixel group may include, and the overlapping of the pixels may include overlapping the corrected pixels in the first area.

여기서, 상기 제2 이미지에서, 제2 영역에 위치하는 상기 제1 객체를 트래킹하는 단계, 상기 제1 이미지에서, 상기 제2 영역에 대응되는 픽셀들의 집합인 제2 픽셀 그룹의 정보를 획득하는 단계 및 상기 제2 이미지의 상기 제2 영역에 상기 제2 픽셀 그룹을 오버랩하는 단계를 포함할 수 있다.Here, in the second image, tracking the first object located in a second area, obtaining information on a second pixel group that is a set of pixels corresponding to the second area in the first image and overlapping the second pixel group on the second area of the second image.

여기서, 상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 기초로 상기 객체를 구분하기 위한 제1 인공 신경망의 가중치 벡터를 업데이트하는 단계를 더 포함하고, 상기 제1 인공 신경망의 가중치 벡터는, 상기 제1 이미지의 미리 설정된 객체들의 정보 및 상기 제1 이미지의 픽셀들 각각의 정보를 기초로 구분된 객체들 간의 차이값을 기초로 업데이트될 수 있다.Here, the method further comprises updating a weight vector of a first artificial neural network for classifying the object based on a difference value between pixels of the original image and the reconstructed image, wherein the weight vector of the first artificial neural network includes: The information may be updated based on a difference value between objects divided based on information on preset objects of the first image and information on each pixel of the first image.

여기서, 상기 제2 인공 신경망의 가중치 벡터는, 상기 제1 이미지의 미리 설정된 상기 제1 객체에 상응하는 영역에서의 픽셀들의 정보 및 복원된 상기 제1 객체에 상응하는 영역에서의 픽셀들의 정보 간의 차이값을 기초로 업데이트될 수 있다.Here, the weight vector of the second artificial neural network is a difference between information on pixels in a region corresponding to the preset first object of the first image and information on pixels in a region corresponding to the restored first object. It can be updated based on the value.

본 발명에 의하면, 인공지능을 기반으로 이미지를 분석하여, 이미지를 객체별로 구분하고, 구분된 객체들 중 적어도 하나 이상의 객체를 제거한 후, 이미지를 복원함으로써, 사용자에게 보다 용이한 이미지 인페인팅 서비스를 제공할 수 있는 이점이 있다. According to the present invention, by analyzing an image based on artificial intelligence, classifying the image by object, removing at least one object among the divided objects, and then restoring the image, a more convenient image inpainting service is provided to the user. There are advantages that can be provided.

본 발명에 의하면, 제거된 이미지의 주변 영역의 객체를 이용하여 본래 이미지를 복원하는 동작을 수행함으로써, 사용자에게 보다 용이한 이미지 인페인팅 서비스를 제공할 수 있는 이점이 있다.According to the present invention, there is an advantage that an image inpainting service can be more easily provided to a user by performing an operation of restoring an original image using an object in a peripheral area of the removed image.

도 1은 단말의 구조의 제1 실시예를 도시한 블록도이다.
도 2는 이미지 인페인팅을 위한 디바이스의 동작의 일 실시예를 도시한 흐름도이다.
도3은 이미지 인페인팅을 위한 동작들 중 이미지의 복원을 위한 프로세서의 동작의 제1 실시예를 도시한 흐름도이다.
도4는 이미지 인페인팅을 위한 동작들 중 이미지의 복원을 위한 프로세서의 동작의 제2 실시예를 도시한 흐름도이다.
도 5는 이미지 인페인팅을 위한 동작 과정 각각에 따른 이미지의 보정 과정의 일 실시예를 도시한 개념도이다.
도 6은 동영상의 이미지 인페인팅을 위한 디바이스의 동작의 일 실시예를 도시한 흐름도이다.
도 7은 동영상의 이미지 인페인팅을 위한 동작 과정 각각에 따른 이미지의 보정 과정의 일 실시예를 도시한 개념도이다.
도 8은 이미지 인페인팅을 위한 디바이스의 인공 신경망 학습 동작의 일 실시예를 도시한 흐름도이다.
도 9는 이미지 인페인팅을 위한 디바이스의 인공 신경망 학습 동작 수행 과정의 일 실시예를 도시한 개념도이다.
도 10은 이미지 인페인팅을 위한 동작들 중 인공 신경망을 기초로 한 동작의 실시예를 도시한 흐름도이다.
도 11은 이미지 인페인팅을 위한 동작들 중 오브젝트 트래킹 동작의 실시예를 도시한 개념도이다.
1 is a block diagram illustrating a first embodiment of the structure of a terminal.
2 is a flowchart illustrating an embodiment of an operation of a device for image inpainting.
3 is a flowchart illustrating a first embodiment of an operation of a processor for image restoration among operations for image inpainting.
4 is a flowchart illustrating a second embodiment of an operation of a processor for image restoration among operations for image inpainting.
5 is a conceptual diagram illustrating an embodiment of an image correction process according to each operation process for image inpainting.
6 is a flowchart illustrating an embodiment of an operation of a device for inpainting an image of a moving picture.
7 is a conceptual diagram illustrating an embodiment of an image correction process according to each operation process for image inpainting of a moving picture.
8 is a flowchart illustrating an embodiment of an artificial neural network learning operation of a device for image inpainting.
9 is a conceptual diagram illustrating an embodiment of a process of performing an artificial neural network learning operation of a device for image inpainting.
10 is a flowchart illustrating an embodiment of an operation based on an artificial neural network among operations for image inpainting.
11 is a conceptual diagram illustrating an embodiment of an object tracking operation among operations for image inpainting.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.Since the present invention can have various changes and can have various embodiments, specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to specific embodiments, and it should be understood to include all modifications, equivalents and substitutes included in the spirit and scope of the present invention.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first, second, etc. may be used to describe various elements, but the elements should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component. and/or includes a combination of a plurality of related listed items or any of a plurality of related listed items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being “connected” or “connected” to another component, it may be directly connected or connected to the other component, but it is understood that other components may exist in between. it should be On the other hand, when it is said that a certain element is "directly connected" or "directly connected" to another element, it should be understood that the other element does not exist in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in the present application are only used to describe specific embodiments, and are not intended to limit the present invention. The singular expression includes the plural expression unless the context clearly dictates otherwise. In the present application, terms such as “comprise” or “have” are intended to designate that a feature, number, step, operation, component, part, or combination thereof described in the specification exists, but one or more other features It should be understood that this does not preclude the existence or addition of numbers, steps, operations, components, parts, or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가진 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical and scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Terms such as those defined in a commonly used dictionary should be interpreted as having a meaning consistent with the meaning in the context of the related art, and should not be interpreted in an ideal or excessively formal meaning unless explicitly defined in the present application. does not

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 본 발명을 설명함에 있어 전체적인 이해를 용이하게 하기 위하여 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. In describing the present invention, in order to facilitate the overall understanding, the same reference numerals are used for the same components in the drawings, and duplicate descriptions of the same components are omitted.

도 1은 단말의 구조의 제1 실시예를 도시한 블록도이다.1 is a block diagram showing a first embodiment of the structure of a terminal.

도 1을 참고하면, 단말은 카메라(110), 프로세서(120), 디스플레이(130) 및 메모리(140)를 포함할 수 있다. 카메라(110)는 이미지 센서(111), 버퍼(112), 전처리 모듈(113), 리사이저(114) 및 제어기(115)를 포함할 수 있다. 카메라(110)는 외부 영역의 이미지를 획득할 수 있다. 카메라(110)는 이미지 센서(111)에 의해 생성된 로우 데이터를 카메라의 버퍼(112)에 저장할 수 있다. 로우 데이터는 카메라(110) 내의 제어기(115) 또는 프로세서(120)에 의해 처리될 수 있다. 처리된 데이터는 디스플레이(140) 또는 인코더(123)로 전달될 수도 있다. 또는, 로우 데이터는 처리된 후 버퍼(112)에 저장될 수 있고, 버퍼(112)로부터 디스플레이(140) 또는 인코더(174)로 전달될 수 있다. 카메라(110)에 의해 획득된 이미지는 장방형(ERP: equirectangular) 이미지, 파노라마 이미지, 원형 어안 이미지, 구형(spherical) 이미지 또는 3차원 이미지의 일부일 수 있다.Referring to FIG. 1 , the terminal may include a camera 110 , a processor 120 , a display 130 , and a memory 140 . The camera 110 may include an image sensor 111 , a buffer 112 , a preprocessing module 113 , a resizer 114 , and a controller 115 . The camera 110 may acquire an image of the external area. The camera 110 may store the raw data generated by the image sensor 111 in the buffer 112 of the camera. The raw data may be processed by the controller 115 or the processor 120 in the camera 110 . The processed data may be transmitted to the display 140 or the encoder 123 . Alternatively, the raw data may be processed and then stored in the buffer 112 , and may be transferred from the buffer 112 to the display 140 or encoder 174 . The image acquired by the camera 110 may be a portion of an equirectangular (ERP) image, a panoramic image, a circular fisheye image, a spherical image, or a three-dimensional image.

이미지 센서(111)는 외부로부터 입사된 광을 감지함으로써 로우 데이터를 수집할 수 있다. 이미지 센서(111)는, 예를 들어, CCD(charge coupled device), CMOS(Complementary Metal Oxide Semiconductor) 이미지 센서 또는 IR(infrared) 광센서(150) 중 적어도 하나의 센서를 포함할 수 있다. 이미지 센서(111)는 제어기(115)에 의해 제어될 수 있다.The image sensor 111 may collect raw data by detecting light incident from the outside. The image sensor 111 may include, for example, at least one of a charge coupled device (CCD), a complementary metal oxide semiconductor (CMOS) image sensor, and an infrared (IR) optical sensor 150 . The image sensor 111 may be controlled by the controller 115 .

전처리 모듈(113)은 이미지 센서(111)에 의해 획득된 로우 데이터를 컬러 스페이스(color space) 형태로 변환할 수 있다. 컬러 스페이스는 YUV 컬러 스페이스, RGB(red green blue) 컬러 스페이스 및 RGBA(red green blue alpha) 컬러 스페이스 중 하나일 수 있다. 전처리 모듈(113)은 컬러 스페이스 형태로 변환된 데이터를 버퍼(112) 또는 프로세서(120)로 전달할 수 있다.The pre-processing module 113 may convert the raw data obtained by the image sensor 111 into a color space form. The color space may be one of a YUV color space, a red green blue (RGB) color space, and a red green blue alpha (RGBA) color space. The preprocessing module 113 may transmit the data converted into the color space form to the buffer 112 or the processor 120 .

전처리 모듈(113)은 수신한 로우 데이터에 포함된 이미지의 에러 또는 왜곡을 보정할 수 있다. 그리고 전처리 모듈(113)은 로우 데이터에 포함된 이미지의 색상 또는 크기 등을 조절할 수 있다. 전처리 모듈(113)은, 예를 들어, BPC(bad pixel correction), LS(lens shading), 디모자이킹(demosaicing), WB(white balance), 감마 보정(gamma correction), CSC(color space conversion), HSC(hue, saturation, contrast) 개선, 크기 변환, 필터링 및 이미지 분석 중 적어도 하나의 동작을 수행할 수 있다.The pre-processing module 113 may correct an error or distortion of an image included in the received raw data. In addition, the pre-processing module 113 may adjust the color or size of the image included in the raw data. The preprocessing module 113 is, for example, bad pixel correction (BPC), lens shading (LS), demosaicing, white balance (WB), gamma correction, color space conversion (CSC) , HSC (hue, saturation, contrast) improvement, size conversion, filtering, and at least one of image analysis may be performed.

단말의 프로세서(120)는 관리 모듈(121), 이미지 처리 모듈(122), 및 인코더(123)를 포함할 수 있다. 관리 모듈(121), 이미지 처리 모듈(122), 및 인코더(123)는 프로세서(120) 내에 포함된 하드웨어 모듈일 수도 있고, 프로세서(290)에 의해 실행될 수 있는 소프트웨어 모듈일 수도 있다. 도 1을 참조하면, 관리 모듈(121), 이미지 처리 모듈(122), 및 인코더(123)는 프로세서(120) 내에 포함된 것으로 도시되었으나, 이에 제한되지 않을 수 있다. 관리 모듈(121), 이미지 처리 모듈(122), 및 인코더(123) 중 일부는 프로세서(120)와 별도의 모듈로 구현될 수도 있다.The processor 120 of the terminal may include a management module 121 , an image processing module 122 , and an encoder 123 . The management module 121 , the image processing module 122 , and the encoder 123 may be hardware modules included in the processor 120 , or may be software modules that may be executed by the processor 290 . Referring to FIG. 1 , the management module 121 , the image processing module 122 , and the encoder 123 are illustrated as being included in the processor 120 , but may not be limited thereto. Some of the management module 121 , the image processing module 122 , and the encoder 123 may be implemented as a module separate from the processor 120 .

일 실시 예에 따르면, 관리 모듈(121)은 단말에 포함된 카메라(110)를 제어할 수 있다. 관리 모듈(121)은 카메라(110)의 초기화, 카메라(110)의 전원 입력 모드 및 카메라(110)의 동작을 제어할 수 있다. 그리고 관리 모듈(121)은 카메라(110)에 포함된 버퍼(112)의 이미지 처리 동작, 캡쳐된 이미지 프로세싱(captured image processing), 이미지의 크기 등을 제어할 수 있다.According to an embodiment, the management module 121 may control the camera 110 included in the terminal. The management module 121 may control initialization of the camera 110 , a power input mode of the camera 110 , and an operation of the camera 110 . In addition, the management module 121 may control an image processing operation of the buffer 112 included in the camera 110 , captured image processing, image size, and the like.

관리 모듈(121)은 제1 전자 장치(100)가 자동 초점, 자동 노출, 해상도, 비트 레이트, 프레임 레이트, 카메라 파워 모드, VBI, 줌, 감마 또는 화이트 밸런스 등을 조절하도록 제1 전자 장치(100)를 제어할 수 있다. 관리 모듈(121)은 획득한 이미지를 이미지 처리 모듈(122)에 전달하고, 처리를 수행하도록 이미지 처리 모듈(122)을 제어할 수 있다.The management module 121 controls the first electronic device 100 so that the first electronic device 100 adjusts auto focus, auto exposure, resolution, bit rate, frame rate, camera power mode, VBI, zoom, gamma, or white balance. ) can be controlled. The management module 121 may transmit the acquired image to the image processing module 122 and control the image processing module 122 to perform processing.

관리 모듈(121)은 획득한 이미지를 인코더(123)로 전달할 수 있다. 그리고 관리 모듈(121)은 인코더(123)를 제어하여 획득한 이미지를 인코딩하도록 할 수 있다. The management module 121 may transmit the acquired image to the encoder 123 . In addition, the management module 121 may control the encoder 123 to encode the obtained image.

이미지 처리 모듈(122)은 관리 모듈(121)로부터 이미지를 획득할 수 있다. 이미지 처리 모듈(122)은 획득한 이미지의 처리 동작을 수행할 수 있다. 구체적으로, 이미지 처리 모듈(122)은 획득한 이미지의 노이즈 제거(noise reduction), 필터링, 이미지 합성(image synthesize), 색상 보정(color correction), 색 변환(color conversion), 이미지 변환(transformation), 3D 모델링, 이미지 드로잉, AR(augmented reality)/VR(virtual reality) 처리, 동적 범위 조절(dynamic range adjusting), 원근감(perspective) 조절, 시어링(shearing), 리사이징, 에지 추출, ROI(region of interest) 판단, 이미지 정합(matching) 및/또는 이미지 분할(segmentation) 등을 수행할 수 있다. 이미지 처리 모듈(122)은 복수의 이미지의 합성, 스테레오스코픽 이미지 생성 또는 깊이 기반 파노라마 이미지 생성 등과 같은 처리를 수행할 수도 있다.The image processing module 122 may acquire an image from the management module 121 . The image processing module 122 may perform a processing operation on the acquired image. Specifically, the image processing module 122 may perform noise reduction, filtering, image synthesize, color correction, color conversion, image transformation, and/or filtering of the acquired image. 3D modeling, image drawing, augmented reality (AR)/virtual reality (VR) processing, dynamic range adjusting, perspective adjustment, shearing, resizing, edge extraction, region of interest (ROI) Judgment, image matching, and/or image segmentation may be performed. The image processing module 122 may perform processing such as synthesizing a plurality of images, generating a stereoscopic image, or generating a depth-based panoramic image.

도 2는 이미지 인페인팅을 위한 디바이스의 동작의 일 실시예를 도시한 흐름도이다. 2 is a flowchart illustrating an embodiment of an operation of a device for image inpainting.

도 2를 참조하면, 디바이스의 프로세서는 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 인공 신경망 네트워크(artificial neural network, ANN)를 포함할 수 있으며, 인공 신경망을 이용하여 인공지능 기반의 이미지 인페인팅을 위한 동작들을 수행할 수 있다. Referring to FIG. 2 , the processor of the device may perform operations for image inpainting. The processor may include an artificial neural network (ANN), and may perform operations for image inpainting based on artificial intelligence using the artificial neural network.

S210단계에서, 프로세서는 제1 이미지에 포함된 객체들을 구분할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 이미지에 포함된 객체들을 구분할 수 있다. 예를 들어, 프로세서는 제1 이미지에 포함된 픽셀들의 정보를 기초로 제1 이미지에 포함된 복수개의 개체들을 구분할 수 있다. 프로세서는 제1 이미지에 포함된 객체들을 구분함에 있어, 픽셀들의 색상 정보 등을 반영할 수 있다. 인접한 서로 다른 픽셀들의 색상 정보 값의 차이가 미리 설정된 값 이하인 경우, 프로세서는 제1 이미지에 포함된 객체들을 구분함에 있어, 인접한 서로 다른 픽셀들을 동일 및/또는 유사한 객체의 이미지로부터 획득한 픽셀임을 판단할 수 있다. In step S210 , the processor may classify objects included in the first image. The processor may classify objects included in the first image by using an artificial neural network. For example, the processor may classify a plurality of objects included in the first image based on information on pixels included in the first image. The processor may reflect color information of pixels, etc. in classifying objects included in the first image. When the difference between the color information values of different adjacent pixels is less than or equal to a preset value, the processor determines that different adjacent pixels are pixels obtained from images of the same and/or similar object in classifying objects included in the first image can do.

S220단계에서, 프로세서는 제1 이미지의 객체들 중에서 보정 대상 객체(또는 별도의 객체)인 제1 객체를 결정할 수 있다. 또는 프로세서는 제1 이미지에 포함된 객체들의 색상 정보, 형상 정보 등을 기초로 객체들 각각을 분석할 수 있으며, 객체들 각각의 분석 결과를 기초로 보정 대상 객체인 제1 객체를 결정할 수 있다. 프로세서는 사용자로부터의 입력 정보를 기초로 제1 이미지의 객체들 중에서 보정 대상 객체인 제1 객체를 결정할 수 있다. 프로세서는 제1 이미지에서 보정 대상 객체로 결정된 제1 객체를 제거할 수 있다. In operation S220 , the processor may determine a first object that is a correction target object (or a separate object) from among the objects of the first image. Alternatively, the processor may analyze each of the objects based on color information and shape information of the objects included in the first image, and may determine the first object to be corrected based on the analysis result of each of the objects. The processor may determine a first object to be corrected from among the objects of the first image based on input information from the user. The processor may remove the first object determined as the object to be corrected from the first image.

S230단계에서, 프로세서는 제1 이미지에서 제거된 제1 객체에 상응하는 영역에서의 제2 객체와 제3 객체 간의 경계를 설정할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 이미지에서 제거된 제1 객체에 상응하는 영역에서의 제2 객체와 제3 객체 간의 경계를 설정할 수 있다. 구체적으로, 프로세서는 제2 객체 및 제3 객체 각각의 픽셀 정보를 기초로 제1 객체에 상응하는 영역에서의 제2 객체와 제3 객체 간의 경계를 설정할 수 있다. 프로세서는 제2 객체 및 제3 객체 각각의 속성 정보 중 적어도 하나의 정보를 기초로 제1 객체에 상응하는 영역에서의 제2 객체와 제3 객체 간의 경계를 설정할 수 있다. 즉, 프로세서는 제1 이미지의 제1 객체에 상응하는 영역을 제2 객체와 연관되는 (a) 영역과 제3 객체에 연관되는 (b) 영역으로 구분할 수 있으며, (a) 영역과 (b) 영역 간의 경계를 설정할 수 있다. In operation S230 , the processor may set a boundary between the second object and the third object in a region corresponding to the first object removed from the first image. The processor may set a boundary between the second object and the third object in a region corresponding to the first object removed from the first image by using the artificial neural network. Specifically, the processor may set a boundary between the second object and the third object in the area corresponding to the first object based on pixel information of each of the second object and the third object. The processor may set a boundary between the second object and the third object in the area corresponding to the first object based on at least one piece of attribute information of each of the second object and the third object. That is, the processor may divide the region corresponding to the first object of the first image into an (a) region associated with the second object and a (b) region associated with the third object, (a) region and (b) You can set boundaries between regions.

S240단계에서, 프로세서는 경계를 기준으로, 제1 객체에 상응하는 영역을 제2 객체 및 제3 객체의 픽셀 정보를 기초로 복원할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 객체에 상응하는 영역을 제2 객체 및 제3 객체의 픽셀 정보를 기초로 복원할 수 있다. 즉, 프로세서는 제2 객체의 픽셀 정보를 기초로 제1 이미지의 (a) 영역을 복원할 수 있으며, 제3 객체의 픽셀 정보를 기초로 제1 이미지의 (b) 영역을 복원할 수 있다. 따라서, 프로세서에 의한 이미지 인페인팅 결과, 프로세서는 복원된 제1 이미지를 획득할 수 있다. In operation S240 , the processor may restore an area corresponding to the first object based on the boundary based on pixel information of the second object and the third object. The processor may reconstruct a region corresponding to the first object based on pixel information of the second object and the third object by using the artificial neural network. That is, the processor may reconstruct region (a) of the first image based on pixel information of the second object, and may reconstruct region (b) of the first image based on pixel information of the third object. Accordingly, as a result of image inpainting by the processor, the processor may acquire a restored first image.

도3은 이미지 인페인팅을 위한 동작들 중 이미지의 복원을 위한 프로세서의 동작의 제1 실시예를 도시한 흐름도이다. 3 is a flowchart illustrating a first embodiment of an operation of a processor for image restoration among operations for image inpainting.

도 3을 참조하면, 디바이스의 프로세서는 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 인공 신경망 네트워크를 포함할 수 있으며, 인공 신경망을 이용하여 인공지능 기반의 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 도 2의 S210 단계 내지 S240 단계의 동작을 수행한 상태일 수 있다. Referring to FIG. 3 , the processor of the device may perform operations for image inpainting. The processor may include an artificial neural network, and may perform operations for image inpainting based on artificial intelligence using the artificial neural network. The processor may be in a state in which the operations of steps S210 to S240 of FIG. 2 are performed.

S310단계에서, 프로세서는 제2 객체의 패턴 정보를 분석할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 객체의 패턴 정보를 분석할 수 있다. 프로세서는 제2 객체에 포함된 픽셀들의 색상 정보, 및 제2 객체의 형상 정보 등을 기초로 제2 객체를 분석할 수 있으며, 분석 결과를 기초로 제2 객체 내부에 추가 경계선을 설정할 수 있다. 프로세서는 설정된 제2 객체 내부에 추가 경계선에 관한 정보를 기초로 제2 객체 내부의 패턴 정보를 획득할 수 있다. In step S310, the processor may analyze the pattern information of the second object. The processor may analyze the pattern information of the second object by using the artificial neural network. The processor may analyze the second object based on color information of pixels included in the second object, shape information of the second object, and the like, and may set an additional boundary line inside the second object based on the analysis result. The processor may acquire pattern information inside the second object based on the information on the additional boundary line inside the set second object.

S320단계에서, 프로세서는 제2 객체의 속성 정보를 분석할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 객체의 속성 정보를 분석할 수 있다. 프로세서는 제2 객체의 색상 정보, 형상 정보 등을 기초로 제2 객체를 분석할 수 있으며, 분석 결과를 기초로 제2 객체의 속성 정보를 결정할 수 있다. 프로세서는 제2 객체에 속성 정보를 라벨링할 수 있다. 제2 객체 내부에 패턴 정보를 획득한 경우, 프로세서는 제2 객체의 세부 영역들에 추가적으로 속성 정보를 라벨링할 수 있다. In step S320 , the processor may analyze attribute information of the second object. The processor may analyze attribute information of the second object by using the artificial neural network. The processor may analyze the second object based on color information and shape information of the second object, and may determine attribute information of the second object based on the analysis result. The processor may label the attribute information on the second object. When the pattern information inside the second object is obtained, the processor may additionally label the attribute information in detailed areas of the second object.

S330단계에서, 프로세서는 제1 이미지의 제1 객체에 상응하는 영역에 제2 객체의 패턴을 오버랩할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 객체에 상응하는 영역에 제2 객체의 패턴을 오버랩할 수 있다. 따라서, 프로세서에 의한 이미지 인페인팅 결과, 복원된 제1 이미지를 획득할 수 있다. In operation S330 , the processor may overlap the pattern of the second object on an area corresponding to the first object of the first image. The processor may overlap the pattern of the second object in an area corresponding to the first object by using the artificial neural network. Accordingly, as a result of image inpainting by the processor, a restored first image may be obtained.

도4는 이미지 인페인팅을 위한 동작들 중 이미지의 복원을 위한 프로세서의 동작의 제2 실시예를 도시한 흐름도이다. 4 is a flowchart illustrating a second embodiment of an operation of a processor for image restoration among operations for image inpainting.

도 4를 참조하면, 디바이스의 프로세서는 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 인공 신경망 네트워크를 포함할 수 있으며, 인공 신경망을 이용하여 인공지능 기반의 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 도 2의 S210 단계 내지 S240 단계의 동작을 수행한 상태일 수 있다.Referring to FIG. 4 , the processor of the device may perform operations for image inpainting. The processor may include an artificial neural network, and may perform operations for image inpainting based on artificial intelligence using the artificial neural network. The processor may be in a state in which the operations of steps S210 to S240 of FIG. 2 are performed.

S410단계에서, 프로세서는 제2 이미지를 획득할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 이미지 인페인팅 대상인 제1 이미지와 유사한 제2 이미지를 획득할 수 있다. 프로세서는 제1 이미지의 픽셀들의 정보를 기초로 별도의 이미지들을 분석하여, 별도의 이미지들 중 미리 설정된 값 이상의 유사도를 갖는 제2 이미지를 획득할 수 있다. 프로세서는 디바이스의 메모리에 저장된 별도의 이미지들 중에서 제1 이미지와 유사한 제2 이미지를 획득할 수 있다. 또는 프로세서는 외부의 데이터베이스에 저장된 별도의 이미지들 중에서 제1 이미지와 유사한 제2 이미지를 획득할 수 있다.In step S410, the processor may acquire a second image. The processor may acquire a second image similar to the first image, which is an image inpainting target, by using the artificial neural network. The processor may analyze the separate images based on the information on the pixels of the first image to obtain a second image having a similarity greater than or equal to a preset value among the separate images. The processor may acquire a second image similar to the first image from among the separate images stored in the memory of the device. Alternatively, the processor may acquire a second image similar to the first image from among separate images stored in an external database.

S420단계에서, 프로세서는 제2 이미지에서 제1 객체에 상응하는 영역에 대응되는 제1 픽셀 그룹을 획득할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 이미지에서 제1 이미지의 제1 객체에 상응하는 영역에 대응되는 제1 픽셀 그룹을 획득할 수 있다. In operation S420 , the processor may acquire a first pixel group corresponding to an area corresponding to the first object in the second image. The processor may obtain a first pixel group corresponding to a region corresponding to the first object of the first image in the second image by using the artificial neural network.

일 실시예에 따르면, 프로세서는 제1 이미지에서의 제1 객체에 상응하는 영역의 위치 정보를 산출할 수 있으며, 산출한 위치 정보를 제2 이미지에 적용하여, 제2 이미지로부터 제1 픽셀 그룹을 획득할 수 있다. According to an embodiment, the processor may calculate location information of a region corresponding to the first object in the first image, and apply the calculated location information to the second image to generate a first pixel group from the second image. can be obtained

다른 실시예에 따르면, 프로세서는 제1 이미지에서의 제1 객체에 상응하는 영역에 인접한 픽셀들의 정보를 산출할 수 있으며, 산출한 픽셀들의 정보를 기초로 제2 이미지로부터 제1 픽셀 그룹을 획득할 수 있다. According to another embodiment, the processor may calculate information on pixels adjacent to an area corresponding to the first object in the first image, and obtain a first pixel group from the second image based on the calculated information on the pixels. can

S430단계에서, 프로세서는 제1 픽셀 그룹의 픽셀들을 보정할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 픽셀 그룹의 픽셀들을 보정함으로써, 제1 픽셀 그룹의 픽셀들을 제1 이미지에 최적화시킬 수 있다. In operation S430 , the processor may correct the pixels of the first pixel group. The processor may optimize the pixels of the first pixel group to the first image by correcting the pixels of the first pixel group using the artificial neural network.

일 실시예에 따르면, 프로세서는 제1 그룹의 픽셀들의 색상 정보와 제1 이미지의 제1 객체에 인접한 픽셀들의 색상 정보를 비교할 수 있다. 제1 그룹의 픽셀들의 색상 정보 값과 제1 이미지의 제1객체에 인접한 픽셀들의 색상 정보 값의 차이가 미리 설정된 값을 초과하는 경우, 프로세서는 제1 이미지의 제1 객체에 인접한 픽셀들의 색상 정보를 기준으로 제1 그룹의 픽셀들의 색상을 보정할 수 있다. According to an embodiment, the processor may compare color information of pixels of the first group with color information of pixels adjacent to the first object of the first image. When the difference between the color information value of pixels of the first group and the color information value of pixels adjacent to the first object of the first image exceeds a preset value, the processor is configured to: Colors of pixels of the first group may be corrected based on .

다른 실시예에 따르면, 프로세서는 제1 그룹의 형상 정보와 제1 이미지의 제1 객체의 형상 정보를 비교할 수 있다. 제1 그룹의 형상 정보와 제1 이미지의 제1 객체의 형상이 일치하지 않는 경우, 프로세서는 제1 이미지의 제1 객체의 형상을 기준으로, 제1 그룹의 형상을 보정할 수 있다. According to another embodiment, the processor may compare the shape information of the first group with the shape information of the first object of the first image. When the shape information of the first group does not match the shape of the first object of the first image, the processor may correct the shape of the first group based on the shape of the first object of the first image.

S440단계에서, 프로세서는 제1 픽셀 그룹의 픽셀들을 제1 객체에 상응하는 영역에 오버랩할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 이미지로부터 획득하고, 복원된 제1 픽셀 그룹의 픽셀들을 제1 이미지에 오버랩하여, 제1 이미지를 보정할 수 있다. 따라서, 프로세서에 의한 이미지 인페인팅 결과, 복원된 제1 이미지를 획득할 수 있다. In operation S440 , the processor may overlap the pixels of the first pixel group in an area corresponding to the first object. The processor may use an artificial neural network to correct the first image by overlapping the pixels of the reconstructed first pixel group on the first image obtained from the second image. Accordingly, as a result of image inpainting by the processor, a restored first image may be obtained.

도 5는 이미지 인페인팅을 위한 동작 과정 각각에 따른 이미지의 보정 과정의 일 실시예를 도시한 개념도이다. 5 is a conceptual diagram illustrating an embodiment of an image correction process according to each operation process for image inpainting.

도5를 참조하면, 디바이스의 프로세서는 이미지 인페인팅을 위한 동작들을 수행할 수 있다.프로세서는 도 5(a)의 제1 이미지에 이미지 인페인팅 기법을 적용하여, 도 5(c)에 도시된 복원된 제1 이미지를 획득할 수 있다. 프로세서가 이미지 인페인팅 기법을 적용하여 복원된 이미지를 획득하는 구체적인 동작들은 아래와 같을 수 있다. Referring to FIG. 5 , the processor of the device may perform operations for image inpainting. The processor applies an image inpainting technique to the first image of FIG. 5( a ), as shown in FIG. 5( c ). A restored first image may be acquired. Specific operations in which the processor acquires a reconstructed image by applying the image inpainting technique may be as follows.

도 5(a)를 참조하면, 프로세서는 제1 이미지에 포함된 객체들(510, 520, 530)을 구분할 수 있다. 프로세서는 제1 이미지에 포함된 객체들(510, 520, 530)을 구분함에 있어, 픽셀들의 색상 정보 등을 반영할 수 있다. Referring to FIG. 5A , the processor may distinguish objects 510 , 520 , and 530 included in the first image. In classifying the objects 510 , 520 , and 530 included in the first image, the processor may reflect color information of pixels, and the like.

프로세서는 제1 이미지의 객체들 중에서 보정 대상 객체인 제1 객체(510)를 결정할 수 있다. 프로세서는 제1 이미지에서 보정 대상 객체로 결정된 제1 객체(510)를 제거할 수 있다. 제1 이미지에서 제1 객체가 제거된 이미지는 도 5(b)에 도시된 바와 같을 수 있다. The processor may determine a first object 510 that is a correction target object from among the objects of the first image. The processor may remove the first object 510 determined as the object to be corrected from the first image. The image from which the first object is removed from the first image may be as shown in FIG. 5(b) .

도 5(b)를 참조하면, 프로세서는 제1 이미지에서 제거된 제1 객체에 상응하는 영역에서의 제2 객체와 제3 객체 간의 경계를 설정할 수 있다. 따라서, 제거된 제1 객체에 상응하는 영역은 객체에 상응하도록 경계에 의해 구분될 수 있다. 구체적으로, 프로세서는 제2 객체 및 제3 객체 각각의 픽셀 정보를 기초로 제1 객체에 상응하는 영역에서의 제2 객체(520)와 제3 객체(530) 간의 경계를 설정할 수 있다. Referring to FIG. 5B , the processor may set a boundary between the second object and the third object in a region corresponding to the first object removed from the first image. Accordingly, an area corresponding to the removed first object may be divided by a boundary to correspond to the object. Specifically, the processor may set a boundary between the second object 520 and the third object 530 in an area corresponding to the first object based on pixel information of each of the second object and the third object.

프로세서는 경계를 기준으로, 제1 객체(510)에 상응하는 영역을 제2 객체 및 제3 객체의 픽셀 정보를 기초로 복원할 수 있다. 프로세서는 제2 객체의 픽셀 정보를 기초로 제1 객체(510)에 상응하는 영역 중에서 일부 영역(512)을 복원할 수 있으며, 제3 객체의 픽셀 정보를 기초로 제1 객체(510)에 상응하는 영역 중에서 나머지 영역(513) 영역을 복원할 수 있다. 프로세서가 제1 이미지와 별도의 이미지인 제2 이미지로부터 일부 영역에 관한 제1 픽셀 그룹을 획득한 경우, 프로세서는 제1 픽셀 그룹의 픽셀들을 제1 객체에 상응하는 영역 중에서 일부 영역(512)에 오버랩할 수 있다. 또는 프로세서가 제3 객체의 패턴 정보를 획득한 경우, 프로세서는 제1 객체에 상응하는 영역 중에서 일부 영역(513)에 제3 객체의 패턴을 오버랩할 수 있다. 복원된 제1 이미지는 도 5(c)에 도시된 바와 같을 수 있다. The processor may reconstruct an area corresponding to the first object 510 based on the pixel information of the second object and the third object based on the boundary. The processor may reconstruct a partial region 512 from among the regions corresponding to the first object 510 based on the pixel information of the second object, and may reconstruct the region 512 corresponding to the first object 510 based on the pixel information of the third object. The remaining area 513 may be restored among the areas to be used. When the processor obtains the first pixel group for the partial region from the second image, which is an image separate from the first image, the processor places the pixels of the first pixel group into the partial region 512 of the region corresponding to the first object. can overlap. Alternatively, when the processor obtains the pattern information of the third object, the processor may overlap the pattern of the third object in a partial region 513 of the regions corresponding to the first object. The restored first image may be as shown in FIG. 5( c ).

도 6은 동영상의 이미지 인페인팅을 위한 디바이스의 동작의 일 실시예를 도시한 흐름도이다. 6 is a flowchart illustrating an embodiment of an operation of a device for inpainting an image of a moving picture.

도 6을 참조하면, 디바이스의 프로세서는 제1 이미지 및 제2 이미지를 포함하는 동영상의 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 인공 신경망 네트워크를 포함할 수 있으며, 인공 신경망을 이용하여 인공지능 기반의 동영상의 이미지 인페인팅을 위한 동작들을 수행할 수 있다. 프로세서는 도 2의 S210 단계 내지 S240 단계의 동작을 수행한 상태일 수 있다.Referring to FIG. 6 , the processor of the device may perform operations for image inpainting of a moving picture including a first image and a second image. The processor may include an artificial neural network, and may perform operations for image inpainting of a moving image based on artificial intelligence using the artificial neural network. The processor may be in a state in which the operations of steps S210 to S240 of FIG. 2 are performed.

S610단계에서, 프로세서는 제2 이미지에서의 제1 객체를 트래킹할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 이미지에서의 제1 객체를 트랙킹할 수 있다. 프로세서는 제2 이미지의 객체들 중, 제1 이미지에서의 제1 객체와의 유사도가 미리 설정된 값 이상인 객체를 제1 객체로 판단할 수 있다. 즉, 프로세서는 제1 객채의 색채, 형상 정보 등을 이용하여, 제2 이미지에서 유사한 색채 및 형상을 갖는 객체를 트랙킹할 수 있다. In step S610, the processor may track the first object in the second image. The processor may track the first object in the second image by using the artificial neural network. The processor may determine, among the objects of the second image, an object having a degree of similarity to the first object in the first image equal to or greater than a preset value as the first object. That is, the processor may track an object having a similar color and shape in the second image by using the color and shape information of the first object.

S620단계에서, 프로세서는 제1 이미지에서, 제2 이미지에 포함된 제1 객체에 상응하는 영역에 대응되는 제2 픽셀 그룹을 획득할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 이미지에 포함된 제1 객체에 상응하는 영역에 대응되는 제2 픽셀 그룹을 획득할 수 있다.In operation S620 , the processor may acquire, from the first image, a second pixel group corresponding to an area corresponding to the first object included in the second image. The processor may acquire a second pixel group corresponding to an area corresponding to the first object included in the second image by using the artificial neural network.

일 실시예에 따르면, 프로세서는 제2 이미지에서의 제1 객체에 상응하는 영역의 위치 정보를 산출할 수 있으며, 산출한 위치 정보를 제2 이미지에 적용하여, 제2 이미지로부터 제1 픽셀 그룹을 획득할 수 있다. According to an embodiment, the processor may calculate location information of a region corresponding to the first object in the second image, and apply the calculated location information to the second image to generate a first pixel group from the second image. can be obtained

다른 실시예에 따르면, 프로세서는 제2 이미지에서의 제1 객체에 상응하는 영역에 인접한 픽셀들의 정보를 산출할 수 있으며, 산출한 픽셀들의 정보를 기초로 제1 이미지로부터 제2 픽셀 그룹을 획득할 수 있다. According to another embodiment, the processor may calculate information on pixels adjacent to an area corresponding to the first object in the second image, and obtain a second pixel group from the first image based on the calculated information on the pixels. can

S630단계에서, 프로세서는 제2 픽셀 그룹의 픽셀들을 보정할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제2 픽셀 그룹의 픽셀들을 보정함으로써, 제2 픽셀 그룹의 픽셀들을 제2 이미지에 최적화시킬 수 있다. In operation S630, the processor may correct the pixels of the second pixel group. The processor may optimize the pixels of the second pixel group to the second image by correcting the pixels of the second pixel group using the artificial neural network.

일 실시예에 따르면, 프로세서는 제2 그룹의 픽셀들의 색상 정보와 제2 이미지의 제1 객체에 인접한 픽셀들의 색상 정보를 비교할 수 있다. 제2 그룹의 픽셀들의 색상 정보 값과 제2 이미지의 제1객체에 인접한 픽셀들의 색상 정보 값의 차이가 미리 설정된 값을 초과하는 경우, 프로세서는 제2 이미지의 제 객체에 인접한 픽셀들의 색상 정보를 기준으로 제2 그룹의 픽셀들의 색상을 보정할 수 있다. According to an embodiment, the processor may compare color information of pixels of the second group with color information of pixels adjacent to the first object of the second image. When the difference between the color information value of the pixels of the second group and the color information value of the pixels adjacent to the first object of the second image exceeds a preset value, the processor receives the color information of pixels adjacent to the first object of the second image Colors of pixels of the second group may be corrected as a reference.

다른 실시예에 따르면, 프로세서는 제2 그룹의 형상 정보와 제2 이미지의 제1 객체의 형상 정보를 비교할 수 있다. 제2 그룹의 형상 정보와 제2 이미지의 제1 객체의 형상이 일치하지 않는 경우, 프로세서는 제2 이미지의 제1 객체의 형상을 기준으로, 제2 그룹의 형상을 보정할 수 있다. According to another embodiment, the processor may compare the shape information of the second group with the shape information of the first object of the second image. When the shape information of the second group does not match the shape of the first object of the second image, the processor may correct the shape of the second group based on the shape of the first object of the second image.

S640단계에서, 프로세서는 제2 픽셀 그룹의 픽셀들을 제1 객체에 상응하는 영역에 오버랩할 수 있다. 프로세서는 인공 신경망 네트워크를 이용하여, 제1 이미지로부터 획득하고, 복원된 제2 픽셀 그룹의 픽셀들을 제2 이미지에 오버랩하여, 제2 이미지를 보정할 수 있다. 따라서, 프로세서에 의한 이미지 인페인팅 결과, 복원된 제1 이미지와 복원된 제2 이미지를 포함하는 동영상을 획득할 수 있다.In operation S640, the processor may overlap the pixels of the second pixel group in an area corresponding to the first object. The processor may correct the second image by overlapping the pixels of the reconstructed second pixel group on the second image obtained from the first image using the artificial neural network. Accordingly, as a result of image inpainting by the processor, a moving picture including the restored first image and the restored second image may be obtained.

도 7은 동영상의 이미지 인페인팅을 위한 동작 과정 각각에 따른 이미지의 보정 과정의 일 실시예를 도시한 개념도이다. 7 is a conceptual diagram illustrating an embodiment of an image correction process according to each operation process for image inpainting of a moving picture.

디바이스의 프로세서는 제1 이미지(710) 및 제2 이미지(720)를 포함하는 동영상에 이미지 인페인팅 기법을 적용하여, 복원된 제1 이미지(730) 및 복원된 제2 이미지(740)를 포함하는 동영상을 생성하기 위한 동작들을 수행할 수 있다. 복원된 이미지들을 포함하는 동영상을 생성하기 위한 동작은 아래와 같을 수 있다. The processor of the device applies an image inpainting technique to a moving picture including the first image 710 and the second image 720 , and includes the restored first image 730 and the restored second image 740 . Operations for generating a video may be performed. An operation for generating a moving picture including the restored images may be as follows.

프로세서는 제1 이미지(710)에 포함된 객체들을 구분할 수 있다. 그리고, 프로세서는 제1 이미지(710)의 객체들 중에서 보정 대상 객체인 제1 객체(711)를 결정할 수 있다. The processor may distinguish objects included in the first image 710 . In addition, the processor may determine a first object 711 that is a correction target object from among the objects of the first image 710 .

프로세서는 제2 이미지(720)에서의 제1 객체(721)를 트래킹할 수 있다. 구체적으로, 프로세서는 제2 이미지(720)의 객체들 중, 제1 이미지(710)에서의 제1 객체(711)와의 유사도가 미리 설정된 값 이상인 객체를 제1 객체(721)로 판단할 수 있다. 프로세서는 제2 이미지(720)에서의 제1 객체(721)를 트래킹하는 동시에 제2 이미지(720)에 포함된 객체들을 구분할 수 있다. The processor may track the first object 721 in the second image 720 . Specifically, the processor may determine, among the objects of the second image 720 , as the first object 721 , an object having a degree of similarity with the first object 711 in the first image 710 equal to or greater than a preset value. . The processor may identify the objects included in the second image 720 while tracking the first object 721 in the second image 720 .

프로세서는 제2 이미지(720)에서, 제1 이미지(710)에 포함된 제1 객체(711)에 상응하는 영역에 대응되는 제1 픽셀 그룹(722)을 획득할 수 있다. 그리고 프로세서는 제1 이미지(710)에서, 제2 이미지(720)에 포함된 제1 객체(721)에 상응하는 영역에 대응되는 제2 픽셀 그룹(712)을 획득할 수 있다. 프로세서는 제1 픽셀 그룹과 제2 픽셀 그룹의 픽셀들을 추가로 보정할 수 있다. 예를 들어, 프로세서는 제1 이미지(710)과 제2 이미지의(720) 비교 결과를 기초로, 제1 이미지(710)과 제2 이미지의(720)의 객체들 각각의 변화 정도를 기초로 제1 픽셀 그룹과 제2 픽셀 그룹의 픽셀들을 추가로 보정할 수 있다.The processor may obtain, from the second image 720 , a first pixel group 722 corresponding to an area corresponding to the first object 711 included in the first image 710 . In addition, the processor may obtain, from the first image 710 , a second pixel group 712 corresponding to an area corresponding to the first object 721 included in the second image 720 . The processor may further correct pixels of the first pixel group and the second pixel group. For example, the processor based on the comparison result of 720 of the first image 710 and the second image, based on the degree of change of each of the objects of the first image 710 and the second image 720 . Pixels of the first pixel group and the second pixel group may be further corrected.

프로세서는 제1 픽셀 그룹(722)의 픽셀들을 제1 이미지(710)에서 제1 객체(711)에 상응하는 영역에 오버랩할 수 있다. 그리고, 프로세서는 제1 픽셀 그룹(722)의 픽셀들을 제1 이미지(710)에서 제1 객체(711)에 상응하는 영역에 오버랩할 수 있다. 따라서, 프로세서는 복원된 제1 이미지(730) 및 복원된 제2 이미지(740)를 포함하는 동영상을 생성할 수 있다. 여기서, 제1 픽셀 그룹(722)의 픽셀들을 제1 이미지(710)에서 제1 객체(711)에 상응하는 영역에 오버랩하는 동작과, 제1 픽셀 그룹(722)의 픽셀들을 제1 이미지(710)에서 제1 객체(711)에 상응하는 영역에 오버랩하는 동작은 쌍방향으로 이루어질 수 있다. The processor may overlap the pixels of the first pixel group 722 in an area corresponding to the first object 711 in the first image 710 . In addition, the processor may overlap the pixels of the first pixel group 722 in an area corresponding to the first object 711 in the first image 710 . Accordingly, the processor may generate a moving picture including the restored first image 730 and the restored second image 740 . Here, the operation of overlapping the pixels of the first pixel group 722 on the area corresponding to the first object 711 in the first image 710 and the pixels of the first pixel group 722 are combined with the first image 710 ), overlapping the region corresponding to the first object 711 may be performed interactively.

도 8은 이미지 인페인팅을 위한 디바이스의 인공 신경망 학습 동작의 일 실시예를 도시한 흐름도이다. 8 is a flowchart illustrating an embodiment of an artificial neural network learning operation of a device for image inpainting.

도 8을 참조하면, 동영상의 이미지 인페인팅을 위한 동작들을 수행하는 프로세서는 인공 신경망 네트워크를 포함할 수 있으며, 인공 신경망의 학습을 위한 동작들을 수행할 수 있다. 프로세서는 도 2의 S210 단계 내지 S240 단계의 동작을 수행한 상태일 수 있다. 프로세서는 인공 신경망의 학습을 위한 동작들을 수행하기 위해, 기존의 제1 이미지에 제1 객체를 삽입하고, 제1 객체가 삽입된 제1 이미지를 복원하는 동작을 적어도 1회 이상 수행할 수 있다. 프로세서는 기존의 제1 이미지와 복원 동작 결과 획득한 복원된 제1 이미지의 비교 결과를 기초로 인공 신경망의 학습을 위한 동작을 수행할 수 있으며, 구체적인 동작들은 아래와 같을 수 있다. Referring to FIG. 8 , a processor performing operations for image inpainting of a moving picture may include an artificial neural network and may perform operations for learning of the artificial neural network. The processor may be in a state in which the operations of steps S210 to S240 of FIG. 2 are performed. In order to perform operations for learning the artificial neural network, the processor may insert a first object into an existing first image and perform an operation of reconstructing the first image into which the first object is inserted at least once or more. The processor may perform an operation for learning the artificial neural network based on a comparison result between the existing first image and the restored first image obtained as a result of the restoration operation, and specific operations may be as follows.

S810단계에서, 프로세서는 제1 이미지와 이미지 인페인팅 결과 복원된 제1 이미지를 비교할 수 있다. 프로세서는 제1 이미지에 포함된 객체들의 정보와 복원된 제1 이미지에 포함된 객체들의 정보를 비교할 수 있다. 그리고 프로세서는 제1 이미지의 픽셀들 각각의 정보와 복원된 제1 이미지의 픽셀들 각각의 정보를 비교할 수 있다. 프로세서에 의해 비교되는 픽셀들의 정보는 픽셀의 색상 정보 등을 포함할 수 있다. In step S810 , the processor may compare the first image with the first image restored as a result of image inpainting. The processor may compare information on objects included in the first image with information on objects included in the restored first image. In addition, the processor may compare information on each of the pixels of the first image with information on each of the pixels of the reconstructed first image. The information of the pixels compared by the processor may include color information of the pixel and the like.

S820단계에서, 프로세서는 제1 이미지와 복원된 제1 이미지에 포함된 객체 구분 결과의 차이값을 산출할 수 있다. 프로세서는 제1 이미지에 포함된 객체들과 복원된 제1 이미지에 포함된 객체들 간의 차이값을 산출할 수 있으며, 산출된 차이값은 객체들 각각의 범위의 차이 등의 값일 수 있다. In operation S820 , the processor may calculate a difference value between the first image and the object classification result included in the restored first image. The processor may calculate a difference value between the objects included in the first image and the objects included in the restored first image, and the calculated difference value may be a value such as a difference between ranges of the objects.

S830단계에서, 프로세서는 제1 이미지와 복원된 제1 이미지의 제1 영역 복원 결과의 차이값을 산출할 수 있다. 프로세서는 제1 객체에 상응하는 영역의 복원 결과와 제1 이미지 간의 차이값을 산출할 수 있다. 산출된 차이값은 제1 객체에 상응하는 영역에 포함된 픽셀들의 정보 및 제1 객체에 상응하는 영역 내의 다른 객체들을 구분하기 위한 경계선의 정보의 차이값일 수 있다. In step S830, the processor may calculate a difference value between the first image and the first region restoration result of the restored first image. The processor may calculate a difference value between the restoration result of the region corresponding to the first object and the first image. The calculated difference value may be a difference value between information on pixels included in the region corresponding to the first object and information on a boundary line for distinguishing other objects in the region corresponding to the first object.

S840단계 및 S850단계에서, 프로세서는 제1 이미지와 복원된 제1 이미지 간의 차이값을 기초로 인공 신경망의 가중치 벡터를 업데이트할 수 있다. 프로세서는 제1 이미지와 보정된 제1 이미지 간의 차이값을 기초로 객체 구분을 위한 인공 신경망의 가중치 벡터 업데이트할 수 있다. 또한 프로세서는 제1 이미지와 보정된 제1 이미지 간의 차이값을 기초로 이미지 복원을 위한 가중치 벡터 업데이트할 수 있다. In steps S840 and S850, the processor may update the weight vector of the artificial neural network based on the difference value between the first image and the reconstructed first image. The processor may update the weight vector of the artificial neural network for object classification based on the difference value between the first image and the corrected first image. Also, the processor may update a weight vector for image restoration based on a difference value between the first image and the corrected first image.

이 때, 프로세서는 역전파 방식을 적용하여 인공 신경망의 가중치 벡터를 업데이트할 수 있다. 구체적으로, 프로세서는 제1 이미지에 포함된 객체들과 복원된 제1 이미지에 포함된 객체들 간의 차이값을 인공 신경망에 역전파하여, 객체 구분을 위한 인공 신경망의 가중치 벡터를 업데이트할 수 있다. 그리고 프로세서는 제1 이미지와 복원된 제1 이미지의 제1 영역 복원 결과의 차이값을 인공 신경망에 역전파하여, 이미지 복원을 위한 인공 신경망의 가중치 벡터를 업데이트할 수 있다.In this case, the processor may update the weight vector of the artificial neural network by applying the backpropagation method. Specifically, the processor may backpropagate a difference value between the objects included in the first image and the objects included in the restored first image to the artificial neural network to update the weight vector of the artificial neural network for object classification. In addition, the processor may backpropagate a difference value between the first image and the first region restoration result of the restored first image to the artificial neural network, and update the weight vector of the artificial neural network for image restoration.

도 9는 이미지 인페인팅을 위한 디바이스의 인공 신경망 학습 동작 수행 과정의 일 실시예를 도시한 개념도이다. 9 is a conceptual diagram illustrating an embodiment of a process of performing an artificial neural network learning operation of a device for image inpainting.

도 9를 참조하면, 이미지 인페인팅을 위한 동작들을 수행하는 프로세서는 인공 신경망 네트워크를 포함할 수 있으며, 인공 신경망의 학습을 위한 동작들을 수행할 수 있다. 프로세서는 인공 신경망의 학습을 위한 동작들을 수행하기 위해, 기존의 제1 이미지(910)에 제1 객체(921)를 삽입하고, 제1 객체(910)가 삽입된 제1 이미지(920)에 이미지 인페인팅 기법을 적용하는 동작을 적어도 1회 이상 수행할 수 있다. 프로세서는 기존의 제1 이미지(910)와 복원 동작 결과 획득한 복원된 제1 이미지(930)의 비교 결과를 기초로 인공 신경망의 학습을 위한 동작을 수행할 수 있다. 여기서, 제1 이미지는 데이터베이스 또는 메모리에 미리 저장된 이미지일 수 있다. Referring to FIG. 9 , a processor performing operations for image inpainting may include an artificial neural network network, and may perform operations for learning the artificial neural network. The processor inserts the first object 921 into the existing first image 910 to perform operations for learning the artificial neural network, and inserts the image into the first image 920 into which the first object 910 is inserted. The operation of applying the inpainting technique may be performed at least once. The processor may perform an operation for learning the artificial neural network based on a comparison result between the existing first image 910 and the restored first image 930 obtained as a result of the restoration operation. Here, the first image may be an image previously stored in a database or memory.

프로세서는 제1 이미지(910)와 복원된 제1 이미지(930)를 비교할 수 있다. 프로세서는 제1 이미지(910)에 포함된 객체들의 정보와 복원된 제1 이미지(930)에 포함된 객체들의 정보를 비교할 수 있다. 그리고 프로세서는 제1 이미지(910)의 픽셀들 각각의 정보와 복원된 제1 이미지(930)의 픽셀들 각각의 정보를 비교할 수 있다. The processor may compare the first image 910 with the reconstructed first image 930 . The processor may compare information on objects included in the first image 910 with information on objects included in the restored first image 930 . In addition, the processor may compare information on each of the pixels of the first image 910 with information on each of the pixels of the reconstructed first image 930 .

프로세서는 제1 이미지(910)와 복원된 제1 이미지(930)에 포함된 객체들 간의 구분 결과의 차이값을 산출할 수 있다. 프로세서는 제1 이미지(910)와 복원된 제1 이미지(930)의 제1 영역 복원 결과의 차이값을 산출할 수 있다. The processor may calculate a difference value of a result of classification between the first image 910 and objects included in the restored first image 930 . The processor may calculate a difference value between the first region restoration result of the first image 910 and the restored first image 930 .

프로세서는 제1 이미지(910)와 복원된 제1 이미지(930) 간의 차이값을 기초로 인공 신경망의 가중치 벡터를 업데이트할 수 있다. 프로세서는 제1 이미지(910)에 포함된 객체들과 복원된 제1 이미지(930)에 포함된 객체들 간의 차이값을 인공 신경망에 역전파하여, 객체 구분을 위한 인공 신경망의 가중치 벡터를 업데이트할 수 있다. 그리고 프로세서는 제1 이미지(910)와 복원된 제1 이미지(930)의 제1 영역(921) 복원 결과의 차이값을 인공 신경망에 역전파하여, 이미지 복원을 위한 인공 신경망의 가중치 벡터를 업데이트할 수 있다.The processor may update the weight vector of the artificial neural network based on a difference value between the first image 910 and the reconstructed first image 930 . The processor backpropagates the difference value between the objects included in the first image 910 and the objects included in the restored first image 930 to the artificial neural network to update the weight vector of the artificial neural network for object classification. can Then, the processor back-propagates the difference value between the first image 910 and the restoration result of the first region 921 of the restored first image 930 to the artificial neural network to update the weight vector of the artificial neural network for image restoration. can

도 10은 이미지 페인팅을 위한 동작들 중 인공 신경망을 기초로 한 동작의 실시예를 도시한 흐름도이다.10 is a flowchart illustrating an embodiment of an operation based on an artificial neural network among operations for painting an image.

도 10을 참조하면, 제1 인공 신경망과 제2 인공 신경망에서의 프로세스를 각각 나타내고 있다. 우선 제1 인공 신경망에서 제1 이미지에 포함된 객체들을 제1 이미지의 픽셀들 각각의 정보에 기초하여 구분할 수 있다. 상기 제1 이미지에 포함된 별도의 객체가 제거된 후 이에 상응하는 영역(제1 영역)을 복원을 위해 제2 인공 신경망을 이용할 수 있다. Referring to FIG. 10 , processes in the first artificial neural network and the second artificial neural network are respectively shown. First, in the first artificial neural network, objects included in the first image may be classified based on information on each pixel of the first image. After the separate object included in the first image is removed, a second artificial neural network may be used to restore a corresponding area (the first area).

즉, 제2 인공 신경망에서는 제1 영역을 제2 객체 및 제3 객체의 픽셀 정보를 기초로 복원할 수 있는 것이다. 상기 제2 객체 및 제3 객체의 경우 제1 영역을 기준으로 주변 영역에 해당할 것이다.That is, in the second artificial neural network, the first region may be restored based on pixel information of the second object and the third object. The second object and the third object may correspond to surrounding areas based on the first area.

도 11은 이미지 인페인팅을 위한 동작들 중 오브젝트 트래킹 동작의 실시예를 도시한 개념도이다.11 is a conceptual diagram illustrating an embodiment of an object tracking operation among operations for image inpainting.

딥러닝을 이용하여 이미지 인페인팅 동작의 경우 양방향 트래킹 및 일방향 트래킹이 가능하다. 예를 들어, 도 11의 상측 그림과 같이 좌측에서부터의 트래킹, 우측에서부터의 트래킹 각각을 나타낼 수 있는 것이다. 또한, 일방향 트래킹의 경우 세그멘테이션 작업과 함께 동시에 이루어져 딥러닝 네트워크 학습 효율화를 가져올 수 있을 것이다.In the case of image inpainting motion using deep learning, two-way tracking and one-way tracking are possible. For example, as shown in the upper figure of FIG. 11 , tracking from the left and tracking from the right may be indicated. In addition, in the case of one-way tracking, it will be performed simultaneously with the segmentation task, thereby improving the learning efficiency of the deep learning network.

한편, 다른 실시예에서는 경우에 따라서 상기 제1 영역을 복원하기 위해 이용되는 제2 객체 및 제3 객체의 경계를 제2 객체와 제3 객체가 전체 이미지에서 차지하는 면적에 따라 구분될 수도 있다. 이는 단순 편의성을 위한 것으로 일정 크기 보다 작은 크기의 영역을 복원하는 경우에 이용될 수 있다.Meanwhile, in another embodiment, in some cases, the boundary between the second object and the third object used to restore the first area may be divided according to the area occupied by the second object and the third object in the entire image. This is for simple convenience and may be used when restoring an area having a size smaller than a predetermined size.

구체적으로, 전체 이미지가 존재한다고 할 때, 제2 객체가 제3 객체보다 전체 이미지에서의 차지하는 면적이 크다고 가정할 수 있다. 이와 같은 경우 복원된 제1 영역에서의 제2 객체에 상응하는 이미지 면적이 제3 객체에 상응하는 이미지 면적보다 클 수 있다.Specifically, assuming that the entire image exists, it may be assumed that the area occupied by the second object in the entire image is larger than that of the third object. In this case, the image area corresponding to the second object in the restored first area may be larger than the image area corresponding to the third object.

또한, 경우에 따라서는 전체 이미지에서의 제2 객체가 차지하는 면적 대 제3 객체가 차지하는 면적 비율과 복원된 제1 영역에서의 제2 객체에 상응하는 이미지 면적 대 제3 객체에 상응하는 이미지 면적 비율이 동일할 수도 있다.In addition, in some cases, the ratio of the area occupied by the second object to the area occupied by the third object in the entire image and the ratio of the image area corresponding to the second object to the image area corresponding to the third object in the restored first area This may be the same.

본 발명에 따른 방법들은 다양한 컴퓨터 수단을 통해 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 컴퓨터 판독 가능 매체에 기록되는 프로그램 명령은 본 발명을 위해 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다.The methods according to the present invention may be implemented in the form of program instructions that can be executed by various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the computer-readable medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the art of computer software.

컴퓨터 판독 가능 매체의 예에는 롬(rom), 램(ram), 플래시 메모리(flash memory) 등과 같이 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러(compiler)에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터(interpreter) 등을 사용해서 컴퓨터에 의해 실행될 수 있는 고급 언어 코드를 포함한다. 상술한 하드웨어 장치는 본 발명의 동작을 수행하기 위해 적어도 하나의 소프트웨어 모듈로 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Examples of computer-readable media include hardware devices specially configured to store and carry out program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. The hardware device described above may be configured to operate as at least one software module to perform the operations of the present invention, and vice versa.

이상 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although it has been described with reference to the above embodiments, it will be understood by those skilled in the art that various modifications and changes can be made to the present invention without departing from the spirit and scope of the present invention as set forth in the claims below. will be able

Claims (7)

이미지 인페인팅 모델의 학습을 위한 동작 방법에 있어,
원본 이미지에 별도의 객체를 추가하여, 제1 이미지를 생성하는 단계;
객체 구분을 위한 제1 인공 신경망을 이용하여, 상기 제1 이미지에 포함된 객체들을 상기 제1 이미지의 픽셀들 각각의 정보에 기초하여 구분하는 단계;
상기 제1 이미지에서 상기 별도의 객체를 제거하는 단계;
상기 제1 이미지에서, 상기 제거된 별도의 객체에 상응하는 제1 영역에서의 제2 객체와 제3 객체 간의 경계를 설정하는 단계;
이미지 복원을 위한 제2 인공 신경망을 이용하여, 상기 제1 영역을 상기 제2 객체 및 상기 제3 객체의 픽셀 정보를 기초로 복원하고, 복원된 이미지를 생성하는 단계;
상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 산출하는 단계; 및
상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 기초로 상기 이미지 복원을 위한 상기 제2 인공 신경망의 가중치 벡터를 업데이트하는 단계를 포함하고,
상기 제2 인공 신경망의 가중치 벡터는, 상기 제1 이미지의 미리 설정된 제1 객체에 상응하는 영역에서의 픽셀들의 정보 및 복원된 상기 제1 객체에 상응하는 영역에서의 픽셀들의 정보 간의 차이값을 기초로 업데이트되고,
상기 복원된 이미지를 생성하는 단계 이후,
상기 제1 이미지를 포함하는 동영상에서, 별도의 제2 이미지를 획득하는 단계;
상기 제2 이미지에서, 상기 제1 영역에 대응되는 픽셀들의 집합인 제1 픽셀 그룹의 정보를 획득하는 단계; 및
상기 제1 이미지의 상기 제1 영역에 상기 제1 픽셀 그룹을 오버랩하는 단계를 포함하며,
상기 제2 이미지에서, 제2 영역에 위치하는 상기 제1 객체를 트래킹하는 단계;
상기 제1 이미지에서, 상기 제2 영역에 대응되는 픽셀들의 집합인 제2 픽셀 그룹의 정보를 획득하는 단계; 및
상기 제2 이미지의 상기 제2 영역에 상기 제2 픽셀 그룹을 오버랩하는 단계를 포함하며,
복원된 제1 이미지 및 복원된 제2 이미지를 포함하는 동영상을 재생하는, 이미지 인페인팅 모델의 학습을 위한 동작 방법.
In an operation method for learning an image inpainting model,
generating a first image by adding a separate object to the original image;
classifying objects included in the first image based on information on each pixel of the first image by using a first artificial neural network for object classification;
removing the separate object from the first image;
setting a boundary between a second object and a third object in a first area corresponding to the removed separate object in the first image;
restoring the first region based on pixel information of the second object and the third object using a second artificial neural network for image restoration, and generating a restored image;
calculating a difference value between pixels of the original image and the reconstructed image; and
updating a weight vector of the second artificial neural network for image restoration based on a difference value between pixels of the original image and the restored image,
The weight vector of the second artificial neural network is based on a difference value between information on pixels in a region corresponding to a preset first object of the first image and information on pixels in a region corresponding to the restored first object. updated to
After generating the restored image,
obtaining a separate second image from the moving picture including the first image;
obtaining information on a first pixel group that is a set of pixels corresponding to the first area from the second image; and
overlapping the first group of pixels in the first area of the first image;
tracking the first object located in a second area in the second image;
obtaining information on a second pixel group that is a set of pixels corresponding to the second area in the first image; and
overlapping the second group of pixels in the second region of the second image;
An operating method for learning an image inpainting model, which reproduces a moving picture including the restored first image and the restored second image.
청구항 1에 있어,
상기 제1 영역에서의 제2 객체와 제3 객체 간의 경계를 설정하는 단계는,
상기 제2 객체 및 상기 제3 객체 각각의 픽셀 정보 및 상기 제2 객체 및 상기 제3 객체 각각의 속성 정보 중 적어도 하나의 정보를 기초로 설정하는, 이미지 인페인팅을 위한 동작 방법.
The method according to claim 1,
The step of setting a boundary between the second object and the third object in the first area comprises:
An operation method for image inpainting, setting based on at least one of pixel information of each of the second object and the third object and attribute information of each of the second object and the third object.
청구항 1에 있어,
상기 복원된 이미지를 생성하는 단계 이후,
상기 제2 객체의 적어도 일부의 영역의 픽셀 정보를 기초로 상기 제2 객체의 패턴 정보를 분석하는 단계; 및
상기 경계에 의해 구분되는 상기 제1 영역 중 적어도 일부의 영역에 상기 제2 객체의 패턴을 오버랩하는 단계를 포함하는, 이미지 인페인팅을 위한 동작 방법.
The method according to claim 1,
After generating the restored image,
analyzing pattern information of the second object based on pixel information of at least a portion of the second object; and
and overlapping the pattern of the second object on at least a portion of the first area divided by the boundary.
삭제delete 청구항 1에 있어,
상기 제1 픽셀 그룹을 보정하는 단계를 포함하고,
상기 픽셀들을 오버랩하는 단계는,
상기 보정된 픽셀들을 상기 제1 영역에 오버랩하는, 이미지 인페인팅을 위한 동작 방법.
The method according to claim 1,
calibrating the first group of pixels;
The overlapping of the pixels comprises:
and overlapping the corrected pixels in the first area.
삭제delete 청구항 1에 있어,
상기 원본 이미지 및 상기 복원된 이미지의 픽셀들의 차이값을 기초로 상기 객체를 구분하기 위한 제1 인공 신경망의 가중치 벡터를 업데이트하는 단계를 더 포함하고,
상기 제1 인공 신경망의 가중치 벡터는, 상기 제1 이미지의 미리 설정된 객체들의 정보 및 상기 제1 이미지의 픽셀들 각각의 정보를 기초로 구분된 객체들 간의 차이값을 기초로 업데이트되는, 이미지 인페인팅을 위한 동작 방법.
The method according to claim 1,
The method further comprising: updating a weight vector of a first artificial neural network for classifying the object based on a difference value between pixels of the original image and the reconstructed image;
The weight vector of the first artificial neural network is updated based on a difference value between objects classified based on information on preset objects of the first image and information on each pixel of the first image. how it works for you.
KR1020200134397A 2020-10-16 2020-10-16 Method and device for image inpainting considering the surrounding information KR102389304B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020200134397A KR102389304B1 (en) 2020-10-16 2020-10-16 Method and device for image inpainting considering the surrounding information
PCT/KR2021/012505 WO2022080681A1 (en) 2020-10-16 2021-09-14 Image inpainting method and device considering peripheral region

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200134397A KR102389304B1 (en) 2020-10-16 2020-10-16 Method and device for image inpainting considering the surrounding information

Publications (1)

Publication Number Publication Date
KR102389304B1 true KR102389304B1 (en) 2022-04-21

Family

ID=81208271

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200134397A KR102389304B1 (en) 2020-10-16 2020-10-16 Method and device for image inpainting considering the surrounding information

Country Status (2)

Country Link
KR (1) KR102389304B1 (en)
WO (1) WO2022080681A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150009184A (en) * 2013-07-16 2015-01-26 삼성전자주식회사 Apparatus and method for processing an image having a camera device
KR20190078543A (en) * 2017-12-26 2019-07-04 삼성전자주식회사 Image acqusition device and controlling method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011053374A1 (en) * 2009-10-30 2011-05-05 Zoran Corporation Method and apparatus for image detection with undesired object removal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150009184A (en) * 2013-07-16 2015-01-26 삼성전자주식회사 Apparatus and method for processing an image having a camera device
KR20190078543A (en) * 2017-12-26 2019-07-04 삼성전자주식회사 Image acqusition device and controlling method thereof

Also Published As

Publication number Publication date
WO2022080681A1 (en) 2022-04-21

Similar Documents

Publication Publication Date Title
US11882369B2 (en) Method and system of lens shading color correction using block matching
EP3477931B1 (en) Image processing method and device, readable storage medium and electronic device
US8189960B2 (en) Image processing apparatus, image processing method, program and recording medium
US20130242127A1 (en) Image creating device and image creating method
WO2020152521A1 (en) Systems and methods for transforming raw sensor data captured in low-light conditions to well-exposed images using neural network architectures
CN107993209B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
KR20160039701A (en) Image processing device, image processing method and recording medium
JP2023056056A (en) Data generation method, learning method and estimation method
CN116188296A (en) Image optimization method and device, equipment, medium and product thereof
US20220070369A1 (en) Camera Image Or Video Processing Pipelines With Neural Embedding
CN113379609A (en) Image processing method, storage medium and terminal equipment
KR102389284B1 (en) Method and device for image inpainting based on artificial intelligence
US20230132230A1 (en) Efficient Video Execution Method and System
KR102389304B1 (en) Method and device for image inpainting considering the surrounding information
US11889175B2 (en) Neural network supported camera image or video processing pipelines
KR102052725B1 (en) Method and apparatus for generating virtual reality image inside the vehicle by using image stitching technique
US20220408013A1 (en) DNN Assisted Object Detection and Image Optimization
WO2024079532A1 (en) Temporally consistent neural network processing system
JP2018195989A (en) Image processing apparatus, image processing method, and program
JP2010049444A (en) Imaging device

Legal Events

Date Code Title Description
GRNT Written decision to grant