KR20200057849A - Image processing apparatus and method for retargetting image - Google Patents

Image processing apparatus and method for retargetting image Download PDF

Info

Publication number
KR20200057849A
KR20200057849A KR1020180141141A KR20180141141A KR20200057849A KR 20200057849 A KR20200057849 A KR 20200057849A KR 1020180141141 A KR1020180141141 A KR 1020180141141A KR 20180141141 A KR20180141141 A KR 20180141141A KR 20200057849 A KR20200057849 A KR 20200057849A
Authority
KR
South Korea
Prior art keywords
image
resizing
retargeting
shift map
training
Prior art date
Application number
KR1020180141141A
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 KR1020180141141A priority Critical patent/KR20200057849A/en
Priority to PCT/KR2019/015668 priority patent/WO2020101434A1/en
Publication of KR20200057849A publication Critical patent/KR20200057849A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4046Scaling the whole image or part thereof using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • 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

Disclosed is a method for processing an image according to one embodiment of the present invention. The method comprises the steps of: obtaining a resizing image, wherein a size of the resizing image is changed from an original image according to a predetermined aspect ratio; inputting the resizing image into a pre-learned neural network model; and obtaining a retargeting image changed from the resizing image based on a shift map outputted from the neural network model. The method for processing the image may allow continuity between a plurality of temporally related images to be preserved.

Description

영상의 리타겟팅을 위한 영상 처리 장치 및 방법{IMAGE PROCESSING APPARATUS AND METHOD FOR RETARGETTING IMAGE}IMAGE PROCESSING APPARATUS AND METHOD FOR RETARGETTING IMAGE}

본 개시는 영상 처리 분야에 관한 것이다. 보다 구체적으로, 본 개시는 영상 내 중요 부분의 왜곡이 최소화되도록 영상을 리타겟팅하는 영상 처리 장치 및 방법에 관한 것이다.The present disclosure relates to the field of image processing. More specifically, the present disclosure relates to an image processing apparatus and method for retargeting an image so that distortion of an important portion of the image is minimized.

카메라, 디스플레이 장치들의 발전에 따라 다양한 해상도 및 종횡비를 갖는 기기들이 출시되고 있다. 이러한 환경하에서, 카메라에 의해 촬영된 영상의 종횡비가 디스플레이 장치의 종횡비에 맞지 않는 상황이 발생할 수 있다. 예를 들어, 카메라에 의해 촬영된 영상이 4:3의 종횡비를 가지고 있고, 디스플레이 장치가 16:9의 종횡비를 가지고 있는 경우, 해당 영상을 디스플레이 장치에서 풀(full) 스크린으로 재생하기 위해서는 영상을 스트레칭(stretching)시켜야 하는데, 이러한 스트레칭은 영상의 왜곡을 야기한다.Devices having various resolutions and aspect ratios are being released according to the development of cameras and display devices. Under such an environment, a situation may arise in which the aspect ratio of the image captured by the camera does not match the aspect ratio of the display device. For example, when an image photographed by a camera has an aspect ratio of 4: 3, and a display device has an aspect ratio of 16: 9, the image is displayed in order to play the image on a full screen on the display device. It needs to be stretched, which causes distortion of the image.

영상의 종횡비 조절을 위한 영상 리타겟팅 기술이 이용되고 있다. 영상 리타겟팅 기술이란, 원본 영상 내 픽셀들의 위치를 변경하거나, 새로운 픽셀을 추가하거나, 기존 픽셀을 제거하는 방식 등으로 원본 영상으로부터 원하는 종횡비를 갖는 영상을 생성하는 기술을 의미한다. 그러나, 아직까지는 소정 종횡비를 갖는 영상을 생성하기 위한 효율적인 처리 방법이 제안되어 있지 않은 실정이다.Image retargeting technology for adjusting the aspect ratio of an image is used. The image retargeting technology refers to a technique of generating an image having a desired aspect ratio from an original image by changing positions of pixels in the original image, adding new pixels, or removing existing pixels. However, an efficient processing method for generating an image having a predetermined aspect ratio has not been proposed so far.

일 실시예에 따른 영상의 처리 장치 및 방법은 영상 내 중요 부분의 왜곡이 최소화되도록 영상을 리타겟팅 하는 것을 기술적 과제로 한다.An image processing apparatus and method according to an embodiment has a technical problem of retargeting an image so that distortion of an important part of the image is minimized.

또한, 일 실시예에 따른 영상의 처리 장치 및 방법은 시간적으로 관련된 복수의 영상들 사이의 연속성이 보존되도록 하는 것을 기술적 과제로 한다.In addition, an image processing apparatus and method according to an embodiment has a technical problem to ensure that continuity between a plurality of time-related images is preserved.

일 실시예에 따른 영상 처리 방법은,An image processing method according to an embodiment,

소정 종횡비에 따라 원본 영상으로부터 크기가 변경된 리사이징 영상을 획득하는 단계; 상기 리사이징 영상을 미리 훈련된 신경망 모델에 입력하는 단계; 및 상기 신경망 모델에서 출력되는 시프트 맵에 기초하여 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득하는 단계를 포함할 수 있다.Obtaining a resized image whose size is changed from the original image according to a predetermined aspect ratio; Inputting the resizing image into a pre-trained neural network model; And obtaining a retargeting image converted from the resizing image based on the shift map output from the neural network model.

예시적인 실시예에서, 상기 신경망 모델은, 상기 리사이징 영상을 입력받는 제 1 서브 모델, 상기 제 1 서브 모델로부터 출력되는 특징 맵을 히든 스테이트에 따라 처리하는 컨볼루션 LSTM(long short-term memory) 레이어 및 상기 컨볼루션 LSTM 레이어에서 출력되는 데이터를 처리하여 상기 시프트 맵을 출력하는 제 2 서브 모델을 포함할 수 있다.In an exemplary embodiment, the neural network model includes a convolutional long short-term memory (LSTM) layer that processes a first sub-model receiving the resizing image and a feature map output from the first sub-model according to a hidden state. And a second sub-model that outputs the shift map by processing data output from the convolution LSTM layer.

예시적인 실시예에서, 상기 컨볼루션 LSTM 레이어는, 이전 시간대의 원본 영상에 대응하는 리사이징 영상을 처리한 후 업데이트된 상기 히든 스테이트를 이용하여 상기 원본 영상에 대응하는 리사이징 영상을 처리할 수 있다.In an exemplary embodiment, the convolution LSTM layer may process a resizing image corresponding to the original image in a previous time period and then process the resizing image corresponding to the original image using the updated hidden state.

예시적인 실시예에서, 상기 제 1 서브 모델 및 제 2 서브 모델 각각은, 소정의 필터 커널을 이용하여 입력 데이터를 컨볼루션 처리하는 적어도 하나의 컨볼루션 레이어를 포함할 수 있다.In an exemplary embodiment, each of the first sub-model and the second sub-model may include at least one convolution layer that convokes input data using a predetermined filter kernel.

예시적인 실시예에서, 상기 리사이징 영상의 픽셀들의 제 1 위치 맵 및 제 2 위치 맵이 상기 제 2 서브 모델로 입력되며, 상기 제 1 위치 맵의 첫 번째 행과 마지막 행에는 상기 원본 영상과 상기 리사이징 영상 사이의 세로 크기들 사이의 비율에 대응하는 값이 할당되고, 상기 제 2 위치 맵의 첫 번째 열과 마지막 열에는, 상기 원본 영상과 상기 리사이징 영상 사이의 가로 크기들 사이의 비율에 대응하는 값이 할당될 수 있다.In an exemplary embodiment, a first location map and a second location map of pixels of the resizing image are input to the second sub-model, and the original image and the resizing are performed in the first row and the last row of the first location map. Values corresponding to ratios between vertical sizes between images are allocated, and values corresponding to ratios between horizontal sizes between the original image and the resizing image are assigned to first and last columns of the second location map. Can be assigned.

예시적인 실시예에서, 상기 제 1 위치 맵의 상기 첫 번째 행으로부터 상기 마지막 행까지 소정 차이를 갖는 값들이 순차적으로 각 행에 할당되고, 상기 제 2 위치 맵의 상기 첫 번째 열로부터 상기 마지막 열까지 소정 차이를 갖는 값들이 순차적으로 각 열에 할당될 수 있다.In an exemplary embodiment, values having a predetermined difference from the first row to the last row of the first location map are sequentially assigned to each row, from the first column to the last column of the second location map. Values having a predetermined difference may be sequentially assigned to each column.

예시적인 실시예에서, 상기 리타겟팅 영상을 획득하는 단계는, 상기 리사이징 영상으로부터 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 기초하여 변환된 영상을, 제 2 방향으로의 리타겟팅을 위한 시프트 맵을 기초로 변환하여 상기 리타겟팅 영상을 획득하는 단계를 포함할 수 있다.In an exemplary embodiment, the step of acquiring the retargeting image may include converting the converted image based on a shift map for retargeting in the first direction from the resizing image, and a shift map for retargeting in the second direction. And acquiring the retargeting image by converting based on.

예시적인 실시예에서, 상기 리타겟팅 영상을 획득하는 단계는, 이전 시간대의 시프트 맵과 현재 시간대의 상기 시프트 맵을 조합하여, 상기 현재 시간대의 시프트 맵을 갱신하는 단계; 및 상기 갱신된 상기 현재 시간대의 시프트 맵에 기초하여, 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득하는 단계를 포함할 수 있다.In an exemplary embodiment, the step of acquiring the retargeting image may include updating a shift map of the current time zone by combining a shift map of the previous time zone and the shift map of the current time zone; And obtaining a converted retargeting image from the resizing image based on the updated shift map of the current time zone.

예시적인 실시예에서, GT(ground truth) 영상과 훈련용 리타겟팅 영상의 차이에 마스크를 적용한 결과에 대응하는 제 1 손실 정보가 감소되도록 상기 신경망 모델이 훈련될 수 있다.In an exemplary embodiment, the neural network model may be trained such that first loss information corresponding to a result of applying a mask to a difference between a ground truth (GT) image and a training retargeting image is reduced.

예시적인 실시예에서, 훈련용 리사이징 영상을 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 따라 변환시켜 획득된 영상과 GT 영상의 차이에 제 1 배경 마스크를 적용한 결과에 대응하는 제 2 손실 정보와, 상기 훈련용 리사이징 영상을 상기 제 1 방향으로의 리타겟팅을 위한 시프트 맵 및 제 2 방향으로의 리타겟팅을 위한 시프트 맵에 따라 변환시켜 획득된 훈련용 리타겟팅 영상과 상기 GT 영상의 차이에 제 1 전경 마스크를 적용한 결과에 대응하는 제 3 손실 정보가 감소되도록 상기 신경망 모델이 훈련될 수 있다.In an exemplary embodiment, the training resizing image is transformed according to a shift map for retargeting in the first direction, and second loss information corresponding to a result of applying a first background mask to a difference between the obtained image and the GT image. , Reconstruct the training resizing image according to the shift map for retargeting in the first direction and the shift map for retargeting in the second direction, and remove the difference between the training retargeting image and the GT image obtained. The neural network model may be trained such that third loss information corresponding to a result of applying one foreground mask is reduced.

예시적인 실시예에서, 상기 제 1 전경 마스크는, 훈련용 원본 영상에 대응하는 제 2 전경 마스크를 패딩하여 획득되며, 상기 제 1 배경 마스크는, 상기 제 2 전경 마스크에 대응하는 제 2 배경 마스크와, 상기 제 2 전경 마스크의 크기를 변경시켜 획득한 제 3 전경 마스크에 대응하는 제 3 배경 마스크를 서로 결합하여 획득될 수 있다.In an exemplary embodiment, the first foreground mask is obtained by padding a second foreground mask corresponding to a training original image, and the first background mask includes a second background mask corresponding to the second foreground mask. The third background mask corresponding to the third foreground mask obtained by changing the size of the second foreground mask may be obtained by combining each other.

예시적인 실시예에서, 상기 GT 영상은, 상기 훈련용 원본 영상에 상기 제 2 전경 마스크를 적용하여 획득한 전경 오브젝트와, 상기 훈련용 리사이징 영상에 상기 제 3 배경 마스크를 적용하여 획득한 배경 오브젝트를 결합하여 획득될 수 있다.In an exemplary embodiment, the GT image may include a foreground object obtained by applying the second foreground mask to the training original image and a background object obtained by applying the third background mask to the training resizing image. Can be obtained in combination.

예시적인 실시예에서, 이전 시간대의 훈련용 원본 영상에 대응하는 시프트 맵과 현재 시간대의 훈련용 원본 영상에 대응하는 시프트 맵 사이의 관계에 기초하여 도출되는 제 4 손실 정보가 감소되도록 상기 신경망 모델이 훈련될 수 있다.In an exemplary embodiment, the neural network model is configured such that the fourth loss information derived based on the relationship between the shift map corresponding to the original training image in the previous time zone and the shift map corresponding to the original training image in the current time zone is reduced. Can be trained.

일 실시예에 따른 영상 처리 장치는,An image processing apparatus according to an embodiment,

프로세서; 및 미리 훈련된 신경망 모델 및 적어도 하나의 프로그램을 저장하는 메모리를 포함하되, 상기 프로세서는, 상기 메모리에 저장된 상기 적어도 하나의 프로그램이 실행됨에 따라, 소정 종횡비에 따라 원본 영상으로부터 크기가 변경된 리사이징 영상을 획득하고, 상기 리사이징 영상을 상기 신경망 모델에 입력하고, 상기 신경망 모델에서 출력되는 시프트 맵에 기초하여 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득할 수 있다.Processor; And a memory for storing a pre-trained neural network model and at least one program, wherein the processor is configured to display a resized image whose size is changed from an original image according to a predetermined aspect ratio as the at least one program stored in the memory is executed. Acquiring, inputting the resizing image into the neural network model, and obtaining a retargeting image converted from the resizing image based on a shift map output from the neural network model.

예시적인 실시예에서, 상기 영상 처리 장치는, 상기 리타겟팅 영상을 출력하는 디스플레이를 포함하되, 상기 프로세서는, 상기 디스플레이의 종횡비에 기초하여 상기 리사이징 영상의 종횡비를 결정할 수 있다.In an exemplary embodiment, the image processing apparatus includes a display that outputs the retargeting image, and the processor can determine an aspect ratio of the resizing image based on the aspect ratio of the display.

예시적인 실시예에서, 상기 프로세서는, 상기 리사이징 영상으로부터 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 기초하여 변환된 영상을, 제 2 방향으로의 리타겟팅을 위한 시프트 맵을 기초로 변환하여 상기 리타겟팅 영상을 획득할 수 있다.In an exemplary embodiment, the processor converts an image converted based on a shift map for retargeting from the resizing image to a first direction based on a shift map for retargeting in the second direction, and Retargeting images can be obtained.

예시적인 실시예에서, 상기 프로세서는, 이전 시간대의 시프트 맵과 현재 시간대의 상기 시프트 맵을 조합하여, 상기 현재 시간대의 시프트 맵을 갱신하고, 상기 갱신된 상기 현재 시간대의 시프트 맵에 기초하여, 상기 리사이징 영상을 변환시킬 수 있다.In an exemplary embodiment, the processor updates the shift map of the current time zone by combining the shift map of the previous time zone and the shift map of the current time zone, and based on the updated shift map of the current time zone, the Resizing images can be converted.

예시적인 실시예에서, 상기 프로세서는, 훈련용 원본 영상에 대응하는 훈련용 리사이징 영상을 상기 신경망 모델로 입력하되, 상기 신경망 모델은, 훈련용 리타겟팅 영상과 GT 영상 사이의 차이에 마스크를 적용한 결과에 대응하는 손실 정보가 감소되도록 훈련될 수 있다.In an exemplary embodiment, the processor inputs a training resizing image corresponding to a training original image into the neural network model, wherein the neural network model is a result of applying a mask to the difference between the training retargeting image and the GT image. It can be trained to reduce the loss information corresponding to.

예시적인 실시예에서, 상기 영상 처리 장치는, 상기 미리 훈련된 신경망 모델의 데이터를 외부 장치로부터 수신하는 통신 모듈을 더 포함할 수 있다.In an exemplary embodiment, the image processing device may further include a communication module that receives data of the pre-trained neural network model from an external device.

일 실시예에 따른 영상의 처리 장치 및 방법은 영상 내 중요 부분의 왜곡이 최소화되도록 영상을 리타겟팅할 수 있다.The apparatus and method for processing an image according to an embodiment may retarget the image to minimize distortion of an important part in the image.

또한, 일 실시예에 따른 영상의 처리 장치 및 방법은 시간적으로 관련된 복수의 영상들 사이의 연속성이 보존되도록 할 수 있다.In addition, the apparatus and method for processing an image according to an embodiment may ensure that continuity between a plurality of temporally related images is preserved.

다만, 일 실시예에 따른 영상의 처리 장치 및 방법이 달성할 수 있는 효과는 이상에서 언급한 것들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.However, the effects that the image processing apparatus and method according to an embodiment can achieve are not limited to those mentioned above, and other effects not mentioned are common in the art to which the present disclosure pertains from the following description. It will be clearly understood by those with knowledge.

본 명세서에서 인용되는 도면을 보다 충분히 이해하기 위하여 각 도면의 간단한 설명이 제공된다.
도 1은 일 실시예에 따른 영상 처리 장치가 적용되는 환경을 설명하기 위한 도면이다.
도 2는 일 실시예에 따른 영상 처리 방법을 설명하기 위한 순서도이다.
도 3은 일 실시예에 따른 리타겟팅 과정을 설명하기 위한 도면이다.
도 4는 일 실시예에 따른 신경망 모델의 구조를 설명하기 위한 도면이다.
도 5는 일 실시예에 따른 신경망 모델의 구조를 상세히 설명하기 위한 도면이다.
도 6 및 도 7은 제 2 서브 모델에 입력되는 위치 맵을 도시하는 예시적인 도면이다.
도 8은 훈련용 원본 영상에 대응하는 GT 영상을 생성하는데 이용되는 마스크를 도시하는 예시적인 도면이다.
도 9는 훈련용 원본 영상 및 훈련용 리사이징 영상에 기초하여 GT 영상을 생성하는 방법을 설명하기 위한 도면이다.
도 10 및 도 11은 신경망 모델의 훈련에 이용되는 전경 마스크와 배경 마스크를 생성하는 방법을 설명하기 위한 도면이다.
도 12는 신경망 모델의 훈련에 이용되는 손실 정보들을 설명하기 위한 도면이다.
도 13은 일 실시예에 따른 영상 처리 장치의 구성을 도시하는 블록도이다.
A brief description of each drawing is provided to better understand the drawings cited herein.
1 is a view for explaining an environment to which an image processing apparatus according to an embodiment is applied.
2 is a flowchart illustrating an image processing method according to an embodiment.
3 is a view for explaining a retargeting process according to an embodiment.
4 is a diagram for explaining the structure of a neural network model according to an embodiment.
5 is a view for explaining the structure of a neural network model according to an embodiment in detail.
6 and 7 are exemplary views showing a location map input to the second sub-model.
8 is an exemplary diagram showing a mask used to generate a GT image corresponding to a training original image.
9 is a diagram for explaining a method of generating a GT image based on a training original image and a training resizing image.
10 and 11 are views for explaining a method of generating a foreground mask and a background mask used for training a neural network model.
12 is a diagram for explaining loss information used for training a neural network model.
13 is a block diagram showing the configuration of an image processing apparatus according to an embodiment.

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

실시예를 설명함에 있어서, 관련된 공지 기술에 대한 구체적인 설명이 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 실시예의 설명 과정에서 이용되는 숫자(예를 들어, 제 1, 제 2 등)는 하나의 구성요소를 다른 구성요소와 구분하기 위한 식별기호에 불과하다.In describing the embodiments, when it is determined that detailed descriptions of related known technologies may unnecessarily obscure the subject matter, detailed descriptions thereof will be omitted. In addition, the numbers (for example, first, second, etc.) used in the description of the embodiment are merely identification numbers for distinguishing one component from other components.

또한, 본 명세서에서 일 구성요소가 다른 구성요소와 "연결된다" 거나 "접속된다" 등으로 언급된 때에는, 상기 일 구성요소가 상기 다른 구성요소와 직접 연결되거나 또는 직접 접속될 수도 있지만, 특별히 반대되는 기재가 존재하지 않는 이상, 중간에 또 다른 구성요소를 매개하여 연결되거나 또는 접속될 수도 있다고 이해되어야 할 것이다.In addition, when one component is referred to as “connected” or “connected” with another component in the present specification, the one component may be directly connected to or directly connected to the other component, but is specifically opposed It should be understood that as long as there is no description to be made, it may be connected or connected through another element in the middle.

또한, 본 명세서에서 '~부(유닛)', '모듈' 등으로 표현되는 구성요소는 2개 이상의 구성요소가 하나의 구성요소로 합쳐지거나 또는 하나의 구성요소가 보다 세분화된 기능별로 2개 이상으로 분화될 수도 있다. 또한, 이하에서 설명할 구성요소 각각은 자신이 담당하는 주기능 이외에도 다른 구성요소가 담당하는 기능 중 일부 또는 전부의 기능을 추가적으로 수행할 수도 있으며, 구성요소 각각이 담당하는 주기능 중 일부 기능이 다른 구성요소에 의해 전담되어 수행될 수도 있음은 물론이다.In addition, in this specification, two or more components represented by '~ unit (unit)', 'module', etc. are combined into one component, or two or more components are divided into more detailed functions. It may be differentiated into. In addition, each of the components to be described below may additionally perform some or all of the functions of other components in addition to the main functions in charge of them, and some of the main functions of each component are different. Needless to say, it can also be carried out by components.

이하, 본 개시의 기술적 사상에 의한 실시예들을 차례로 상세히 설명한다.Hereinafter, embodiments according to the technical spirit of the present disclosure will be described in detail.

도 1은 일 실시예에 따른 영상 처리 장치(100)가 적용되는 환경을 설명하기 위한 도면이다.1 is a view for explaining an environment to which the image processing apparatus 100 according to an embodiment is applied.

일 실시예에 따른 영상 처리 장치(100)는 원본 영상을 획득하고, 원본 영상에 기초하여 리타겟팅 영상을 획득한다. 영상 처리 장치(100)는 소정 종횡비와 상이한 종횡비를 갖는 원본 영상으로부터 소정 종횡비를 갖는 리타겟팅 영상을 생성할 수 있다. 영상 처리 장치(100)는 리타겟팅 영상을 디스플레이 장치(200)를 통해 디스플레이할 수 있다.The image processing apparatus 100 according to an embodiment acquires an original image and acquires a retargeting image based on the original image. The image processing apparatus 100 may generate a retargeting image having a predetermined aspect ratio from an original image having an aspect ratio different from a predetermined aspect ratio. The image processing apparatus 100 may display the retargeting image through the display apparatus 200.

일 실시예에서, 영상 처리 장치(100)는 디스플레이 장치(200) 내에 포함될 수 있다. 또는, 일 실시예에서, 영상 처리 장치(100)는 서버로 구현될 수 있고, 이 경우, 영상 처리 장치(100)는 리타겟팅 영상을 네트워크를 통해 디스플레이 장치(200)로 전송할 수도 있다. 일 실시예에서 네트워크는 유선 네트워크와 무선 네트워크를 포함할 수 있으며, 구체적으로, 근거리 네트워크(LAN: Local Area Network), 도시권 네트워크(MAN: Metropolitan Area Network), 광역 네트워크(WAN: Wide Area Network) 등의 다양한 네트워크를 포함할 수 있다. 또한, 네트워크는 공지의 월드 와이드 웹(WWW: World Wide Web)을 포함할 수도 있다. 그러나, 네트워크는 상기 열거된 네트워크에 국한되지 않고, 공지의 무선 데이터 네트워크나 공지의 전화 네트워크, 공지의 유무선 텔레비전 네트워크를 적어도 일부로 포함할 수도 있다.In one embodiment, the image processing apparatus 100 may be included in the display apparatus 200. Alternatively, in one embodiment, the image processing apparatus 100 may be implemented as a server, and in this case, the image processing apparatus 100 may transmit the retargeting image to the display apparatus 200 through a network. In one embodiment, the network may include a wired network and a wireless network, specifically, a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), and the like. It can include a variety of networks. In addition, the network may include a known World Wide Web (WWW). However, the network is not limited to the networks listed above, and may include at least part of a known wireless data network, a known telephone network, and a known wired / wireless television network.

일 실시예에 따른 영상 처리 장치(100)는 리타겟팅 영상을 생성할 때, 원본 영상 내 중요한 부분이 리타겟팅 영상에서도 원본 영상 내에서의 종횡비를 최대한 유지하도록 할 수 있다.When generating a retargeting image, the image processing apparatus 100 according to an embodiment may enable an important portion of the original image to maintain the aspect ratio within the original image as much as possible even in the retargeting image.

도 2는 일 실시예에 따른 영상 처리 방법을 설명하기 위한 순서도이고, 도 3은 일 실시예에 따른 리타겟팅 과정을 설명하기 위한 도면이다.2 is a flowchart illustrating an image processing method according to an embodiment, and FIG. 3 is a diagram illustrating a retargeting process according to an embodiment.

S210 단계에서, 영상 처리 장치(100)는 소정 종횡비에 따라 원본 영상(10)으로부터 크기가 변경된 리사이징 영상(20)을 획득한다. In step S210, the image processing apparatus 100 obtains a resized image 20 whose size is changed from the original image 10 according to a predetermined aspect ratio.

리사이징 영상(20)의 크기는 원본 영상(10)의 크기보다 클 수 있다. 예를 들어, 리사이징 영상(20)의 세로 방향 크기는 원본 영상(10)의 세로 방향 크기와 동일하되, 리사이징 영상(20)의 가로 방향 크기는 원본 영상(10)의 가로 방향 크기보다 클 수 있다. The size of the resizing image 20 may be larger than the size of the original image 10. For example, the vertical size of the resizing image 20 is the same as the vertical size of the original image 10, but the horizontal size of the resizing image 20 may be larger than the horizontal size of the original image 10. .

상기 소정 종횡비는 후술하는 리타겟팅 영상을 출력하는 디스플레이의 종횡비에 기초하여 결정될 수 있다. 예를 들어, 소정 종횡비는 리타겟팅 영상을 출력하는 디스플레이가 가지는 종횡비와 동일하게 결정될 수 있다. The predetermined aspect ratio may be determined based on an aspect ratio of a display outputting a retargeting image, which will be described later. For example, the predetermined aspect ratio may be determined to be the same as the aspect ratio of the display outputting the retargeting image.

영상 처리 장치(100)는 원본 영상(10)을 스케일링하여 크기가 변경된 리사이징 영상(20)을 획득할 수 있다. 일 예에서, 영상 처리 장치(100)는 원본 영상(10) 내 픽셀들을 보간(interpolation)하여 크기가 변경된 리사이징 영상(20)을 획득할 수 있다.The image processing apparatus 100 may obtain a resized image 20 whose size is changed by scaling the original image 10. In one example, the image processing apparatus 100 may obtain a resized image 20 whose size is changed by interpolating pixels in the original image 10.

S220 단계에서, 영상 처리 장치(100)는 리사이징 영상(20)을 미리 훈련된 신경망 모델(300)에 입력한다. 신경망 모델(300)은 예를 들어, 복수의 레이어로 이루어진 딥러닝(deep learning) 모델일 수 있다. 신경망 모델(300)의 구조 및 훈련 방법에 대해서는 도 8 이하를 참조하여 상세히 설명한다.In step S220, the image processing apparatus 100 inputs the resizing image 20 into the pre-trained neural network model 300. The neural network model 300 may be, for example, a deep learning model composed of a plurality of layers. The structure and training method of the neural network model 300 will be described in detail with reference to FIG. 8 and below.

S230 단계에서, 영상 처리 장치(100)는 신경망 모델(300)에서 출력되는 시프트 맵(90)을 획득한다. 시프트 맵(90)은 리사이징 영상(20) 내 픽셀들의 위치를 변경하기 위한 정보를 포함한다. 예를 들어, 시프트 맵(90)은 리사이징 영상(20) 내 각 픽셀들이 리타겟팅 영상 내 어느 위치로 이동되어야 하는지의 정보를 포함할 수 있다. 시프트 맵(90)은 리사이징 영상(20)의 크기와 동일한 크기를 가질 수 있다.In step S230, the image processing apparatus 100 acquires a shift map 90 output from the neural network model 300. The shift map 90 includes information for changing the positions of pixels in the resizing image 20. For example, the shift map 90 may include information about where each pixel in the resizing image 20 should be moved. The shift map 90 may have the same size as the size of the resizing image 20.

S240 단계에서, 영상 처리 장치(100)는 시프트 맵(90)에 기초하여 리사이징 영상(20)으로부터 변환된 리타겟팅 영상을 획득한다.In operation S240, the image processing apparatus 100 acquires the converted retargeting image from the resizing image 20 based on the shift map 90.

일 실시예에 따른 신경망 모델(300)은, 신경망 모델(300)은 출력되는 시프트 맵(90)에 따라 리사이징 영상(20)을 리타겟팅하더라도 원본 영상(10) 내 중요 부분의 비율이 리타겟팅 영상 내에서도 유지되도록 훈련될 수 있다.In the neural network model 300 according to an embodiment, the neural network model 300 re-targets a significant portion of the original image 10 even if the resizing image 20 is retargeted according to the output shift map 90. Can be trained to stay within.

도 4는 일 실시예에 따른 신경망 모델(300)의 구조를 설명하기 위한 도면이다.4 is a diagram for explaining the structure of a neural network model 300 according to an embodiment.

도 4를 참조하면, 신경망 모델(300)은 제 1 서브 모델(310), 컨볼루션 LSTM 레이어(320) 및 제 2 서브 모델(330)을 포함할 수 있다.Referring to FIG. 4, the neural network model 300 may include a first sub-model 310, a convolutional LSTM layer 320 and a second sub-model 330.

제 1 서브 모델(310)은 리사이징 영상(20)을 입력받아 처리한다. 제 1 서브 모델(310)의 출력 데이터, 예를 들어, 특징 맵(feature map)은 컨볼루션 LSTM(long short-term memory) 레이어로 입력된다. 그리고, 컨볼루션 LSTM 레이어(320)에서 출력되는 데이터는 제 2 서브 모델(330)로 입력된다. 제 2 서브 모델(330)에서는 리사이징 영상(20)의 리타겟팅을 위한 시프트 맵(90)이 출력된다.The first sub-model 310 receives and processes the resizing image 20. The output data of the first sub-model 310, for example, a feature map, is input into a convolutional long short-term memory (LSTM) layer. Then, data output from the convolution LSTM layer 320 is input to the second sub-model 330. In the second sub-model 330, a shift map 90 for retargeting the resizing image 20 is output.

일 예에서, 제 2 서브 모델(330)에서는 리사이징 영상(20) 내 전경 오브젝트를 추출하기 위한 전경 마스크(92), 리사이징 영상(20)을 제 1 방향을 따라 리타겟팅하기 위한 제 1 시프트 맵(94) 및 리사이징 영상(20)을 제 2 방향을 따라 리타겟팅하기 위한 제 2 시프트 맵(96)이 출력될 수 있다. In one example, the second sub-model 330 includes a foreground mask 92 for extracting a foreground object in the resizing image 20 and a first shift map for retargeting the resizing image 20 along the first direction ( 94) and the second shift map 96 for retargeting the resizing image 20 along the second direction may be output.

예를 들어, 상기 제 1 시프트 맵(94)은 리사이징 영상(20) 내 픽셀들을 세로 방향으로 리타겟팅하는데 이용되며, 제 2 시프트 맵(96)은 리사이징 영상(20) 내 픽셀들을 가로 방향으로 리타겟팅하는데 이용될 수 있다. 일 실시예에서, 원본 영상(10)의 종횡비를 변환하기 위해 원본 영상(10)의 세로 크기만 변경시키고자 하는 경우, 제 2 서브 모델(330)은 제 1 시프트 맵(94)만을 출력하도록 구성될 수 있다. 반대로, 원본 영상(10)의 종횡비를 변환하기 위해 원본 영상(10)의 가로 크기만 변경시키고자 하는 경우, 제 2 서브 모델(330)은 제 2 시프트 맵(96)만을 출력하도록 구성될 수 있다.For example, the first shift map 94 is used to retarget pixels in the resizing image 20 in the vertical direction, and the second shift map 96 repixels pixels in the resizing image 20 in the horizontal direction. It can be used to target. In one embodiment, in order to change only the vertical size of the original image 10 in order to convert the aspect ratio of the original image 10, the second sub-model 330 is configured to output only the first shift map 94 Can be. Conversely, when only the horizontal size of the original image 10 is to be changed to convert the aspect ratio of the original image 10, the second sub-model 330 may be configured to output only the second shift map 96. .

제 2 서브 모델(330)에서 출력되는 전경 마스크(92)는 신경망 모델(300)이 제대로 훈련되었는지를 평가하기 위한 것으로서, 구현예에 따라, 제 2 서브 모델(330)은 전경 마스크(92)가 출력되지 않도록 구성될 수도 있다.The foreground mask 92 output from the second sub-model 330 is for evaluating whether the neural network model 300 is properly trained, and according to an embodiment, the second sub-model 330 has a foreground mask 92 It may be configured not to be output.

컨볼루션 LSTM 레이어(320)는 제 1 서브 모델(310)에서 출력되는 데이터를 입력받아 히든 스테이트(hidden state)에 따라 처리하고, 처리된 결과를 제 2 서브 모델(330)로 전달한다. 컨볼루션 LSTM 레이어(320) 내 히든 스테이트는 제 1 서브 모델(310)에서 출력되는 데이터를 처리한 후, 업데이트되고, 업데이트된 히든 스테이트는 다음 시간대의 영상 처리를 위해 이용될 수 있다.The convolution LSTM layer 320 receives the data output from the first sub-model 310 and processes it according to a hidden state, and transmits the processed result to the second sub-model 330. The hidden state in the convolution LSTM layer 320 is updated after processing the data output from the first sub-model 310, and the updated hidden state can be used for image processing in a next time period.

예를 들어, t 시간 대의 원본 영상(10)에 대응하는 리사이징 영상(20)이 제 1 서브 모델(310)에서 처리되고, 제 1 서브 모델(310)에서 출력되는 데이터는 컨볼루션 LSTM 레이어(320)에서 히든 스테이트에 따라 처리된다. 여기서, t 시간 대의 리사이징 영상(20)을 처리하기 위해 이용되는 히든 스테이트는, 컨볼루션 LSTM 레이어(320)에서 t-1 시간대의 리사이징 영상(20)을 처리한 후 업데이트된 히든 스테이트일 수 있다. t 시간 대의 리사이징 영상(20)에 대해 제 1 서브 모델(310)에서 출력되는 데이터가 컨볼루션 LSTM 레이어(320)에서 히든 스테이트에 따라 처리되면, 히든 스테이트는 업데이트되고, 업데이트된 히든 스테이트는 t+1 시간대의 리사이징 영상(20)을 처리하는데 이용된다.For example, the resizing image 20 corresponding to the original image 10 in time t is processed in the first sub-model 310, and data output from the first sub-model 310 is a convolution LSTM layer 320 ) According to the hidden state. Here, the hidden state used to process the resizing image 20 in the t time zone may be an updated hidden state after processing the resizing image 20 in the t-1 time period in the convolution LSTM layer 320. When the data output from the first sub-model 310 for the resizing image 20 in the t time zone is processed according to the hidden state in the convolution LSTM layer 320, the hidden state is updated, and the updated hidden state is t + It is used to process the resizing image 20 in one hour.

즉, 일 실시예에 따른 신경망 모델(300)에서, 현재 시간대의 리사이징 영상(20)을 처리하는데 이용된 컨볼루션 LSTM 레이어(320)의 히든 스테이트가, 다음 시간대의 리사이징 영상(20)을 처리하는데 이용되기 때문에 여러 프레임들로 구성된 비디오를 리타겟팅하는데 있어, 프레임 간 연속성이 유지될 수 있다.That is, in the neural network model 300 according to an embodiment, the hidden state of the convolution LSTM layer 320 used to process the resizing image 20 in the current time period is used to process the resizing image 20 in the next time period. Since it is used, in retargeting a video composed of several frames, continuity between frames can be maintained.

도 5는 일 실시예에 따른 신경망 모델(300)의 구조를 상세히 설명하기 위한 도면이다.5 is a view for explaining the structure of the neural network model 300 according to an embodiment in detail.

도 5를 참조하면, 제 1 서브 모델(310)은 복수의 컨볼루션 레이어(convolution layer)를 포함할 수 있다. 각각의 컨볼루션 레이어는 미리 결정된 크기 및 개수의 필터 커널을 이용하여 입력 데이터를 컨볼루션 처리한 후, 컨볼루션 처리된 출력 데이터를 다음 레이어로 전달한다. 도 5는 제 1 서브 모델(310)이 5개의 컨볼루션 레이어를 포함하는 것으로 도시하고 있으나, 컨볼루션 레이어의 개수는 당업자에게 자명환 범위 내에서 다양하게 변경될 수 있다. 또한, 도 5에는 도시되어 있지 않지만, 제 1 서브 모델(310) 내 컨볼루션 레이어들 중 적어도 일부의 앞 또는 뒤에는 활성화 레이어 및/또는 풀링(pooling) 레이어가 위치할 수 있다. Referring to FIG. 5, the first sub-model 310 may include a plurality of convolutional layers. Each convolutional layer convolutionally processes input data using a predetermined size and number of filter kernels, and then transmits the convolutional output data to the next layer. FIG. 5 shows that the first sub-model 310 includes five convolutional layers, but the number of convolutional layers may be variously changed within the scope of an autonomous ring by those skilled in the art. In addition, although not shown in FIG. 5, an activation layer and / or a pooling layer may be located before or after at least some of the convolutional layers in the first sub-model 310.

어느 하나의 컨볼루션 레이어의 앞에 활성화 레이어 및/또는 풀링(pooling) 레이어가 위치하는 경우, 활성화 레이어 및/또는 풀링(pooling) 레이어의 출력 데이터는 상기 어느 하나의 컨볼루션 레이어로 입력될 수 있다. 또한, 어느 하나의 컨볼루션 레이어의 뒤에 활성화 레이어 및/또는 풀링(pooling) 레이어가 위치하는 경우, 상기 어느 하나의 컨볼루션 레이어의 출력 데이터는 활성화 레이어 및/또는 풀링(pooling) 레이어로 입력될 수 있다.When an active layer and / or a pooling layer is located in front of any one convolutional layer, output data of the active layer and / or a pooling layer may be input to any one of the convolutional layers. In addition, when an activation layer and / or a pooling layer is located behind one of the convolutional layers, the output data of the one of the convolutional layers may be input as an activation layer and / or a pooling layer. have.

활성화 레이어는 이전 레이어의 출력 결과에 대해 비선형(Non-linear) 특성을 부여할 수 있다. 활성화 레이어는 활성화 함수를 이용할 수 있다. 활성화 함수는 시그모이드 함수(sigmoid function), Tanh 함수, ReLU(Rectified Linear Unit) 함수 등을 포함할 수 있으나, 이에 한정되는 것은 아니다.The active layer may impart a non-linear characteristic to the output result of the previous layer. The activation layer may use an activation function. The activation function may include a sigmoid function, a tanh function, and a rectified linear unit (ReLU) function, but is not limited thereto.

제 2 서브 모델(330)은 복수의 디컨볼루션 레이어(deconvolution layer)를 포함할 수 있다. 각각의 디컨볼루션 레이어는 미리 결정된 크기 및 개수의 필터 커널을 이용하여 입력 데이터를 컨볼루션 처리한 후, 컨볼루션 처리된 출력 데이터를 다음 레이어로 전달한다. 도 5는 제 2 서브 모델(330)이 최종적으로 출력되는 데이터 각각을 위하여 5개의 디컨볼루션 레이어를 포함하는 것으로 도시하고 있으나, 디컨볼루션 레이어의 개수는 당업자에게 자명환 범위 내에서 다양하게 변경될 수 있다. The second sub-model 330 may include a plurality of deconvolution layers. Each deconvolution layer convolutionally processes the input data using a predetermined size and number of filter kernels, and then delivers the convolutional output data to the next layer. FIG. 5 shows that the second sub-model 330 includes five deconvolution layers for each of the data finally output, but the number of deconvolution layers is variously changed within the scope of an autonomous ring by those skilled in the art. Can be.

앞서 설명한 바와 같이, 제 2 서브 모델(330)에서 전경 마스크(92), 제 1 시프트 맵(94) 및 제 2 시프트 맵(96)이 출력되는 경우, 전경 마스크(92), 제 1 시프트 맵(94) 및 제 2 시프트 맵(96) 각각의 출력을 위한 디컨볼루션 레이어들이 서로 병렬로 배치될 수 있다. 제 2 서브 모델(330)에서 제 1 시프트 맵(94)과 제 2 시프트 맵(96)만이 출력되는 경우, 전경 마스크(92)의 출력을 위한 디컨볼루션 레이어(dconv4-1, dconv5-1)는 제 2 서브 모델(330)에 포함되지 않을 수 있다. 마찬가지로, 제 2 서브 모델(330)에서 제 2 시프트 맵(96)만이 출력되는 경우, 전경 마스크(92)의 출력을 위한 디컨볼루션 레이어(dconv4-1, dconv5-1) 그리고, 제 1 시프트 맵(94)의 출력을 위한 디컨볼루션 레이어(dconv4-2, dconv5-2)가 제 2 서브 모델(330)에 포함되지 않을 수 있다.As described above, when the foreground mask 92, the first shift map 94, and the second shift map 96 are output from the second sub-model 330, the foreground mask 92, the first shift map ( 94) and deconvolution layers for the output of each of the second shift map 96 may be arranged in parallel with each other. When only the first shift map 94 and the second shift map 96 are output from the second sub-model 330, deconvolution layers for outputting the foreground mask 92 (dconv4-1, dconv5-1) May not be included in the second sub-model 330. Similarly, when only the second shift map 96 is output from the second sub-model 330, the deconvolution layers for outputting the foreground mask 92 (dconv4-1, dconv5-1) and the first shift map The deconvolution layers dconv4-2 and dconv5-2 for the output of 94 may not be included in the second sub-model 330.

또한, 도 5에는 도시되어 있지 않지만, 제 2 서브 모델(330) 내 디컨볼루션 레이어들 중 적어도 일부의 앞 또는 뒤에는 활성화 레이어 및/또는 풀링 레이어가 위치할 수 있다. In addition, although not illustrated in FIG. 5, an activation layer and / or a pooling layer may be located before or after at least some of the deconvolution layers in the second sub-model 330.

일 실시예에서, 제 2 서브 모델(330)에 포함된 디컨볼루션 레이어 중 적어도 하나의 디컨볼루션 레이어로 리사이징 영상(20) 내 픽셀들의 위치를 나타내는 위치 맵이 입력될 수도 있다.In one embodiment, a location map indicating the positions of pixels in the resizing image 20 may be input to at least one deconvolution layer among the deconvolution layers included in the second sub-model 330.

도 6 및 도 7은 제 2 서브 모델(330)에 입력되는 위치 맵을 도시하는 예시적인 도면이다.6 and 7 are exemplary views showing a location map input to the second sub-model 330.

제 2 서브 모델(330)에 포함된 디컨볼루션 레이어 중 적어도 하나의 디컨볼루션 레이어로 제 1 위치 맵(610, 710)과 제 2 위치 맵(630, 730)이 입력될 수 있는데, 제 1 위치 맵(610, 710)은 리사이징 영상(20) 내 픽셀들의 세로 방향 위치를 나타내고, 제 2 위치 맵(630, 730)은 리사이징 영상(20) 내 픽셀들의 가로 방향 위치를 나타낼 수 있다.The first location maps 610 and 710 and the second location maps 630 and 730 may be input as at least one deconvolution layer among the deconvolution layers included in the second sub-model 330. The location maps 610 and 710 may indicate vertical positions of pixels in the resizing image 20, and the second location maps 630 and 730 may indicate horizontal positions of pixels in the resizing image 20.

일 실시예에서, 영상 처리 장치(100)는 제 1 위치 맵(610, 710) 및 제 2 위치 맵(630, 730을 생성하는 경우, 제 1 위치 맵(610, 710)과 제 2 위치 맵(630, 730)이 원본 영상(10)과 리사이징 영상(20) 사이의 크기 비율 정보를 포함하도록 할 수 있다.In one embodiment, when the image processing apparatus 100 generates the first location maps 610 and 710 and the second location maps 630 and 730, the first location maps 610 and 710 and the second location map ( 630 and 730 may include size ratio information between the original image 10 and the resizing image 20.

일 예에서, 영상 처리 장치(100)는 제 1 위치 맵(610, 710)의 첫 번째 행(611, 711)과 마지막 행(619, 719)에 포함된 픽셀들에, 원본 영상(10)과 리사이징 영상(20)의 세로 크기들 사이의 비율에 대응하는 값을 할당할 수 있다. 그리고, 영상 처리 장치(100)는 제 2 위치 맵(630, 730)의 첫 번째 열(631, 731)과 마지막 열(639, 739)에 포함된 픽셀들에, 원본 영상(10)과 리사이징 영상(20)의 가로 크기들 사이의 비율에 대응하는 값을 할당할 수 있다.In one example, the image processing apparatus 100 includes the original image 10 and the pixels included in the first row 611 and 711 and the last row 619 and 719 of the first location maps 610 and 710. A value corresponding to a ratio between vertical sizes of the resizing image 20 may be assigned. In addition, the image processing apparatus 100 includes pixels included in the first column 631 and 731 and the last column 639 and 739 of the second location maps 630 and 730, and the original image 10 and the resizing image. A value corresponding to the ratio between the horizontal sizes of 20 may be assigned.

도 6은 원본 영상(10)과 리사이징 영상(20)의 크기 및 종횡비가 동일할 때의 제 1 위치 맵(610) 및 제 2 위치 맵(630)을 도시하고 있다. 6 shows a first location map 610 and a second location map 630 when the size and aspect ratio of the original image 10 and the resizing image 20 are the same.

도 6을 참조하면, 제 1 위치 맵(610)의 첫 번째 행(611)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 세로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 -로 결정될 수 있다. 그리고, 제 1 위치 맵(610)의 마지막 행(619)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 세로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 +로 결정될 수 있다. 제 1 위치 맵(610)의 첫 번째 행(611)으로부터 마지막 행(619)까지 소정 차이를 갖는 값들이 순차적으로 각 행의 픽셀들에 할당될 수 있다. 예를 들어, 제 1 위치 맵(610)의 두 번째 행의 픽셀들에는, 첫 번째 행(611)의 픽셀들에 할당된 -1보다 a만큼 큰 값들이 할당될 수 있고, 제 1 위치 맵(610)의 세 번째 행의 픽셀들에는, 두 번째 행의 픽셀들에 할당된 값보다 a만큼 큰 값들이 할당될 수 있다.Referring to FIG. 6, pixels included in the first row 611 of the first location map 610 include values corresponding to a ratio between vertical sizes of the original image 10 and the resizing image 20, that is, 1 is assigned, but the sign can be determined as-. And, the pixels included in the last row 619 of the first location map 610 are assigned a value corresponding to the ratio between the vertical sizes of the original image 10 and the resizing image 20, that is, 1, The sign can be determined as +. Values having a predetermined difference from the first row 611 of the first location map 610 to the last row 619 may be sequentially assigned to pixels of each row. For example, the pixels in the second row of the first location map 610 may be assigned values greater than a assigned to pixels in the first row 611 as much as a, and the first location map ( The pixels in the third row of 610 may be assigned values larger than a allocated to the pixels in the second row.

제 2 위치 맵(630)의 첫 번째 열(631)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 가로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 -로 결정될 수 있다. 그리고, 제 2 위치 맵(630)의 마지막 열(639)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 가로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 +로 결정될 수 있다. 제 2 위치 맵(630)의 첫 번째 열(631)으로부터 마지막 열(639)까지 소정 차이를 갖는 값들이 순차적으로 각 열의 픽셀들에 할당될 수 있다. 예를 들어, 제 2 위치 맵(630)의 두 번째 열의 픽셀들에는, 첫 번째 열(631)의 픽셀들에 할당된 -1보다 a만큼 큰 값들이 할당될 수 있고, 제 2 위치 맵(630)의 세 번째 열의 픽셀들에는, 두 번째 열의 픽셀들에 할당된 값보다 a만큼 큰 값들이 할당될 수 있다.Pixels included in the first column 631 of the second location map 630 are assigned a value corresponding to a ratio between the horizontal sizes of the original image 10 and the resizing image 20, that is, 1 The sign can be determined by-. In addition, a value corresponding to the ratio between the horizontal sizes of the original image 10 and the resizing image 20 is assigned to the pixels included in the last column 639 of the second location map 630, that is, 1 The sign can be determined as +. Values having a predetermined difference from the first column 631 of the second location map 630 to the last column 639 may be sequentially assigned to pixels of each column. For example, the pixels in the second column of the second location map 630 may be assigned values greater than a assigned to pixels in the first column 631 as a, and the second location map 630 ), Pixels larger than a value assigned to pixels in the second column may be assigned to pixels in the third column.

도 7은 리사이징 영상(20)의 세로 크기와 원본 영상(10)의 세로 크기가 동일하고, 리사이징 영상(20)의 가로 크기가 원본 영상(10)의 가로 크기보다 1.5배 클 때의 제 1 위치 맵(710) 및 제 2 위치 맵(730)을 도시하고 있다. 7 shows the first position when the vertical size of the resizing image 20 and the original image 10 are the same, and the horizontal size of the resizing image 20 is 1.5 times larger than the horizontal size of the original image 10. The map 710 and the second location map 730 are shown.

도 7을 참조하면, 제 1 위치 맵(710)의 첫 번째 행(711)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 세로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 -로 결정될 수 있다. 그리고, 제 1 위치 맵(710)의 마지막 행(719)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 세로 크기들 사이의 비율에 대응하는 값, 즉 1이 할당되되, 그 부호가 +로 결정될 수 있다. 제 1 위치 맵(710)의 첫 번째 행(711)으로부터 마지막 행(719)까지 소정 차이를 갖는 값들이 순차적으로 각 행의 픽셀들에 할당될 수 있다. 예를 들어, 제 1 위치 맵(710)의 두 번째 행의 픽셀들에는, 첫 번째 행(711)의 픽셀들에 할당된 -1보다 a만큼 큰 값들이 할당될 수 있고, 제 1 위치 맵(710)의 세 번째 행의 픽셀들에는, 두 번째 행의 픽셀들에 할당된 값보다 a만큼 큰 값들이 할당될 수 있다.Referring to FIG. 7, pixels included in the first row 711 of the first location map 710 include values corresponding to a ratio between vertical sizes of the original image 10 and the resizing image 20, that is, 1 is assigned, but the sign can be determined as-. In addition, a value corresponding to a ratio between vertical sizes of the original image 10 and the resizing image 20 is assigned to the pixels included in the last row 719 of the first location map 710, namely 1 The sign can be determined as +. Values having a predetermined difference from the first row 711 of the first location map 710 to the last row 719 may be sequentially assigned to pixels of each row. For example, the pixels of the second row of the first location map 710 may be assigned values greater than a assigned to pixels of the first row 711 by a, and the first location map ( Pixels in the third row of 710 may be assigned values larger than a that are allocated to the pixels in the second row.

제 2 위치 맵(730)의 첫 번째 열(731)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 가로 크기들 사이의 비율에 대응하는 값, 즉 1.5가 할당되되, 그 부호가 -로 결정될 수 있다. 그리고, 제 2 위치 맵(730)의 마지막 열(739)에 포함된 픽셀들에는 원본 영상(10)과 리사이징 영상(20)의 가로 크기들 사이의 비율에 대응하는 값, 즉 1.5가 할당되되, 그 부호가 +로 결정될 수 있다. 제 2 위치 맵(730)의 첫 번째 열(731)으로부터 마지막 열(739)까지 소정 차이를 갖는 값들이 순차적으로 각 행의 픽셀들에 할당될 수 있다. 예를 들어, 제 2 위치 맵(730)의 두 번째 열의 픽셀들에는, 첫 번째 열(731)의 픽셀들에 할당된 -1.5보다 b만큼 큰 값들이 할당될 수 있고, 제 2 위치 맵(730)의 세 번째 열의 픽셀들에는, 두 번째 열의 픽셀들에 할당된 값보다 b만큼 큰 값들이 할당될 수 있다.Pixels included in the first column 731 of the second location map 730 are assigned a value corresponding to a ratio between horizontal sizes of the original image 10 and the resizing image 20, that is, 1.5. The sign can be determined by-. In addition, a value corresponding to the ratio between the horizontal sizes of the original image 10 and the resizing image 20 is assigned to the pixels included in the last column 739 of the second location map 730, that is, 1.5. The sign can be determined as +. Values having a predetermined difference from the first column 731 of the second location map 730 to the last column 739 may be sequentially assigned to pixels of each row. For example, the pixels in the second column of the second location map 730 may be assigned values greater than b, which are assigned to pixels in the first column 731, and a second location map 730. ), Pixels larger than b may be assigned to pixels in the third column.

도 6의 제 2 위치 맵(630)의 각각의 열을 따라 할당된 픽셀 값들의 차이인 a는 도 7의 제 2 위치 맵(730)의 각각의 열을 따라 할당된 픽셀 값들의 차이인 b보다 작을 수 있다. 왜냐하면, 도 6의 제 2 위치 맵(630)과 도 7의 제 2 위치 맵(730)의 가로 크기가 서로 동일할 때, 각각의 제 2 위치 맵(630, 730)의 첫 번째 열(631, 731)과 마지막 열(639, 739)에 할당되는 픽셀 값이 고정되어 있는 상태에서 각 열에 픽셀 값들이 동일 차이의 간격으로 할당되기 때문이다.The difference a of pixel values allocated along each column of the second location map 630 of FIG. 6 is greater than a difference b of the pixel values allocated along each column of the second location map 730 of FIG. 7. It can be small. Because, when the horizontal size of the second location map 630 of FIG. 6 and the second location map 730 of FIG. 7 are equal to each other, the first column 631 of each second location map 630, 730, This is because the pixel values assigned to the 731) and the last columns 639 and 739 are fixed and the pixel values are allocated to the columns at equal intervals.

도 6 및 도 7과 관련하여, 제 1 위치 맵(610, 710)의 첫 번째 행(611, 711)의 픽셀 값들이 -의 부호를 갖고, 제 1 위치 맵(610, 710)의 마지막 행(619, 719)의 픽셀 값들이 +의 부호를 갖는 것으로 설명하였으나, 일 예에서, 제 1 위치 맵(610, 710)의 첫 번째 행(611, 711)의 픽셀 값들이 +의 부호를 갖고, 제 1 위치 맵(610, 710)의 마지막 행(619, 719)의 픽셀 값들이 -의 부호를 가질 수 있다. 마찬가지로, 제 2 위치 맵(630, 730)의 첫 번째 열(631, 731)의 픽셀 값들이 -의 부호를 갖고, 제 2 위치 맵(630, 730)의 마지막 열(639, 739)의 픽셀 값들이 +의 부호를 갖는 것으로 설명하였으나, 일 예에서, 제 2 위치 맵(630, 730)의 첫 번째 열(631, 731)의 픽셀 값들이 +의 부호를 갖고, 제 2 위치 맵(630, 730)의 마지막 열(639, 739)의 픽셀 값들이 -의 부호를 가질 수 있다.6 and 7, the pixel values of the first row 611, 711 of the first location map 610, 710 have a sign of-, and the last row of the first location map 610, 710 ( Although the pixel values of 619 and 719 are described as having a sign of +, in one example, the pixel values of the first row 611 and 711 of the first location maps 610 and 710 have a sign of +, Pixel values of the last rows 619 and 719 of the 1 location map 610 and 710 may have a sign of-. Similarly, pixel values of the first column 631, 731 of the second location map 630, 730 have a sign of-, and pixel values of the last column 639, 739 of the second location map 630, 730 Although they are described as having a sign of +, in one example, the pixel values of the first column 631, 731 of the second position map 630, 730 have a sign of +, and the second position map 630, 730 ), The pixel values of the last columns 639 and 739 may have a sign of-.

일 실시예에서, 영상 처리 장치(100)는 여러 시간대의 원본 영상(10)들에 대응하는 리타겟팅 영상들 사이의 연속성을 유지하기 위하여, 이전 시간대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력되는 시프트 맵(90)과, 현재 시간대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력되는 시프트 맵(90)을 결합하여 현재 시간대의 리사이징 영상(20)을 리타겟팅할 수도 있다. In one embodiment, the image processing apparatus 100 corresponds to a resizing image 20 of a previous time zone in order to maintain continuity between retargeting images corresponding to original images 10 of various time zones. Retargeting the resizing image 20 of the current time zone by combining the shift map 90 output from the 300 and the shift map 90 output from the neural network model 300 corresponding to the resizing image 20 of the current time zone. You may.

예를 들어, 영상 처리 장치(100)는 t-1 시간 대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력되는 시프트 맵(90)과, t 시간 대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력되는 시프트 맵(90)을 결합한 후, t 시간대의 리사이징 영상(20)을 리타겟팅할 수 있다. 각 시간대별 시프트 맵(90)의 갱신 과정은 아래의 수학식 1로 표현될 수 있다.For example, the image processing apparatus 100 may correspond to the shift map 90 output from the neural network model 300 corresponding to the resizing image 20 in the t-1 time zone, and the resizing image 20 in the t time zone. After combining the shift map 90 output from the neural network model 300, the resizing image 20 in time t may be retargeted. The update process of the shift map 90 for each time zone may be expressed by Equation 1 below.

[수학식 1][Equation 1]

Sb'(t) = (t/(t+1))*Sb'(t-1)+(1/(t+1))*Sb(t)Sb '(t) = (t / (t + 1)) * Sb' (t-1) + (1 / (t + 1)) * Sb (t)

Sf'(t) = (t/(t+1))*Sf'(t-1)+(1/(t+1))*Sf(t)Sf '(t) = (t / (t + 1)) * Sf' (t-1) + (1 / (t + 1)) * Sf (t)

상기 수학식 1에서, Sb(t)는 t 시간대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력된 제 1 시프트 맵(94), Sb'(t)은 Sb(t)로부터 업데이트된 제 1 시프트 맵(94), Sb'(t-1)은 t-1 시간대 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력된 후, 업데이트된 제 1 시프트 맵(94), Sf(t)는 t 시간대의 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력된 제 2 시프트 맵(96), Sf'(t)은 Sf(t)로부터 업데이트된 제 2 시프트 맵(96), Sf'(t-1)은 t-1 시간대 리사이징 영상(20)에 대응하여 신경망 모델(300)에서 출력된 후, 업데이트된 제 2 시프트 맵(96)을 의미한다. 상기 제 1 시프트 맵(94)은 리사이징 영상(20)을 세로 방향으로 리타겟팅하기 위한 시프트 맵, 제 2 시프트 맵(96)은 리사이징 영상(20)을 가로 방향으로 리타겟팅하기 위한 시프트 맵을 나타낼 수 있다.In Equation 1, Sb (t) is the first shift map 94 output from the neural network model 300 corresponding to the resizing image 20 in time t, and Sb '(t) is updated from Sb (t). After the first shift map 94 and Sb '(t-1) are output from the neural network model 300 corresponding to the t-1 time zone resizing image 20, the updated first shift map 94 and Sf (t) is the second shift map 96 output from the neural network model 300 corresponding to the resizing image 20 in the t time zone, and Sf '(t) is the second shift map 96 updated from Sf (t). ), Sf '(t-1) means the updated second shift map 96 after being output from the neural network model 300 corresponding to the t-1 time zone resizing image 20. The first shift map 94 is a shift map for retargeting the resizing image 20 in the vertical direction, and the second shift map 96 is a shift map for retargeting the resizing image 20 in the horizontal direction. Can be.

이하에서는, 도 8 내지 도 12를 참조하여, 신경망 모델(300)을 훈련시키는 방법에 대해 설명한다.Hereinafter, a method of training the neural network model 300 will be described with reference to FIGS. 8 to 12.

도 8은 훈련용 원본 영상(910)에 대응하는 GT 영상(930)을 생성하는데 이용되는 마스크를 도시하는 예시적인 도면이고, 도 9는 훈련용 원본 영상(910) 및 훈련용 리사이징 영상(920)에 기초하여 GT 영상(930)을 생성하는 방법을 설명하기 위한 도면이다.8 is an exemplary view showing a mask used to generate a GT image 930 corresponding to the training original image 910, and FIG. 9 is an original training image 910 and a training resizing image 920. A diagram for explaining a method of generating a GT image 930 based on the above.

일 실시예에서, 마스크는 바이너리 마스크일 수 있다. 마스크 내 포함된 픽셀들은 두 가지 값 중 어느 하나의 값을 가질 수 있다. 전경 마스크는 영상 내 전경 오브젝트를 추출하기 위한 마스크로서, 예를 들어, 영상 내 중요 영역만을 추출하기 위해 이용될 수 있다. 배경 마스크는 영상 내 배경 오브젝트를 추출하기 위한 마스크로서, 예를 들어, 영상 내 비중요 영역만을 추출하기 위해 이용될 수 있다.In one embodiment, the mask may be a binary mask. Pixels included in the mask may have one of two values. The foreground mask is a mask for extracting a foreground object in an image, and may be used, for example, to extract only an important region in the image. The background mask is a mask for extracting a background object in an image, and can be used, for example, to extract only a non-critical region in the image.

영상 처리 장치(100)는 신경망 모델(300)의 훈련을 위해 훈련용 원본 영상(910)에 대응하는 GT(ground truth) 영상(930)을 생성할 수 있다. GT 영상(930)은 훈련용 리사이징 영상(920)과 동일한 종횡비 및 크기를 가질 수 있다. The image processing apparatus 100 may generate a ground truth (GT) image 930 corresponding to the original training image 910 for training the neural network model 300. The GT image 930 may have the same aspect ratio and size as the training resizing image 920.

영상 처리 장치(100)는 GT 영상(930)을 생성하기 위해 도 8에 도시된 것과 같은 제 1 전경 마스크(32) 및 제 2 배경 마스크(44)를 획득할 수 있다.The image processing apparatus 100 may obtain the first foreground mask 32 and the second background mask 44 as shown in FIG. 8 to generate the GT image 930.

영상 처리 장치(100)는 훈련용 원본 영상(910)에 대응하는 제 1 전경 마스크(32)를 획득할 수 있다. 영상 처리 장치(100)는 훈련용 원본 영상(910) 및 그에 대응하는 제 1 전경 마스크(32)를 외부의 장치로부터 수신하거나, 관리자로부터 입력받을 수 있다. 훈련용 원본 영상(910)과 제 1 전경 마스크(32)는 동일한 크기 및 동일한 종횡비를 가질 수 있다. 일 실시예에서, 영상 처리 장치(100)는 훈련용 원본 영상(910)을 미리 저장된 알고리즘에 따라 분석하여, 훈련용 원본 영상(910) 내 중요 부분을 식별하고, 식별된 부분을 추출하기 위한 제 1 전경 마스크(32)를 생성할 수도 있다.The image processing apparatus 100 may obtain a first foreground mask 32 corresponding to the training original image 910. The image processing apparatus 100 may receive an original image 910 for training and a first foreground mask 32 corresponding thereto from an external device or input from an administrator. The original training image 910 and the first foreground mask 32 may have the same size and the same aspect ratio. In one embodiment, the image processing apparatus 100 analyzes the original image 910 for training according to a pre-stored algorithm, identifies an important part in the original image 910 for training, and extracts the identified part. 1 A foreground mask 32 may be created.

영상 처리 장치(100)는 소정 종횡비에 따라 제 1 전경 마스크(32)를 스트레칭(stretching)한 제 2 전경 마스크(34)를 획득할 수 있다. 영상 처리 장치(100)는 제 1 전경 마스크(32)를 보간 처리하여 제 2 전경 마스크(34)를 생성할 수 있다.The image processing apparatus 100 may obtain a second foreground mask 34 that stretches the first foreground mask 32 according to a predetermined aspect ratio. The image processing apparatus 100 may generate the second foreground mask 34 by interpolating the first foreground mask 32.

영상 처리 장치(100)는 제 1 전경 마스크(32)의 픽셀 값들을 반전시켜 제 1 전경 마스크(32)에 대응하는 제 1 배경 마스크(42)를 획득할 수 있다. 제 1 배경 마스크(42)는 후술하는 바와 같이, 제 3 배경 마스크(46)를 생성하는데 이용될 수 있다. 그리고, 영상 처리 장치(100)는 제 2 전경 마스크(34)의 픽셀 값들을 반전시켜 제 2 전경 마스크(34)에 대응하는 제 2 배경 마스크(44)를 획득할 수 있다. 여기서, 전경 마스크의 픽셀 값들을 반전시킨다는 것은, 전경 마스크 내 픽셀들에 할당된 어느 하나의 값을, 마스크에 할당 가능한 2가지 값 중 다른 하나로 변경하는 것을 의미할 수 있다. 예를 들어, 제 1 전경 마스크(32)에서 1의 값을 가지는 픽셀은, 제 1 배경 마스크(42)에서 0의 값을 가질 수 있다. 일 실시예에서, 상기 제 2 배경 마스크(44)는 제 1 배경 마스크(42)의 크기를 변경시켜 획득될 수도 있다.The image processing apparatus 100 may acquire the first background mask 42 corresponding to the first foreground mask 32 by inverting pixel values of the first foreground mask 32. The first background mask 42 can be used to generate the third background mask 46, as described below. Then, the image processing apparatus 100 may acquire the second background mask 44 corresponding to the second foreground mask 34 by inverting the pixel values of the second foreground mask 34. Here, inverting the pixel values of the foreground mask may mean changing one value assigned to pixels in the foreground mask to another of two values that can be assigned to the mask. For example, a pixel having a value of 1 in the first foreground mask 32 may have a value of 0 in the first background mask 42. In one embodiment, the second background mask 44 may be obtained by changing the size of the first background mask 42.

도 9를 참조하면, 영상 처리 장치(100)는 훈련용 원본 영상(910)에 제 1 전경 마스크(32)를 적용하여 훈련용 원본 영상(910)으로부터 전경 오브젝트(915)를 추출하고, 훈련용 리사이징 영상(920)에 제 2 배경 마스크(44)를 적용하여 훈련용 리사이징 영상(920)으로부터 배경 오브젝트(927)를 추출한다. 그리고, 영상 처리 장치(100)는 훈련용 원본 영상(910)에서 추출되는 전경 오브젝트(915)와 훈련용 리사이징 영상(920)에서 추출되는 배경 오브젝트(927)를 결합하여 GT 영상(930)을 생성한다. 여기서, 결합한다는 것은, 훈련용 원본 영상(910)에서 추출되는 오브젝트(915)와 훈련용 리사이징 영상(920)에 추출되는 오브젝트(927)를 합하여 하나의 GT 영상(930)을 생성한다는 것을 의미할 수 있다.Referring to FIG. 9, the image processing apparatus 100 applies the first foreground mask 32 to the training original image 910 to extract the foreground object 915 from the training original image 910, and for training A second background mask 44 is applied to the resizing image 920 to extract the background object 927 from the training resizing image 920. Then, the image processing apparatus 100 generates a GT image 930 by combining the foreground object 915 extracted from the training original image 910 and the background object 927 extracted from the training resizing image 920. do. Here, combining means that one GT image 930 is generated by combining the object 915 extracted from the training original image 910 and the object 927 extracted from the training resizing image 920. Can be.

훈련용 리사이징 영상(920) 내 포함된 전경 오브젝트(925)는, 훈련용 원본 영상(910) 내 포함된 전경 오브젝트(915) 대비 크기 비율이 변경된 것이므로, 도 9에 도시된 바와 같이, GT 영상(930) 내에는 빈 영역(935)이 존재하게 된다. 다시 말하면, 제 2 배경 마스크(44)를 훈련용 리사이징 영상(920)에 적용하였을 때, 훈련용 리사이징 영상(920)에 포함된 전경 오브젝트(925)는 훈련용 리사이징 영상(920)에 포함된 그대로 추출되지 않고, 제 2 배경 마스크(44)를 거쳐 예를 들어, 0의 픽셀 값을 가지게 된다. 훈련용 원본 영상(910)에 포함된 전경 오브젝트(915)의 크기는 훈련용 리사이징 영상(920)에 포함된 전경 오브젝트(925)의 크기보다 작으므로, 훈련용 원본 영상(910)으로부터 추출된 전경 오브젝트(915)를 훈련용 리사이징 영상(920)으로부터 추출되는 배경 오브젝트(927)에 결합시키는 경우, 0의 픽셀 값을 가진 부분은 그대로 빈 공간(935)이 되는 것이다.As the foreground object 925 included in the training resizing image 920 is changed in size ratio compared to the foreground object 915 included in the training original image 910, the GT image ( An empty area 935 exists in the 930. In other words, when the second background mask 44 is applied to the training resizing image 920, the foreground object 925 included in the training resizing image 920 remains as it is included in the training resizing image 920. It is not extracted, and has a pixel value of 0, for example, through the second background mask 44. Since the size of the foreground object 915 included in the training original image 910 is smaller than the size of the foreground object 925 included in the training resizing image 920, the foreground extracted from the training original image 910 When the object 915 is combined with the background object 927 extracted from the training resizing image 920, a portion having a pixel value of 0 becomes an empty space 935.

영상 처리 장치(100)는 신경망 모델(300)의 훈련을 위해, 훈련용 리사이징 영상(920)을 신경망 모델(300)로 입력한다. 신경망 모델(300)은 훈련용 리사이징 영상(920)에 대응하여 시프트 맵을 출력한다. 그리고, 신경망 모델(300)은 시프트 맵에 기초하여 훈련용 리사이징 영상(920)으로부터 변환된 훈련용 리타겟팅 영상과 GT 영상(930) 사이의 차이가 감소되도록 훈련할 수 있다. 일 예에서, 신경망 모델(300)은 훈련용 리타겟팅 영상과 GT 영상(930) 사이의 차이에 마스크를 적용한 결과에 대응하는 손실 정보가 감소되도록 훈련될 수 있다. 상기 손실 정보를 도출하기 위한 마스크는 앞서 도 8의 제 1 전경 마스크(32), 제 1 배경 마스크(42) 및 제 2 배경 마스크(44)에 기초하여 생성될 수 있는데, 이에 대해서는 도 10 및 도 11을 참조하여 설명한다.The image processing apparatus 100 inputs a training resizing image 920 into the neural network model 300 for training the neural network model 300. The neural network model 300 outputs a shift map corresponding to the training resizing image 920. Then, the neural network model 300 may train to reduce the difference between the training retargeting image and the GT image 930 converted from the training resizing image 920 based on the shift map. In one example, the neural network model 300 may be trained to reduce loss information corresponding to a result of applying a mask to a difference between the training retargeting image and the GT image 930. The mask for deriving the loss information may be generated based on the first foreground mask 32, the first background mask 42, and the second background mask 44 of FIG. 8, as described above. This will be described with reference to 11.

도 10 및 도 11은 신경망 모델(300)의 훈련에 이용되는 전경 마스크와 배경 마스크를 생성하는 방법을 설명하기 위한 도면이다.10 and 11 are diagrams for explaining a method of generating a foreground mask and a background mask used for training the neural network model 300.

도 10을 참조하면, 영상 처리 장치(100)는 제 1 전경 마스크(32)를 패딩(padding)하여 제 3 전경 마스크(36)를 생성할 수 있다. 영상 처리 장치(100)는 제 3 전경 마스크(36)의 크기 및 종횡비가 GT 영상(930)의 크기 및 종횡비와 동일하도록 제 1 전경 마스크(32)를 패딩할 수 있다. 패딩에 따라 새롭게 생성되는 픽셀들에는, 제 1 전경 마스크(32)에 포함된 주변 픽셀 값들과 동일한 값들이 할당될 수 있다. 제 3 전경 마스크(36)는 GT 영상(930)으로부터 전경 오브젝트를 추출하는데 이용될 수 있다.Referring to FIG. 10, the image processing apparatus 100 may pad the first foreground mask 32 to generate a third foreground mask 36. The image processing apparatus 100 may pad the first foreground mask 32 such that the size and aspect ratio of the third foreground mask 36 are the same as the size and aspect ratio of the GT image 930. Pixels newly generated according to padding may be assigned the same values as the surrounding pixel values included in the first foreground mask 32. The third foreground mask 36 may be used to extract foreground objects from the GT image 930.

도 11을 참조하면, 영상 처리 장치(100)는 제 1 배경 마스크(42)와 제 2 배경 마스크(44)를 결합하여 제 3 배경 마스크(46)를 생성할 수 있다. 영상 처리 장치(100)는 제 1 배경 마스크(42)와 제 2 배경 마스크(44)를 합하여 하나의 제 3 배경 마스크(46)를 생성할 수 있다. 제 3 배경 마스크(46)는 GT 영상(930)으로부터 배경 오브젝트를 추출하는데 이용될 수 있다.Referring to FIG. 11, the image processing apparatus 100 may generate a third background mask 46 by combining the first background mask 42 and the second background mask 44. The image processing apparatus 100 may generate one third background mask 46 by combining the first background mask 42 and the second background mask 44. The third background mask 46 may be used to extract a background object from the GT image 930.

GT 영상(930), 제 3 전경 마스크(36) 및 제 3 배경 마스크(46)를 이용하여 신경망 모델(300)을 훈련시키는 방법은 도 12를 참조하여 설명한다.A method of training the neural network model 300 using the GT image 930, the third foreground mask 36 and the third background mask 46 will be described with reference to FIG. 12.

도 12는 신경망 모델(300)의 훈련에 이용되는 손실 정보들을 설명하기 위한 도면이다.12 is a diagram for describing loss information used for training the neural network model 300.

영상 처리 장치(100)는 훈련용 원본 영상(910)에 대응하는 훈련용 리사이징 영상(920)을 신경망 모델(300)로 입력하고, 신경망 모델(300)에서는 훈련용 리사이징 영상(920)의 제 1 방향(예를 들어, 세로 방향)으로의 리타겟팅을 위한 제 1 시프트 맵(994)과 훈련용 리사이징 영상(920)의 제 2 방향(예를 들어, 가로 방향)으로의 리타겟팅을 위한 제 2 시프트 맵(996)이 출력된다.The image processing apparatus 100 inputs a training resizing image 920 corresponding to the training original image 910 into the neural network model 300, and in the neural network model 300, the first of the training resizing image 920. A first shift map 994 for retargeting in the direction (eg, portrait) and a second for retargeting in the second direction (eg, landscape) of the training resizing image 920 The shift map 996 is output.

훈련용 리사이징 영상(920)은 제 1 시프트 맵(994)에 기초하여 리타겟팅되고, 리타겟팅된 영상과 GT 영상(930) 사이의 차이에 제 3 배경 마스크(46)가 적용된다. 제 3 배경 마스크(46)가 적용된 결과에 대응하는 제 1 손실 정보(1210)가 추출될 수 있다. 신경망 모델(300)은 제 1 손실 정보(1210)가 감소되도록 훈련될 수 있다. 일 예에서, 신경망 모델(300)은 제 1 손실 정보(1210)가 최소화되도록 훈련될 수 있다. 제 1 손실 정보(1210)는 아래의 수학식 2로 계산될 수 있다.The training resizing image 920 is retargeted based on the first shift map 994, and a third background mask 46 is applied to the difference between the retargeted image and the GT image 930. The first loss information 1210 corresponding to the result of applying the third background mask 46 may be extracted. The neural network model 300 may be trained such that the first loss information 1210 is reduced. In one example, the neural network model 300 may be trained such that the first loss information 1210 is minimized. The first loss information 1210 may be calculated by Equation 2 below.

[수학식 2][Equation 2]

Figure pat00001
Figure pat00001

상기 수학식 2에서, Lb는 제 1 손실 정보(1210), (x, y)는 영상 내 픽셀의 위치, I는 훈련용 리사이징 영상(920), Sb는 제 1 시프트 맵(994), GT는 GT 영상(930), Mb는 제 3 배경 마스크(46)를 나타낸다. In Equation 2, Lb is the first loss information 1210, (x, y) is a position of a pixel in the image, I is a training resizing image 920, Sb is a first shift map 994, GT is The GT image 930 and Mb represent the third background mask 46.

또한, 훈련용 리사이징 영상(920)은 제 1 시프트 맵(994) 및 제 2 시프트 맵(996)에 기초하여 리타겟팅되고, 훈련용 리사이징 영상(920)이 리타겟팅되어 생성된 훈련용 리타겟팅 영상과 GT 영상(930) 사이의 차이에 제 3 전경 마스크(36)가 적용된다. 제 3 전경 마스크(36)가 적용된 결과에 대응하는 제 2 손실 정보(1230)가 추출될 수 있다. 신경망 모델(300)은 제 2 손실 정보(1230)가 감소되도록 훈련될 수 있다. 일 예에서, 신경망 모델(300)은 제 2 손실 정보(1230)가 최소화되도록 훈련될 수 있다. 제 2 손실 정보(1230)는 아래의 수학식 3으로 계산될 수 있다.In addition, the training resizing image 920 is retargeted based on the first shift map 994 and the second shift map 996, and the training resizing image 920 is generated by retargeting the training retargeting image. The third foreground mask 36 is applied to the difference between the and the GT image 930. The second loss information 1230 corresponding to the result of applying the third foreground mask 36 may be extracted. The neural network model 300 may be trained to reduce the second loss information 1230. In one example, the neural network model 300 may be trained such that the second loss information 1230 is minimized. The second loss information 1230 may be calculated by Equation 3 below.

[수학식 3][Equation 3]

Figure pat00002
Figure pat00002

상기 수학식 3에서, Lf는 제 2 손실 정보(1230), (x, y)는 영상 내 픽셀의 위치, I는 훈련용 리사이징 영상(920), Sb는 제 1 시프트 맵(994), Sf는 제 2 시프트 맵(996), GT는 GT 영상(930), Mf는 제 3 전경 마스크(36)를 나타낸다.In Equation 3, Lf is the second loss information 1230, (x, y) is the position of the pixel in the image, I is the training resizing image 920, Sb is the first shift map 994, Sf is The second shift map 996, GT is a GT image 930, and Mf is a third foreground mask 36.

일 실시예에서, 신경망 모델(300)은 이전 시간대의 훈련용 리사이징 영상(920)에 대응하는 시프트 맵과 현재 시간대의 훈련용 리사이징 영상(920)에 대응하는 시프트 맵 사이의 관계에 기초하여 도출되는 제 3 손실 정보가 감소되도록 훈련될 수 있다. 일 예에서, 신경망 모델(300)은 제 3 손실 정보가 최소화되도록 훈련될 수도 있다.In one embodiment, the neural network model 300 is derived based on a relationship between a shift map corresponding to the training resizing image 920 of the previous time zone and a shift map corresponding to the training resizing image 920 of the current time zone. The third loss information can be trained to be reduced. In one example, the neural network model 300 may be trained to minimize third loss information.

제 3 손실 정보는 여러 프레임들로 구성된 비디오에서 리타겟팅된 프레임들 사이의 연속성을 유지하기 위해 산출된다. 제 3 손실 정보는 Flow consistency loss에 대응할 수 있다. 제 3 손실 정보는 아래의 수학식 4에 따라 산출될 수 있다.The third loss information is calculated to maintain continuity between retargeted frames in a video composed of several frames. The third loss information may correspond to a flow consistency loss. The third loss information may be calculated according to Equation 4 below.

[수학식 4][Equation 4]

Figure pat00003
Figure pat00003

상기 수학식 4에서 warp는 플로우넷(flownet)을 이용한 워핑 함수를 나타내고, Sb(t)는 t 시간 대의 훈련용 리사이징 영상(920)을 입력받아 신경망 모델(300)이 출력하는 제 1 시프트 맵(994), Sb(t+1)은 t+1 시간 대의 훈련용 리사이징 영상(920)을 입력받아 신경망 모델(300)이 출력하는 제 1 시프트 맵(994), Sf(t)는 t 시간 대의 훈련용 리사이징 영상(920)을 입력받아 신경망 모델(300)이 출력하는 제 2 시프트 맵(996), Sf(t+1)은 t+1 시간 대의 훈련용 리사이징 영상(920)을 입력받아 신경망 모델(300)이 출력하는 제 2 시프트 맵(996)을 나타내고, Mo는 오클루젼 마스크(occlusion mask)로서 아래의 수학식 5로 산출된다.In Equation 4, warp denotes a warping function using a flownet, and Sb (t) is a first shift map output by the neural network model 300 after receiving a training resizing image 920 for t time zone ( 994), Sb (t + 1) is a first shift map 994 received by the resizing image 920 for training in the t + 1 time zone and output by the neural network model 300, and Sf (t) is training in the t time zone. The second shift map 996, Sf (t + 1) output by the neural network model 300 after receiving the resizing image 920 for use, and Sf (t + 1) receive the training resizing image 920 for the t + 1 time zone and receive the neural network model ( 300) represents the second shift map 996 output, and Mo is an occlusion mask, and is calculated by Equation 5 below.

[수학식 5][Equation 5]

Figure pat00004
Figure pat00004

상기 수학식 5에서 a는 미리 결정된 가중치를 나타내고, I(t)는 t 시간대의 훈련용 원본 영상(910)에 대응하는 훈련용 리사이징 영상(920), I(t+1)은 t+1 시간대의 훈련용 원본 영상(910)에 대응하는 훈련용 리사이징 영상(920)을 나타낸다.In Equation 5, a denotes a predetermined weight, and I (t) is a training resizing image 920 corresponding to the training image 910 of time t, and I (t + 1) is time t + 1. A training resizing image 920 corresponding to the original training image 910 of FIG.

신경망 모델(300)은 제 1 손실 정보(1210), 제 2 손실 정보(1230) 및 제 3 손실 정보를 조합한 최종 손실 정보가 감소되도록 훈련될 수 있다. 최종 손실 정보는 아래의 수학식 6에 따라 결정될 수 있다.The neural network model 300 may be trained so that the final loss information combining the first loss information 1210, the second loss information 1230, and the third loss information is reduced. The final loss information may be determined according to Equation 6 below.

[수학식 6][Equation 6]

최종 손실 정보 = a·제 1 손실 정보 + b·제 2 손실 정보 + c·제 3 손실 정보Final loss information = a · first loss information + b · second loss information + c · third loss information

상기 수학식 6에서, a, b, c는 각 손실 정보에 적용되는 미리 결정된 가중치이다.In Equation 6, a, b, and c are predetermined weights applied to each loss information.

일 실시예에 따른 신경망 모델(300)은, 훈련용 리사이징 영상(920)을 제 1 시프트 맵(994)에 기초하여 세로 방향으로 리타겟팅시킨 영상의 배경과 GT 영상(930)의 배경 사이의 차이가 감소 또는 최소화되도록 훈련되고, 훈련용 리사이징 영상(920)을 제 1 시프트 맵(994) 및 제 2 시프트 맵(996)에 기초하여 세로 및 가로 방향으로 리타겟팅시킨 영상의 전경과 GT 영상(930)의 전경 사이의 차이가 감소 또는 최소화되도록 훈련될 수 있다. 특히, 훈련용 리타겟팅 영상과 GT 영상(930) 사이의 차이에 제 3 전경 마스크(36)가 적용되는데, 제 3 전경 마스크(36)는 훈련용 원본 영상(910)에 포함된 전경 오브젝트와 동일 크기의 오브젝트를 추출할 수 있으며, GT 영상(930)은 훈련용 원본 영상(910)에 포함된 전경 오브젝트의 크기와 동일한 크기의 오브젝트를 포함하고 있으므로, 결국, 신경망 모델(300)은 훈련용 리타겟팅 영상에 포함된 전경 오브젝트가 훈련용 원본 영상(910)에 포함된 전경 오브젝트와 동일 또는 유사해지도록 훈련될 수 있는 것이다.In the neural network model 300 according to an embodiment, the difference between the background of the image retargeting the training resizing image 920 in the vertical direction based on the first shift map 994 and the background of the GT image 930 And GT images 930 trained to be reduced or minimized, and retargeting the training resizing image 920 in the vertical and horizontal directions based on the first shift map 994 and the second shift map 996. ) Can be trained to reduce or minimize the difference between foregrounds. In particular, the third foreground mask 36 is applied to the difference between the retargeting image for training and the GT image 930, and the third foreground mask 36 is the same as the foreground object included in the training original image 910. Since the size of the object can be extracted, and the GT image 930 includes an object of the same size as the size of the foreground object included in the training original image 910, in the end, the neural network model 300 is used for training The foreground object included in the targeting image may be trained to be the same or similar to the foreground object included in the training original image 910.

도 13은 일 실시예에 따른 영상 처리 장치(100)의 구성을 도시하는 블록도이다.13 is a block diagram showing the configuration of an image processing apparatus 100 according to an embodiment.

도 13을 참조하면, 일 실시예에 따른 영상 처리 장치(100)는 메모리(110) 및 프로세서(130)를 포함할 수 있다.Referring to FIG. 13, the image processing apparatus 100 according to an embodiment may include a memory 110 and a processor 130.

메모리(110)는 적어도 하나의 프로그램 및 신경망 모델(300)을 저장할 수 있다. 프로세서(130)는 메모리(110)에 저장된 적어도 하나의 프로그램이 실행됨에 따라 영상의 리타겟팅을 포함한 영상 처리 동작을 수행할 수 있다.The memory 110 may store at least one program and neural network model 300. The processor 130 may perform an image processing operation including retargeting of an image as at least one program stored in the memory 110 is executed.

구체적으로, 프로세서(130)는 소정 종횡비에 따라 원본 영상으로부터 크기가 변경된 리사이징 영상을 획득하고, 리사이징 영상을 신경망 모델(300)에 입력할 수 있다. 프로세서(130)는 신경망 모델(300)에서 출력되는 시프트 맵에 기초하여 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득할 수 있다. 리사이징 영상을 신경망 모델(300)에 입력하고, 신경망 모델(300)에서 출력되는 시프트 맵에 기초하여 리타겟팅 영상을 생성하는 방법에 대해서는 앞서 상세히 설명하였으므로, 여기에서는 그 설명을 생략한다.Specifically, the processor 130 may obtain a resized image whose size is changed from the original image according to a predetermined aspect ratio, and input the resized image to the neural network model 300. The processor 130 may obtain a converted retargeting image from the resizing image based on the shift map output from the neural network model 300. A method of inputting a resizing image into the neural network model 300 and generating a retargeting image based on a shift map output from the neural network model 300 has been described in detail above, and thus description thereof is omitted here.

도 13에 도시되지는 않았지만, 프로세서(130)는 리타겟팅 영상을 디스플레이로 전송하여, 리타겟팅 영상이 디스플레이에 의해 재생되도록 할 수 있다. 또한, 프로세서(130)는 원본 영상으로부터 리사이징 영상을 획득하는데 있어, 리사이징 영상의 종횡비를 디스플레이가 가지는 종횡비에 기초하여 결정할 수 있다. 예를 들어, 프로세서(130)는 리사이징 영상의 종횡비를 디스플레이가 가지는 종횡비와 동일하게 결정할 수 있다.Although not shown in FIG. 13, the processor 130 may transmit the retargeting image to the display so that the retargeting image is reproduced by the display. In addition, in obtaining a resizing image from the original image, the processor 130 may determine an aspect ratio of the resizing image based on the aspect ratio of the display. For example, the processor 130 may determine the aspect ratio of the resizing image to be the same as the aspect ratio of the display.

일 실시예에 따른 영상 처리 장치(100)는 스마트폰, 태블릿 PC, 데스크탑 PC, 텔레비전, 스마트워치, 스마트글래스, 서버 등에 포함될 수 있다. The image processing apparatus 100 according to an embodiment may be included in a smart phone, a tablet PC, a desktop PC, a television, a smart watch, a smart glass, and a server.

영상 처리 장치(100)에 저장되는 신경망 모델(300)의 훈련은 다양한 장치에서 이루어질 수 있다.Training of the neural network model 300 stored in the image processing apparatus 100 may be performed in various devices.

일 실시예에서, 신경망 모델(300)의 훈련이 외부 장치(예를 들어, 서버 등)에서 수행되고, 훈련된 신경망 모델(300)이 영상 처리 장치(100)에 저장될 수 있다. In one embodiment, training of the neural network model 300 is performed on an external device (eg, a server, etc.), and the trained neural network model 300 may be stored in the image processing apparatus 100.

일 실시예에서, 신경망 모델(300)의 훈련이 외부 장치(예를 들어, 서버 등)에서 수행되고, 훈련된 신경망 모델(300)의 데이터가 네트워크를 통해 영상 처리 장치(100)의 통신 모듈(미도시)로 전송될 수도 있다. In one embodiment, training of the neural network model 300 is performed on an external device (for example, a server), and data of the trained neural network model 300 is communicated through the network to the communication module 100 of the image processing apparatus 100 ( (Not shown).

또는, 일 예에서, 신경망 모델(300)이 영상 처리 장치(100)에 저장된 상태에서, 신경망 모델(300)의 훈련이 영상 처리 장치(100)에서 수행될 수 있다.Alternatively, in one example, while the neural network model 300 is stored in the image processing apparatus 100, training of the neural network model 300 may be performed in the image processing apparatus 100.

또는, 일 예에서, 신경망 모델(300)의 훈련이 외부 장치(예를 들어, 서버 등)에서 수행된 후, 신경망 모델(300)의 내부 가중치를 나타내는 정보가 외부 장치로부터 영상 처리 장치(100)로 네트워크를 통해 전송될 수도 있다. 영상 처리 장치(100)는 수신된 내부 가중치 정보에 따라 미리 저장된 신경망 모델(300)을 훈련시킬 수 있다.Alternatively, in one example, after training of the neural network model 300 is performed on an external device (for example, a server), information representing the internal weight of the neural network model 300 is image-processed from the external device 100 It can also be transmitted over the network. The image processing apparatus 100 may train the pre-stored neural network model 300 according to the received internal weight information.

한편, 상술한 본 개시의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 작성된 프로그램은 매체에 저장될 수 있다.Meanwhile, the above-described embodiments of the present disclosure can be written as a program that can be executed on a computer, and the created program can be stored in a medium.

매체는 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다.The medium may be a computer that continuously stores executable programs or may be temporarily stored for execution or download. In addition, the medium may be various recording means or storage means in the form of a combination of single or several hardware, and is not limited to a medium that is directly connected to a computer system, but may be distributed on a network. Examples of the medium include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, and magneto-optical media such as floptical disks, And program instructions including ROM, RAM, flash memory, and the like. In addition, examples of other media include an application store for distributing applications, a site for distributing or distributing various software, and a recording medium or storage medium managed by a server.

이상, 본 개시의 기술적 사상을 바람직한 실시예를 들어 상세하게 설명하였으나, 본 개시의 기술적 사상은 상기 실시예들에 한정되지 않고, 본 개시의 기술적 사상의 범위 내에서 당 분야에서 통상의 지식을 가진 자에 의하여 여러 가지 변형 및 변경이 가능하다.As described above, the technical idea of the present disclosure has been described in detail with reference to preferred embodiments, but the technical idea of the present disclosure is not limited to the above embodiments and has ordinary knowledge in the art within the scope of the technical idea of the present disclosure. Various modifications and changes are possible by the ruler.

100: 영상 처리 장치
110: 메모리
130: 프로세서
100: image processing device
110: memory
130: processor

Claims (20)

소정 종횡비에 따라 원본 영상으로부터 크기가 변경된 리사이징 영상을 획득하는 단계;
상기 리사이징 영상을 미리 훈련된 신경망 모델에 입력하는 단계; 및
상기 신경망 모델에서 출력되는 시프트 맵에 기초하여 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득하는 단계를 포함하는 것을 특징으로 하는 영상 처리 방법.
Obtaining a resized image whose size is changed from the original image according to a predetermined aspect ratio;
Inputting the resizing image into a pre-trained neural network model; And
And obtaining a converted retargeting image from the resizing image based on the shift map output from the neural network model.
제1항에 있어서,
상기 신경망 모델은,
상기 리사이징 영상을 입력받는 제 1 서브 모델, 상기 제 1 서브 모델로부터 출력되는 특징 맵을 히든 스테이트에 따라 처리하는 컨볼루션 LSTM(long short-term memory) 레이어 및 상기 컨볼루션 LSTM 레이어에서 출력되는 데이터를 처리하여 상기 시프트 맵을 출력하는 제 2 서브 모델을 포함하는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
The neural network model,
The first sub-model receiving the resizing image, the convolutional long short-term memory (LSTM) layer for processing the feature map output from the first sub-model according to the hidden state, and the data output from the convolutional LSTM layer And a second sub-model for processing and outputting the shift map.
제2항에 있어서,
상기 컨볼루션 LSTM 레이어는,
이전 시간대의 원본 영상에 대응하는 리사이징 영상을 처리한 후 업데이트된 상기 히든 스테이트를 이용하여 상기 원본 영상에 대응하는 리사이징 영상을 처리하는 것을 특징으로 하는 영상 처리 방법.
According to claim 2,
The convolution LSTM layer,
And processing the resizing image corresponding to the original image in the previous time period, and then processing the resizing image corresponding to the original image using the updated hidden state.
제2항에 있어서,
상기 제 1 서브 모델 및 제 2 서브 모델 각각은,
소정의 필터 커널을 이용하여 입력 데이터를 컨볼루션 처리하는 적어도 하나의 컨볼루션 레이어를 포함하는 것을 특징으로 하는 영상 처리 방법.
According to claim 2,
Each of the first sub-model and the second sub-model,
And at least one convolutional layer for convolutionally processing input data using a predetermined filter kernel.
제2항에 있어서,
상기 리사이징 영상의 픽셀들의 제 1 위치 맵 및 제 2 위치 맵이 상기 제 2 서브 모델로 입력되며,
상기 제 1 위치 맵의 첫 번째 행과 마지막 행에는 상기 원본 영상과 상기 리사이징 영상 사이의 세로 크기들 사이의 비율에 대응하는 값이 할당되고,
상기 제 2 위치 맵의 첫 번째 열과 마지막 열에는, 상기 원본 영상과 상기 리사이징 영상 사이의 가로 크기들 사이의 비율에 대응하는 값이 할당되는 것을 특징으로 하는 영상 처리 방법.
According to claim 2,
The first location map and the second location map of pixels of the resizing image are input to the second sub-model,
Values corresponding to ratios between vertical sizes between the original image and the resizing image are allocated to the first row and the last row of the first location map,
The first and last columns of the second location map are assigned values corresponding to a ratio between horizontal sizes between the original image and the resizing image.
제5항에 있어서,
상기 제 1 위치 맵의 상기 첫 번째 행으로부터 상기 마지막 행까지 소정 차이를 갖는 값들이 순차적으로 각 행에 할당되고,
상기 제 2 위치 맵의 상기 첫 번째 열로부터 상기 마지막 열까지 소정 차이를 갖는 값들이 순차적으로 각 열에 할당되는 것을 특징으로 하는 영상 처리 방법.
The method of claim 5,
Values having a predetermined difference from the first row to the last row of the first location map are sequentially assigned to each row,
An image processing method, characterized in that values having a predetermined difference from the first column to the last column of the second location map are sequentially assigned to each column.
제1항에 있어서,
상기 리타겟팅 영상을 획득하는 단계는,
상기 리사이징 영상으로부터 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 기초하여 변환된 영상을, 제 2 방향으로의 리타겟팅을 위한 시프트 맵을 기초로 변환하여 상기 리타겟팅 영상을 획득하는 단계를 포함하는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
Acquiring the retargeting image,
And converting the converted image based on the shift map for retargeting in the first direction from the resizing image, and obtaining the retargeting image by converting the converted image based on the shift map for retargeting in the second direction. Image processing method characterized in that.
제1항에 있어서,
상기 리타겟팅 영상을 획득하는 단계는,
이전 시간대의 시프트 맵과 현재 시간대의 상기 시프트 맵을 조합하여, 상기 현재 시간대의 시프트 맵을 갱신하는 단계; 및
상기 갱신된 상기 현재 시간대의 시프트 맵에 기초하여, 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득하는 단계를 포함하는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
Acquiring the retargeting image,
Updating the shift map of the current time zone by combining the shift map of the previous time zone and the shift map of the current time zone; And
And obtaining a converted retargeting image from the resizing image based on the updated shift map of the current time zone.
제1항에 있어서,
GT(ground truth) 영상과 훈련용 리타겟팅 영상의 차이에 마스크를 적용한 결과에 대응하는 제 1 손실 정보가 감소되도록 상기 신경망 모델이 훈련되는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
An image processing method characterized in that the neural network model is trained such that first loss information corresponding to a result of applying a mask to a difference between a ground truth (GT) image and a training retargeting image is reduced.
제1항에 있어서,
훈련용 리사이징 영상을 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 따라 변환시켜 획득된 영상과 GT 영상의 차이에 제 1 배경 마스크를 적용한 결과에 대응하는 제 2 손실 정보와,
상기 훈련용 리사이징 영상을 상기 제 1 방향으로의 리타겟팅을 위한 시프트 맵 및 제 2 방향으로의 리타겟팅을 위한 시프트 맵에 따라 변환시켜 획득된 훈련용 리타겟팅 영상과 상기 GT 영상의 차이에 제 1 전경 마스크를 적용한 결과에 대응하는 제 3 손실 정보가 감소되도록 상기 신경망 모델이 훈련되는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
Second loss information corresponding to a result of applying a first background mask to a difference between an acquired image and a GT image by converting a training resizing image according to a shift map for retargeting in a first direction,
The difference between the training retargeting image and the GT image obtained by converting the training resizing image according to the shift map for retargeting in the first direction and the shift map for retargeting in the second direction is the first. The neural network model is trained so that the third loss information corresponding to the result of applying the foreground mask is reduced.
제10항에 있어서,
상기 제 1 전경 마스크는, 훈련용 원본 영상에 대응하는 제 2 전경 마스크를 패딩하여 획득되며,
상기 제 1 배경 마스크는, 상기 제 2 전경 마스크에 대응하는 제 2 배경 마스크와, 상기 제 2 전경 마스크의 크기를 변경시켜 획득한 제 3 전경 마스크에 대응하는 제 3 배경 마스크를 서로 결합하여 획득되는 것을 특징으로 하는 영상 처리 방법.
The method of claim 10,
The first foreground mask is obtained by padding a second foreground mask corresponding to the training original image,
The first background mask is obtained by combining a second background mask corresponding to the second foreground mask and a third background mask corresponding to a third foreground mask obtained by changing the size of the second foreground mask. Image processing method characterized in that.
제11항에 있어서,
상기 GT 영상은,
상기 훈련용 원본 영상에 상기 제 2 전경 마스크를 적용하여 획득한 전경 오브젝트와, 상기 훈련용 리사이징 영상에 상기 제 3 배경 마스크를 적용하여 획득한 배경 오브젝트를 결합하여 획득되는 것을 특징으로 하는 영상 처리 방법.
The method of claim 11,
The GT video,
An image processing method comprising obtaining a foreground object obtained by applying the second foreground mask to the training original image and a background object obtained by applying the third background mask to the training resizing image. .
제1항에 있어서,
이전 시간대의 훈련용 원본 영상에 대응하는 시프트 맵과 현재 시간대의 훈련용 원본 영상에 대응하는 시프트 맵 사이의 관계에 기초하여 도출되는 제 4 손실 정보가 감소되도록 상기 신경망 모델이 훈련되는 것을 특징으로 하는 영상 처리 방법.
According to claim 1,
The neural network model is trained such that the fourth loss information derived based on the relationship between the shift map corresponding to the original training image in the previous time zone and the shift map corresponding to the original training image in the current time period is reduced. Image processing method.
하드웨어와 결합하여 제1항 내지 제13항 중 어느 하나의 항의 영상 처리 방법을 실행하기 위하여 매체에 저장된 프로그램.
A program stored in a medium to execute the image processing method of any one of claims 1 to 13 in combination with hardware.
프로세서; 및
미리 훈련된 신경망 모델 및 적어도 하나의 프로그램을 저장하는 메모리를 포함하되,
상기 프로세서는, 상기 메모리에 저장된 상기 적어도 하나의 프로그램이 실행됨에 따라,
소정 종횡비에 따라 원본 영상으로부터 크기가 변경된 리사이징 영상을 획득하고,
상기 리사이징 영상을 상기 신경망 모델에 입력하고,
상기 신경망 모델에서 출력되는 시프트 맵에 기초하여 상기 리사이징 영상으로부터 변환된 리타겟팅 영상을 획득하는 것을 특징으로 하는 영상 처리 장치.
Processor; And
A pre-trained neural network model and a memory storing at least one program,
The processor, as the at least one program stored in the memory is executed,
Obtain a resized image whose size is changed from the original image according to a predetermined aspect ratio,
Input the resizing image into the neural network model,
An image processing apparatus characterized by acquiring a retargeting image converted from the resizing image based on a shift map output from the neural network model.
제15항에 있어서,
상기 영상 처리 장치는,
상기 리타겟팅 영상을 출력하는 디스플레이를 포함하되,
상기 프로세서는,
상기 디스플레이의 종횡비에 기초하여 상기 리사이징 영상의 종횡비를 결정하는 것을 특징으로 하는 영상 처리 장치.
The method of claim 15,
The image processing device,
It includes a display for outputting the retargeting image,
The processor,
And an aspect ratio of the resizing image is determined based on the aspect ratio of the display.
제15항에 있어서,
상기 프로세서는,
상기 리사이징 영상으로부터 제 1 방향으로의 리타겟팅을 위한 시프트 맵에 기초하여 변환된 영상을, 제 2 방향으로의 리타겟팅을 위한 시프트 맵을 기초로 변환하여 상기 리타겟팅 영상을 획득하는 것을 특징으로 하는 영상 처리 장치.
The method of claim 15,
The processor,
And converting the converted image based on the shift map for retargeting in the first direction from the resizing image, and obtaining the retargeting image by converting the transformed image based on the shift map for retargeting in the second direction. Image processing device.
제15항에 있어서,
상기 프로세서는,
이전 시간대의 시프트 맵과 현재 시간대의 상기 시프트 맵을 조합하여, 상기 현재 시간대의 시프트 맵을 갱신하고, 상기 갱신된 상기 현재 시간대의 시프트 맵에 기초하여, 상기 리사이징 영상을 변환시키는 것을 특징으로 하는 영상 처리 장치.
The method of claim 15,
The processor,
An image characterized by combining the shift map of the previous time zone and the shift map of the current time zone, updating the shift map of the current time zone, and converting the resizing image based on the updated shift map of the current time zone. Processing unit.
제15항에 있어서,
상기 프로세서는,
훈련용 원본 영상에 대응하는 훈련용 리사이징 영상을 상기 신경망 모델로 입력하되,
상기 신경망 모델은, 훈련용 리타겟팅 영상과 GT 영상 사이의 차이에 마스크를 적용한 결과에 대응하는 손실 정보가 감소되도록 훈련되는 것을 특징으로 하는 영상 처리 장치.
The method of claim 15,
The processor,
The training resizing image corresponding to the original training image is input to the neural network model,
The neural network model, an image processing apparatus characterized in that the loss information corresponding to the result of applying the mask to the difference between the training retargeting image and the GT image is reduced.
제15항에 있어서,
상기 영상 처리 장치는,
상기 미리 훈련된 신경망 모델의 데이터를 외부 장치로부터 수신하는 통신 모듈을 더 포함하는 것을 특징으로 하는 영상 처리 장치.
The method of claim 15,
The image processing device,
And a communication module receiving data of the pre-trained neural network model from an external device.
KR1020180141141A 2018-11-15 2018-11-15 Image processing apparatus and method for retargetting image KR20200057849A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020180141141A KR20200057849A (en) 2018-11-15 2018-11-15 Image processing apparatus and method for retargetting image
PCT/KR2019/015668 WO2020101434A1 (en) 2018-11-15 2019-11-15 Image processing device and method for retargeting of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180141141A KR20200057849A (en) 2018-11-15 2018-11-15 Image processing apparatus and method for retargetting image

Publications (1)

Publication Number Publication Date
KR20200057849A true KR20200057849A (en) 2020-05-27

Family

ID=70730338

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180141141A KR20200057849A (en) 2018-11-15 2018-11-15 Image processing apparatus and method for retargetting image

Country Status (2)

Country Link
KR (1) KR20200057849A (en)
WO (1) WO2020101434A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102542220B1 (en) * 2022-09-19 2023-06-13 아주대학교 산학협력단 Method of semantic segmentation based on self-knowledge distillation and semantic segmentation device based on self-knowledge distillation

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561993B (en) * 2020-12-07 2023-04-28 宁波大学 Stereo image repositioning method
GB202100316D0 (en) * 2021-01-11 2021-02-24 Samsung Electronics Co Ltd Hybrid image retargeting

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2539845B (en) * 2015-02-19 2017-07-12 Magic Pony Tech Ltd Offline training of hierarchical algorithms
GB2555136A (en) * 2016-10-21 2018-04-25 Nokia Technologies Oy A method for analysing media content

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102542220B1 (en) * 2022-09-19 2023-06-13 아주대학교 산학협력단 Method of semantic segmentation based on self-knowledge distillation and semantic segmentation device based on self-knowledge distillation

Also Published As

Publication number Publication date
WO2020101434A1 (en) 2020-05-22

Similar Documents

Publication Publication Date Title
US10755173B2 (en) Video deblurring using neural networks
US20220060639A1 (en) Live style transfer on a mobile device
US20190228264A1 (en) Method and apparatus for training neural network model used for image processing, and storage medium
US20220222776A1 (en) Multi-Stage Multi-Reference Bootstrapping for Video Super-Resolution
WO2021177324A1 (en) Image generating device, image generating method, recording medium generating method, learning model generating device, learning model generating method, learning model, data processing device, data processing method, inferring method, electronic instrument, generating method, program, and non-transitory computer-readable medium
KR20200057849A (en) Image processing apparatus and method for retargetting image
KR20200128378A (en) Image generation network training and image processing methods, devices, electronic devices, and media
CN107564063B (en) Virtual object display method and device based on convolutional neural network
CN108875751B (en) Image processing method and device, neural network training method and storage medium
CN112541867A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
KR20190030870A (en) Image composition apparatus using virtual chroma-key background, method and computer program
CN115115516B (en) Real world video super-resolution construction method based on Raw domain
CN114429191B (en) Electronic anti-shake method, system and storage medium based on deep learning
Yue et al. Real-rawvsr: Real-world raw video super-resolution with a benchmark dataset
CN115294055A (en) Image processing method, image processing device, electronic equipment and readable storage medium
KR102303002B1 (en) Method and Apparatus for Deblurring of Human and Scene Motion using Pseudo-blur Synthesizer
CN116612015A (en) Model training method, image mole pattern removing method and device and electronic equipment
CN112714263B (en) Video generation method, device, equipment and storage medium
Jeelani et al. Expanding synthetic real-world degradations for blind video super resolution
TWI559762B (en) An image processing apparatus, an image processing method, and a recording medium
WO2021031210A1 (en) Video processing method and apparatus, storage medium, and electronic device
CN115049559A (en) Model training method, human face image processing method, human face model processing device, electronic equipment and readable storage medium
CN115049572A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP2015197818A (en) Image processing apparatus and method of the same
CN113902639A (en) Image processing method, image processing device, electronic equipment and storage medium