KR20240089729A - Image processing methods, devices, storage media and electronic devices - Google Patents

Image processing methods, devices, storage media and electronic devices Download PDF

Info

Publication number
KR20240089729A
KR20240089729A KR1020247015956A KR20247015956A KR20240089729A KR 20240089729 A KR20240089729 A KR 20240089729A KR 1020247015956 A KR1020247015956 A KR 1020247015956A KR 20247015956 A KR20247015956 A KR 20247015956A KR 20240089729 A KR20240089729 A KR 20240089729A
Authority
KR
South Korea
Prior art keywords
image
shaded
shaded area
output
processed
Prior art date
Application number
KR1020247015956A
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 아크소프트 코포레이션 리미티드
Publication of KR20240089729A publication Critical patent/KR20240089729A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/60Image enhancement or restoration using machine learning, e.g. neural networks
    • 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/20021Dividing image into blocks, subimages or windows
    • 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

본 출원은 화상 처리 방법, 장치, 저장 매체 및 전자 기기를 개시한다. 여기서, 해당 화상 처리 방법은 음영 영역을 포함하는 피처리 화상을 획득하는 것, 및 피처리 화상을 훈련된 뉴럴 네트워크에 입력하여 음영 제거 화상을 얻는 것을 포함하고, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 1단째 네트워크는 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 2단째 네트워크는 피처리 화상 및 음영 영역 마스크 화상을 동시에 수신하고 음영 제거 화상을 출력한다. 본 출원은 종래 기술 중 음영 영역을 제거하면서 화상의 배경층에 대해 부작용을 일으키기 쉬우며 하드웨어 플랫폼에 대한 요구가 높다는 기술적 문제를 해결할 수 있다. This application discloses image processing methods, devices, storage media, and electronic devices. Here, the image processing method includes acquiring an image to be processed including a shaded area, and inputting the image to be processed into a trained neural network to obtain a deshading image, and the neural network is a two-stage cascade-connected first stage. It includes a network and a second-stage network, where the first-stage network receives the image to be processed and outputs a shaded area mask image, and the second-stage network simultaneously receives the image to be processed and the shaded area mask image and outputs a shadow-removed image. This application can solve the technical problem of removing shadow areas among the prior art, which tends to cause side effects on the background layer of the image, and requires a high hardware platform.

Description

화상 처리 방법, 장치, 저장 매체 및 전자 기기Image processing methods, devices, storage media and electronic devices

본 출원은 2021년 10월 18일에 제출된 중국 특허 출원 제202111210502. 3의 우선권을 주장하며, 해당 중국 특허 출원의 내용을 본 출원의 일부로서 본 명세서에 인용한다. This application is Chinese Patent Application No. 202111210502 filed on October 18, 2021. 3, priority is claimed, and the contents of the Chinese patent application are incorporated herein as part of this application.

(기술 분야)(technology field)

본 출원은 화상 처리 기술에 관한 것으로, 구체적으로, 화상 처리 방법, 장치, 저장 매체 및 전자 기기에 관한 것이다. This application relates to image processing technology, and specifically to image processing methods, devices, storage media, and electronic devices.

사람들이 휴대폰으로 문서를 촬영할 때, 늘 광선에 대한 손이나 휴대폰의 차폐 및 광선에 대한 환경 내의 기타 물체의 차폐로 인해 문서에 음영이 남아 있어, 촬영된 화상의 시각적 체험에 영향을 미치며, 촬영된 화상을 컴퓨터 시각 처리 기술로 처리함으로써 음영을 제거하고, 음영 뒤에 있는 문자나 그림의 내용을 복원시켜 화상의 품질을 효과적으로 향상시킬 수 있기 때문에, 문서의 음영 제거는 중요한 기술로서 촬상된 화상의 품질을 크게 향상시킬 수 있으며, 시장 전망이 밝다. When people take pictures of documents with mobile phones, there are always shadows left on the documents due to the shielding of the hands or mobile phones against the light rays and other objects in the environment against the light rays, which affects the visual experience of the captured images. By processing the image with computer vision processing technology, the quality of the image can be effectively improved by removing the shading and restoring the content of the text or picture behind the shading. Removing the shading of the document is an important technology that improves the quality of the captured image. It can be greatly improved and the market outlook is bright.

음영층을 효과적으로 제거하는 동시에 배경층에 대해 현저한 부작용을 일으키지 않음과 아울러, 빠른 실행 속도와 허용 가능한 하드웨어 컨피규레이션(configuration) 요구를 갖는 것은 음영 제거 방법을 휴대폰에 적용하는 기본적인 요건과 주요 과제이며, 현재의 음영 제거 방법은 음영을 깨끗이 제거할 수 없거나, 배경층의 정보를 손실하거나, 또는 실행 속도가 느리며, 이들 모두 일반 사용자의 사용에 불리하다. Effectively removing the shadow layer while not causing significant side effects on the background layer, as well as having fast execution speed and acceptable hardware configuration requirements are the basic requirements and main challenges in applying the shadow removal method to mobile phones, and currently The shading removal method cannot completely remove shading, loses background layer information, or has slow execution speed, all of which are disadvantageous for general users.

종래의 음영 제거 방법은 글로벌 측위 모듈, 외관 모델링 모듈 및 시맨틱 모델링 모듈을 포함하는 뉴럴 네트워크를 사용해왔다. 글로벌 측위 모듈은 음영 영역을 검출하고 음영 영역의 위치 특징을 획득하며, 외관 모델링 모듈은 네트워크의 출력과 라벨링 데이터(Ground Truth, GT)가 비음영 영역에서 일치하도록, 비음영 영역의 특징을 학습하며, 시맨틱 모델링 모듈은 음영 뒤에 있는 오리지널 콘텐츠를 복원시킨다. 그러나, 해당 방법에 있어서 음영이 제거된 배경 화상을 직접 출력하는 것이 아니라 음영 화상과 배경 화상의 비율을 출력하며, 나아가 음영 화상 및 네트워크의 출력으로 화소마다 나눗셈하여 배경 화상을 얻어야 하며, 이에 의해 보다 큰 산출량이 도입됨과 아울러, 나눗셈에 있어서 0으로 나눗셈되는 문제로 인해 산출 안정성에 영향을 미칠  가능성이 있다. Conventional shading removal methods have used a neural network including a global localization module, an appearance modeling module, and a semantic modeling module. The global positioning module detects the shaded area and acquires the location characteristics of the shaded area, and the appearance modeling module learns the features of the non-shaded area so that the output of the network and the labeling data (Ground Truth, GT) match in the non-shaded area. , The semantic modeling module restores the original content behind the shading. However, in this method, rather than directly outputting the background image with the shading removed, the ratio between the shading image and the background image must be output, and further, the background image must be obtained by dividing the shading image and the output of the network for each pixel. In addition to the introduction of a large output quantity, there is a possibility that output stability will be affected due to the problem of division by 0 in division.

따라서, 음영을 효과적으로 제거하면서 배경층에 대해 현저한 부작용을 일으키지 않을 수 있음과 아울러, 빠른 실행 속도와 허용 가능한 하드웨어 컨피규레이션 요구를 갖는 화상 처리 기술을 제안할 필요가 있다. Therefore, there is a need to propose an image processing technique that can effectively remove shadows while not causing significant side effects on the background layer, while also having fast execution speed and acceptable hardware configuration requirements.

본 출원의 실시예는 적어도 종래 기술 중 음영 영역을 제거하는 동시에 화상의 배경층에 대해 부작용을 일으키기 쉬우며 하드웨어 플랫폼에 대한 요구가 높은 기술적 문제를 해결하기 위한 화상 처리 방법, 장치, 저장 매체 및 전자 기기를 제공한다. Embodiments of the present application are, at least among the prior art, image processing methods, devices, storage media, and electronics to solve the technical problem of removing shaded areas while being prone to side effects on the background layer of the image and placing high demands on the hardware platform. Provides equipment.

본 출원의 실시예의 일 측면에 따르면, 음영 영역을 포함하는 피처리 화상을 획득하는 것, 및 피처리 화상을 훈련된 뉴럴 네트워크에 입력하여 음영 제거 화상을 얻는 것을 포함하고, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 1단째 네트워크는 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 2단째 네트워크는 피처리 화상 및 음영 영역 마스크 화상을 동시에 수신하고 음영 제거 화상을 출력하는 화상 처리 방법을 제공한다. According to one aspect of the embodiment of the present application, the method includes obtaining an image to be processed including a shaded area, and inputting the image to be processed into a trained neural network to obtain a deshading image, wherein the neural network is a two-stage subordinate. It includes a connected first-stage network and a second-stage network. The first-stage network receives the processed image and outputs the shaded area mask image, and the second-stage network simultaneously receives the processed image and the shaded area mask image and outputs the shaded area mask image. Provides an image processing method for output.

선택적으로, 1단째 네트워크는 제1 인코더를 포함하고, 피처리 화상의 특징을 층별로 추출하여 제1 세트의 특징 데이터를 얻는 제1 특징 추출 모듈, 및 제1 특징 추출 모듈의 출력에 연결되고, 제1 디코더를 포함하며, 제1 세트의 특징 데이터에 기초하여 음영 영역을 추정하여 음영 영역 마스크 화상을 출력하는 음영 영역 추정 모듈을 포함한다. Optionally, the first stage network includes a first encoder and is connected to a first feature extraction module that extracts features of the image to be processed layer by layer to obtain a first set of feature data, and an output of the first feature extraction module, It includes a first decoder, and includes a shaded area estimation module that estimates a shaded area based on the first set of feature data and outputs a shaded area mask image.

선택적으로, 2단째 네트워크는 제2 인코더를 포함하고, 1단째 네트워크의 출력에 연결되고, 피처리 화상을 수신함과 아울러, 1단째 네트워크로부터 출력된 음영 영역 마스크 화상을 수신하여 제2 세트의 특징 데이터를 얻는 제2 특징 추출 모듈, 및 제2 특징 추출 모듈의 출력에 연결되고, 제2 디코더를 포함하며, 제2 세트의 특징 데이터에 기초하여 음영 제거 화상을 출력하는 결과 화상 출력 모듈을 포함한다. Optionally, the second stage network includes a second encoder, is connected to the output of the first stage network, and receives the image to be processed, as well as receiving the shaded area mask image output from the first stage network to generate a second set of feature data. a second feature extraction module, and a result image output module connected to the output of the second feature extraction module, including a second decoder, and outputting a deshading image based on the second set of feature data.

선택적으로, 제1 디코더 또는 제2 디코더의 각 층의 출력을 크로스 레이어 연결을 통해 채널축을 따라 제1 인코더 또는 제2 인코더의 대응하는 층의 출력에 스플라이싱하고, 제1 디코더 또는 제2 디코더와 제1 인코더 또는 제2 인코더의 크로스 레이어 연결에 멀티 스케일 피라미드 풀링 모듈을 추가시키며, 멀티 스케일 피라미드 풀링 모듈은 상이한 스케일의 특징을 융합한다. Optionally, splicing the output of each layer of the first decoder or the second decoder to the output of the corresponding layer of the first encoder or the second encoder along the channel axis through a cross-layer connection, and A multi-scale pyramid pooling module is added to the cross-layer connection of the first encoder or the second encoder, and the multi-scale pyramid pooling module fuses features of different scales.

선택적으로, 음영 영역을 포함하는 피처리 화상을 획득한 후, 화상 처리 방법은 화상 피라미드 알고리즘을 이용하여 피처리 화상을 다운샘플링하고, 다운샘플링하는 동안 각 단의 화상층의 구배 정보를 저장하여 라플라시안 피라미드를 형성하는 것, 최소 사이즈의 화상층을 훈련된 뉴럴 네트워크에 송입하여 출력 화상을 얻는 것, 및 라플라시안 피라미드를 이용하여 출력 화상에 대해 저해상도부터 고해상도에로의 재구성을 수행하고, 음영 제거 화상을 얻는 것을 더 포함한다. Optionally, after acquiring the image to be processed including the shaded area, the image processing method downsamples the image to be processed using the image pyramid algorithm, stores the gradient information of the image layer at each stage during downsampling, and performs Laplacian Forming a pyramid, feeding the image layer of the minimum size to the trained neural network to obtain an output image, performing reconstruction from low resolution to high resolution on the output image using the Laplacian pyramid, and producing a deshading image. Includes more to get.

선택적으로, 상기 화상 처리 방법은 초기 뉴럴 네트워크를 구축하는 것, 및 샘플 데이터를 이용하여 초기 뉴럴 네트워크를 훈련하여 훈련된 뉴럴 네트워크를 얻는 것을 더 포함하고, 샘플 데이터는 실사 화상 및 합성 음영 화상을 포함하고, 화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 합성 음영 화상을 합성한다. Optionally, the image processing method further includes building an initial neural network, and training the initial neural network using sample data to obtain a trained neural network, wherein the sample data includes a real image and a synthetic shaded image. Then, a synthetic shaded image is synthesized from a simple shaded image and an unshaded image using an image synthesis method.

선택적으로, 화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 상기 합성 음영 화상을 합성하는 것은 단순 음영 화상을 획득하는 것, 무음영 화상을 획득하는 것, 및 단순 음영 화상 및 무음영 화상에 기초하여 합성 음영 화상을 얻는 것을 포함한다. Optionally, compositing the composite shaded image with a simple shaded image and an unshaded image using an image fusion method may include obtaining a simple shaded image, acquiring a unshaded image, and combining the simple shaded image and the unshaded image. and obtaining a synthetic shaded image based on the

선택적으로, 화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 상기 합성 음영 화상을 합성하는 것은 단순 음영 화상을 변환하고, 변환된 단순 음영 화상과 무음영 화상에 기초하여 합성 음영 화상을 얻는 것을 더 포함하고, 상기 변환된 단순 음영 화상에 있어서의 비음영 영역의 화소값은 하나의 고정 수치인 a로 일괄하여 설정되고, 음영 영역의 화소값은 0~a 사이의 수치로 되며, a는 정의 정수이다. Optionally, compositing the composite shading image with a simple shading image and an unshading image using an image fusion method includes converting the simple shading image and obtaining a composite shading image based on the converted simple shading image and unshading image. Further comprising, the pixel value of the non-shaded area in the converted simple shaded image is collectively set to one fixed value, a, and the pixel value of the shaded area is a value between 0 and a, and a is defined. It is an integer.

선택적으로, 초기 뉴럴 네트워크는 샘플 데이터에 대해 종별 판단을 수행하는 모듈을 더 포함하고, 초기 뉴럴 네트워크에 입력된 샘플 데이터가 실사 화상이라고 판단하였을 경우, 라벨링 데이터는 실경에서 수집된 음영 제거 화상이며, 초기 뉴럴 네트워크로부터 출력된 음영 제거 화상과 라벨링 데이터로서의 음영 제거 화상 사이의 차이에 기초하여, 2단째 네트워크 내부의 파라미터를 조정하고, 초기 뉴럴 네트워크에 입력된 샘플 데이터가 합성 음영 화상이라고 판단하였을 경우, 라벨링 데이터는 실경에서 수집된 무음영 화상과 단순 음영 화상을 포함하며, 음영 영역 마스크 화상과 단순 음영 화상 사이의 차이에 기초하여, 1단째 네트워크 내부의 파라미터를 조정하고, 초기 뉴럴 네트워크로부터 출력된 음영 제거 화상과 무음영 화상 사이의 차이에 기초하여, 2단째 네트워크 내부의 파라미터를 조정한다. Optionally, the initial neural network further includes a module that performs a type judgment on the sample data, and when it is determined that the sample data input to the initial neural network is a real-world image, the labeling data is a de-shaded image collected from the real-world scene, Based on the difference between the shaded image output from the initial neural network and the shaded image as labeling data, the parameters inside the second-stage network are adjusted, and the sample data input to the initial neural network is determined to be a synthetic shaded image. The labeling data includes unshaded images and simple shaded images collected from the real scene. Based on the difference between the shaded area mask image and the simple shaded image, the parameters inside the first stage network are adjusted, and the shading output from the initial neural network is adjusted. Based on the difference between the removed image and the unshaded image, the parameters inside the second-stage network are adjusted.

선택적으로, 샘플 데이터를 이용하여 초기 뉴럴 네트워크를 훈련할 때, 손실 함수는 화소 손실, 특징 손실, 구조적 유사성 손실, 적대적 손실, 음영 가장자리 손실, 음영 휘도 손실 중 적어도 하나를 포함한다. Optionally, when training the initial neural network using sample data, the loss function includes at least one of pixel loss, feature loss, structural similarity loss, adversarial loss, shaded edge loss, and shaded luminance loss.

선택적으로, 화소 손실은 화소 차단 손실을 포함하고, 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상에 있어서의 대응하는 두 개 화소의 절대차가 소정의 역치보다 클 경우, 두 개 화소의 손실을 산출하고, 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상에 있어서의 대응하는 두 개 화소의 절대차가 소정의 역치 이하일 경우, 두 개 화소 간의 차이를 무시한다. Optionally, the pixel loss includes a pixel blocking loss, and if the absolute difference of the corresponding two pixels in the output image from the initial neural network and the label image is greater than a predetermined threshold, calculating the loss of the two pixels; If the absolute difference between the corresponding two pixels in the output image from the initial neural network and the label image is less than or equal to a predetermined threshold, the difference between the two pixels is ignored.

선택적으로, 음영 휘도 손실은 뉴럴 네트워크로부터 출력된 음영 제거 화상에 있어서의 음영 영역에 대응하는 영역의 휘도와 입력된 피처리 화상에 있어서의 음영 영역의 휘도의 차를 0보다 크게 하여, 음영 제거 화상에 있어서의 음영 영역에 대응하는 영역의 휘도를 향상시킨다. Optionally, the shade luminance loss is achieved by making the difference between the luminance of the area corresponding to the shaded area in the shaded area output from the neural network and the luminance of the shaded area in the input image to be processed greater than 0, thereby creating a shaded area removed image. The luminance of the area corresponding to the shaded area is improved.

선택적으로, 손실 함수가 음영 가장자리 손실을 포함할 경우, 상기 화상 처리 방법은 음영 영역 마스크 화상에 대해 팽창 처리를 수행하여 팽창 화상을 얻는 것, 음영 영역 마스크 화상에 대해 에로젼 처리를 수행하여 에로젼 화상을 얻는 것, 및 팽창 화상과 에로젼 화상의 차 집합을 음영과 비음영의 경계 영역으로서 획득하고, TVLoss를 이용하여 평활화하는 것을 포함한다. Optionally, when the loss function includes shaded edge loss, the image processing method includes performing dilation processing on the shaded area mask image to obtain a dilated image, and performing erosion processing on the shaded area mask image to obtain an erosion image. It includes obtaining an image, and obtaining the difference set between the dilation image and the erosion image as a boundary area between shaded and non-shaded areas, and smoothing it using TVLoss.

본 출원의 실시예의 다른 측면에 따르면, 음영 영역을 포함하는 피처리 화상을 획득하는 화상 수집 유닛, 및 피처리 화상을 수신하고, 훈련된 뉴럴 네트워크를 이용하여 피처리 화상을 처리하여 음영 제거 화상을 얻는 처리 유닛을 포함하고, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 1단째 네트워크는 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 2단째 네트워크는 피처리 화상 및 음영 영역 마스크 화상을 동시에 수신하고 음영 제거 화상을 출력하는 화상 처리 장치를 더 제공한다. According to another aspect of the embodiment of the present application, an image collection unit that acquires an image to be processed including a shaded area, and receives the image to be processed, and processes the image to be processed using a trained neural network to produce a deshaded image. A neural network includes a two-stage cascaded first-stage network and a second-stage network, where the first-stage network receives the image to be processed and outputs a shaded area mask image, and the second-stage network receives the image to be processed. and an image processing device that simultaneously receives a shaded area mask image and outputs a shaded area mask image.

선택적으로, 1단째 네트워크는 제1 인코더를 포함하고, 피처리 화상의 특징을 층별로 추출하여 제1 세트의 특징 데이터를 얻는 제1 특징 추출 모듈, 및 제1 특징 추출 모듈의 출력에 연결되고, 제1 디코더를 포함하며, 제1 세트의 특징 데이터에 기초하여 음영 영역을 추정하여 음영 영역 마스크 화상을 출력하는 음영 영역 추정 모듈을 포함한다. Optionally, the first stage network includes a first encoder and is connected to a first feature extraction module that extracts features of the image to be processed layer by layer to obtain a first set of feature data, and an output of the first feature extraction module, It includes a first decoder, and includes a shaded area estimation module that estimates a shaded area based on the first set of feature data and outputs a shaded area mask image.

선택적으로, 2단째 네트워크는 제2 인코더를 포함하고, 1단째 네트워크의 출력에 연결되고, 피처리 화상을 수신함과 아울러, 1단째 네트워크로부터 출력된 음영 영역 마스크 화상을 수신하여 제2 세트의 특징 데이터를 얻는 제2 특징 추출 모듈, 및 제2 특징 추출 모듈의 출력에 연결되고, 제2 디코더를 포함하며, 제2 세트의 특징 데이터에 기초하여 음영 제거 화상을 출력하는 결과 화상 출력 모듈을 포함한다. Optionally, the second stage network includes a second encoder, is connected to the output of the first stage network, and receives the image to be processed, as well as receiving the shaded area mask image output from the first stage network to generate a second set of feature data. a second feature extraction module, and a result image output module connected to the output of the second feature extraction module, including a second decoder, and outputting a deshading image based on the second set of feature data.

본 출원의 실시예의 또 다른 측면에 따르면, 프로그램이 저장된 저장 매체로서, 상기 프로그램이 실행되면 상기 중 어느 한 항에 기재된 화상 처리 방법을 실행하도록 상기 저장 매체가 위치하는 기기를 제어하는 저장 매체를 더 제공한다. According to another aspect of the embodiment of the present application, a storage medium storing a program, which, when the program is executed, controls a device in which the storage medium is located to execute the image processing method according to any one of the above, is further provided. to provide.

본 출원의 실시예의 또 다른 측면에 따르면, 프로세서, 및 상기 프로세서의 실행 가능한 명령을 저장하는 메모리를 포함하고, 상기 프로세서는 상기 실행 가능한 명령을 실행하는 것을 통해, 상기 중 어느 한 항에 기재된 화상 처리 방법을 실행하도록 구성되는 전자 기기를 더 제공한다. According to another aspect of an embodiment of the present application, there is provided a processor, and a memory storing executable instructions of the processor, wherein the processor executes the executable instructions to process the image according to any one of the above. An electronic device configured to perform the method is further provided.

본 출원은 속도가 빠르고, 효과가 좋으며 휴대폰 등의 이동 단말에 적용 가능한 음영 제거 방법을 제안하며, 음영이라는 물리적 현상의 특성을 파악하여, 리얼감이 뛰여난 훈련 자료를 합성함과 아울러, 다양한 손실 함수나 효과적인 네트워크 구조 및 모듈을 조합하여 훈련함으로써, 효과가 좋은 음영 제거를 구현하고, 휴대폰 등의 이동 단말을 통해 촬영된 화상의 해상도가 높다는 특성에 대해, 본 출원은 다운샘플링 기술 및 네트워크 프루닝 기술을 이용하여 고해상도의 화상에 있어서 여전히 빠른 처리 속도를 달성할 수 있다. This application proposes a shadow removal method that is fast, effective, and applicable to mobile terminals such as mobile phones, identifies the characteristics of the physical phenomenon called shadow, synthesizes training data with excellent realism, and reduces various losses. By training in combination with functions or effective network structures and modules, effective shadow removal is implemented, and in response to the characteristics of high resolution of images captured through mobile terminals such as mobile phones, this application proposes downsampling technology and network pruning. Using the technology, it is still possible to achieve fast processing speeds for high-resolution images.

여기에서 설명하는 도면은 본 출원의 진일보의 이해를 돕기 위한 것으로, 본 출원의 일부를 구성하며, 본 출원의 예시적인 실시예 및 그 설명은 본 출원을 해석하기 위한 것으로, 본 출원을 부적절하게 한정하는 것은 아니다.
도 1은 본 출원의 실시예에 따른 선택적인 화상 처리 방법의 흐름도이다.
도 2는 본 출원의 실시예에 따른 선택적인 뉴럴 네트워크의 구조 도이다.
도 3은 본 출원의 실시예에 따른 선택적인 뉴럴 네트워크의 훈련 흐름도이다.
도 4는 본 출원의 실시예에 따른 선택적인 화상 합성 방법의 흐름도이다.
도 5 (a) 및 도 5 (b)는 본 출원의 실시예의 화상 처리 방법을 이용하여 음영 제거를 구현한 효과의 비교도이다.
도 6은 본 출원의 실시예에 따른 선택적인 화상 처리 장치의 구조 블록도이다.
The drawings described herein are intended to aid further understanding of the present application and constitute a part of the present application, and the exemplary embodiments of the present application and their descriptions are intended to interpret the present application and do not inappropriately limit the present application. It's not like that.
1 is a flowchart of a selective image processing method according to an embodiment of the present application.
Figure 2 is a structural diagram of an optional neural network according to an embodiment of the present application.
Figure 3 is a training flowchart of an optional neural network according to an embodiment of the present application.
Figure 4 is a flowchart of a selective image synthesis method according to an embodiment of the present application.
Figures 5(a) and 5(b) are comparative diagrams of the effect of implementing shadow removal using the image processing method of the embodiment of the present application.
Figure 6 is a structural block diagram of an optional image processing device according to an embodiment of the present application.

이하, 당업자가 본 출원의 기술안을 보다 쉽게 이해하기 위하여, 본 출원의 실시예의 도면을 참조하면서 본 출원의 실시예의 기술안을 명확하고 완전하게 기술하며, 기술되는 실시예는 본 출원의 일부 실시예에 불과하며, 모든 실시예가 아니다는 점은 분명하다. 본 출원의 실시예에 기반하여, 당업자가 창의적인 노력 없이 얻어진 기타 모든 실시예는 본 출원의 보호 범위에 속해야 한다. Hereinafter, in order for those skilled in the art to more easily understand the technical draft of the present application, the technical draft of the embodiments of the present application will be clearly and completely described with reference to the drawings of the embodiments of the present application, and the described embodiments are included in some embodiments of the present application. It is clear that this is limited and not all examples. Based on the embodiments of this application, all other embodiments obtained by a person skilled in the art without creative efforts shall fall within the protection scope of this application.

본 출원의 명세서, 특허 청구의 범위 및 상기 도면에 있어서의 "제1", "제2 " 등 용어는 유사한 오브젝트를 구분하기 위한 것이며, 반드시 특정 순서 또는 우선 순위를 기술하기 위한 것은 아니다는 점에 유의해야 한다. 이렇게 사용되는 순서는 본 명세서에 기술된 본 출원의 실시예가 본 명세서에 도시 또는 기술된 것 이외의 순서로 실시 가능하도록, 적절한 상황에서 서로 교환 가능하다는 점을 이해해야 한다. 또한, "포함한다"나 "가진다"라는 용어 및 이들의 어떠한 변형은 비배타적인 "포함"을 포괄하기 위한 의도이며, 예컨대 일련의 스텝 또는 유닛을 포함하는 프로세스, 방법, 시스템, 제품 또는 기기는 반드시 명시적으로 나열된 스텝 또는 유닛에 한정되는 것은 아니며, 명시적으로 나열되지 않은 것 또는 이들의 프로세스, 방법, 제품 또는 기기 고유의 기타 스텝 또는 유닛을 포함하여도 된다. It should be noted that terms such as “first” and “second” in the specification, claims, and drawings of this application are intended to distinguish similar objects and are not necessarily intended to describe a specific order or priority. Be careful. It is to be understood that the orders used are interchangeable under appropriate circumstances, such that the embodiments of the application described herein can be practiced in orders other than those shown or described herein. Additionally, the terms “comprise” or “have” and any variations thereof are intended to encompass the non-exclusive “including,” e.g., a process, method, system, product or device that includes a series of steps or units. It is not necessarily limited to steps or units explicitly listed, and may include other steps or units that are not explicitly listed or that are unique to their processes, methods, products, or devices.

이하, 본 출원의 실시예의 선택적인 화상 처리 방법의 흐름도를 설명하고자 한다. 도면의 흐름도에 도시된 스텝은 한 세트의 컴퓨터 실행 가능한 명령과 같은 컴퓨터 시스템에서 실행되어도 되며, 또한 흐름도에 논리적 순서가 도시되어 있지만, 경우에 따라 도시되거나 기술된 스텝은 여기와 다른 순서로 실행되어도 된다는 점에 유의해야 한다. Hereinafter, a flowchart of an optional image processing method of an embodiment of the present application will be described. The steps shown in the flowcharts of the drawings may be executed by a computer system as a set of computer-executable instructions, and although the flowcharts show a logical order, in some cases the steps shown or described may be executed in a different order than here. It should be noted that this happens.

도 1을 참조하면, 본 출원의 실시예에 따른 선택적인 화상 처리 방법의 흐름도이다. 도 1에 도시된 바와 같이, 해당 화상 처리 방법은 이하의 스텝을 포함한다. Referring to FIG. 1, it is a flowchart of a selective image processing method according to an embodiment of the present application. As shown in FIG. 1, the image processing method includes the following steps.

S100: 음영 영역을 포함하는 피처리 화상을 획득한다. S100: Acquire an image to be processed including a shaded area.

S102: 피처리 화상을, 훈련된 뉴럴 네트워크에 입력하여 음영 제거 화상을 얻는다. 여기서, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하고, 1단째 네트워크는 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 2단째 네트워크는 피처리 화상 및 음영 영역 마스크 화상을 동시에 수신하고 음영 제거 화상을 출력한다. S102: The image to be processed is input to a trained neural network to obtain a shaded image. Here, the neural network includes a two-stage cascaded first-stage network and a second-stage network, the first-stage network receives the image to be processed and outputs a shaded area mask image, and the second-level network receives the image to be processed and the shaded area mask image. simultaneously receives and outputs a shadow-removed image.

상기 화상 처리 방법을 통해, 정확한 음영 영역 경계를 얻을 수 있으며, 얻어진 음영 제거 화상은 음영과 비음영 사이에서 매끄럽게 이행할 수 있다. Through the above image processing method, an accurate shaded area boundary can be obtained, and the obtained shaded removed image can smoothly transition between shaded and non-shaded.

하나의 선택적인 실시예에 있어서, 도 2에 도시된 바와 같이, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 20 및 2단째 네트워크 22를 포함하며, 1단째 네트워크는 제1 특징 추출 모듈 200과 음영 영역 추정 모듈 202를 포함하고, 2단째 네트워크는 제2 특징 추출 모듈 204와 결과 화상 출력 모듈 206을 포함한다. 여기서, 제1 특징 추출 모듈 200은 제1 인코더를 포함하고, 피처리 화상의 특징을 층별로 추출하여 제1 세트의 특징 데이터를 얻으며, 음영 영역 추정 모듈 202는 제1 특징 추출 모듈 200의 출력에 연결되고, 제1 디코더를 포함하며, 제1 세트의 특징 데이터에 기초하여 음영 영역을 추정하여 음영 영역 마스크 화상을 출력하며, 제2 특징 추출 모듈 204는 제2 인코더를 포함하고, 1단째 네트워크의 출력에 연결되며, 피처리 화상을 수신함과 아울러, 1단째 네트워크로부터 출력된 음영 영역 마스크 화상을 수신하여 제2 세트의 특징 데이터를 얻으며, 결과 화상 출력 모듈 206은 제2 특징 추출 모듈 204의 출력에 연결되고, 제2 디코더를 포함하며, 제2 세트의 특징 데이터에 기초하여 음영 제거 화상을 출력한다. 2단 종속 연결된 뉴럴 네트워크를 통해 음영의 제거 효과를 강화할 수 있다. 하나의 선택적인 실시예에 있어서, 1단째 네트워크와 2단째 네트워크는 입력된 채널수가 상이한 것 외에 동일한 구조를 가지며, 예컨대 고전적 분할 네트워크 UNet에 기초하여 구축되어도 된다. In one optional embodiment, as shown in FIG. 2, the neural network includes a two-stage cascade-connected first-stage network 20 and a second-stage network 22, where the first-stage network includes a first feature extraction module 200 and a shaded area. It includes an estimation module 202, and the second stage network includes a second feature extraction module 204 and a result image output module 206. Here, the first feature extraction module 200 includes a first encoder, extracts features of the image to be processed layer by layer to obtain a first set of feature data, and the shaded area estimation module 202 outputs the output of the first feature extraction module 200. connected, comprising a first decoder, estimating a shaded area based on the first set of feature data and outputting a shaded area mask image, the second feature extraction module 204 comprising a second encoder, and It is connected to the output, and receives the image to be processed, as well as receiving the shaded area mask image output from the first stage network to obtain a second set of feature data, and the resulting image output module 206 outputs the output of the second feature extraction module 204. It is connected, includes a second decoder, and outputs a shadow removal image based on the second set of feature data. The shadow removal effect can be strengthened through a two-stage cascaded neural network. In one optional embodiment, the first-level network and the second-level network have the same structure except that the number of input channels is different, and may be built based on, for example, a classical partition network UNet.

두 개 인코더 각 층의 출력을 크로스 레이어 연결을 통해 채널축을 따라 두 개 디코더의 대응하는 층의 출력에 각각 스플라이싱한다. 인코더와 디코더의 크로스 레이어 연결에 멀티 스케일 피라미드 풀링 모듈을 추가시킨다. 멀티 스케일 피라미드 풀링 모듈은 복수의 상이한 커널 크기의 풀링층, 컨볼루션층 및 보간 업샘플링층을 포함하며, 우선 풀링층을 통해 상이한 스케일의 특징을 추출하고, 그 다음 컨볼루션층을 통해 저수준 및/또는 고수준의 특징을 추출하며, 나아가 보간 업샘플링층을 통해 인코더 및 디코더의 대응하는 층의 출력을 동일한 사이즈로 조정하며, 마지막으로 채널축을 따라 하나의 특징으로 스플라이싱한다. 음영의 영향 정도 및 면적은 화상에 따라 크게 다르기 때문에, 음영 영역의 판정은 로컬적인 텍스처 특징을 참조해야 할 뿐만 아니라, 글로벌적인 시맨틱 정보도 고려해야 한다. 멀티 스케일 피라미드 풀링 모듈은 상이한 스케일의 특징을 융합함으로써, 네트워크의 범화성을 강화시켜, 상이한 면적 및 정도의 음영 화상에 있어서의 네트워크의 양호한 효과를 달성할 수 있다. The output of each layer of the two encoders is spliced to the output of the corresponding layer of the two decoders along the channel axis through cross-layer connection. A multi-scale pyramid pooling module is added to the cross-layer connection of the encoder and decoder. The multi-scale pyramid pooling module includes a plurality of different kernel size pooling layers, convolution layers and interpolation upsampling layers, first extracting features of different scales through the pooling layer, and then through the convolution layer to low-level and/or Alternatively, high-level features are extracted, and further, the outputs of the corresponding layers of the encoder and decoder are adjusted to the same size through an interpolation upsampling layer, and finally, spliced into one feature along the channel axis. Because the degree and area of shading influence vary greatly depending on the image, determination of the shading area not only requires reference to local texture features, but also considers global semantic information. By fusing the features of different scales, the multi-scale pyramid pooling module can enhance the universality of the network and achieve a good effect of the network on shading images of different areas and degrees.

기기에서의 모델의 실행 속도를 향상시키기 위하여, 모델을 프루닝(Pruning)하고, 인코더의 컨볼루션층을 그룹화 컨볼루션으로 치환하여, 각 컨볼루션 커널이 하나의 채널만 컨볼루션하도록 하여도 되며, 이를 통해 모델의 연산량을 감소시키고 처리 속도를 향상시킨다. To improve the execution speed of the model on the device, you can prune the model and replace the encoder's convolution layer with a grouping convolution so that each convolution kernel convolves only one channel. This reduces the amount of model calculations and improves processing speed.

공분산 드리프트를 보다 양호하게 억제하고 데이터에 대한 네트워크의 핏팅(fitting) 능력을 강화하기 위하여, 인코더 및 디코더의 컨볼루션층의 뒤에 인스턴스 정규화층을 추가하여 특징을 정규화함으로써, 음영의 제거 효과를 향상시킨다. In order to better suppress covariance drift and enhance the fitting ability of the network to the data, an instance normalization layer is added after the convolutional layer of the encoder and decoder to normalize the features, thereby improving the effect of shading removal. .

피처리 화상의 화상 해상도가 높거나 데이터량이 클 경우, 피처리 화상을 훈련된 뉴럴 네트워크에 직접 송입하면, 비디오 메모리(Video Memory) 오버플로우가 발생하거나 처리 시간이 너무 길어져 사용자의 체험에 영향을 미칠 가능성이 있으며, 이 문제를 해결하기 위하여 일반적인 보간 스케일링 알고리즘을 이용할 수 있지만, 화상 정보가 손실되기 쉬우며 생성된 화상을 원본 화상으로 완벽하게 확대할 수 없다. If the image resolution of the image to be processed is high or the amount of data is large, if the image to be processed is directly transmitted to the trained neural network, video memory overflow may occur or the processing time may be too long, affecting the user experience. There is a possibility, and a general interpolation scaling algorithm can be used to solve this problem, but image information is likely to be lost, and the generated image cannot be perfectly enlarged to the original image.

음영 영역이 통상 현저한 구배 정보를 갖지 않는다는 특징을 고려하여, 하나의 선택적인 실시예에 있어서, 화상 피라미드 알고리즘을 이용하여, 우선 피처리 화상을 다운샘플링하고, 다운샘플링하는 동안 각 단의 화상층의 구배 정보를 저장하여 라플라시안 피라미드를 형성하고, 그 다음 피라미드 사이즈가 가장 작은 화상층을 훈련된 뉴럴 네트워크에 송입하여 출력 화상을 얻으며, 마지막으로 라플라시안 피라미드를 이용하여 출력 화상을 재구성하여도 되며, 음영 영역의 구배 정보가 약하기 때문에, 재구성 프로세스에서 피처리 화상의 일부 구배 정보를 복원시키더라도 음영 제거 효과에는 영향을 미치지 않는다. 다운샘플링하는 동안 저장된 각 단의 화상층의 구배 정보를 이용하여 화상 재구성을 수행하는 것을 통해, 화상 해상도에 영향을 주지 않고 음영을 제거할 수 있다. 다운샘플링 및 화상 재구성을 도입하는 것을 통해, 한편으로는 화상 처리 속도가 보장되고, 다른 한편으로는 화상 처리 전후의 품질에 영향을 미치지 않으므로, 휴대폰 등의 연산력이 낮은 장치에서 고해상도 화상을 처리하는 데 유리하다. Considering the characteristic that shaded areas usually do not have significant gradient information, in one alternative embodiment, an image pyramid algorithm is used to first downsample the image to be processed, and during downsampling, the image layer at each stage is The gradient information is stored to form a Laplacian pyramid, and then the image layer with the smallest pyramid size is sent to the trained neural network to obtain an output image. Finally, the output image can be reconstructed using the Laplacian pyramid, and the shaded area is Because the gradient information of is weak, even if some of the gradient information of the image to be processed is restored in the reconstruction process, the shadow removal effect is not affected. By performing image reconstruction using the gradient information of each image layer stored during downsampling, shading can be removed without affecting image resolution. By introducing downsampling and image reconstruction, on the one hand, the image processing speed is guaranteed, and on the other hand, the quality before and after image processing is not affected, making it possible to process high-resolution images on devices with low computing power such as mobile phones. It is advantageous.

도 3에 도시된 바와 같이, 훈련된 뉴럴 네트워크를 얻기 위하여, 해당 화상 처리 방법은 이하의 스텝을 더 포함한다. As shown in Figure 3, in order to obtain a trained neural network, the image processing method further includes the following steps.

S300: 초기 뉴럴 네트워크를 구축한다. S300: Build an initial neural network.

S302: 샘플 데이터를 이용하여 초기 뉴럴 네트워크를 훈련하여 훈련된 뉴럴 네트워크를 얻는다. 여기서, 샘플 데이터는 실사 화상 및 합성 음영 화상을 포함하고, 합성 음영 화상은 단순 음영 화상 및 무음영 화상으로 합성된다. S302: Train the initial neural network using sample data to obtain a trained neural network. Here, the sample data includes a real image and a synthetic shaded image, and the synthetic shaded image is synthesized into a simple shaded image and an unshaded image.

사용자가 늘 촬영하는 화상에는 음영의 종류가 매우 풍부하기 때문에, 음영의 가장자리로부터 구분하면, 광원부터 배경까지의 거리가 가까운 경우에 촬영된 선명하고 날카로운 음영 가장자리와, 광원부터 배경까지의 거리가 먼 경우에 촬영된 흐릿하고 이행이 완만한 음영 가장자리를 포함하며, 그 외에 광원이 상이한 색갈을 나타낼 경우(예컨대, 적황색을 띤 온색광, 청색 계열의 냉색광이나 일광), 음영도 상이한 색갈을 나타낸다. 따라서, 이들 특징을 고려하면, 화상 처리 방법 전체에 있어서 초기 뉴럴 네트워크를 훈련하기 위한 샘플 데이터는 매우 중요한 역할을 하며, 샘플 데이터의 획득에는 주로 실경 수집과 화상 합성 이 두 가지 방법이 있다. Since there are many types of shading in the images that users always capture, if you distinguish them from the edges of the shading, you can distinguish between clear and sharp shading edges captured when the distance from the light source to the background is close, and sharp shading edges captured when the distance from the light source to the background is long. In addition, if the light source has a different color (e.g., reddish-yellow warm light, blue-colored cool light or daylight), the shading also has a different color. Therefore, considering these characteristics, sample data for training the initial neural network plays a very important role in the entire image processing method, and there are mainly two methods for acquiring sample data: real scene collection and image synthesis.

실경 수집을 이용하는 방법에 있어서, 수집자는 씬(scene)의 종별(예컨대, 온색광, 냉색광, 일광 등 상이한 조명 씬)에 따라 대응하는 광선 환경 및 촬영 대상을 선택하며, 휴대폰 또는 카메라 등 촬영 장치를 삼각대로 고정하고, 적절한 조명 방향 및 초점 거리를 조정하며, 손바닥, 휴대폰 또는 기타 일반 물체를 차폐물로서 사용하여 차광하고, 촬영 대상에 음영을 형성하고 촬영하여 음영 화상을 얻은 후, 차폐물을 치우고 다시 촬영하여 무음영 배경 화상을 얻으며, 이로써 쌍을 이루는 샘플 데이터를 얻는다. In a method using real scene collection, the collector selects the corresponding light environment and shooting target according to the type of scene (e.g., different lighting scenes such as warm color light, cold color light, daylight, etc.), and uses a shooting device such as a mobile phone or camera. Fix the camera on a tripod, adjust the appropriate lighting direction and focal length, use the palm, mobile phone or other common objects as a shield to block the light, form a shadow on the object to be photographed and shoot to obtain a shaded image, then remove the shield and start again. By taking pictures, a shadow-free background image is obtained, thereby obtaining paired sample data.

그렇지만, 실경 수집은 통상 샘플 데이터의 높은 품질을 보장하기 어려우며, 한편으로는 차폐로 인한 광선의 변화에 의해, 배경 화상 및 음영 화상은 비음영 영역에서 휘도나 색채의 차이가 생김과 동시에, 음영 화상은 배경 화상과 완전히 일치하기 어려우며, 다른 한편으로는 광선의 변화 또는 초점의 변화에 의해, 음영 화상 및 배경 화상에 노이즈가 생기며, 이들 모두 네트워크의 훈련에 큰 영향을 미친다. However, real-world collection is usually difficult to ensure high quality of sample data, and on the other hand, due to changes in light rays due to occlusion, differences in luminance and color occur in unshaded areas in the background and shaded images, and at the same time, the shaded images On the one hand, it is difficult to completely match the background image, and on the other hand, changes in light rays or changes in focus produce noise in the shaded image and background image, both of which greatly affect the training of the network.

이에 대해, 화상 합성 방법을 이용하여 진실에 거의 가까운 합성 음영 화상을 생성하여 뉴럴 네트워크의 훈련에 사용하여도 된다. In response to this, a synthetic shading image that is almost close to the truth may be generated using an image synthesis method and used for training a neural network.

하나의 선택적인 실시예에 있어서, 화상 합성 방법은 이하의 스텝을 포함한다. In one alternative embodiment, the image compositing method includes the following steps.

S400: 단순 음영 화상을 획득한다. S400: Acquire a simple shaded image.

하나의 선택적인 실시예에 있어서, 데이터 수집자는 미리 설정된 광선 환경에서, 테이블 위에 한 장의 백지를 평평하게 깔고, 손바닥, 휴대폰 또는 기타 일반 물체로 차광하여 백지 위에 단순 음영 화상 S를 남기며, 단순 음영 화상 S의 전부 또는 일부 영역이 음영 영역이다. In one optional embodiment, the data collector, in a preset light environment, lays a sheet of blank paper flat on a table, blocks the light with the palm of his hand, a cell phone, or other common object, and leaves a simple shaded image S on the blank paper, All or part of the area of S is a shaded area.

단순 음영 화상을 획득할 때, 백지 위의 비음영 영역이 단순한 흰색으로 표시되지 않을 가능성이 있기 때문에, 비음영 영역과 음영 영역의 경계가 충분히 뚜렷하지 않게 된다. 따라서, 다른 선택적인 실시예에 있어서, 나아가 단순 음영 화상을 변환하여도 되며, 예컨대, S'=min(a,S/mean(S)*a), 여기서 a는 정의 정수이다. 상기 변환을 통해, 변환된 단순 음영 화상에 있어서의 비음영 영역의 화소값을 하나의 고정값 a(예컨대 255)로 일괄하여 설정할 수 있으며, 음영 영역의 화소값은 0~a 사이의 수치로 되며, 단순 음영 화상중의 비음영 영역과 음영 영역 사이에 비교적 선명한 경계를 가지게 된다. When acquiring a simple shaded image, there is a possibility that the non-shaded area on the white paper will not be displayed as simple white, so the boundary between the non-shaded area and the shaded area will not be sufficiently clear. Therefore, in another optional embodiment, the simple shading image may be further converted, for example, S'=min(a,S/mean(S)*a), where a is a positive integer. Through the above conversion, the pixel values of the non-shaded area in the converted simple shaded image can be collectively set to one fixed value a (e.g., 255), and the pixel value of the shaded area is a value between 0 and a. , there is a relatively clear boundary between the non-shaded area and the shaded area in the simple shaded image.

S402: 무음영 화상을 획득한다. S402: Acquire an unshaded image.

하나의 선택적인 실시예에 있어서, 데이터 수집자는 상기 동일한 광선 환경에서 각 종류의 촬영 대상의 무음영 화상 B를 촬영한다. In one alternative embodiment, the data collector takes unshaded images B of each type of subject in the same light environment.

S404: 단순 음영 화상 및 무음영 화상에 기초하여, 합성 음영 화상을 얻는다. S404: Based on the simple shaded image and the unshaded image, a composite shaded image is obtained.

하나의 선택적인 실시예에 있어서, 단순 음영 화상 S(혹은 변환된 단순 음영 화상 S')와 무음영 화상 B를 화소마다 곱셈하여 합성 음영 화상을 얻는다. In one alternative embodiment, the simple shaded image S (or the converted simple shaded image S') and the unshaded image B are multiplied pixel-by-pixel to obtain a composite shaded image.

이러한 화상 합성 방법은 광선에 대한 음영의 감쇠 작용을 고려하여 가장자리의 이행이 완만한 음영을 양호하게 처리할 수 있으며 리얼감이 뛰여나다. This image synthesis method takes into account the attenuation effect of shadows on light rays and can handle shadows with gentle transitions between edges well, providing an excellent sense of realism.

샘플 데이터는 실사 화상과 합성 음영 화상을 포함하는 혼합 데이터이며, 초기 뉴럴 네트워크는 샘플 데이터에 대해 종별 판단을 수행하는 모듈을 더 포함하기 때문에, 초기 뉴럴 네트워크에 입력된 샘플 데이터가 실사 화상이라고 판단하였을 경우, 라벨링 데이터(Ground Truth, GT)는 실경에서 수집된 음영 제거 화상이며, 실사 화상의 음영 영역 마스크 화상은 조정이 불가능하므로, 초기 뉴럴 네트워크로부터 출력된 음영 제거 화상과 라벨링 데이터 GT로서의 음영 제거 화상 사이의 차이에 기초하여, 2단째 네트워크 22 내부의 파라미터를 조정하고, 초기 뉴럴 네트워크에 입력된 샘플 데이터가 합성 음영 화상이라고 판단하였을 경우, 라벨링 데이터(Ground Truth, GT)는 실경에서 수집된 무음영 화상과 단순 음영 화상을 포함하며, 음영 영역 마스크 화상과 단순 음영 화상 사이의 차이에 기초하여, 1단째 네트워크 20 내부의 파라미터를 조정하고, 초기 뉴럴 네트워크로부터 출력된 음영 제거 화상과 라벨링 데이터로서의 무음영 화상 사이의 차이에 기초하여, 2단째 네트워크 22 내부의 파라미터를 조정할 수 있다. 혼합 데이터를 샘플 데이터로서 사용하여 훈련하는 것을 통해, 이행이 완만한 음영에 대해 그의 정확한 마스크를 획득하고, 마스크 분할의 품질을 보장하며, 음영 제거의 효과를 향상시킬 수 있다. The sample data is mixed data including a real image and a synthetic shaded image, and the initial neural network further includes a module that performs type judgment on the sample data, so it may have been determined that the sample data input to the initial neural network was a real image. In this case, the labeling data (Ground Truth, GT) is a deshaded image collected from the real scene, and since the mask image of the shaded area of the real image cannot be adjusted, the deshaded image output from the initial neural network and the deshaded image as the labeling data GT Based on the difference between the two, the parameters inside the second-stage network 22 are adjusted, and when it is determined that the sample data input to the initial neural network is a synthetic shaded image, the labeling data (ground truth, GT) is the unshaded image collected from the real scene. It includes an image and a simple shaded image, and adjusts the parameters inside the first stage network 20 based on the difference between the shaded area mask image and the simple shaded image, and the deshaded image output from the initial neural network and the unshaded image as labeling data. Based on the differences between images, the parameters inside the second stage network 22 can be adjusted. Through training using mixed data as sample data, its accurate mask can be obtained for smooth transition shading, ensure the quality of mask segmentation, and improve the effect of shading removal.

하나의 선택적인 실시예에 있어서, 샘플 데이터의 획득 방법은 샘플 데이터를 더 풍부하게 하고, 네트워크의 로버스트성(Robustness)을 증가시키도록, 획득된 샘플 데이터에 대해 랜덤 플리핑, 회전, 색 온도 조정, 채널 스와핑, 랜덤 노이즈의 추가 등과 같은 하나 이상의 처리를 수행하는 것을 더 포함하여도 된다. In one optional embodiment, the method of acquiring sample data includes random flipping, rotation, and color temperature on the obtained sample data to enrich the sample data and increase the robustness of the network. It may further include performing one or more processing such as adjustment, channel swapping, addition of random noise, etc.

하나의 선택적인 실시예에 있어서, 초기 뉴럴 네트워크를 감시 훈련할 때, 손실 함수는 화소 손실, 특징 손실, 구조적 유사성 손실 및 적대적 손실 중 적어도 하나를 포함한다. In one alternative embodiment, when training an initial neural network, the loss function includes at least one of a pixel loss, a feature loss, a structural similarity loss, and an adversarial loss.

화소 손실 함수는 화상의 화소 차원에서 두 개 화상의 유사성을 가늠하는 함수이며, 주로 화상 화소값 손실 및 구배 손실이 있다. 본 실시예에 있어서, 주로 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상의 비교 화소값의 평균 제곱 오차와 두 개 화상의 구배의 L1놈(Norm)오차의 가중합을 가리킨다. 화소 손실은 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상의 각 화소의 화소값이 가능한 한 접근하도록, 화소 차원에서 훈련 과정을 감시한다. 화상 전체의 노이즈가 아니라 음영 영역에 있어서의 음영층과 배경층의 상이성에 주목하도록 초기 뉴럴 네트워크를 가이드하기 위하여, 하나의 선택적인 실시예에 있어서, 화소 차단 손실을 도입하여 화소 손실을 차단하여도 되며, 즉 두 개 화소의 절대차가 소정의 역치보다 클 경우에만 두 개 화소의 손실을 산출하고, 그렇지 않을 경우 두 개 화소 간의 차이를 무시한다. 화소 차단 손실을 추가한 후, 음영 영역에 주목하도록 네트워크를 가이드하여 화상의 노이즈를 억제할 수 있으며, 음영 제거의 효과가 향상될 뿐만 아니라 네트워크의 수렴 속도도 대폭 빨라진다. The pixel loss function is a function that measures the similarity of two images in the pixel dimension of the images, and mainly includes image pixel value loss and gradient loss. In this embodiment, it mainly refers to the weighted sum of the mean square error of the compared pixel values of the output image and the label image from the initial neural network and the L1 norm error of the gradient of the two images. Pixel loss monitors the training process at the pixel level to ensure that the pixel value of each pixel in the output image and label image from the initial neural network is as close as possible. In order to guide the initial neural network to pay attention to the differences between the shadow layer and the background layer in the shaded region rather than the noise in the entire image, in one alternative embodiment, a pixel blocking loss is introduced to block the pixel loss. That is, the loss of two pixels is calculated only when the absolute difference between the two pixels is greater than a predetermined threshold, otherwise, the difference between the two pixels is ignored. After adding pixel blocking loss, noise in the image can be suppressed by guiding the network to pay attention to shaded areas. Not only does the effect of shade removal improve, but the convergence speed of the network is also significantly accelerated.

특징 손실이란, 주로 초기 뉴럴 네트워크에로의 입력 화상 및 라벨 화상의 대응하는 특징의 L1놈 오차의 가중합이다. 하나의 선택적인 실시예에 있어서, ImageNet데이터 세트에 사전 훈련된 VGG19네트워크를 특징 추출기로서 사용하고, 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상을 해당 특징 추출기에 각각 송입하여 VGG19 각 층의 특징을 획득한 후, 입력 화상 및 라벨 화상의 대응하는 특징의 L1놈 오차를 산출하여 가중 가산한다. VGG19 각 층의 특징은 화상의 디테일이나 노이즈에 민감하지 않으며 양호한 시맨틱 특성이 있음으로, 입력 화상 및 출력 화상에 노이즈나 오정렬 등의 결함이 존재하더라도, 특징 손실은 여전히 효과적인 음영 영역의 차이를 정확하게 생성할 수 있으며, 노이즈에 대한 화소 손실의 민감도 부족을 보완하고, 양호한 안정성을 가진다. The feature loss is mainly a weighted sum of the L1 norm errors of the corresponding features of the input image and label image to the initial neural network. In one optional embodiment, a VGG19 network pre-trained on the ImageNet data set is used as a feature extractor, and the output image and label image from the initial neural network are respectively fed to the feature extractor to obtain features of each layer of VGG19. After that, the L1 norm errors of the corresponding features of the input image and the label image are calculated and weighted. The features of each layer of VGG19 are not sensitive to image details or noise and have good semantic characteristics, so even if there are defects such as noise or misalignment in the input image and output image, feature loss still accurately generates the effective shaded area difference. It can compensate for the lack of sensitivity of pixel loss to noise and has good stability.

구조적 유사성 손실 함수는 화상의 글로벌 특징에 기초하여 두 개 화상의 유사성을 가늠하는 함수이다. 본 실시예에 있어서, 주로 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상의 글로벌적인 휘도 및 콘트라스트 차이를 가리키며, 해당 손실 함수를 추가하는 것을 통해, 네트워크의 출력의 색상 편차를 효과적으로 억제하며, 화상 전체의 품질을 향상시킬 수 있다. The structural similarity loss function is a function that measures the similarity of two images based on the global characteristics of the images. In this embodiment, it mainly refers to the global luminance and contrast differences between the output image and the label image from the initial neural network, and by adding the corresponding loss function, the color deviation of the output of the network is effectively suppressed, and the color deviation of the entire image is effectively suppressed. Quality can be improved.

적대적 손실이란, 주로 식별기의 출력 결과 및 출력 화상의 트루 종별의 손실값이다. 훈련의 후반에서 초기 뉴럴 네트워크로부터의 출력 화상과 라벨 화상의 차이가 작아지면, 화소 손실, 특징 손실, 구조적 유사성 손실의 효과가 점차 작아지며, 네트워크의 수렴이 느려진다. 이 때, 네트워크의 훈련을 지원하기 위하여, 하나의 식별기 네트워크를 동기로 훈련한다. 우선, 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상을 식별기에 송입하고, 식별기를 통해 출력 화상이 라벨 화상인지 여부를 판정하며, 식별기의 출력 결과 및 출력 화상의 트루 종별에 기초하여 손실을 산출하고 식별기의 파라미터를 갱신하며, 그 후, 출력 화상에 대한 식별기의 식별 결과를 출력 화상의 리얼리티 정도의 손실로 하며, 해당 손실로 식별기의 파라미터를 갱신한다. 식별기가 초기 뉴럴 네트워크로부터의 출력 화상과 라벨 화상을 구분할 수 없을 경우, 훈련이 종료되였음을 나타낸다. 적대적 손실은 네트워크 처리로 인한 화상의 부작용(예컨대, 음영 및 비음영 영역의 색갈의 불일치 문제나 음영 잔류 문제 등)을 효과적으로 제거하고, 네트워크로부터의 출력 화상의 리얼리티 정도를 향상시킬 수 있다. The adversarial loss is mainly the output result of the identifier and the loss value of the true classification of the output image. In the later stages of training, as the difference between the output image from the initial neural network and the label image becomes smaller, the effects of pixel loss, feature loss, and structural similarity loss gradually become smaller, and the convergence of the network slows down. At this time, to support network training, one identifier network is trained synchronously. First, the output image and label image from the initial neural network are sent to the identifier, the identifier determines whether the output image is a label image, the loss is calculated based on the output result of the identifier and the true classification of the output image, and the identifier is The parameters of are updated, and then the identification result of the identifier for the output image is set as the loss of the reality degree of the output image, and the parameters of the identifier are updated with the loss. If the discriminator cannot distinguish between the output image from the initial neural network and the label image, it indicates that training has ended. Adversarial loss can effectively eliminate image side effects caused by network processing (e.g., color mismatch problem in shaded and non-shaded areas, shade residual problem, etc.) and improve the degree of reality of images output from the network.

역치 차단 손실. 조명의 영향으로 인해 실경에서 수집된 쌍을 이루는 데이터는 비음영 영역에서도 미세한 휘도의 차이나 색갈의 변화가 발생할 가능성이 있지만, 이들 차이는 사용자에게 있어서 허용 범위에 속하는 것으로 처리할 필요가 없다. 따라서, 훈련 중 네트워크가 이들 글로벌적인 미소한 차이에 주목하는 것을 방지하기 위하여, 해당 방법은 역치 차단 손실을 도입하며, 즉 네트워크의 출력과 GT 사이의 차이가 소정의 역치보다 클 경우에만 해당 차이를 총 손실 산출 파라미터의 구배에 집약적으로 계상하며, 그렇지 않을 경우 손실이 0이라고 간주한다. 해당 손실 함수는 네트워크의 출력과 GT 사이에 존재하는 미소한 차이를 허용하며, 네트워크 학습의 중심을 차이가 큰 영역으로 옮기는 것을 통해, 비교적 뚜렷한 음영에 대한 네트워크의 제거 능력을 효과적으로 향상시킨다. Threshold cutoff loss. Due to the influence of lighting, paired data collected in real scenes may have subtle luminance differences or color changes even in non-shaded areas, but these differences are within an acceptable range for the user and do not need to be processed. Therefore, in order to prevent the network from paying attention to these global small differences during training, the method introduces a threshold blocking loss, that is, it only detects the difference between the output of the network and GT if it is greater than a certain threshold. It is calculated intensively in the gradient of the total loss calculation parameter, otherwise the loss is considered 0. The loss function allows for small differences between the network's output and GT, and effectively improves the network's removal ability for relatively distinct shading by shifting the center of network learning to areas with large differences.

음영 가장자리 손실. 우선, 음영 영역 마스크 화상에 대해 팽창 처리를 수행하여 팽창 화상을 얻고, 그 다음, 음영 영역 마스크 화상에 대해 에로젼(erosion) 처리를 수행하여 에로젼 화상을 얻으며, 그 후, 팽창 화상과 에로젼 화상의 차 집합을 음영과 비음영의 경계 영역으로서 획득하고, TVLoss를 이용하여 평활화하는 것을 통해, 음영 및 비음영 영역 사이에서 효과적으로 이행할 수 있다. Shaded edge loss. First, dilation processing is performed on the shaded area mask image to obtain a dilation image, then erosion processing is performed on the shaded area mask image to obtain an erosion image, and then the dilation image and the erosion image are obtained. By obtaining the difference set of the image as the boundary area between shaded and non-shaded areas and smoothing it using TVLoss, it is possible to effectively transition between shaded and non-shaded areas.

음영 휘도 손실은 뉴럴 네트워크로부터 출력된 음영 제거 화상에 있어서의 음영 영역에 대응하는 영역의 휘도와 입력된 피처리 화상에 있어서의 음영 영역의 휘도의 차를 0보다 크게 하여, 음영 제거 화상에 있어서의 음영 영역에 대응하는 영역의 휘도를 향상시킨다. Shade luminance loss is caused by making the difference between the luminance of the area corresponding to the shaded area in the shaded area output from the neural network and the luminance of the shaded area in the input image to be processed greater than 0, Improves the luminance of the area corresponding to the shaded area.

하나의 선택적인 실시예에 있어서, 초기 뉴럴 네트워크의 배경층 출력 모듈은 상기 모든 손실의 가중합을 총 손실로서 사용함과 아울러, Wassertein적대적 생성 네트워크를 적대적 손실로서 사용한다. In one alternative embodiment, the background layer output module of the initial neural network uses the weighted sum of all losses above as the total loss, and also uses the Wassertein adversarial generative network as the adversarial loss.

해당 네트워크 구조는 입력 화상의 글로벌 특징 및 로컬 특징을 추출하는 것을 통해, 음영의 제거 정도를 향상시킴과 아울러, 비음영 영역에 대해 부작용을 일으키지 않도록 보호한다. The network structure extracts global features and local features of the input image to improve the degree of shading removal and protects non-shaded areas from causing side effects.

도 5 (a) 및 도 5 (b)는 본 출원의 실시예의 화상 처리 방법을 이용하여 구현되는 처리 효과의 비교도이며, 도 5 (a)는 음영을 포함하는 피처리 화상이고, 도 5 (b)는 화상 처리 방법을 통해 처리된 후의 음영 제거 화상이며, 두 개 화상의 비교로부터 알 수 있듯이, 본 출원에 따른 화상 처리 방법은 음영을 효과적으로 제거하면서 배경층에 대해 현저한 부작용을 일으키지 않을 수 있다. Figures 5(a) and 5(b) are comparative diagrams of processing effects realized using the image processing method of the embodiment of the present application, Figure 5(a) is a target image including shading, and Figure 5(a) is a target image including shading. b) is a shadow removal image after processing through an image processing method, and as can be seen from the comparison of the two images, the image processing method according to the present application can effectively remove shadows while not causing significant side effects to the background layer. .

본 출원의 실시예에 사용되는 뉴럴 네트워크 구조 및 손실 함수는 음영 제거, 비 제거, 안개 제거 등의 응용 씬에 적용되어도 되며, 주로 휴대폰 등의 이동 단말을 통해 촬영된 고해상도 화상을 처리하는 데 이용되지만, PC나 기타 임베디드 기기에서 다양한 해상도의 화상을 처리하는 데에도 동일하게 적용된다. The neural network structure and loss function used in the embodiments of the present application may be applied to application scenes such as shadow removal, rain removal, and fog removal, and are mainly used to process high-resolution images captured through mobile terminals such as mobile phones. , the same applies to processing images of various resolutions on PCs or other embedded devices.

본 출원의 실시예의 다른 측면에 따르면, 프로세서, 및 프로세서의 실행 가능한 명령을 저장하는 메모리를 포함하고, 프로세서는 실행 가능한 명령을 실행하는 것을 통해, 상기 중 어느 한 항의 화상 처리 방법을 실행하도록 구성되는 전자 기기를 더 제공한다. According to another aspect of the embodiment of the present application, comprising a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the image processing method of any one of the above through executing the executable instructions. Provides more electronic devices.

본 출원의 실시예의 또 다른 측면에 따르면, 프로그램이 저장된 저장 매체로서, 프로그램이 실행되면 상기 중 어느 한 항의 화상 처리 방법을 실행하도록 저장 매체가 위치하는 기기를 제어하는 저장 매체를 더 제공한다. According to another aspect of the embodiment of the present application, a storage medium storing a program is further provided, which controls a device in which the storage medium is located to execute the image processing method of any one of the above when the program is executed.

본 출원의 실시예의 또 다른 측면에 따르면, 화상 처리 장치를 더 제공한다. 도 6을 참조하면, 본 출원의 실시예에 따른 선택적인 화상 처리 장치의 구조 블록도이다. 도 6에 도시된 바와 같이, 화상 처리 장치 60은 화상 수집 유닛 600과 처리 유닛 602를 포함한다. According to another aspect of the embodiment of the present application, an image processing device is further provided. Referring to FIG. 6, it is a structural block diagram of an optional image processing device according to an embodiment of the present application. As shown in FIG. 6, the image processing device 60 includes an image collection unit 600 and a processing unit 602.

이하, 화상 처리 장치 60에 포함되는 각 유닛을 구체적으로 기술하고자 한다. Hereinafter, each unit included in the image processing device 60 will be described in detail.

화상 수집 유닛 600은 음영 영역을 포함하는 피처리 화상을 획득한다. The image collection unit 600 acquires an image to be processed including a shaded area.

처리 유닛 602는 피처리 화상을 수신하고, 훈련된 뉴럴 네트워크를 이용하여 피처리 화상을 처리하여 음영 제거 화상을 얻으며, 여기서, 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 피처리 화상 및 1단째 네트워크로부터의 출력 화상은 2단째 네트워크에 동시에 입력된다. The processing unit 602 receives the image to be processed, and processes the image to be processed using a trained neural network to obtain a deshading image, where the neural network includes a first-stage network and a second-stage network that are two-stage cascade-connected, The image to be processed and the output image from the first-stage network are simultaneously input to the second-stage network.

하나의 선택적인 실시예에 있어서, 뉴럴 네트워크의 구조는 도 2 및 본 명세서의 관련 기술에 도시된 바와 같으며, 여기서는 설명을 중복하지 않는다. In one alternative embodiment, the structure of the neural network is as shown in Figure 2 and the related art herein, and the description is not duplicated here.

본 출원의 상기 실시예의 번호는 단지 기술하기 위한 것이며, 실시예의 우열을 나타내는 것은 아니다. The numbers of the above examples in this application are for descriptive purposes only and do not indicate superiority or inferiority of the examples.

본 출원의 상기 실시예에 있어서, 각 실시예에 대한 기술은 모두 각각 치중점이 있으며, 어느 한 실시예에서 상세히 설명되지 않은 부분은 기타 실시예의 관련 기술을 참조할 수 있다. In the above-mentioned embodiments of the present application, the techniques for each embodiment are all focused on each other, and parts that are not described in detail in one embodiment may refer to related techniques in other embodiments.

본 출원에 따른 여러 실시예에 있어서, 개시된 기술적 내용은 기타 방식으로 구현될 수 있다는 점을 이해해야 한다. 여기서, 이상 기술된 장치의 실시예는 예시적인 것에 불과하며, 예컨대 상기 유닛의 구분은 논리적 기능의 구분이어도 되고, 실제 구현 시 기타 구분 방식이 있을 수 있으며, 예컨대 복수의 유닛 또는 컴포넌트는 조합되거나 다른 시스템에 통합되어도 되며, 또는 일부 특징은 생략되거나 실행되지 않아도 된다. 또한, 개시 또는 검토된 상호 간의 결합 또는 직접 결합 또는 통신 연결은 일부의 인터페이스, 유닛 또는 모듈을 개재한 간접 결합 또는 통신 연결이어도 되며, 전기적 또는 기타 형태이어도 된다. It should be understood that in various embodiments according to the present application, the disclosed technical content may be implemented in other ways. Here, the embodiments of the device described above are merely illustrative, and for example, the division of the units may be a division of logical functions, and there may be other division methods in actual implementation, for example, a plurality of units or components may be combined or used in other ways. It may be integrated into the system, or some features may be omitted or not implemented. In addition, the mutual coupling or direct coupling or communication connection disclosed or reviewed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or other forms.

분리 부재로서 설명된 상기 유닛은 물리적으로 분리된 것이어도 되고, 물리적으로 분리된 것이 아니어도 되며, 유닛으로서 개시된 부재는 물리적 유닛이어도 되고, 물리적 유닛이 아니어도 되며, 즉 하나의 개소에 위치하여도 되고, 또는 복수의 유닛에 분포되어도 된다. 실제 수요에 따라 그 중의 일부 또는 전부의 유닛을 선택하여 본 실시예의 기술안의 목적을 구현하여도 된다. The unit described as a separate member may or may not be physically separate, and the member disclosed as a unit may or may not be a physical unit, i.e., may be located in one location. Alternatively, it may be distributed across multiple units. Depending on actual demand, some or all of the units may be selected to implement the purpose of the technical plan of this embodiment.

또한, 본 출원의 각 실시예에 있어서의 각 기능 유닛은 하나의 처리 유닛에 통합되어도 되고, 각 유닛이 단독적으로 물리적으로 존재하여도 되며, 두 개 이상의 유닛이 하나의 유닛에 통합되어도 된다. 상기 통합된 유닛은 하드웨어의 형태로 구현되어도 되고, 소프트웨어 기능 유닛의 형태로 구현되어도 된다. Additionally, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may physically exist independently, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

상기 통합된 유닛이 소프트웨어 기능 유닛의 형태로 구현되고 또한 독립적인 제품으로서 판매 또는 사용될 경우, 하나의 컴퓨터 판독 가능한 저장 매체에 저장되어도 된다. 이러한 이해에 기반하여, 본 출원의 기술안의 본질적이거나 종래의 기술에 기여하는 부분, 또는 해당 기술안의 전부 또는 일부는 소프트웨어 제품의 형태로 구현화되어도 되며, 해당 컴퓨터 소프트웨어 제품은 한 대의 컴퓨터 기기(퍼스널 컴퓨터, 서버 또는 네트워크 기기 등이어도 됨)에 본 출원의 각 실시예에 기재된 방법의 전부 또는 일부의 스텝을 실행시키기 위한 약간의 명령을 포함하는 하나의 저장 매체에 저장된다. 전술한 저장 매체는 USB디스크, 리드온리 메모리(ROM, Read-Only Memory), 랜덤 엑세스 메모리(RAM, Random Access Memory), 리무버블 하드 디스크, 자기 디스크 또는 광 디스크 등의 프로그램 코드를 저장할 수 있는 여러 가지 매체를 포함한다. When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a single computer-readable storage medium. Based on this understanding, the essential or contributing part of the technical plan of this application, or all or part of the technical plan, may be implemented in the form of a software product, and the computer software product may be implemented on a single computer device (personal computer). , a server or a network device, etc.) are stored in a storage medium containing some instructions for executing all or part of the steps of the method described in each embodiment of the present application. The above-described storage media includes various types of storage media that can store program code, such as USB disks, read-only memory (ROM), random access memory (RAM), removable hard disks, magnetic disks, or optical disks. Includes various media.

이상은 본 출원의 바람직한 실시 형태일 뿐이며, 당업자에게 있어서 본 출원의 원리를 벗어나지 않는 범위에서 약간의 개선 및 수식을 수행할 수도 있으며, 이들 개선 및 수식도 본 출원의 보호 범위로 간주되어야 한다는 점에 유의해야 한다. The above is only a preferred embodiment of the present application, and those skilled in the art may make some improvements and modifications without departing from the principles of the present application, and these improvements and modifications should also be considered within the scope of protection of the present application. Be careful.

Claims (18)

1. 화상 처리 방법으로서,
음영 영역을 포함하는 피처리 화상을 획득하는 것, 및
상기 피처리 화상을, 훈련된 뉴럴 네트워크에 입력하여 음영 제거 화상을 얻는 것을 포함하고,
상기 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 상기 1단째 네트워크는 상기 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 상기 2단째 네트워크는 상기 피처리 화상 및 상기 음영 영역 마스크 화상을 동시에 수신하고 상기 음영 제거 화상을 출력하는 화상 처리 방법.
1. As an image processing method,
acquiring an image to be processed including a shaded area, and
Including inputting the image to be processed into a trained neural network to obtain a deshading image,
The neural network includes a two-stage cascade-connected first-stage network and a second-stage network, wherein the first-stage network receives the image to be processed and outputs a shaded area mask image, and the second-stage network receives the image to be processed and the image to be processed. An image processing method for simultaneously receiving a shaded area mask image and outputting the shadow removal image.
제1항에 있어서,
상기 1단째 네트워크는
제1 인코더를 포함하고, 상기 피처리 화상의 특징을 층별로 추출하여 제1 세트의 특징 데이터를 얻는 제1 특징 추출 모듈, 및
상기 제1 특징 추출 모듈의 출력에 연결되고, 제1 디코더를 포함하며, 상기 제1 세트의 특징 데이터에 기초하여 음영 영역을 추정하여 음영 영역 마스크 화상을 출력하는 음영 영역 추정 모듈을 포함하는 것을 특징으로 하는 화상 처리 방법.
According to paragraph 1,
The first stage network is
A first feature extraction module comprising a first encoder and extracting features of the image to be processed layer by layer to obtain a first set of feature data, and
and a shaded area estimation module connected to the output of the first feature extraction module, including a first decoder, and configured to estimate a shaded area based on the first set of feature data and output a shaded area mask image. Image processing method.
제1항에 있어서,
상기 2단째 네트워크는
제2 인코더를 포함하고, 상기 1단째 네트워크의 출력에 연결되고, 피처리 화상을 수신함과 아울러, 상기 1단째 네트워크로부터 출력된 음영 영역 마스크 화상을 수신하여 제2 세트의 특징 데이터를 얻는 제2 특징 추출 모듈, 및
상기 제2 특징 추출 모듈의 출력에 연결되고, 제2 디코더를 포함하며, 상기 제2 세트의 특징 데이터에 기초하여 상기 음영 제거 화상을 출력하는 결과 화상 출력 모듈을 포함하는 것을 특징으로 하는 화상 처리 방법.
According to paragraph 1,
The second tier network is
A second feature comprising a second encoder, connected to the output of the first stage network, receiving an image to be processed and receiving a shaded area mask image output from the first stage network to obtain a second set of feature data. an extraction module, and
An image processing method comprising a result image output module coupled to the output of the second feature extraction module, comprising a second decoder, and outputting the deshading image based on the second set of feature data. .
제2항에 있어서,
상기 제1 디코더 또는 상기 제2 디코더의 각 층의 출력을 크로스 레이어 연결을 통해 채널축을 따라 상기 제1 인코더 또는 상기 제2 인코더의 대응하는 층의 출력에 스플라이싱하고, 상기 제1 디코더 또는 상기 제2 디코더와 상기 제1 인코더 또는 상기 제2 인코더의 크로스 레이어 연결에 멀티 스케일 피라미드 풀링 모듈을 추가시키며, 상기 멀티 스케일 피라미드 풀링 모듈은 상이한 스케일의 특징을 융합하는 것을 특징으로 하는 화상 처리 방법.
According to paragraph 2,
Splicing the output of each layer of the first decoder or the second decoder to the output of a corresponding layer of the first encoder or the second encoder along a channel axis through cross-layer connection, and An image processing method comprising adding a multi-scale pyramid pooling module to a cross-layer connection of a second decoder and the first encoder or the second encoder, wherein the multi-scale pyramid pooling module fuses features of different scales.
제1항에 있어서,
음영 영역을 포함하는 피처리 화상을 획득한 후, 상기 화상 처리 방법은
화상 피라미드 알고리즘을 이용하여 상기 피처리 화상을 다운샘플링하고, 다운샘플링하는 동안 각 단의 화상층의 구배 정보를 저장하여 라플라시안 피라미드를 형성하는 것,
최소 사이즈의 화상층을 훈련된 뉴럴 네트워크에 송입하여 출력 화상을 얻는 것, 및
라플라시안 피라미드를 이용하여 상기 출력 화상에 대해 저해상도부터 고해상도에로의 재구성을 수행하고, 상기 음영 제거 화상을 얻는 것을 더 포함하는 것을 특징으로 하는 화상 처리 방법.
According to paragraph 1,
After acquiring the image to be processed including the shaded area, the image processing method
Downsampling the image to be processed using an image pyramid algorithm, and storing gradient information of each image layer during downsampling to form a Laplacian pyramid,
Obtaining an output image by feeding the image layer of the minimum size to a trained neural network, and
An image processing method further comprising performing reconstruction from low resolution to high resolution on the output image using a Laplacian pyramid, and obtaining the shadow removal image.
제1항에 있어서,
초기 뉴럴 네트워크를 구축하는 것, 및
샘플 데이터를 이용하여 상기 초기 뉴럴 네트워크를 훈련하여 상기 훈련된 뉴럴 네트워크를 얻는 것을 더 포함하고,
상기 샘플 데이터는 실사 화상 및 합성 음영 화상을 포함하고, 화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 상기 합성 음영 화상을 합성하는 것을 특징으로 하는 화상 처리 방법.
According to paragraph 1,
building an initial neural network, and
Further comprising training the initial neural network using sample data to obtain the trained neural network,
The image processing method characterized in that the sample data includes a real image and a synthetic shaded image, and the synthetic shaded image is synthesized into a simple shaded image and an unshaded image using an image synthesis method.
제6항에 있어서,
화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 상기 합성 음영 화상을 합성하는 것은
단순 음영 화상을 획득하는 것,
무음영 화상을 획득하는 것, 및
상기 단순 음영 화상 및 상기 무음영 화상에 기초하여 상기 합성 음영 화상을 얻는 것을 포함하는 것을 특징으로 하는 화상 처리 방법.
According to clause 6,
Combining the synthetic shaded image with a simple shaded image and an unshaded image using an image synthesis method is
acquiring simple shaded images;
acquiring a shadeless image, and
An image processing method comprising obtaining the composite shaded image based on the simple shaded image and the unshaded image.
제7항에 있어서,
화상 합성 방법을 이용하여 단순 음영 화상 및 무음영 화상으로 상기 합성 음영 화상을 합성하는 것은 상기 단순 음영 화상을 변환하고, 변환된 단순 음영 화상과 상기 무음영 화상에 기초하여 상기 합성 음영 화상을 얻는 것을 더 포함하고,
상기 변환된 단순 음영 화상에 있어서의 비음영 영역의 화소값은 하나의 고정 수치인 a로 일괄하여 설정되고, 음영 영역의 화소값은 0~a 사이의 수치로 되며, a는 정의 정수인 것을 특징으로 하는 화상 처리 방법.
In clause 7,
Compositing the synthetic shaded image with a simple shaded image and an unshaded image using an image synthesis method includes converting the simple shaded image and obtaining the synthesized shaded image based on the converted simple shaded image and the unshaded image. Contains more,
The pixel values of the non-shaded area in the converted simple shaded image are collectively set to one fixed value, a, and the pixel values of the shaded area are set to a number between 0 and a, where a is a positive integer. Image processing method.
제7항에 있어서,
상기 초기 뉴럴 네트워크는 샘플 데이터에 대해 종별 판단을 수행하는 모듈을 더 포함하고,
상기 초기 뉴럴 네트워크에 입력된 샘플 데이터가 실사 화상이라고 판단하였을 경우, 라벨링 데이터는 실경에서 수집된 음영 제거 화상이며, 상기 초기 뉴럴 네트워크로부터 출력된 상기 음영 제거 화상과 상기 라벨링 데이터로서의 상기 음영 제거 화상 사이의 차이에 기초하여, 상기 2단째 네트워크 내부의 파라미터를 조정하고,
상기 초기 뉴럴 네트워크에 입력된 샘플 데이터가 합성 음영 화상이라고 판단하였을 경우, 상기 라벨링 데이터는 실경에서 수집된 상기 무음영 화상과 상기 단순 음영 화상을 포함하며, 상기 음영 영역 마스크 화상과 상기 단순 음영 화상 사이의 차이에 기초하여, 1단째 네트워크 내부의 파라미터를 조정하고, 상기 초기 뉴럴 네트워크로부터 출력된 음영 제거 화상과 상기 무음영 화상 사이의 차이에 기초하여, 2단째 네트워크 내부의 파라미터를 조정하는 것을 특징으로 하는 화상 처리 방법.
In clause 7,
The initial neural network further includes a module that performs type judgment on sample data,
When it is determined that the sample data input to the initial neural network is a real image, the labeling data is a deshaded image collected from the real scene, and between the deshaded image output from the initial neural network and the deshaded image as the labeling data. Based on the difference, adjust the parameters inside the second stage network,
When it is determined that the sample data input to the initial neural network is a synthetic shaded image, the labeling data includes the unshaded image and the simple shaded image collected from the real scene, and between the shaded area mask image and the simple shaded image. Based on the difference, adjusting the parameters inside the first-stage network, and adjusting the parameters inside the second-stage network based on the differences between the de-shaded image output from the initial neural network and the unshaded image. Image processing method.
제6항에 있어서,
샘플 데이터를 이용하여 상기 초기 뉴럴 네트워크를 훈련할 때, 손실 함수는 화소 손실, 특징 손실, 구조적 유사성 손실, 적대적 손실, 음영 가장자리 손실, 음영 휘도 손실 중 적어도 하나를 포함하는 것을 특징으로 하는 화상 처리 방법.
According to clause 6,
When training the initial neural network using sample data, the loss function includes at least one of pixel loss, feature loss, structural similarity loss, adversarial loss, shade edge loss, and shade luminance loss. .
제10항에 있어서,
상기 화소 손실은 화소 차단 손실을 포함하고,
상기 초기 뉴럴 네트워크로부터의 출력 화상 및 라벨 화상에 있어서의 대응하는 두 개 화소의 절대차가 소정의 역치보다 클 경우, 상기 두 개 화소의 손실을 산출하고, 상기 초기 뉴럴 네트워크로부터의 출력 화상 및 상기 라벨 화상에 있어서의 대응하는 두 개 화소의 절대차가 상기 소정의 역치 이하일 경우, 상기 두 개 화소 간의 차이를 무시하는 것을 특징으로 하는 화상 처리 방법.
According to clause 10,
The pixel loss includes pixel blocking loss,
If the absolute difference between the corresponding two pixels in the output image from the initial neural network and the label image is greater than a predetermined threshold, the loss of the two pixels is calculated, and the output image from the initial neural network and the label are calculated. An image processing method, wherein when the absolute difference between two corresponding pixels in an image is less than or equal to the predetermined threshold, the difference between the two pixels is ignored.
제10항에 있어서,
상기 음영 휘도 손실은 상기 뉴럴 네트워크로부터 출력된 상기 음영 제거 화상에 있어서의 상기 음영 영역에 대응하는 영역의 휘도와 입력된 상기 피처리 화상에 있어서의 상기 음영 영역의 휘도의 차를 0보다 크게 하여, 상기 음영 제거 화상에 있어서의 상기 음영 영역에 대응하는 영역의 휘도를 향상시키는 것을 특징으로 하는 화상 처리 방법.
According to clause 10,
The shade luminance loss is such that the difference between the luminance of an area corresponding to the shaded area in the shaded area output from the neural network and the luminance of the shaded area in the input image to be processed is greater than 0, An image processing method characterized by improving the luminance of an area corresponding to the shaded area in the shaded area.
제10항에 있어서,
상기 손실 함수가 상기 음영 가장자리 손실을 포함할 경우, 상기 화상 처리 방법은 상기 음영 영역 마스크 화상에 대해 팽창 처리를 수행하여 팽창 화상을 얻는 것, 상기 음영 영역 마스크 화상에 대해 에로젼 처리를 수행하여 에로젼 화상을 얻는 것, 및 상기 팽창 화상과 상기 에로젼 화상의 차 집합을 음영과 비음영의 경계 영역으로서 획득하고, TVLoss를 이용하여 평활화하는 것을 포함하는 것을 특징으로 하는 화상 처리 방법.
According to clause 10,
When the loss function includes the shaded edge loss, the image processing method includes performing dilation processing on the shaded area mask image to obtain a dilated image, and performing erosion processing on the shaded area mask image to obtain an erotic image. An image processing method comprising obtaining a dilation image, obtaining a set of differences between the dilatation image and the erosion image as a boundary area between shaded and non-shaded areas, and smoothing it using TVLoss.
음영 영역을 포함하는 피처리 화상을 획득하는 화상 수집 유닛, 및
피처리 화상을 수신하고, 훈련된 뉴럴 네트워크를 이용하여 피처리 화상을 처리하여 음영 제거 화상을 얻는 처리 유닛을 포함하고,
상기 뉴럴 네트워크는 2단 종속 연결된 1단째 네트워크 및 2단째 네트워크를 포함하며, 상기 1단째 네트워크는 상기 피처리 화상을 수신하고 음영 영역 마스크 화상을 출력하며, 상기 2단째 네트워크는 상기 피처리 화상 및 상기 음영 영역 마스크 화상을 동시에 수신하고 상기 음영 제거 화상을 출력하는 화상 처리 장치.
an image collection unit that acquires an image to be processed including a shaded area, and
A processing unit that receives an image to be processed and processes the image to be processed using a trained neural network to obtain a deshading image,
The neural network includes a two-stage cascade-connected first-stage network and a second-stage network, wherein the first-stage network receives the image to be processed and outputs a shaded area mask image, and the second-stage network receives the image to be processed and the image to be processed. An image processing device that simultaneously receives a shaded area mask image and outputs the shaded area mask image.
제14항에 있어서,
상기 1단째 네트워크는
제1 인코더를 포함하고, 상기 피처리 화상의 특징을 층별로 추출하여 제1 세트의 특징 데이터를 얻는 제1 특징 추출 모듈, 및
상기 제1 특징 추출 모듈의 출력에 연결되고, 제1 디코더를 포함하며, 상기 제1 세트의 특징 데이터에 기초하여 음영 영역을 추정하여 음영 영역 마스크 화상을 출력하는 음영 영역 추정 모듈을 포함하는 것을 특징으로 하는 화상 처리 장치.
According to clause 14,
The first stage network is
A first feature extraction module comprising a first encoder and extracting features of the image to be processed layer by layer to obtain a first set of feature data, and
and a shaded area estimation module connected to the output of the first feature extraction module, including a first decoder, and configured to estimate a shaded area based on the first set of feature data and output a shaded area mask image. An image processing device that uses
제14항에 있어서,
상기 2단째 네트워크는
제2 인코더를 포함하고, 상기 1단째 네트워크의 출력에 연결되고, 피처리 화상을 수신함과 아울러, 상기 1단째 네트워크로부터 출력된 음영 영역 마스크 화상을 수신하여 제2 세트의 특징 데이터를 얻는 제2 특징 추출 모듈, 및
상기 제2 특징 추출 모듈의 출력에 연결되고, 제2 디코더를 포함하며, 상기 제2 세트의 특징 데이터에 기초하여 음영 제거 화상을 출력하는 결과 화상 출력 모듈을 포함하는 것을 특징으로 하는 화상 처리 장치.
According to clause 14,
The second tier network is
A second feature comprising a second encoder, connected to the output of the first stage network, receiving an image to be processed and receiving a shaded area mask image output from the first stage network to obtain a second set of feature data. an extraction module, and
and a result image output module coupled to the output of the second feature extraction module, including a second decoder, and outputting a deshading image based on the second set of feature data.
프로그램이 저장된 저장 매체로서, 상기 프로그램이 실행되면 제1항 내지 제13항 중 어느 한 항에 기재된 화상 처리 방법을 실행하도록 상기 저장 매체가 위치하는 기기를 제어하는 것을 특징으로 하는 저장 매체. A storage medium in which a program is stored, wherein when the program is executed, a device in which the storage medium is located is controlled to execute the image processing method according to any one of claims 1 to 13. 전자 기기로서,
프로세서, 및
상기 프로세서의 실행 가능한 명령을 저장하는 메모리를 포함하고,
상기 프로세서는 상기 실행 가능한 명령을 실행하는 것을 통해, 제1항 내지 제13항 중 어느 한 항에 기재된 화상 처리 방법을 실행하도록 구성되는 것을 특징으로 하는 전자 기기.
As an electronic device,
processor, and
Includes a memory that stores executable instructions of the processor,
The electronic device, wherein the processor is configured to execute the image processing method according to any one of claims 1 to 13 through executing the executable instructions.
KR1020247015956A 2021-10-18 2022-10-17 Image processing methods, devices, storage media and electronic devices KR20240089729A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111210502.3 2021-10-18

Publications (1)

Publication Number Publication Date
KR20240089729A true KR20240089729A (en) 2024-06-20

Family

ID=

Similar Documents

Publication Publication Date Title
US11637971B2 (en) Automatic composition of composite images or videos from frames captured with moving camera
CN106910247B (en) Method and apparatus for generating three-dimensional avatar model
CN108932693B (en) Face editing and completing method and device based on face geometric information
CN110503703B (en) Method and apparatus for generating image
WO2022110638A1 (en) Human image restoration method and apparatus, electronic device, storage medium and program product
CN106682632B (en) Method and device for processing face image
EP3735677A1 (en) Fusing, texturing, and rendering views of dynamic three-dimensional models
CN113327278B (en) Three-dimensional face reconstruction method, device, equipment and storage medium
WO2023066173A1 (en) Image processing method and apparatus, and storage medium and electronic device
CN111311532B (en) Image processing method and device, electronic device and storage medium
US20220230323A1 (en) Automatically Segmenting and Adjusting Images
US20190206117A1 (en) Image processing method, intelligent terminal, and storage device
CN114782864B (en) Information processing method, device, computer equipment and storage medium
Xiao et al. Image hazing algorithm based on generative adversarial networks
CN115967823A (en) Video cover generation method and device, electronic equipment and readable medium
CN114049290A (en) Image processing method, device, equipment and storage medium
US20220398704A1 (en) Intelligent Portrait Photography Enhancement System
KR20240089729A (en) Image processing methods, devices, storage media and electronic devices
US20230131418A1 (en) Two-dimensional (2d) feature database generation
CN111383289A (en) Image processing method, image processing device, terminal equipment and computer readable storage medium
CN115116468A (en) Video generation method and device, storage medium and electronic equipment
CN113920023A (en) Image processing method and device, computer readable medium and electronic device
US11182634B2 (en) Systems and methods for modifying labeled content
CN113989460A (en) Real-time sky replacement special effect control method and device for augmented reality scene
CN113628144B (en) Portrait restoration method and device, electronic equipment and storage medium