KR20220160660A - Method, apparatus and storage media for removing handwriting from text image - Google Patents

Method, apparatus and storage media for removing handwriting from text image Download PDF

Info

Publication number
KR20220160660A
KR20220160660A KR1020227037762A KR20227037762A KR20220160660A KR 20220160660 A KR20220160660 A KR 20220160660A KR 1020227037762 A KR1020227037762 A KR 1020227037762A KR 20227037762 A KR20227037762 A KR 20227037762A KR 20220160660 A KR20220160660 A KR 20220160660A
Authority
KR
South Korea
Prior art keywords
image
handwritten
pixel
text
content
Prior art date
Application number
KR1020227037762A
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 KR20220160660A publication Critical patent/KR20220160660A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/147Determination of region of interest
    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/273Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion removing elements interfering with the pattern to be recognised
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/22Character recognition characterised by the type of writing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/24Character recognition characterised by the processing or recognition method
    • G06V30/242Division of the character sequences into groups prior to recognition; Selection of dictionaries
    • G06V30/244Division of the character sequences into groups prior to recognition; Selection of dictionaries using graphical properties, e.g. alphabet type or font
    • G06V30/2455Discrimination between machine-print, hand-print and cursive writing

Abstract

본 발명은 텍스트 이미지에서 필기 내용을 제거하는 방법, 장치 및 저장 매체를 제공한다. 텍스트 이미지에서 필기 내용을 제거하는 방법은 처리할 텍스트 페이지의 입력 이미지를 획득하는 단계 - 상기 입력 이미지는 필기 영역을 포함하고, 상기 필기 영역은 필기 내용을 포함함 -; 이미지 분할 모델을 이용해 상기 입력 이미지를 식별하여, 상기 필기 내용의 초기 필기 픽셀을 획득하는 단계; 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하여, 필기 픽셀 마스크 영역을 획득하는 단계; 필기 픽셀 마스크 영역을 기반으로 상기 필기 내용을 결정하는 단계; 및 상기 입력 이미지에서 상기 필기 내용을 제거하여, 출력 이미지를 획득하는 단계를 포함한다.The present invention provides a method, apparatus, and storage medium for removing handwritten contents from a text image. A method of removing handwritten content from a text image includes acquiring an input image of a text page to be processed, the input image including a writing area, and the writing area including the writing content; identifying the input image using an image segmentation model to obtain an initial handwritten pixel of the handwritten content; performing a blurring process on the initial handwritten pixel to obtain a handwritten pixel mask area; determining the handwritten content based on a handwritten pixel mask area; and obtaining an output image by removing the handwritten content from the input image.

Description

텍스트 이미지에서 필기 내용을 제거하는 방법, 장치 및 저장 매체Method, apparatus and storage media for removing handwriting from text image

본 발명은 텍스트 이미지에서 필기 내용을 제거하는 방법, 장치 및 저장 매체에 관한 것이다.The present invention relates to a method, apparatus, and storage medium for removing handwritten contents from a text image.

현재 사용자는 텍스트를 이미지 또는 PDF 등 기타 포맷의 파일로 촬영 및 스캔할 때, 원본 텍스트 상에 현재 사용자 또는 다른 사람의 필기 내용, 예를 들어 비고 문자, 설명 문자, 주석 또는 표기 부호 등의 문자 부호 내용이 이미 존재하는 경우, 이러한 필기 내용도 출력 이미지 또는 파일에 동시에 기록할 수 있다. 사용자가 상기 필기 내용이 필요하지 않거나 필기 내용의 기밀을 유지해야 하는 경우, 관련 필기 내용을 제거하는 것은 일반 사용자에 있어 비교적 어려우며 저장 또는 배포가 용이하지 않다. 또한 사용자가 휴대폰으로 촬영한 텍스트 사진은 종종 촬영 환경의 빛 조사 차이로 인해 텍스트 사진에 음영 등이 생길 수 있다. 곧바로 해당 텍스트 사진을 인쇄하면, 프린터가 텍스트 사진 중의 음영 부분을 그대로 인쇄하여 잉크가 낭비되고 판독에도 영향을 미칠 수 있다.When the current user captures and scans the text as an image or a file in other formats such as PDF, the current user or other person's handwriting on the original text, such as text marks such as remarks, explanatory characters, comments or notation marks. If the contents already exist, these handwritten contents can also be simultaneously written to the output image or file. If the user does not need the written content or needs to keep the written content confidential, it is relatively difficult for the general user to remove the related written content, and it is not easy to store or distribute. In addition, a text photo taken by a user with a mobile phone may sometimes have shadows on the text photo due to a difference in light irradiation in a shooting environment. If the text photo is printed immediately, the printer prints the shaded portion of the text photo as it is, wasting ink and affecting reading.

상술한 결함을 해결하기 위해, 본 발명은 텍스트 이미지에서 필기 내용을 제거하는 방법을 제공한다. 여기에는 처리할 텍스트 페이지의 입력 이미지를 획득하는 단계 - 상기 입력 이미지는 필기 영역을 포함하고, 상기 필기 영역은 필기 내용을 포함함 -; 이미지 분할 모델을 이용해 상기 입력 이미지를 식별하여, 상기 필기 내용의 초기 필기 픽셀을 획득하는 단계; 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하여, 필기 픽셀 마스크 영역을 획득하는 단계; 상기 필기 픽셀 마스크 영역을 기반으로 상기 상기 필기 영역 중의 상기 필기 내용을 결정하는 단계; 및 상기 입력 이미지에서 상기 필기 내용을 제거하여, 출력 이미지를 획득하는 단계가 포함된다.In order to solve the above-described defect, the present invention provides a method of removing handwritten content from a text image. Acquiring an input image of a text page to be processed, wherein the input image includes a writing area, and the writing area includes writing contents; identifying the input image using an image segmentation model to obtain an initial handwritten pixel of the handwritten content; performing a blurring process on the initial handwritten pixel to obtain a handwritten pixel mask area; determining the handwritten content in the writing area based on the writing pixel mask area; and obtaining an output image by removing the handwritten content from the input image.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는 하기 단계를 포함한다.Optionally, in the method for removing handwritten content from a text image provided by the present invention, the step of obtaining an output image by removing the handwritten content from the input image includes the following steps.

상기 초기 필기 픽셀의 픽셀값 및 상기 필기 픽셀 마스크 영역의 위치를 기반으로, 상기 입력 이미지에서 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀을 결정한다. 상기 입력 이미지 중의 상기 필기 픽셀 마스크 영역 내용을 제거하여, 중간 출력 이미지를 획득한다.A non-writing pixel in the handwritten pixel mask area of the input image is determined based on the pixel value of the initial handwritten pixel and the position of the handwritten pixel mask area. The handwritten pixel mask region content in the input image is removed to obtain an intermediate output image.

상기 중간 출력 이미지에 대해 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 복원을 수행하여, 상기 출력 이미지를 획득한다.Restoring the non-written pixels in the written pixel mask area is performed on the intermediate output image to obtain the output image.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는 하기 단계를 포함한다.Optionally, in the method for removing handwritten content from a text image provided by the present invention, the step of obtaining an output image by removing the handwritten content from the input image includes the following steps.

상기 초기 필기 픽셀의 픽셀값 및 상기 필기 픽셀 마스크 영역의 위치를 기반으로, 상기 입력 이미지에서 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀을 결정한다.A non-writing pixel in the handwritten pixel mask area of the input image is determined based on the pixel value of the initial handwritten pixel and the position of the handwritten pixel mask area.

상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 및 상기 필기 픽셀 마스크 영역을 기반으로 상기 입력 이미지 중의 상기 필기 내용을 제거하여, 상기 출력 이미지를 획득한다.The output image is obtained by removing the handwritten content in the input image based on the non-written pixels in the handwritten pixel mask area and the handwritten pixel mask area.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는, 상기 입력 이미지로부터 상기 필기 내용을 절단 제거하여 중간 출력 이미지를 획득하는 단계; 및 상기 중간 출력 이미지에 대해 이진화 처리를 수행하여, 상기 출력 이미지를 획득하는 단계를 포함한다.Optionally, in the method of removing handwritten content from a text image provided by the present invention, the step of removing the handwritten content from the input image to obtain an output image includes: cutting and removing the writing content from the input image to intermediate obtaining an output image; and performing a binarization process on the intermediate output image to obtain the output image.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 입력 이미지에서 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계는, 대체 픽셀을 획득하는 단계; 및 상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계를 포함한다.Optionally, in the method for removing handwritten content from a text image provided by the present invention, the step of obtaining the output image by removing the handwritten content from the input image includes: acquiring a replacement pixel; and obtaining the output image by removing the handwritten content from the input image by using the replacement pixel to replace the pixel of the handwritten content.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계는, 상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 중간 출력 이미지를 획득하는 단계; 및 상기 중간 출력 이미지에 대해 이진화 처리를 수행하여, 상기 출력 이미지를 획득하는 단계를 포함한다.Optionally, in the method of removing handwritten content from a text image provided by the present invention, the output image is obtained by removing the handwritten content from the input image by replacing pixels of the handwritten content using the replacement pixels. The steps may include replacing pixels of the handwritten content using the replacement pixels to remove the handwritten content from the input image to obtain an intermediate output image; and performing a binarization process on the intermediate output image to obtain the output image.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 대체 픽셀은 상기 필기 내용의 픽셀을 기반으로 픽셀 인접 영역 기반으로 계산한 이미지 복원 알고리즘을 통해 획득하는 것이다.Optionally, in the method of removing handwritten content from a text image provided by the present invention, the replacement pixel is obtained through an image restoration algorithm calculated based on a pixel adjacent area based on a pixel of the handwritten content.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 대체 픽셀을 획득하는 단계는 영역 식별 모델을 이용해 상기 입력 이미지를 식별하여 상기 필기 영역을 획득하는 단계를 더 포함한다. 상기 대체 픽셀은 상기 필기 영역에서 상기 필기 내용의 픽셀을 제외한 어느 하나의 픽셀이거나; 또는 상기 대체 픽셀은 상기 필기 영역에서 상기 필기 내용의 픽셀을 제외한 모든 픽셀의 픽셀값의 평균값이다.Optionally, in the method for removing handwritten content from a text image provided by the present invention, the acquiring of the replacement pixel further includes acquiring the writing region by identifying the input image using a region identification model. . the replacement pixel is any pixel except for the pixel of the written content in the writing area; Alternatively, the replacement pixel is an average value of pixel values of all pixels except for the pixel of the handwritten content in the writing area.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 처리할 텍스트 페이지의 입력 이미지를 획득하는 단계는, 상기 처리할 텍스트 페이지의 원본 이미지를 획득하는 단계 - 상기 원본 이미지는 처리할 텍스트 영역을 포함함 - ; 상기 원본 이미지에 대해 에지 검출을 수행하여, 상기 원본 이미지 중의 상기 처리할 텍스트 영역을 결정하는 단계; 및 상기 처리할 텍스트 영역에 대해 정규화 처리를 수행하여 상기 입력 이미지를 획득하는 단계를 포함한다.Optionally, in the method of removing handwritten contents from a text image provided by the present invention, the obtaining of an input image of a text page to be processed comprises: obtaining an original image of the text page to be processed - the original image - contains the text area to be processed; determining the text area to be processed in the original image by performing edge detection on the original image; and obtaining the input image by performing normalization processing on the text area to be processed.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 상기 이미지 분할 모델은 사전 학습된 상기 입력 이미지를 분할하는 U-Net 모델이다.Optionally, in the method for removing handwriting from a text image provided by the present invention, the image segmentation model is a U-Net model for segmenting the pretrained input image.

선택적으로, 본 발명에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서, 가우시안 필터 함수를 통해 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하고, 상기 초기 필기 픽셀의 영역을 확대하여, 상기 필기 픽셀 마스크 영역을 획득한다.Optionally, in the method of removing handwritten content from a text image provided by the present invention, a blurring process is performed on the initial handwritten pixel through a Gaussian filter function, a region of the initial handwritten pixel is enlarged, and the handwriting is removed. Get the pixel mask area.

또한 본 발명은 텍스트 이미지에서 필기 내용을 제거하는 장치를 더 제공한다. 여기에는 컴퓨터 판독 가능 명령을 비일시적으로 저장하는 데 사용되는 메모리; 및 상기 컴퓨터 판독 가능 명령을 실행하는 데 사용되는 프로세서가 포함된다. 상기 컴퓨터 판독 가능 명령이 상기 프로세서에 의해 실행되면 상술한 어느 하나의 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법이 실행된다.In addition, the present invention further provides an apparatus for removing handwritten contents from a text image. Memory used for non-transitory storage of computer readable instructions; and a processor used to execute the computer readable instructions. When the computer-readable command is executed by the processor, the method of removing handwritten content from a text image according to any one of the above-described embodiments is executed.

또한 본 발명은 컴퓨터 판독 가능 명령을 비일시적으로 저장하는 저장 매체를 더 제공한다. 상기 컴퓨터 판독 가능 명령이 컴퓨터에 의해 실행되면 상술한 어느 하나의 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법을 실행할 수 있다.In addition, the present invention further provides a storage medium for non-temporarily storing computer readable instructions. When the computer readable command is executed by a computer, the method of removing handwritten content from a text image according to any one of the above-described embodiments may be executed.

본 발명 실시예의 기술적 해결책을 보다 명확하게 설명하기 위하여, 이하에서는 실시예의 첨부 도면을 간략히 소개한다. 이하의 설명에서 첨부 도면은 본 발명을 제한하기보다는 본 발명의 일부 실시예에 관한 것일 뿐이다.
도 1은 본 발명 일 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법의 흐름도이다.
도 2a는 본 발명 일 실시예에 따른 원본 이미지의 개략도이다.
도 2b는 본 발명 일 실시예에 따른 출력 이미지의 개략도이다.
도 3은 본 발명 일 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 장치의 블록도이다.
도 4는 본 발명 일 실시예에 따른 저장 매체의 개략도이다.
도 5는 본 발명 일 실시예에 따른 하드웨어 환경의 개략도이다.
BRIEF DESCRIPTION OF THE DRAWINGS To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings in the embodiments. The accompanying drawings in the following description only relate to some embodiments of the invention rather than limit it.
1 is a flowchart of a method of removing handwritten content from a text image according to an embodiment of the present invention.
2A is a schematic diagram of an original image according to an embodiment of the present invention.
2B is a schematic diagram of an output image according to an embodiment of the present invention.
3 is a block diagram of a device for removing written content from a text image according to an embodiment of the present invention.
4 is a schematic diagram of a storage medium according to an embodiment of the present invention.
5 is a schematic diagram of a hardware environment according to an embodiment of the present invention;

본 발명 실시예의 목적, 기술적 해결책 및 이점을 보다 명확하게 하기 위하여, 본 발명 실시예의 첨부 도면을 참조하여 본 발명 실시예의 기술적 해결책을 명확하고 완전하게 설명한다. 설명된 실시예는 본 발명의 전부가 아닌, 일부 실시예이다. 본 발명의 설명된 실시예를 기반으로, 본 기술 분야에서 통상의 기술자가 창의적인 노력 없이 획득한 다른 모든 실시예는 본 발명의 보호 범위에 속한다.In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. The described embodiments are some, but not all, embodiments of the present invention. Based on the described embodiments of the present invention, all other embodiments obtained by a person skilled in the art without creative efforts fall within the protection scope of the present invention.

달리 정의되지 않는 한, 본 발명에 사용된 기술적 또는 과학적 용어는 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 이해하는 바와 같은 통상적인 의미를 가져야 한다. 본 발명에 사용된 "제1", "제2" 및 이와 유사한 용어는 어떠한 순서, 수량 또는 중요도를 나타내지 않으며, 단지 상이한 구성요소를 구별하기 위해 사용된다. "포함" 또는 "포괄" 등 이와 유사한 용어는 해당 용어 앞에 나오는 요소 또는 사물이 해당 용어 뒤에 나열된 요소 또는 사물 및 그 등가물을 포함하되, 다른 요소 또는 사물을 배제하지 않음을 의미한다. "연결" 또는 "상호 연결" 등 이와 유사한 용어는 물리적 또는 기계적 연결에 국한되지 않으며 직접적이든 간접적이든 관계 없이 전기적 연결을 포함할 수 있다. "상", "하", "좌", "우" 등은 상대적인 위치 관계를 나타낼 때만 사용된다. 설명 대상의 절대적 위치가 변경되면 그에 따라 해당 상대적인 위치 관계도 변경될 수 있다.Unless defined otherwise, technical or scientific terms used herein shall have ordinary meanings as understood by one of ordinary skill in the art to which this invention belongs. The terms "first", "second" and similar terms used herein do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "inclusive" and similar terms mean that the element or thing preceding the term includes, but does not exclude other elements or things, the elements or things listed after the term and their equivalents. Terms such as “connection” or “interconnection” and similar terms are not limited to physical or mechanical connections and may include electrical connections, whether direct or indirect. "Upper", "lower", "left", "right", etc. are used only when indicating a relative positional relationship. If the absolute position of the description target is changed, the corresponding relative positional relationship may also be changed accordingly.

본 발명의 실시예에 대한 하기 설명을 명확하고 간결하게 유지하기 위해, 본 발명은 일부 공지된 기능 및 공지된 부재에 대한 상세한 설명을 생략한다.To keep the following description of embodiments of the present invention clear and concise, the present invention omits detailed descriptions of some well-known functions and known elements.

본 발명의 적어도 일 실시예는 텍스트 이미지에서 필기 내용을 제거하는 방법, 장치 및 저장 매체를 제공한다. 텍스트 이미지에서 필기 내용을 제거하는 방법은 처리할 텍스트 페이지의 입력 이미지를 획득하는 단계 - 입력 이미지는 필기 영역을 포함하고, 필기 영역은 필기 내용을 포함함 -; 이미지 분할 모델을 이용해 상기 입력 이미지를 식별하여, 상기 필기 내용의 초기 필기 픽셀을 획득하는 단계; 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하여, 필기 픽셀 마스크 영역을 획득하는 단계; 필기 픽셀 마스크 영역을 기반으로 상기 필기 내용을 결정하는 단계; 및 입력 이미지에서 필기 내용을 제거하여, 출력 이미지를 획득하는 단계를 포함한다.At least one embodiment of the present invention provides a method, apparatus, and storage medium for removing writing contents from a text image. A method of removing written content from a text image includes acquiring an input image of a text page to be processed, wherein the input image includes a writing area, and the writing area includes the writing content; identifying the input image using an image segmentation model to obtain an initial handwritten pixel of the handwritten content; performing a blurring process on the initial handwritten pixel to obtain a handwritten pixel mask area; determining the handwritten content based on a handwritten pixel mask area; and obtaining an output image by removing handwritten content from the input image.

해당 텍스트 이미지에서 필기 내용을 제거하는 방법은 입력 이미지에서 필기 영역 내의 필기 내용을 효과적으로 제거하여 인쇄 내용만 포함된 이미지나 파일을 출력하기 용이하게 한다. 또한 텍스트 이미지에서 필기 내용을 제거하는 방법은 입력 이미지를 인쇄하기 용이한 형태로 변환하여 사용자가 입력 이미지를 종이 형태로 인쇄하여 저장하거나 배포할 수 있도록 할 수도 있다.A method of removing handwritten content from a corresponding text image effectively removes handwritten content within a writing area in an input image, making it easy to output an image or file containing only printed content. In addition, the method of removing handwritten content from a text image may convert an input image into a printable form so that a user can print the input image in paper form and store or distribute the input image.

이하에서는 첨부 도면을 참조하여 본 발명의 실시예를 상세히 설명하나, 본 발명은 이러한 구체적인 실시예에 한정되지 않는다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings, but the present invention is not limited to these specific embodiments.

도 1은 본 발명의 적어도 일 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법의 흐름도이다. 도 2a는 본 발명의 적어도 일 실시예에 따른 원본 이미지의 개략도이다. 도 2b는 본 발명의 적어도 일 실시예에 따른 출력 이미지의 개략도이다.1 is a flowchart of a method of removing written content from a text image according to at least one embodiment of the present invention. 2A is a schematic diagram of an original image according to at least one embodiment of the present invention. 2B is a schematic diagram of an output image according to at least one embodiment of the present invention.

예를 들어, 도 1에 도시된 바와 같이, 본 발명 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법은 단계 S10 내지 S14를 포함한다.For example, as shown in FIG. 1 , a method for removing handwritten content from a text image provided in an embodiment of the present invention includes steps S10 to S14.

도 1에 도시된 바와 같이, 먼저 텍스트 이미지에서 필기 내용을 제거하는 방법은 단계 S10에서 처리할 텍스트 페이지의 입력 이미지를 획득한다.As shown in FIG. 1 , in the method of removing handwritten content from a text image, an input image of a text page to be processed is obtained in step S10.

예를 들어, 단계 S10에서 입력 이미지는 필기 영역을 포함하고, 필기 영역은 필기 내용을 포함한다. 입력 이미지는 필기 내용을 포함하는 임의 이미지일 수 있다.For example, in step S10, the input image includes a writing area, and the writing area includes writing contents. The input image may be any image including written content.

예를 들어, 입력 이미지는 이미지 수집 장치(예를 들어, 디지털 카메라 또는 휴대폰 등)를 통해 촬영한 이미지일 수 있다. 입력 이미지는 그레이스케일 이미지일 수 있으며, 컬러 이미지일 수도 있다. 입력 이미지는 시각화 방식으로 처리할 텍스트 페이지를 제시한 형태를 의미한다. 예를 들어 처리할 텍스트 페이지의 사진 등이 있다.For example, the input image may be an image captured through an image collection device (eg, a digital camera or mobile phone). The input image may be a grayscale image or a color image. The input image means a form in which a text page to be processed is presented in a visualization manner. For example, a photo of a text page to be processed.

예를 들어, 필기 영역은 고정된 형태가 없으며 필기 영역에 따라 결정된다. 즉, 필기 내용이 있는 영역이 바로 필기 영역이다. 필기 영역은 규칙적 형상(예를 들어, 직사각형 등)일 수 있으며, 불규칙적 형상일 수도 있다. 필기 영역은 패딩 영역, 필기의 초안 또는 기타 필기 표시의 영역 등을 포함할 수 있다.For example, the writing area does not have a fixed shape and is determined according to the writing area. That is, the area where the writing content is located is the writing area. The writing area may have a regular shape (eg, a rectangle) or an irregular shape. The writing area may include a padding area, a draft of writing or other writing display area, and the like.

예를 들어, 입력 이미지는 텍스트 인쇄 영역도 포함하며, 텍스트 인쇄 영역은 인쇄 내용을 포함한다. 텍스트 인쇄 영역의 형상은 규칙적 형상(예를 들어, 직사각형)일 수 있으며, 불규칙적 형상일 수도 있다. 본 발명의 실시예에 있어서, 각 필기 영역의 형상이 직사각형이고 각 텍스트 인쇄 영역의 형상이 직사각형인 경우를 예로 들어 설명한다. 본 발명은 이에 한정되지 않는다.For example, the input image also includes a text print area, and the text print area includes printed content. The shape of the text printing area may be a regular shape (for example, a rectangle) or an irregular shape. In the embodiment of the present invention, a case where each writing area has a rectangular shape and each text printing area has a rectangular shape will be described as an example. The present invention is not limited to this.

예를 들어, 처리할 텍스트 페이지는 서적, 신문, 간행물, 영수증, 도표, 계약서 등을 포함할 수 있다. 서적, 신문 및 간행물은 문장 또는 도안이 있는 다양한 파일 페이지가 포함된다. 영수증은 다양한 인보이스, 송장, 택배 영수증 등을 포함한다. 도표는 연말정산서, 인사기록부, 신청서 등과 같은 다양한 유형의 도표일 수 있다. 계약서는 다양한 형식의 계약 텍스트 페이지 등을 포함할 수 있다. 본 발명은 처리할 텍스트 페이지의 유형을 구체적으로 한정하지 않는다.For example, text pages to be processed may include books, newspapers, periodicals, receipts, charts, contracts, and the like. Books, newspapers and periodicals include various file pages with text or graphics. Receipts include various invoices, invoices, courier receipts, and the like. Charts can be of various types, such as year-end statements, personnel records, applications, etc. The contract may include contract text pages in various formats. The present invention does not specifically limit the type of text page to be processed.

예를 들어, 처리할 텍스트 페이지는 종이 형식의 텍스트일 수 있으며, 전자 형식의 텍스트일 수도 있다. 예를 들어, 처리할 텍스트 페이지가 영수증, 예를 들어 택배 영수증인 경우, 인쇄 내용은 각 항목을 포함하는 표제 텍스트를 포함할 수 있다. 필기 내용은 사용자가 기입하는 정보, 예를 들어 성명, 주소, 전화 등(이때, 정보는 사용자가 기입하는 개인 정보이며, 범용 정보가 아님)을 포함할 수 있다. 처리할 텍스트 페이지가 문장류 텍스트인 경우, 인쇄 내용은 문장 내용일 수 있으며, 필기 내용은 사용자의 비고 또는 기타 필기 표시 등일 수 있다. 처리할 텍스트 페이지가 인사기록부와 같은 폼인 경우, 인쇄 내용은 "성명", "성별", "민족", "직업 이력" 등 항목 표제 문자를 포함할 수 있다. 필기 내용은 사용자(예를 들어, 직원 등)가 인사기록부에 기입하는 사용자의 성명, 성별(남 또는 여), 민족 및 직업 경력 등 필기 정보를 포함할 수 있다. 인쇄 내용은 다양한 부호, 도형 등을 더 포함할 수 있다.For example, the text page to be processed may be text in paper format or may be text in electronic format. For example, when the text page to be processed is a receipt, for example, a delivery receipt, the printed content may include heading text including each item. The handwritten content may include information entered by the user, for example, name, address, phone number, etc. (at this time, the information is personal information entered by the user, not general information). If the text page to be processed is sentence-like text, the printed content may be sentence content, and the handwritten content may be a user's remarks or other handwritten marks. If the text page to be processed is a form such as a personnel record book, the printed content may include item heading characters such as "name", "gender", "ethnicity", and "occupational history". The written contents may include handwritten information such as a user's name, gender (male or female), ethnicity, and occupational history that a user (eg, an employee) writes in a personnel record book. The printed content may further include various symbols, figures, and the like.

예를 들어, 처리할 텍스트 페이지의 형상은 직사각형 등 형상일 수 있다. 입력 이미지의 형상은 인쇄가 용이하도록 규칙적 형상(예를 들어, 평행사변형, 직사각형 등)일 수 있다. 그러나 본 발명은 이에 한정되지 않는다. 일부 실시예에 있어서, 입력 이미지는 불규칙 형상일 수도 있다.For example, the shape of a text page to be processed may be a shape such as a rectangle. The shape of the input image may be a regular shape (eg, parallelogram, rectangle, etc.) to facilitate printing. However, the present invention is not limited thereto. In some embodiments, the input image may be of irregular shape.

예를 들어, 이미지 수집 장치가 이미지를 수집할 때 변형이 일어날 수 있으므로, 입력 이미지의 크기와 처리할 텍스트 페이지의 크기가 다를 수 있다. 그러나 본 발명은 이에 한정되지 않는다. 입력 이미지의 크기와 처리할 텍스트 페이지의 크기는 동일할 수도 있다.For example, since deformation may occur when an image collection device collects an image, the size of an input image and the size of a text page to be processed may be different. However, the present invention is not limited thereto. The size of the input image and the size of the text page to be processed may be the same.

예를 들어, 처리할 텍스트 페이지는 인쇄 내용과 필기 내용을 포함한다. 인쇄 내용은 인쇄하여 획득한 내용이며, 필기 내용은 사용자가 필기한 내용이다. 필기 내용은 필기 부호를 포함할 수 있다.For example, a text page to be processed includes printed content and handwritten content. The printed content is content obtained by printing, and the handwritten content is content written by the user. The writing contents may include writing codes.

"인쇄 내용"은 입력 장치를 통해 전자 디바이스 상에 입력한 문자, 부호, 도형 등 내용을 나타낸다. 이 뿐만 아니라 일부 실시예에서 처리할 텍스트 페이지가 예를 들어 메모 등의 텍스트인 경우, 메모 내용은 사용자가 필기한 것일 수도 있다. 이때 인쇄 내용은 필기용 빈 메모장 페이지 상의 인쇄 내용, 예를 들어 가로줄 등이다."Printed content" indicates content such as characters, symbols, and figures input onto an electronic device through an input device. In addition to this, in some embodiments, when a text page to be processed is text such as a memo, the content of the memo may be handwritten by the user. At this time, the printed content is a printed content on a blank notepad page for writing, for example, a horizontal line.

예를 들어, 인쇄 내용은 예를 들어 중국어(예를 들어 한자 또는 병음), 영어, 일어, 불어, 한글 등과 같은 다양한 언어의 문자를 포함할 수 있다. 또한 인쇄 내용은 숫자, 각종 부호(예를 들어, 체크 부호, 삽입 부호 및 각종 연산 부호 등)와 각종 도형 등을 포함할 수도 있다. 필기 내용은 다양한 언어의 문자, 숫자, 각종 부호 및 각종 도형 등을 포함할 수도 있다.For example, the printed content may include characters of various languages such as Chinese (eg, Chinese characters or Pinyin), English, Japanese, French, Korean, and the like. In addition, the printed contents may include numbers, various symbols (eg, check marks, insertion marks, various operation codes, etc.) and various figures. The written contents may include letters, numbers, various symbols, and various figures in various languages.

예를 들어, 도 2a에 도시된 예시에 있어서, 처리할 텍스트 페이지(100)는 폼이다. 4개의 경계선(직선 101A 내지 101D)으로 둘러싸인 영역은 처리할 텍스트 페이지에 대응하는 처리할 텍스트 영역(100)을 나타낸다. 상기 처리할 텍스트 영역(100)에서 인쇄 영역은 폼 영역을 포함한다. 인쇄 영역은 예를 들어 성명, 생일 등과 같은 각 항목의 문자를 포함할 수 있다. 인쇄 내용은 처리할 텍스트 영역(100)에서 우측 상단의 logo 도형(마스킹 처리함) 등을 포함할 수도 있다. 필기 영역은 필기 정보 영역을 포함한다. 필기 내용은 사용자가 필기한 개인 정보, 예를 들어 사용자가 필기한 성명, 생일 정보, 건강 정보, 체크 부호 등을 포함할 수 있다.For example, in the example shown in FIG. 2A, the text page 100 to be processed is a form. An area surrounded by four border lines (straight lines 101A to 101D) represents a text area 100 to be processed corresponding to a text page to be processed. In the text area 100 to be processed, the print area includes a form area. The print area may include characters of each item, such as a name, a birthday, and the like. The printed content may include a logo figure (masked) at the top right of the text area 100 to be processed. The writing area includes a writing information area. The handwritten content may include personal information written by the user, for example, a name, birthday information, health information, and a check code written by the user.

예를 들어, 입력 이미지는 복수의 필기 내용과 복수의 인쇄 내용을 포함할 수 있다. 복수의 필기 내용은 서로 이격되며, 복수의 인쇄 내용도 서로 이격된다. 예를 들어, 복수의 필기 내용 중의 일부 필기 내용은 동일할 수 있으며(즉, 필기 내용의 부호가 동일하나, 필기 내용의 구체적인 형태가 상이함), 복수의 인쇄 내용 중의 일부 인쇄 내용도 동일할 수 있다. 본 발명은 이에 한정되지 않는다. 복수의 필기 내용은 서로 상이할 수도 있고, 복수의 인쇄 내용도 서로 상이할 수 있다.For example, the input image may include a plurality of written contents and a plurality of printed contents. A plurality of written contents are spaced apart from each other, and a plurality of printed contents are also spaced apart from each other. For example, some of the written contents among the plurality of written contents may be the same (that is, the written contents have the same sign, but the specific shapes of the written contents are different), and some of the printed contents among the plurality of printed contents may also be the same. have. The present invention is not limited to this. A plurality of written contents may be different from each other, and a plurality of printed contents may also be different from each other.

예를 들어, 일부 실시예에 있어서, 단계 S10은, 처리할 텍스트 페이지의 원본 이미지를 획득하는 단계 - 원본 이미지는 처리할 텍스트 영역을 포함함 - ; 원본 이미지에 대해 에지 검출을 수행하여, 원본 이미지 중의 처리할 텍스트 영역을 결정하는 단계; 및 처리할 텍스트 영역에 대해 정규화 처리를 수행하여 입력 이미지를 획득하는 단계를 포함할 수 있다.For example, in some embodiments, step S10 includes acquiring an original image of a text page to be processed, wherein the original image includes a text area to be processed; determining a text area to be processed in the original image by performing edge detection on the original image; and obtaining an input image by performing normalization processing on a text area to be processed.

예를 들어, 신경망 또는 OpenCV 기반의 에지 검출 알고리즘 등 방법을 채택해 원본 이미지에 대해 에지 검출을 수행함으로써 처리할 텍스트 영역을 결정할 수 있다. 예를 들어, OpenCV는 오픈 소스 컴퓨터 비전 라이브러리이다. OpenCV 기반의 에지 검출 알고리즘은 Sobel, Scarry, Canny, Laplacian, Prewitt, Marr-Hildresh, scharr 등 다양한 알고리즘을 포함한다.For example, a text area to be processed can be determined by performing edge detection on the original image by adopting a method such as a neural network or OpenCV-based edge detection algorithm. For example, OpenCV is an open source computer vision library. Edge detection algorithms based on OpenCV include various algorithms such as Sobel, Scarry, Canny, Laplacian, Prewitt, Marr-Hildresh, and scharr.

예를 들어, 원본 이미지에 대해 에지 검출을 수행하여 원본 이미지 중의 처리할 텍스트 영역을 결정하는 단계는, 원본 이미지를 처리하여 원본 이미지 중 그레이스케일 윤곽의 선도(line drawing)를 획득하는 단계 - 선도는 복수의 선을 포함함 - ; 선도에서 유사한 선을 합쳐 복수의 초기 병합 선을 획득하고, 복수의 초기 병합 선을 기반으로 경계 행렬을 결정하는 단계; 복수의 초기 병합 선에서 유사한 선을 합쳐 타깃 선을 획득하고, 합치지 않은 초기 병합 선도 타깃 선으로 사용함으로써, 복수의 타깃 선을 획득하는 단계; 경계 행렬을 기반으로, 복수의 타깃 선으로부터 복수의 기준 경계선을 결정하는 단계; 사전 학습된 경계선 영역 식별 모델을 통해 원본 이미지를 처리하여, 원본 이미지 중 처리할 텍스트 페이지의 복수의 경계선 영역을 획득하는 단계; 각 경계선 영역에 대해, 복수의 기준 경계선 중 해당 경계선 영역에 대응하는 타깃 경계선을 결정하는 단계; 및 결정한 복수의 타깃 경계선을 기반으로 원본 이미지 중 처리할 텍스트 페이지의 에지를 결정하는 단계를 포함할 수 있다.For example, the step of performing edge detection on the original image to determine the text area to be processed in the original image is the step of processing the original image to obtain a grayscale outline line drawing of the original image - the line drawing is Contains multiple lines - ; obtaining a plurality of initial merged lines by combining similar lines in the diagram, and determining a boundary matrix based on the plurality of initial merged lines; acquiring a plurality of target lines by merging similar lines from the plurality of initial merge lines to obtain target lines, and using the non-merged initial merge lines as target lines; Based on the boundary matrix, determining a plurality of reference boundary lines from the plurality of target lines; acquiring a plurality of boundary regions of a text page to be processed from among the original images by processing the original image through a pretrained boundary region identification model; For each boundary area, determining a target boundary line corresponding to the corresponding boundary line area among a plurality of reference boundary lines; and determining an edge of a text page to be processed among original images based on the determined plurality of target boundary lines.

예를 들어, 일부 실시예에 있어서, 원본 이미지를 처리하여 원본 이미지 중 그레이스케일 윤곽의 선도를 획득하는 단계는, OpenCV 기반의 에지 검출 알고리즘을 통해 원본 이미지를 처리하고, 원본 이미지 중 그레이스케일 윤곽의 선도를 획득하는 단계를 포함한다.For example, in some embodiments, the step of processing the original image and obtaining a grayscale outline of the original image includes processing the original image through an OpenCV-based edge detection algorithm, and obtaining a grayscale outline of the original image. It includes obtaining a line.

예를 들어, 선도에서 유사한 선을 병합하고 복수의 초기 병합 선을 획득하는 단계는, 선도 중의 긴 선을 획득하는 단계 - 긴 선은 길이가 제1 소정 임계값을 초과하는 선임 - ; 긴 선으로부터 복수 세트의 제1 유형 선을 획득하는 단계 - 제1 유형 선은 적어도 2개의 순차적으로 인접한 긴 선을 포함하고, 임의 인접한 2개의 긴 선 사이의 협각은 모두 제2 소정 임계값보다 작음 - ; 및 각 세트의 제1 유형 선에 대해, 해당 세트의 제1 유형 선 중의 각 긴 선을 순차적으로 합쳐 하나의 초기 병합 선을 획득하는 단계를 포함한다.For example, the step of merging similar lines in the diagram and obtaining a plurality of initial merged lines may include: acquiring a long line in the diagram, wherein the long line has a length exceeding a first predetermined threshold; obtaining a plurality of sets of first type lines from the long lines, wherein the first type lines include at least two sequentially adjacent long lines, and all included angles between any two adjacent long lines are smaller than a second predetermined threshold value. - ; and for each set of first type lines, sequentially merging each long line of the first type lines in the set to obtain one initial merged line.

예를 들어, 경계 행렬은 이하 방식에 따라 결정된다. 즉, 복수의 초기 병합 선 및 긴 선에서 합치지 않은 선을 다시 제도한다. 다시 제도한 모든 선에서 픽셀 포인트의 위치 정보를 전체 원본 이미지의 행렬에 대응시킨다. 원본 이미지의 행렬 중 이러한 선의 픽셀 포인트가 소재한 위치의 값을 제1 값으로 설정한다. 이러한 선 이외의 픽셀 포인트가 소재한 위치의 값은 제2 값으로 설정하여, 경계 행렬을 형성한다.For example, the boundary matrix is determined according to the following method. That is, a plurality of initial merged lines and lines that are not merged from long lines are re-drafted. The positional information of the pixel points in all the re-drafted lines is mapped to the matrix of the entire original image. A value of a position where a pixel point of such a line is located in a matrix of an original image is set as a first value. A value of a location where a pixel point other than the line is located is set to a second value to form a boundary matrix.

예를 들어, 복수의 초기 병합 선에서 유사한 선을 합쳐 타깃 선을 획득하는 단계는, 복수의 초기 병합 선으로부터 복수 세트의 제2 유형 선을 획득하는 단계 - 제2 유형 선은 적어도 2개의 순차적으로 인접한 초기 병합 선을 포함하고, 임의 인접한 2개의 초기 병합 선 사이의 협각은 모두 제3 소정 임계값보다 작음 - ; 및 각 세트의 제2 유형 선에 대해, 해당 세트의 제2 유형 선 중의 각 초기 병합 선을 순차적으로 합쳐 하나의 타깃 선을 획득하는 단계를 포함한다.For example, acquiring a target line by merging similar lines from a plurality of initial merged lines may include obtaining a plurality of sets of second type lines from the plurality of initial merged lines - the second type lines are sequentially formed by at least two sets of second type lines. including adjacent initial merging lines, and an included angle between any two adjacent initial merging lines is smaller than a third predetermined threshold value; and for each set of second type lines, sequentially merging each initial merged line in the set of second type lines to obtain one target line.

예를 들어, 제1 소정 임계값은 2개 픽셀의 길이일 수 있다. 제2 소정 임계값과 제3 소정 임계값은 15도일 수 있다. 제1 소정 임계값, 제2 소정 임계값 및 제3 소정 임계값은 실제 응용 수요에 따라 설치할 수 있음에 유의한다.For example, the first predetermined threshold may be two pixels in length. The second predetermined threshold value and the third predetermined threshold value may be 15 degrees. Note that the first predetermined threshold, the second predetermined threshold, and the third predetermined threshold may be set according to actual application needs.

예를 들어, 경계 행렬을 기반으로 복수의 타깃 선으로부터 복수의 기준 경계선을 결정하는 단계는 하기 단계를 포함한다. 즉, 각 타깃 선에 대해 해당 타깃 선을 연장한다. 연장한 해당 타깃 선을 기반으로 하나의 선 행렬을 결정한 후, 해당 선 행렬과 경계 행렬의 비교한다. 연장된 해당 타깃 선 상에서 경계 행렬에 속하는 픽셀 포인트의 개수를 계산하여, 해당 타깃 선의 점수로 사용한다. 즉, 해당 선 행렬과 경계 행렬을 비교하여 얼마나 많은 픽셀 포인트가 경계 행렬 내면에 떨어졌는지 판단한다. 즉, 2개 행렬 중 얼마나 많은 동일 위치의 픽셀 포인트가 동일한 제1 값, 예를 들어 255를 갖는지 판단하여 점수를 계산한다. 여기에서 선 행렬과 경계 행렬의 크기는 동일하다. 각 타깃 선의 점수를 기반으로 복수의 타깃 선으로부터 복수의 기준 경계선을 결정한다. 점수가 우수한 타깃 선의 수량은 복수개일 수 있음에 유의한다. 따라서 각 타깃 선의 점수를 기반으로, 복수의 타깃 선으로부터 점수가 가장 우수한 복수의 타깃 선을 기준 경계선으로 결정한다.For example, the step of determining a plurality of reference boundary lines from a plurality of target lines based on the boundary matrix includes the following steps. That is, for each target line, the corresponding target line is extended. After determining one line matrix based on the corresponding extended target line, the corresponding line matrix and boundary matrix are compared. The number of pixel points belonging to the boundary matrix on the extended target line is calculated and used as the score of the target line. That is, by comparing the corresponding line matrix with the boundary matrix, it is determined how many pixel points fall inside the boundary matrix. That is, a score is calculated by determining how many pixel points at the same location among the two matrices have the same first value, for example, 255. Here, the size of the line matrix and the boundary matrix are the same. A plurality of reference boundary lines are determined from the plurality of target lines based on the score of each target line. Note that the number of target lines having excellent scores may be plural. Therefore, based on the score of each target line, a plurality of target lines having the highest score among the plurality of target lines is determined as the reference boundary line.

예를 들어, 선 행렬은 하기 방식에 따라 결정한다. 즉, 연장된 타깃 선 또는 직선을 다시 제도한다. 다시 제도한 선 중에서 픽셀 포인트의 위치 정보를 전체 원본 이미지의 행렬에 대응시킨다. 원본 이미지의 행렬 중 선의 픽셀 포인트가 소재한 위치의 값을 제1 값으로 설정하고, 선 이외의 픽셀 포인트가 소재한 위치의 값은 제2 값으로 설정하여, 선 행렬을 형성한다.For example, the line matrix is determined according to the following method. That is, the extended target line or straight line is drawn again. Among the redrawn lines, the location information of the pixel points is mapped to the matrix of the entire original image. In the matrix of the original image, a value of a position where a pixel point of a line is located is set as a first value, and a value of a position where a pixel point other than a line is located is set to a second value to form a line matrix.

예를 들어, 각 경계선 영역에 대해, 복수의 기준 경계선으로부터 해당 경계선 영역에 대응하는 타깃 경계선을 결정하는 단계는 하기 단계를 포함한다. 즉, 각 기준 경계선의 기울기를 계산한다. 각 경계선 영역에 대해 허프(Hough) 변환을 이용해 해당 경계선 영역을 복수의 직선으로 변환하고, 복수의 직선의 평균 기울기를 계산한다. 그 다음 복수의 기준 경계선에 기울기와 평균 기울기가 매칭된는 기준 경계선이 존재하는지 판단한다. 존재하는 경우, 해당 기준 경계선을 해당 경계선 영역에 대응하는 타깃 경계선으로 결정한다. 복수의 기준 경계선에 기울기와 평균 기울기가 매칭되는 기준 경계선이 존재하지 않는다고 판단되는 경우, 해당 경계선 영역을 변환하여 획득한 각 직선에 대해, 해당 직선이 형성하는 선 행렬과 경계 행렬을 비교한다. 해당 직선 상에서 경계 행렬에 속하는 픽셀 포인트의 개수를 계산하여 해당 직선의 점수로 사용한다. 점수가 가장 좋은 직선을 해당 경계선 영역에 대응하는 타깃 경계선으로 결정한다. 여기에서 선 행렬과 경계 행렬의 크기는 동일하다. 점수가 가장 우수한 직선이 복수개인 경우, 정렬 알고리즘에 따라 그 중 가장 먼저 나타난 직선을 가장 바람직한 경계선으로 사용함에 유의한다.For example, the step of determining a target boundary line corresponding to the boundary line region from a plurality of reference boundary lines for each boundary line region includes the following steps. That is, the slope of each reference boundary line is calculated. For each boundary line region, a Hough transform is used to convert the boundary line region into a plurality of straight lines, and an average slope of the plurality of straight lines is calculated. Next, it is determined whether there exists a reference boundary line whose slope and average slope match among the plurality of reference boundary lines. If present, the reference boundary line is determined as the target boundary line corresponding to the boundary line area. When it is determined that there is no reference boundary line whose slope and average slope are matched among the plurality of reference boundary lines, a line matrix formed by the corresponding straight line and a boundary matrix are compared for each straight line obtained by transforming the corresponding boundary line area. The number of pixel points belonging to the boundary matrix on the corresponding straight line is calculated and used as the score of the corresponding straight line. A straight line with the highest score is determined as a target boundary line corresponding to the boundary line area. Here, the size of the line matrix and the boundary matrix are the same. Note that when there are multiple straight lines with the best score, the straight line appearing first among them according to the sorting algorithm is used as the most desirable boundary line.

예를 들어, 경계선 영역 식별 모델은 신경망 기반의 모델이다. 경계선 영역 식별 모델은 머신러닝 학습에 의해 구축될 수 있다.For example, the boundary area identification model is a neural network-based model. A boundary area identification model can be built by machine learning learning.

예를 들어, 원본 이미지에 대해 에지 검출을 수행한 후 복수의 타깃 경계선(예를 들어, 4개의 타깃 경계선)을 결정할 수 있다. 처리할 텍스트 영역은 복수의 타깃 경계선에서 결정한다. 예를 들어, 복수의 타깃 경계선의 복수의 교차점과 복수의 타깃 경계선을 기반으로 처리할 텍스트 영역을 결정할 수 있다. 각 2개의 인접한 타깃 경계선이 교차하여 하나의 차점을 획득하며, 복수의 교차점과 복수의 타깃 경계선은 함께 원본 이미지 중 처리할 텍스트가 소재한 영역을 한정한다. 예를 들어, 도 2a에 도시된 예시에 있어서, 처리할 텍스트 영역은 4개의 타깃 경계선으로 둘러싸인 텍스트 영역일 수 있다. 4개의 타깃 경계선은 모두 직선이다. 4개의 타깃 경계선은 각각 제1 타깃 경계선(101A), 제2 타깃 경계선(101B), 제3 타깃 경계선(101C) 및 제4 타깃 경계선(101D)이다. 처리할 텍스트 영역 이외에, 원본 이미지는 비텍스트 영역을 더 포함할 수 있다. 예를 들어, 도 2a에서 4개의 경계선으로 둘러싸인 영역 이외의 영역이다.For example, after edge detection is performed on the original image, a plurality of target boundary lines (eg, four target boundary lines) may be determined. A text area to be processed is determined by a plurality of target boundary lines. For example, a text area to be processed may be determined based on a plurality of intersections of a plurality of target boundary lines and a plurality of target boundary lines. Each of two adjacent target boundary lines intersects to obtain a difference point, and the plurality of intersection points and the plurality of target boundary lines together define an area of the original image where the text to be processed is located. For example, in the example shown in FIG. 2A , the text area to be processed may be a text area surrounded by four target boundary lines. All four target boundary lines are straight. The four target boundary lines are a first target boundary line 101A, a second target boundary line 101B, a third target boundary line 101C, and a fourth target boundary line 101D. In addition to the text area to be processed, the original image may further include a non-text area. For example, it is an area other than the area surrounded by the four boundary lines in FIG. 2A.

예를 들어, 일부 실시예에 있어서, 처리할 텍스트 영역에 대해 정규화 처리를 수행하여 입력 이미지를 획득하는 단계는, 처리할 텍스트 영역에 대해 투영 변환을 수행하여, 처리할 텍스트 영역의 정면도를 획득하는 단계를 포함한다. 해당 정면도는 입력 이미지이다. 투영 변환(Perspective Transformation)은 사진을 하나의 새로운 뷰잉 평면(Viewing Plane)에 투영시키는 기술로, 투영 맵핑(Projective Mapping)으로 불리기도 한다. 촬영하여 획득한 원본 이미지에서 처리할 텍스트의 실제 형상은 원본 이미지에서 변형되어 기하학적 왜곡이 발생한다. 도 2a에 도시된 원본 이미지와 같이, 처리할 텍스트(즉, 폼)의 형상은 원래 직사각형이다. 그러나 원본 이미지 중의 처리할 텍스트의 형상이 변형되어 불규칙한 다각형으로 변형되었다. 따라서 원본 이미지 중의 처리할 텍스트 영역에 대해 투여 변환을 수행한다. 처리할 텍스트 영역을 불규칙한 다각형에서 직사각형 또는 평행사변형 등으로 변환할 수 있다. 즉, 처리할 텍스트 영역을 정규화하여 기하학적 왜곡의 영향을 제거하고 원본 이미지 중 처리할 텍스트의 정면도를 획득한다. 투영 변환은 공간 투영 환산 좌표를 기반으로 처리할 텍스트 영역 중의 픽셀을 처리하여 처리할 텍스트의 정면도를 획득할 수 있다. 이는 여기에서 반복하여 설명하지 않기로 한다.For example, in some embodiments, performing normalization processing on the text area to be processed to obtain an input image includes performing projection transformation on the text area to be processed to obtain a front view of the text area to be processed. Include steps. The corresponding front view is the input image. Perspective Transformation is a technique of projecting a picture onto a new viewing plane, and is also called Projective Mapping. The actual shape of the text to be processed in the original image obtained by shooting is deformed from the original image, resulting in geometric distortion. Like the original image shown in FIG. 2A, the shape of the text to be processed (ie, form) is originally a rectangle. However, the shape of the text to be processed in the original image was deformed and transformed into an irregular polygon. Accordingly, dose transformation is performed on the text area to be processed in the original image. The text area to be processed can be transformed from an irregular polygon to a rectangle or parallelogram, etc. That is, the text area to be processed is normalized to remove the effect of geometric distortion, and a front view of the text to be processed is obtained from the original image. In the projection transformation, a front view of the text to be processed may be obtained by processing pixels in the text area to be processed based on spatial projection conversion coordinates. This will not be repeated here.

다른 일부 실시예에 있어서, 처리할 텍스트 영역에 대해 정규화 처리를 수행하지 않고, 곧바로 원본 이미지로부터 처리할 텍스트 영역을 절단하여, 독립된 처리할 텍스트 영역의 이미지를 획득할 수도 있다. 상기 독립된 처리할 텍스트 영역의 이미지는 입력 이미지이다.In some other embodiments, an image of an independent text area to be processed may be obtained by directly cutting the text area to be processed from an original image without performing normalization on the text area to be processed. The image of the text area to be processed independently is an input image.

예를 들어, 원본 이미지는 이미지 수집 장치에 의해 직접 수집된 이미지일 수 있다. 또한 이미지 수집 장치에 의해 직접 수집된 이미지를 사전 처리한 후 획득한 이미지일 수도 있다. 원본 이미지는 그레이스케일 이미지일 수 있으며, 컬러 이미지일 수도 있다. 예를 들어, 원본 이미지의 데이터 품질, 데이터 불균형 등이 텍스트 이미지에서 필기 내용을 제거하는 데 미치는 영향을 방지하기 위해, 원본 이미지를 처리하기 전에, 본 발명 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법은, 원본 이미지를 사전 처리하는 작업을 더 포함할 수 있다. 사전처리는 원본 이미지에서 무관한 정보 또는 노이즈 정보를 삭제하여, 원본 이미지에 대한 처리를 더욱 용이하게 만들 수 있다. 사전처리는 예를 들어 이미지 수집 장치에 의해 직접 수집된 이미지에 대한 줌(zoom), 절단, 감마(Gamma) 보정, 이미지 향상 또는 노이즈 저감 필터링 등 처리를 포함할 수 있다.For example, the original image may be an image directly collected by an image collection device. It may also be an image obtained after pre-processing an image directly collected by the image collection device. The original image may be a grayscale image or a color image. For example, in order to prevent the effect of data quality, data imbalance, etc. of the original image on removing the handwritten content from the text image, prior to processing the original image, the handwritten content is removed from the text image provided by the embodiment of the present invention. The removal method may further include pre-processing the original image. Pre-processing can make the processing of the original image easier by removing irrelevant or noise information from the original image. Preprocessing may include, for example, processing such as zooming, cropping, gamma correction, image enhancement, or noise reduction filtering for images directly collected by the image collection device.

주의할 점은 일부 실시예에 있어서 원본 이미지가 입력 이미지로 사용될 수 있다는 것이다. 이 경우, 예를 들어 직접 원본 이미지를 식별하여 원본 이미지 중의 필기 내용을 결정한 후, 원본 이미지 중의 필기 내용을 제거하여 출력 이미지를 획득한다. 또는 직접 원본 이미지를 식별하여 원본 이미지 중의 필기 내용을 결정한 후 원본 이미지 중의 필기 내용을 제거하여 중간 출력 이미지를 획득한다. 그 후 중간 출력 이미지에 대해 에지 검출을 수행하여 중간 출력 이미지 중의 처리할 텍스트 영역을 결정할 수 있다. 처리할 텍스트 영역에 대해 정규화 처리를 수행하여 출력 이미지를 획득한다. 즉, 본 발명의 일부 실시예에 있어서, 먼저 원본 이미지 중의 필기 내용을 제거하여 중간 출력 이미지를 획득한 다음 중간 출력 이미지에 대해 에지 검출 및 정규화 처리를 수행할 수 있다.It should be noted that in some embodiments, an original image may be used as an input image. In this case, for example, the original image is directly identified to determine the written content in the original image, and then the written content in the original image is removed to obtain an output image. Alternatively, the original image is directly identified to determine the written content in the original image, and then the written content in the original image is removed to obtain an intermediate output image. Then, edge detection may be performed on the intermediate output image to determine a text region to be processed in the intermediate output image. Normalization is performed on the text area to be processed to obtain an output image. That is, in some embodiments of the present invention, handwritten content in the original image is first removed to obtain an intermediate output image, and then edge detection and normalization processing may be performed on the intermediate output image.

이어서 도 1에 도시된 바와 같이, 단계 S11에 있어서, 이미지 분할 모델을 이용해 상기 입력 이미지를 식별하여 상기 필기 내용의 초기 필기 픽셀을 획득한다.Subsequently, as shown in FIG. 1 , in step S11, the input image is identified using an image segmentation model to obtain an initial handwritten pixel of the handwritten content.

예를 들어, 이미지 분할 모델은 입력 이미지에 대해 영역 식별(또는 분할)을 수행하는 모델을 나타낸다. 이미지 분할 모델은 머신러닝 기술(예를 들어, 컨볼루션 신경망 기술)을 채택해 구현하며 예를 들어 범용 컴퓨팅 장치나 전용 컴퓨팅 장치 상에서 실행된다. 상기 이미지 분할 모델은 사전 학습된 모델이다. 예를 들어, 이미지 분할 모델에 적용되는 신경망은 심층 컨볼루션 신경망, 마스크 영역 컨볼루션 신경망(Mask-RCNN), 심층 레지듀얼 망(deep residual network), 주의력 모델 등을 포함하는 기타 신경망 모델을 통해 동일한 기능을 구현할 수도 있다. 이는 여기에서 한정하지 않는다.For example, an image segmentation model represents a model that performs region identification (or segmentation) on an input image. The image segmentation model is implemented by adopting machine learning techniques (eg, convolutional neural network technology) and is executed, for example, on a general-purpose computing device or a dedicated computing device. The image segmentation model is a pretrained model. For example, the neural network applied to the image segmentation model is the same through other neural network models, including deep convolutional neural networks, mask-region convolutional neural networks (Mask-RCNN), deep residual networks, attention models, etc. function can be implemented. This is not limited here.

예를 들어, 이미지 분할 모델을 이용해 상기 입력 이미지를 식별하는 것은 U-Net 모델을 채택한다. 이는 개선된 FCN(Fully Convolutional Network, 완전 컨볼루션 신경망) 구조로, FCN의 이미지 시맨틱 분할 개념을 사용한다. 즉, 컨볼루션 레이어, 풀링 레이어를 이용해 특징 추출을 수행한 다음 디컨볼루션 레이어를 이용해 이미지 크기를 복원한다. U-Net망 모델은 이미지 분할 성능이 비교적 우수한 일종의 모델이다. 딥러닝은 분류 문제를 잘 해결함, 딥러닝의 이러한 특징을 이용하여 이미지 분할을 수행하는 것의 실질은 이미지 중의 각 픽셀 포인트를 분류하는 것이다. 최종적으로 상이한 클래스의 포인트는 상이한 채널을 이용해 표시하여, 타깃 영역 중의 특징 정보를 분류 표시하는 효과를 낼 수 있다. U-Net 모델을 통해 입력 이미지에서 상기 필기 내용의 초기 필기 픽셀을 결정할 수 있다. 마찬가지로 예를 들어 Mask-RCNN 등 다른 신경망 모델을 통해서도 상기 필기 내용의 초기 필기 픽셀을 결정할 수 있다.For example, identifying the input image using an image segmentation model adopts a U-Net model. This is an improved Fully Convolutional Network (FCN) structure, and uses the image semantic segmentation concept of FCN. That is, feature extraction is performed using a convolution layer and a pooling layer, and then the image size is restored using a deconvolution layer. The U-Net network model is a kind of model with relatively excellent image segmentation performance. Deep learning solves the classification problem well. The essence of performing image segmentation using this feature of deep learning is to classify each pixel point in the image. Finally, points of different classes may be displayed using different channels, so that characteristic information in the target area is classified and displayed. An initial handwritten pixel of the handwritten contents may be determined in an input image through a U-Net model. Similarly, the initial handwritten pixel of the handwritten contents may be determined through other neural network models such as Mask-RCNN, for example.

이어서 도 1에 도시된 바와 같이, 단계 S12에서 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하여 필기 픽셀 마스크 영역을 획득한다. 이미지 분할 모델을 통해 상기 입력 이미지를 식별한다. 획득한 초기 필기 픽셀은 전체 필기 픽셀이 아닐 수도 있다. 그러나 나머지 누락된 필기 픽셀은 일반적으로 모두 상기 초기 필기 픽셀에 가깝다. 따라서 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하고 필기 픽셀 영역을 확대하여 필기 픽셀 마스크 영역을 획득해야 한다. 상기 필기 픽셀 마스크 영역은 기본적으로 전체 필기 픽셀을 포함한다.Subsequently, as shown in FIG. 1, in step S12, a blurring process is performed on the initial handwritten pixel to obtain a handwritten pixel mask area. The input image is identified through an image segmentation model. The obtained initial handwritten pixels may not be all handwritten pixels. However, the remaining missing writing pixels are generally all close to the initial writing pixels. Accordingly, a blurring process is performed on the initial handwritten pixel and the handwritten pixel area is enlarged to obtain a handwritten pixel mask area. The handwritten pixel mask area basically includes all handwritten pixels.

예를 들어, OpenCV 기반의 가우시안 필터(Gaussian Blur) 함수를 통해 초기 필기 픽셀에 대해 가우시안 블러링 처리를 수행하여 초기 필기 픽셀 영역을 확대한다. 따라서 필기 픽셀 마스크 영역을 획득한다. 가우시안 필터는 입력 배열의 각 포인트와 입력된 가우시안 필터 템플릿에 대해 컨볼루션 계산을 실행한 후 이러한 결과를 필터링된 출력 배열로 구성하는 것이다. 이는 초기 필기 픽셀의 이미지에 대해 가중 평균을 수행하는 과정이며, 각 픽셀 포인트의 값은 모두 그 자체 및 인접 영역 내의 다른 픽셀값이 가중 평균되어 획득된다. 가우시안 블러링 처리를 수행한 후, 필기 픽셀 이미지가 블러링되나 그 영역은 확대된다. 예를 들어, 다른 임의 블러링 처리 기술을 채택해 초기 필기 픽셀에 대해 블러링 처리를 수행할 수도 있다. 이는 여기에서 한정하지 않는다.For example, a Gaussian blurring process is performed on the initial handwritten pixel through an OpenCV-based Gaussian blur function to enlarge the initial handwritten pixel area. Thus, a handwritten pixel mask area is obtained. The Gaussian filter performs convolution calculations on each point of the input array and the input Gaussian filter template, and then configures these results as a filtered output array. This is a process of performing a weighted average on the image of the initial handwritten pixel, and the value of each pixel point is obtained by weighting the values of itself and other pixels in the adjacent area. After performing the Gaussian blurring process, the handwritten pixel image is blurred but its area is enlarged. For example, a blurring process may be performed on an initial handwritten pixel by adopting another arbitrary blurring technique. This is not limited here.

이어서 도 1에 도시된 바와 같이, 단계 S13에서 필기 픽셀 마스크 영역을 기반으로 상기 필기 내용을 결정한다. 필기 픽셀 마스크 영역을 기반으로 초기 필기 픽셀을 결합하여 필기 내용의 전체 필기 픽셀을 결정함으로써 필기 내용을 결정한다.Subsequently, as shown in FIG. 1 , in step S13, the handwritten content is determined based on the handwritten pixel mask area. The handwritten content is determined by combining initial handwritten pixels based on the handwritten pixel mask area to determine total handwritten pixels of the handwritten content.

이어서 도 1에 도시된 바와 같이, 단계 S14에서 상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득한다.Subsequently, as shown in FIG. 1 , in step S14, the handwritten content is removed from the input image to obtain an output image.

예를 들어, 본 발명의 비교적 바람직한 제1 실시예에 있어서, 단계 S12에서 필기 픽셀 마스크 영역을 획득한 후, 입력 이미지에서 필기 픽셀 마스크 영역을 결정할 수 있다. 이이서 입력 이미지 중 상응하는 위치의 영역으로 옮겨 비필기 픽셀을 결정한다. 상기 초기 필기 픽셀의 픽셀값을 기반으로, 상기 입력 이미지 중 필기 픽셀 마스크 영역 위치에 대응하는 상응하는 영역에서 픽셀값 차이가 비교적 큰 다른 픽셀을 찾고 이를 비필기 픽셀로 결정한다. 예를 들어 픽셀 차이값의 임계값을 설정할 수 있다. 영역 내에 픽셀 차이값이 임계값 범위 이외에 있는 픽셀이 있는 경우, 이를 비필기 픽셀로 결정한다.For example, in the first relatively preferred embodiment of the present invention, after obtaining the handwritten pixel mask area in step S12, the handwritten pixel mask area may be determined in the input image. Subsequently, non-writing pixels are determined by moving to an area at a corresponding position in the input image. Based on the pixel value of the initial handwritten pixel, another pixel having a relatively large pixel value difference is found in a corresponding region corresponding to the position of the handwritten pixel mask region in the input image and determined as a non-written pixel. For example, a threshold value of a pixel difference value may be set. If there is a pixel whose pixel difference value is outside the threshold range in the area, it is determined as a non-writing pixel.

이어서 상기 입력 이미지 중의 상기 필기 픽셀 마스크 영역 내용을 제거하여 중간 출력 이미지를 획득한다.Then, the content of the handwritten pixel mask area in the input image is removed to obtain an intermediate output image.

예를 들어, OpenCV 기반의 inpaint 함수를 통해 필기 픽셀 마스크 영역 내용을 제거할 수 있다. OpenCV 기반의 inpaint 함수는 영역 인접 영역을 사용하여 이미지에서 선택 영역을 복원한다. 즉, 상기 입력 이미지 중 필기 픽셀 마스크 영역 위치에 대응하는 상응하는 영역 중의 픽셀을 영역 인접 픽셀을 사용해 복원한다. 따라서 상기 입력 이미지 중의 상기 필기 픽셀 마스크 영역 내용을 제거하는 효과를 구현하고 중간 출력 이미지를 획득한다.For example, the contents of the handwritten pixel mask area can be removed through the OpenCV-based inpaint function. The OpenCV-based inpaint function uses region contiguous to restore a selection in an image. That is, pixels in a corresponding region corresponding to the position of the handwritten pixel mask region in the input image are reconstructed using pixels adjacent to the region. Thus, an effect of removing the handwritten pixel mask region content in the input image is realized, and an intermediate output image is obtained.

이어서 상기 중간 출력 이미지에 대해 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 복원을 수행하여, 상기 출력 이미지를 획득한다.Then, restoring non-written pixels in the written pixel mask area is performed on the intermediate output image to obtain the output image.

예를 들어, 입력 이미지 중 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀의 픽셀값을 획득하고, 직접 상기 중간 출력 이미지 중 상응하는 위치 지점의 픽셀을 대체한다. 따라서 해당 위치의 비필기 픽셀에 대한 복원을 완료한다. 최종적으로 상기 출력 이미지를 획득한다.For example, the pixel value of the non-written pixel in the handwritten pixel mask area of the input image is obtained, and the pixel of the corresponding position point in the intermediate output image is directly replaced. Accordingly, restoration of the non-writing pixel at the corresponding position is completed. Finally, the output image is acquired.

예를 들어, 본 발명의 비교적 바람직한 다른 실시예에 있어서, 단계 S12에서 필기 픽셀 마스크 영역을 획득한 후, 입력 이미지에서 필기 픽셀 마스크 영역을 결정할 수 있다. 이이서 입력 이미지 중 상응하는 위치의 영역으로 옮겨 비필기 픽셀을 결정한다. 상기 초기 필기 픽셀의 픽셀값을 기반으로, 상기 입력 이미지 중 필기 픽셀 마스크 영역 위치에 대응하는 상응하는 영역에서 픽셀값 차이가 비교적 큰 다른 픽셀을 찾고 이를 비필기 픽셀로 결정한다. 예를 들어 픽셀 차이값의 임계값을 설정할 수 있다. 영역 내에 픽셀 차이값이 임계값 범위 이외에 있는 픽셀이 있는 경우, 이를 비필기 픽셀로 결정한다.For example, in another preferred embodiment of the present invention, after obtaining the handwritten pixel mask area in step S12, the handwritten pixel mask area may be determined in the input image. Subsequently, non-writing pixels are determined by moving to an area at a corresponding position in the input image. Based on the pixel value of the initial handwritten pixel, another pixel having a relatively large pixel value difference is found in a corresponding region corresponding to the position of the handwritten pixel mask region in the input image and determined as a non-written pixel. For example, a threshold value of a pixel difference value may be set. If there is a pixel whose pixel difference value is outside the threshold range in the area, it is determined as a non-writing pixel.

이어서 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 및 상기 필기 픽셀 마스크 영역을 기반으로 상기 입력 이미지 중의 상기 필기 내용을 제거하여, 상기 출력 이미지를 획득한다. 즉, 상기 필기 픽셀 마스크 영역에서 비필기 픽셀을 배제하여, 다른 부분의 픽셀을 제거한다. 따라서 비필기 픽셀이 잘못 제거되지 않도록 보존하며, 최종적으로 상기 출력 이미지를 획득한다.Subsequently, the output image is obtained by removing the handwritten content in the input image based on the non-written pixels in the handwritten pixel mask area and the handwritten pixel mask area. That is, by excluding non-writing pixels from the writing pixel mask area, pixels in other parts are removed. Therefore, non-writing pixels are preserved so as not to be erroneously removed, and the output image is finally obtained.

예를 들어, OpenCV 기반의 inpaint 함수를 통해 비필기 픽셀의 필기 픽셀 마스크 영역 내용을 배제할 수 있다. OpenCV 기반의 inpaint 함수는 영역 인접 영역을 사용하여 이미지에서 선택 영역을 복원한다. 즉, 상기 입력 이미지 중 필기 픽셀 마스크 영역 위치에 대응하는 상응하는 영역 중의 비필기 픽셀을 제외한 다른 픽셀을 영역 인접 픽셀을 사용해 복원한다. 따라서 상기 입력 이미지 중의 상기 필기 픽셀 마스크 영역 내용을 제거하는 효과를 구현한다.For example, the contents of the handwritten pixel mask area of non-written pixels can be excluded through the OpenCV-based inpaint function. The OpenCV-based inpaint function uses region contiguous to restore a selection in an image. That is, pixels other than the non-writing pixels in the corresponding region corresponding to the position of the writing pixel mask region in the input image are reconstructed using pixels adjacent to the region. Therefore, the effect of removing the contents of the handwritten pixel mask area in the input image is realized.

예를 들어, 본 발명의 비교적 바람직한 다른 실시예에 있어서, 상기 입력 이미지 중의 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 중간 출력 이미지를 획득하는 단계; 및 중간 출력 이미지에 대해 이진화 처리를 수행하여 출력 이미지를 획득하는 단계를 포함한다.For example, in another relatively preferred embodiment of the present invention, the step of obtaining an output image by removing the handwritten content in the input image is the step of obtaining an intermediate output image by removing the handwritten content from the input image. ; and obtaining an output image by performing a binarization process on the intermediate output image.

이진화 처리는 중간 출력 이미지 상의 픽셀 포인트의 그레이스케일 값을 0 또는 255로 설정하는 것이다. 또한 전체 중간 출력 이미지가 명백한 흑백 효과를 나타내도록 하는 과정이기도 하다. 이진화 처리는 중간 출력 이미지 중 데이터량을 크게 감소시켜 타깃의 윤곽을 부각시킬 수 있다. 이진화 처리는 중간 출력 이미지를 흑백 대비가 비교적 선명한 그레이스케일 이미지(즉, 출력 이미지)로 변환할 수 있다. 변환된 그레이스케일 이미지의 노이즈는 간섭이 비교적 적고, 출력 이미지 중의 내용의 식별력과 인쇄 효과를 효과적으로 향상시킬 수 있다.The binarization process sets the grayscale values of pixel points on the intermediate output image to 0 or 255. It is also the process of ensuring that the entire intermediate output image exhibits a distinct black-and-white effect. The binarization process can greatly reduce the amount of data in the intermediate output image, thereby emphasizing the outline of the target. The binarization process may convert an intermediate output image into a grayscale image (ie, an output image) having a relatively sharp black-and-white contrast. The noise of the converted grayscale image has relatively little interference, and the discrimination of the content in the output image and the printing effect can be effectively improved.

예를 들어, 입력 이미지로부터 상기 필기 내용을 절단 제거한 후, 필기 내용에 대응하는 영역 내의 모든 픽셀이 제거된다. 즉, 입력 이미지 중의 필기 내용에 대응하는 영역의 픽셀이 비어 픽셀이 없다. 중간 출력 이미지에 대해 이진화 처리를 수행할 때, 중간 출력 이미지 중의 픽셀이 빈 영역은 어떠한 처리도 수행하지 않는다. 또는 중간 출력 이미지에 대해 이진화 처리를 수행할 때, 중간 출력 이미지 중의 픽셀이 빈 영역을 그레이스케일 값 255로 채울 수도 있다. 따라서 처리된 텍스트 이미지를 하나의 전체로 형성하여, 외관이 아름답지 않은 필기 내용 공동 영역이 나타나지 않는다.For example, after cutting and removing the written content from the input image, all pixels in a region corresponding to the written content are removed. That is, there are no blank pixels in the area corresponding to the handwritten content in the input image. When performing the binarization process on the intermediate output image, no processing is performed on areas where pixels are blank in the intermediate output image. Alternatively, when binarization is performed on the intermediate output image, pixels in the intermediate output image may fill a blank area with a gray scale value of 255. Accordingly, the processed text image is formed as a whole, so that an unappealing common area of written contents does not appear.

예를 들어, 중간 출력 이미지에 대해 이진화 처리를 수행한 후, 최종적으로 출력 이미지를 획득하여 사용자가 해당 출력 이미지를 종이 형태로 인쇄하기가 용이할 수 있다. 예를 들어, 입력 이미지가 폼이면, 출력 이미지를 종이 형태로 인쇄하여 다른 사용자가 기입하도록 제공할 수 있다.For example, after binarization is performed on an intermediate output image, an output image is finally obtained so that the user can easily print the corresponding output image in paper form. For example, if the input image is a form, the output image can be printed in paper form and provided to other users to fill in.

예를 들어, 이진화 처리의 방법은 임계값법일 수 있다. 임계값법은 이하 단계를 포함한다. 즉, 이진화 임계값을 설정하고, 중간 출력 이미지 중의 각 픽셀이의 픽셀값과 이진화 임계값을 비교한다. 중간 출력 이미지 중의 특정 픽셀의 픽셀값이 이진화 임계값 이상이면, 해당 픽셀의 픽셀값은 255 그레이스케일로 설정한다. 중간 출력 이미지 중의 특정 픽셀의 픽셀값이 이진화 임계값 미만이면, 해당 픽셀의 픽셀값을 0 그레이스케일로 설정한다. 이를 통해 중간 출력 이미지에 대한 이진화 처리를 수행할 수 있다.For example, the method of binarization processing may be a threshold value method. The threshold method includes the following steps. That is, a binarization threshold is set, and the pixel value of each pixel in the intermediate output image is compared with the binarization threshold. If the pixel value of a specific pixel in the intermediate output image is equal to or greater than the binarization threshold, the pixel value of the corresponding pixel is set to 255 grayscale. If the pixel value of a specific pixel in the intermediate output image is less than the binarization threshold, the pixel value of the corresponding pixel is set to 0 grayscale. Through this, it is possible to perform binarization processing on the intermediate output image.

예를 들어, 이진화 임계값의 선택 방법은 바이모달법, P 파라미터법, OTSU법, 최대 엔트로피법, 반복법 등을 포함한다.For example, methods for selecting a binarization threshold include a bimodal method, a P-parameter method, an OTSU method, a maximum entropy method, an iterative method, and the like.

예를 들어, 일부 실시예에 있어서, 중간 출력 이미지에 대해 이진화 처리를 수행하는 단계를 이하 단계를 포함한다. 즉, 중간 출력 이미지를 획득한다. 중간 출력 이미지에 대해 그레이스케일화 처리를 수행하여 중간 출력 이미지의 그레이스케일 이미지를 획득한다. 제1 임계값을 기반으로, 그레이스케일 이미지에 대해 이진화 처리를 수행하여 중간 출력 이미지의 이진화 이미지를 획득한다. 이진화 이미지를 가이드 이미지로 사용하여, 그레이스케일 이미지에 대해 가이드 필터링 처리를 수행하여 필터 이미지를 획득한다. 제2 임계값을 기반으로, 필터 이미지 중의 높은 값 픽셀 포인트를 결정하며, 높은 값 픽셀 포인트의 그레이스케일 값은 제2 임계값보다 크다. 소정 확장 계수를 기반으로 높은 값 픽셀 포인트의 그레이스케일 값에 대해 확장 처리를 수행하여 확장 이미지를 획득한다. 확장 이미지에 대해 선명화 처리를 수행하여 선명한 이미지를 획득한다. 선명한 이미지의 대비도를 조정하여 출력 이미지를 획득한다.For example, in some embodiments, performing a binarization process on an intermediate output image includes the following steps. That is, an intermediate output image is acquired. Grayscale processing is performed on the intermediate output image to obtain a grayscale image of the intermediate output image. Based on the first threshold, the grayscale image is binarized to obtain a binarized image of the intermediate output image. Using the binarized image as a guide image, guide filtering is performed on the grayscale image to obtain a filter image. High-value pixel points in the filter image are determined according to the second threshold, and the grayscale value of the high-value pixel points is greater than the second threshold. An enlarged image is obtained by performing an enlargement process on a gray scale value of a high-value pixel point based on a predetermined expansion coefficient. Sharpening processing is performed on the extended image to obtain a sharp image. The output image is acquired by adjusting the contrast of the clear image.

예를 들어, 그레이스케일화 처리의 방법은 성분법, 최대값법, 평균값법 및 가중평균법 등을 포함한다.For example, methods of gray-scaling processing include component method, maximum value method, average value method, weighted average method, and the like.

예를 들어, 소정 확장 계수는 1.2 내지 1.5이며, 예를 들어 1.3이다. 각 높은 값 픽셀 포인트의 그레이스케일 값에 모두 소정 확장 계수를 곱하여, 높은 값 픽셀 포인트의 그레이스케일 값에 대해 확장 처리를 수행한다. 따라서 흑백 대비가 더욱 명확한 확장 이미지를 획득한다.For example, the predetermined expansion factor is 1.2 to 1.5, for example 1.3. The grayscale value of each high-value pixel point is multiplied by a predetermined expansion coefficient to perform expansion processing on the grayscale value of the high-value pixel point. Accordingly, an extended image having a clearer black-and-white contrast is obtained.

예를 들어, 제2 임계값은 필터 이미지의 그레이스케일 값과 그레이스케일 값의 표준차의 합이다.For example, the second threshold is the sum of the grayscale value of the filter image and the standard difference between the grayscale values.

예를 들어, 확장 이미지에 대해 선명화 처리를 수행하여 선명한 이미지를 획득하는 단계를 하기 단계를 포함한다. 즉, 가우시안 필터를 채택해 확장 이미지에 대해 블러링 처리를 수행하여 블러링 이미지를 획득한다. 소정 혼합 계수를 기반으로 블러링 이미지와 확장이미지를 비례에 맞춰 혼합하여 선명한 이미지를 획득한다.For example, the step of obtaining a clear image by performing a sharpening process on the enlarged image includes the following steps. That is, a blurring image is acquired by performing a blurring process on the enlarged image by adopting a Gaussian filter. A clear image is obtained by mixing the blurring image and the extended image in proportion based on a predetermined mixing coefficient.

예를 들어,

Figure pct00001
가 확장 이미지의
Figure pct00002
지점에서의 픽셀 포인트의 그레이스케일 값이라고 가정한다.
Figure pct00003
는 블러링 이미지의
Figure pct00004
지점에서의 픽셀 포인트의 그레이스케일 값이다.
Figure pct00005
는 선명한 이미지의
Figure pct00006
지점에서의 픽셀 포인트의 그레이스케일 값이다.
Figure pct00007
은 확장 이미지의 소정 혼합 계수이다.
Figure pct00008
는 블러링 이미지의 소정 확장 계수이다.
Figure pct00009
,
Figure pct00010
,
Figure pct00011
는 하기 관계를 충족한다.for example,
Figure pct00001
of the extended image
Figure pct00002
It is assumed to be the grayscale value of the pixel point at the point.
Figure pct00003
of the blurring image
Figure pct00004
The grayscale value of the pixel point at the point.
Figure pct00005
of the clear image
Figure pct00006
The grayscale value of the pixel point at the point.
Figure pct00007
is a predetermined blending coefficient of the extended image.
Figure pct00008
is a predetermined scaling factor of the blurring image.
Figure pct00009
,
Figure pct00010
,
Figure pct00011
satisfies the following relationship.

Figure pct00012
Figure pct00012

예를 들어, 확장 이미지의 소정 혼합 계수는 1.5이고, 블러링 이미지의 소정 혼합 계수는 -0.5이다.For example, the predetermined blending coefficient of the enlarged image is 1.5, and the predetermined blending factor of the blurred image is -0.5.

예를 들어, 선명한 이미지의 대비도를 조정하는 단계는, 선명한 이미지의 그레이스케일 평균값을 기반으로 선명한 이미지의 각 픽셀 포인트의 그레이스케일 값을 조정하는 단계를 포함한다.For example, adjusting the contrast of the sharp image includes adjusting a gray scale value of each pixel point of the sharp image based on an average gray scale value of the sharp image.

예를 들어, 하기 공식을 통해 선명한 이미지의 각 픽셀 포인트의 그레이스케일 값을 조정할 수 있다.For example, the gray scale value of each pixel point of a sharp image can be adjusted through the following formula.

Figure pct00013
Figure pct00013

여기에서

Figure pct00014
은 개선된 이미지의
Figure pct00015
지점에서의 픽셀 포인트의 그레이스케일 값이다.
Figure pct00016
은 선명한 이미지의 그레이스케일 평균값이다.
Figure pct00017
는 선명한 이미지의
Figure pct00018
지점에서의 픽셀 포인트의 그레이스케일 값이고,
Figure pct00019
는 강도 값이다. 예를 들어, 강도 값은 0.1 내지 0.5일 수 있다. 예를 들어 강도 값은 0.2일 수 있다. 실제 응용에서 강도 값은 최종 도달해야 하는 흑백 개선 효과에 따라 선택할 수 있다.From here
Figure pct00014
of the improved image
Figure pct00015
The grayscale value of the pixel point at the point.
Figure pct00016
is the grayscale average value of the clear image.
Figure pct00017
of the clear image
Figure pct00018
is the grayscale value of the pixel point at the point,
Figure pct00019
is the strength value. For example, the intensity value may be between 0.1 and 0.5. For example, the intensity value may be 0.2. In actual application, the intensity value can be selected according to the black-and-white enhancement effect to be finally reached.

예를 들어, 도 1에 도시된 바와 같이, 단계 S14는 대체 픽셀을 획득하는 단계; 및 대체 픽셀을 이용해 필기 내용의 픽셀을 대체하여 입력 이미지로부터 필기 내용을 제거하여 출력 이미지를 획득하는 단계를 포함한다.For example, as shown in Fig. 1, step S14 includes obtaining a replacement pixel; and removing the handwritten content from the input image by replacing pixels of the written content using the replacement pixels to obtain an output image.

예를 들어, 대체 픽셀은 필기 픽셀 마스크 영역 외부의 인접 픽셀일 수 있다. 즉, 현재 대체해야 하는 필기 픽셀의 필기 픽셀 마스크 영역 외부에서 인접한 픽셀이다. 마찬가지로, OpenCV 기반의 inpaint 함수를 이용해 직접 픽셀 대체 처리를 수행할 수도 있다.For example, the replacement pixel may be an adjacent pixel outside the handwritten pixel mask area. That is, it is an adjacent pixel outside the handwritten pixel mask area of the handwritten pixel that is currently to be replaced. Similarly, pixel replacement processing can be performed directly using the OpenCV-based inpaint function.

예를 들어, 영역 식별의 방식을 채택해 필기 픽셀 대체 처리를 수행할 수도 있다. 먼저 영역 식별 모델을 통해 필기 영역을 획득한다. 대체 픽셀은 필기 영역에서 필기 내용의 픽셀을 제외한 어느 하나의 픽셀의 픽셀값일 수 있다. 또는 대체 픽셀은 필기 영역에서 필기 내용의 픽셀을 제외한 모든 픽셀의 픽셀값의 평균값(예를 들어, 기하학적 평균값)이다. 또는 대체 픽셀값은 예를 들어 255 그레이스케일 값과 같이 고정값일 수도 있다. 예를 들어 U-Net 모델 등 이미지 분할 모델을 이용해 직접 필기 영역 중의 필기 내용 픽셀을 제외한 어느 하나의 픽셀을 추출하여 대체 픽셀을 획득할 수 있다. 또는 예를 들어 U-Net 모델 등 이미지 분할 모델을 이용해 필기 영역 중 필기 내용의 픽셀을 제외한 모든 픽셀을 추출한 후, 모든 픽셀의 픽셀값을 기반으로 대체 픽셀을 획득할 수도 있음에 유의한다.For example, a handwritten pixel replacement process may be performed by adopting an area identification method. First, a writing region is acquired through a region identification model. The replacement pixel may be a pixel value of any one pixel excluding the pixel of the handwritten content in the writing area. Alternatively, the replacement pixel is an average value (for example, a geometric average value) of pixel values of all pixels in the writing area excluding pixels of the written content. Alternatively, the replacement pixel value may be a fixed value, such as a 255 grayscale value for example. For example, by using an image segmentation model such as a U-Net model, a replacement pixel may be obtained by directly extracting any one pixel except for a handwriting content pixel in the writing area. Alternatively, it should be noted that replacement pixels may be obtained based on the pixel values of all pixels after extracting all pixels except for the pixels of the handwritten content in the writing area using an image segmentation model such as the U-Net model.

예를 들어, 대체 픽셀을 이용해 필기 내용의 픽셀을 대체하여, 입력 이미지로부터 필기 내용을 제거함으로써 출력 이미지를 획득하는 단계는, 대체 픽셀을 이용해 필기 내용의 픽셀을 대체하여, 입력 이미지로부터 필기 내용을 제거하여 중간 출력 이미지를 획득하는 단계; 및 중간 출력 이미지에 대해 이진화 처리를 수행하여 출력 이미지를 획득하는 단계를 포함한다.For example, the step of obtaining an output image by removing the handwritten content from an input image by replacing pixels of the handwritten content using the replacement pixels may include replacing pixels of the handwritten content using the replacement pixels to remove the handwritten content from the input image. removing to obtain an intermediate output image; and obtaining an output image by performing a binarization process on the intermediate output image.

영역 식별 모델에 대해 영역 식별, 이진화 처리 등을 수행하는 설명은 상술한 관련 설명을 참조할 수 있다. 중복되는 부분은 여기에서 반복하여 설명하지 않기로 한다.For a description of performing region identification, binarization processing, etc. on the region identification model, reference may be made to the above related description. The overlapping parts will not be repeated here.

예를 들어, 도 2a에 도시된 원본 이미지에 대해 텍스트 이미지 중 필기 내용을 제거하는 처리를 수행한 후, 도 2b에 도시된 바와 같은 출력 이미지를 획득할 수 있다. 상기 출력 이미지는 이진화된 이미지이다. 도 2b에 도시된 바와 같이, 해당 출력 이미지에서 모든 필기 내용이 모두 제거되어, 사용자 기입 정보가 없는 빈 폼을 획득한다.For example, an output image as shown in FIG. 2B may be acquired after processing to remove handwritten content from a text image is performed on the original image shown in FIG. 2A. The output image is a binarized image. As shown in FIG. 2B , all handwritten contents are removed from the corresponding output image to obtain an empty form without user input information.

본 발명의 실시예에 있어서, 모델(예를 들어, 영역 식별 모델, 이미지 분할 모델 등 임의 모델)은 단순한 수학 모델이 아니라, 입력 데이터 수신, 데이터 처리 실행, 처리 결과 출력의 모듈일 수 있다. 상기 모듈은 소프트웨어 모듈, 하드웨어 모듈(예를 들어, 하드웨어 신경망) 또는 소프트웨어와 하드웨어를 결합한 방식으로 구현될 수 있다. 일부 실시예에 있어서, 영역 식별 모델 및/또는 이미지 분할 모델은 메모리에 저장된 코드와 프로그램을 포함한다. 프로세서는 상기 코드와 프로그램을 실행하여 전술한 바와 같은 영역 식별 모델 및/또는 이미지 분할 모델의 일부 기능 또는 모든 기능을 구현할 수 있다. 다른 일부 실시예에 있어서, 영역 식별 모델 및/또는 이미지 분할 모델은 하나의 회로판 또는 복수의 회로판의 조합을 포함하여 상술한 바와 같은 기능을 구현하는 데 사용될 수 있다. 일부 실시예에 있어서, 상기 하나의 회로판 또는 복수의 회로판의 조합은, (1) 하나 이상의 프로세서; (2) 프로세서와 연결된 하나 이상의 비일시적 컴퓨터 판독 가능 메모리; 및 (3) 프로세서에 의해 실행 가능한 메모리에 저장된 펌웨어를 포함할 수 있다.In an embodiment of the present invention, a model (eg, an arbitrary model such as a region identification model or an image segmentation model) may not be a simple mathematical model, but may be a module for receiving input data, executing data processing, and outputting a processing result. The module may be implemented as a software module, a hardware module (eg, a hardware neural network), or a combination of software and hardware. In some embodiments, the region identification model and/or image segmentation model includes code and programs stored in memory. The processor may implement some or all functions of the region identification model and/or image segmentation model as described above by executing the above codes and programs. In some other embodiments, a region identification model and/or an image segmentation model may be used to implement the functions described above by including one circuit board or a combination of multiple circuit boards. In some embodiments, the circuit board or combination of circuit boards may include (1) one or more processors; (2) one or more non-transitory computer readable memories associated with the processor; and (3) firmware stored in memory executable by the processor.

본 발명의 실시예에 있어서, 입력 이미지를 획득하기 전에, 텍스트 이미지에서 필기 내용을 제거하는 방법은 학습 단계를 더 포함하는 점에 유의한다. 학습 단계는 영역 식별 모델과 이미지 분할 모델을 학습시키는 과정을 포함한다. 영역 식별 모델과 이미지 분할 모델은 각각 학습시키거나, 동시에 영역 식별 모델과 이미지 분할 모델을 학습시킬 수 있음에 유의한다.Note that, in an embodiment of the present invention, before obtaining an input image, the method for removing handwritten content from a text image further includes a learning step. The learning step includes a process of training a region identification model and an image segmentation model. Note that the region identification model and the image segmentation model may be trained separately, or the region identification model and the image segmentation model may be trained simultaneously.

예를 들어, 텍스트 인쇄 영역(예를 들어, 표시된 텍스트 인쇄 영역의 수량이 적어도 하나임)과 필기 영역(예를 들어, 표시된 필기 영역의 수량이 적어도 하나)이 표시된 제1 샘플 이미지를 통해 학습할 영역 식별 모델에 대해 학습을 수행하여 영역 식별 모델을 획득할 수 있다. 예를 들어, 학습할 영역 식별 모델의 학습 과정은, 학습 단계에서 텍스트 인쇄 영역과 필기 영역이 표시된 여러 장의 제1 샘플 이미지를 이용해 학습할 영역 식별 모델을 학습시켜 영역 식별 모델을 획득하는 단계를 포함할 수 있다.For example, a region to be learned through a first sample image in which a text print area (eg, the number of displayed text print regions is at least one) and a writing area (eg, the number of displayed text print regions is at least one) are displayed. A region identification model may be acquired by performing learning on the identification model. For example, the learning process of the region identification model to be learned includes acquiring the region identification model by learning the region identification model to be learned using a plurality of first sample images in which text printing regions and writing regions are displayed in the learning step. can do.

예를 들어, 여러 장의 제1 샘플 이미지를 이용해 학습할 영역 식별 모델을 학습시키는 단계를 하기 단계를 포함한다. 즉, 여러 장의 제1 샘플 이미지로부터 현재 제1 샘플 이미지를 획득한다. 학습할 영역 식별 모델을 이용해 현재 제1 샘플 이미지를 처리하여, 학습 텍스트 인쇄 영역과 학습 필기 영역을 획득한다. 현재 제1 샘플 이미지 중 표시된 텍스트 인쇄 영역과 필기 영역 및 학습 텍스트 인쇄 영역과 학습 필기 영역을 기반으로, 제1 손실 함수를 통해 학습할 영역 식별 모델의 제1 손실값을 계산한다. 제1 손실값을 기반으로 학습할 영역 식별 모델의 파라미터를 수정한다. 제1 손실 함수가 제1 소정 조건을 충족하면, 학습이 완료된 영역 식별 모델을 획득한다. 제1 손실 함수가 제1 소정 조건을 충족하지 않으면, 계속해서 제1 샘플 이미지를 입력하여 상술한 학습 과정을 다시 실행한다.For example, the step of learning a region identification model to be learned using several first sample images includes the following steps. That is, a current first sample image is acquired from several first sample images. The current first sample image is processed using the region to be learned identification model to obtain a learning text print region and a learning writing region. A first loss value of a region identification model to be learned is calculated through a first loss function based on the displayed text printing area and writing area, the learning text printing area, and the learning writing area of the current first sample image. Based on the first loss value, a parameter of a region identification model to be learned is modified. When the first loss function satisfies the first predetermined condition, a region identification model that has been learned is acquired. If the first loss function does not satisfy the first predetermined condition, the above-described learning process is executed again by continuously inputting the first sample image.

예를 들어, 일 예시에 있어서, 상술한 제1 소정 조건은 일정 수량의 제1 샘플 이미지를 입력한 경우 제1 손실 함수의 손실 수렴(즉, 제1 손실값은 더 이상 현저하게 감소하지 않음)에 대응한다. 예를 들어, 다른 일 예시에 있어서, 상술한 제1 소정 조건은 학습 횟수 또는 학습 주기가 소정 수(예를 들어, 상기 소정 수는 수백만일 수 있음)에 도달하는 것이다.For example, in one example, the above-described first predetermined condition is loss convergence of the first loss function when a predetermined number of first sample images are input (ie, the first loss value does not significantly decrease any more). respond to For example, in another example, the above-described first predetermined condition is that the number of times of learning or the learning period reaches a predetermined number (eg, the predetermined number may be millions).

예를 들어, 필기 내용 픽셀이 표시된 제2 샘플 이미지를 통해 학습할 이미지 분할 모델을 학습시켜 이미지 분할 모델을 획득할 수 있다. 제2 샘플 이미지 중의 필기 내용 픽셀을 표시할 때, 제2 샘플 이미지를 확대하여 전체 필기 내용 픽셀을 정확하게 표시할 수 있다. 다양한 필기 특징(예를 들어, 픽셀 그레이스케일 특징, 글꼴 특징 등)을 기반으로 머신러닝을 수행하여 이미지 분할 모델을 구축한다.For example, an image segmentation model may be obtained by learning an image segmentation model to be learned through a second sample image displaying handwriting content pixels. When displaying the handwritten content pixels in the second sample image, the second sample image may be enlarged to accurately display all the handwritten content pixels. An image segmentation model is built by performing machine learning based on various handwriting features (eg, pixel grayscale features, font features, etc.).

예를 들어, 학습할 이미지 분할 모델의 학습 과정은, 학습 단계에서 필기 내용 픽셀이 표시된 여러 장의 제2 샘플 이미지를 이용해 학습할 이미지 분할 모델을 학습하여 이미지 분할 모델을 획득하는 단계를 포함할 수 있다.For example, the learning process of the image segmentation model to be trained may include acquiring the image segmentation model by learning the image segmentation model to be trained using a plurality of second sample images on which handwriting content pixels are displayed in the learning step. .

예를 들어, 여러 장의 제2 샘플 이미지를 이용해 학습할 영역 식별 모델을 학습하는 단계는 하기 단계를 포함한다. 즉, 여러 장의 제2 샘플 이미지로부터 현재 제2 샘플 이미지를 획득한다. 학습할 이미지 분할 모델을 이용해 현재 제2 샘플 이미지를 처리하여, 학습 필기 내용 픽셀을 획득한다. 현재 제2 샘플 이미지에 표시된 필기 내용 픽셀과 학습 필기 내용 픽셀을 기반으로, 제2 손실 함수를 통해 학습할 이미지 분할 모델의 제2 손실값을 계산한다. 제2 손실값을 기반으로 학습할 이미지 분할 모델의 파라미터를 수정한다. 제2 손실 함수가 제2 소정 조건을 충족하면, 학습이 완료된 이미지 분할 모델을 획득한다. 제2 손실 함수가 제2 소정 조건을 충족하지 않으면, 계속해서 제2 샘플 이미지를 입력하여 상술한 학습 과정을 반복 실행한다.For example, the step of learning a region identification model to be learned using several second sample images includes the following steps. That is, a current second sample image is obtained from several second sample images. The current second sample image is processed using the image segmentation model to be learned to obtain training handwritten content pixels. A second loss value of an image segmentation model to be trained is calculated through a second loss function based on the handwriting content pixels displayed in the current second sample image and the training handwriting content pixels. Parameters of an image segmentation model to be learned are modified based on the second loss value. When the second loss function satisfies the second predetermined condition, a trained image segmentation model is obtained. If the second loss function does not satisfy the second predetermined condition, the above-described learning process is repeatedly executed by continuously inputting the second sample image.

예를 들어, 일 예시에 있어서, 상술한 제2 소정 조건은 일정 수량의 제2 샘플 이미지를 입력한 경우 제2 손실 함수의 손실 수렴(즉, 제2 손실값은 더 이상 현저하게 감소하지 않음)에 대응한다. 예를 들어, 다른 일 예시에 있어서, 상술한 제2 소정 조건은 학습 횟수 또는 학습 주기가 소정 수(예를 들어, 상기 소정 수는 수백만일 수 있음)에 도달하는 것이다.For example, in one example, the above-described second predetermined condition is that the loss convergence of the second loss function when a certain number of second sample images are input (ie, the second loss value no longer significantly decreases). respond to For example, in another example, the above-described second predetermined condition is that the number of times of learning or the learning period reaches a predetermined number (eg, the predetermined number may be millions).

본 기술 분야의 당업자는 여러 장의 제1 학습 샘플 이미지와 여러 장의 제2 학습 샘플 이미지는 동일할 수도, 상이할 수도 있다.For those skilled in the art, several first training sample images and several second training sample images may be the same or different.

본 발명의 적어도 일 실시예는 텍스트 이미지에서 필기 내용을 제거하는 장치를 더 제공한다. 도 3은 본 발명의 적어도 일 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 장치의 블록도이다.At least one embodiment of the present invention further provides an apparatus for removing handwritten content from a text image. 3 is a block diagram of a device for removing writing content from a text image provided by at least one embodiment of the present invention.

도 3에 도시된 바와 같이, 상기 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 프로세서(302) 및 메모리(301)를 포함한다. 도 3에 도시된 텍스트 이미지에서 필기 내용을 제거하는 장치(300)의 어셈블리는 예시적인 것으로, 비제한적인 것이다. 실제 응용 수요에 따라 상기 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 다른 어셈블리를 더 구비할 수 있다. 예를 들어, 메모리(301)는 컴퓨터 판독 가능 명령을 비일시적으로 저장하는 데 사용된다. 프로세서(302)는 컴퓨터 판독 가능 명령을 실행하는 데 사용된다. 컴퓨터 판독 가능 명령이 프로세서(302)에 의해 실행되면 상술한 어느 하나의 실시예에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법이 실행된다.As shown in FIG. 3 , an apparatus 300 for removing handwritten contents from the text image includes a processor 302 and a memory 301 . The assembly of the device 300 for removing handwritten content from a text image shown in FIG. 3 is illustrative and non-limiting. According to actual application needs, the device 300 for removing handwritten content from the text image may further include other assemblies. For example, memory 301 is used to non-transitory store computer readable instructions. Processor 302 is used to execute computer readable instructions. When the computer readable instruction is executed by the processor 302, the method of removing handwritten content from a text image according to any one of the above-described embodiments is executed.

본 발명 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 본 발명 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 방법을 구현하는 데 사용될 수 있다. 상기 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 전자 디바이스 상에 구성될 수 있다. 상기 전자 디바이스는 개인 컴퓨터, 이동 단말 등일 수 있다. 상기 이동 단말은 휴대폰, 태블릿 PC 등 다양한 운영시스템을 구비한 하드웨어 디바이스일 수 있다.The apparatus 300 for removing handwritten contents from a text image provided by an embodiment of the present invention may be used to implement a method of removing written contents from a text image provided by an embodiment of the present invention. The device 300 for removing handwritten content from the text image may be configured on an electronic device. The electronic device may be a personal computer, a mobile terminal, and the like. The mobile terminal may be a hardware device having various operating systems such as a mobile phone and a tablet PC.

예를 들어, 도 3에 도시된 바와 같이, 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 이미지 획득 부재(303)를 더 포함할 수 있다. 이미지 획득 부재(303)는 텍스트 이미지를 획득하는 데 사용된다. 예를 들어 종이 텍스트의 이미지를 획득한다. 메모리(301)는 텍스트 이미지를 저장하는 데 더 사용될 수 있다. 프로세서(302)는 텍스트 이미지를 판독 및 처리하여 입력 이미지를 획득하는 데 더 사용된다. 텍스트 이미지는 상술한 텍스트 이미지에서 필기 내용을 제거하는 방법의 실시예에 설명된 원본 이미지일 수 있다.For example, as shown in FIG. 3 , the device 300 for removing handwritten content from a text image may further include an image acquisition member 303 . The image acquisition member 303 is used to acquire a text image. For example, an image of paper text is acquired. Memory 301 may further be used to store text images. The processor 302 is further used to obtain an input image by reading and processing the text image. The text image may be the original image described in the above-described method of removing handwritten content from the text image.

예를 들어, 이미지 획득 부재(303)는 상술한 텍스트 이미지에서 필기 내용을 제거하는 방법에 설명된 이미지 수집 장치이다. 예를 들어, 이미지 획득 부재(303)는 스마트폰의 카메라, 태블릿 PC의 카메라, 개인용 컴퓨터의 카메라, 디지털카메라의 렌즈, 네트워크 카메라 및 기다 이미지 수집에 사용 가능한 장치일 수 있다.For example, the image acquisition member 303 is the image collection device described in the above-described method for removing handwritten content from a text image. For example, the image acquisition member 303 may be a camera of a smart phone, a camera of a tablet PC, a camera of a personal computer, a lens of a digital camera, a network camera, and other devices usable for collecting images.

예를 들어, 도 3에 도시된 실시예에 있어서, 이미지 획득 부재(303), 메모리(301) 및 프로세서(302) 등은 물리적으로 동일한 전자 디바이스 내부에 집적될 수 있다. 이미지 획득 부재(303)는 전자 디바이스 상에 구성된 카메라일 수 있다. 메모리(301)와 프로세서(302)는 내부 버스를 거쳐 이미지 획득 부재(303)로부터 전송되는 이미지를 수신한다. 또 예를 들면, 이미지 획득 부재(303)와 메모리(301)/프로세서(302)는 물리적 위치 상에서 분리 구성될 수도 있다. 메모리(301)와 프로세서(302)는 제1 사용자의 전자 디바이스(예를 들어, 제1 사용자의 컴퓨터, 휴대폰 등)에 집적될 수 있다. 이미지 획득 부재(303)는 제2 사용자(제1 사용자와 제2 사용자는 상이함)의 전자 디바이스에 집적될 수 있다. 제1 사용자의 전자 디바이스와 제2 사용자의 전자 디바이스는 물리적 위치 상에서 분리 구성될 수 있다. 또한 제1 사용자의 전자 디바이스와 제2 사용자의 전자 디바이스 사이는 유선 또는 무선 방식에 의해 통신을 수행할 수 있다. 다시 말해, 제2 사용자의 전자 디바이스 상의 이미지 획득 부재(303)에서 원본 이미지를 수집한 후, 제2 사용자의 전자 디바이스는 유선 또는 무선 방식으로 해당 원본 이미지를 제1 사용자의 전자 디바이스에 전송할 수 있다. 제1 사용자의 전자 디바이스는 해당 원본 이미지를 수신하여 해당 원본 이미지에 대한 후속 처리를 수행한다. 예를 들어, 메모리(301)와 프로세서(302)는 클라우드 서버에 집적될 수도 있다. 클라우드 서버는 원본 이미지를 수신하고 원본 이미지를 처리한다.For example, in the embodiment shown in FIG. 3 , the image acquiring member 303 , the memory 301 , the processor 302 , and the like may be physically integrated into the same electronic device. The image acquisition member 303 may be a camera configured on an electronic device. The memory 301 and the processor 302 receive an image transmitted from the image acquisition member 303 via an internal bus. Also, for example, the image acquisition member 303 and the memory 301/processor 302 may be configured separately on a physical location. The memory 301 and the processor 302 may be integrated in the first user's electronic device (eg, the first user's computer, mobile phone, etc.). The image acquisition member 303 may be integrated into an electronic device of a second user (the first user and the second user are different). The electronic device of the first user and the electronic device of the second user may be configured separately on a physical location. Also, communication may be performed between the electronic device of the first user and the electronic device of the second user by wired or wireless methods. In other words, after the image acquisition member 303 on the electronic device of the second user collects the original image, the electronic device of the second user may transmit the original image to the electronic device of the first user in a wired or wireless manner. . The electronic device of the first user receives the original image and performs subsequent processing on the original image. For example, memory 301 and processor 302 may be integrated in a cloud server. The cloud server receives the original image and processes the original image.

예를 들어, 텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 출력 장치를 더 포함할 수 있다. 출력 장치는 상기 출력 이미지를 출력하는 데 사용된다. 예를 들어, 출력 장치는 디스플레이(예를 들어, 유기 발광 다이오드 디스플레이, 액정 디스플레이), 영상 장치 등을 포함할 수 있다. 디스플레이와 영상 장치는 출력 이미지를 표시하는 데 사용될 수 있다. 출력 장치는 프린터를 포함할 수 있다. 프린터는 출력 이미지를 인쇄하는 데 사용된다.For example, the device 300 for removing handwritten content from a text image may further include an output device. An output device is used to output the output image. For example, the output device may include a display (eg, an organic light emitting diode display, a liquid crystal display), an imaging device, and the like. Displays and imaging devices may be used to display output images. An output device may include a printer. A printer is used to print the output image.

예를 들어, 프로세서(302)와 메모리(301) 등 어셈블리 사이는 네트워크 연결에 의해 통신이 수행될 수 있다. 네트워크는 무선 네트워크, 유선 네트워크, 및/또는 무선 네트워크와 유선 네트워크의 임의 조합을 포함할 수 있다. 네트워크는 근거리 통신망, 인터넷, 통신 네트워크, 인터넷 및/또는 통신 네트워크 기반의 사물 인터넷(Internet of Things), 및/또는 상기 네트워크의 임의의 조합 등을 포함할 수 있다. 유선 네트워크는 예를 들어 트위스트 페어 선(twisted pair line), 동축 케이블 또는 광섬유 전송 등 방식을 채택해 통신을 수행할 수 있다. 무선 네트워크는 예를 들어 3G/4G/5G 이동 통신망, 블루투스, 지그비(Zigbee) 또는 와이파이(WiFi) 등 통신 방식을 채택할 수 있다. 본 발명은 네트워크의 유형과 기능을 여기에서 한정하지 않는다.For example, communication may be performed between assemblies such as the processor 302 and the memory 301 through a network connection. The network may include a wireless network, a wired network, and/or any combination of wireless and wired networks. The network may include a local area network, the Internet, a communication network, the Internet of Things based on the Internet and/or a communication network, and/or any combination of the above networks. A wired network may perform communication by employing, for example, twisted pair line, coaxial cable, or optical fiber transmission. The wireless network may adopt a communication method such as a 3G/4G/5G mobile communication network, Bluetooth, Zigbee, or WiFi, for example. The present invention is not limited to the type and function of the network here.

예를 들어, 프로세서(302)는 텍스트 이미지에서 필기 내용을 제거하는 장치(300) 중의 기타 어셈블리를 제어하여 원하는 기능을 실행할 수 있다. 프로세서(302)는 중앙 처리 장치(CPU), 텐서 프로세서(TPU) 또는 그래픽 프로세서(GPU) 등 데이터 처리 능력 및/또는 프로그램 실행 능력이 있는 소자일 수 있다. 중앙 처리 장치(CPU)는 X86 또는 ARM 아키텍처 등일 수 있다. GPU는 독립적으로 직접 메인보드 상에 집적되거나 메인보드의 노스 브릿지(north bridge) 칩에 내장될 수 있다. GPU는 중앙 처리 장치(CPU) 상에 내장될 수도 있다.For example, the processor 302 may control other assemblies of the device 300 that remove handwriting from a text image to execute a desired function. The processor 302 may be a device having data processing capability and/or program execution capability, such as a central processing unit (CPU), a tensor processor (TPU), or a graphics processor (GPU). The central processing unit (CPU) may be of X86 or ARM architecture or the like. The GPU can be independently integrated directly on the motherboard or embedded in a chip in the north bridge of the motherboard. A GPU may be embedded on a central processing unit (CPU).

예를 들어, 메모리(301)는 하나 이상의 컴퓨터 프로그램 제품의 임의 조합을 포함할 수 있다. 컴퓨터 프로그램 제품은 다양한 형태의 컴퓨터 판독 가능 저장 매체를 포함할 수 있으며, 예를 들어 휘발성 메모리 및/또는 비휘발성 메모리가 있다. 휘발성 메모리는 예를 들어 랜덤 액세스 메모리(RAM) 및/또는 캐시 메모리(cache)를 포함할 수 있다. 비휘발성 메모리는 예를 들어 읽기 전용 메모리(ROM), 하드 디스크, 삭제 및 프로그래밍 가능한 읽기 전용 메모리(EPROM), 휴대용 콤팩트 디스크 읽기 전용 메모리(CD-ROM), USB 메모리, 플래시 메모리 등을 포함할 수 있다. 상기 컴퓨터 판독 가능 저장 매체 상에는 하나 이상의 컴퓨터 판독 가능 명령이 저장될 수 있다. 프로세서(302)는 상기 컴퓨터 판독 가능 명령을 실행하여, 텍스트 이미지에서 필기 내용을 제거하는 장치(300)의 다양한 기능을 구현할 수 있다. 저장 매체에는 다양한 응용프로그램과 다양한 데이터 등이 더 저장될 수 있다.For example, memory 301 may include any combination of one or more computer program products. A computer program product may include various forms of computer readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and/or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable and programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. have. One or more computer readable instructions may be stored on the computer readable storage medium. The processor 302 may implement various functions of the device 300 for removing handwritten contents from a text image by executing the computer readable instructions. The storage medium may further store various application programs and various data.

텍스트 이미지에서 필기 내용을 제거하는 장치(300)는 텍스트 이미지에서 필기 내용을 제거하는 방법을 실행하는 과정에 관한 상세한 설명을 텍스트 이미지에서 필기 내용을 제거하는 방법 실시예의 관련 설명을 참조할 수 있다. 중복되는 부분은 여기에서 반복하여 설명하지 않기로 한다.The apparatus 300 for removing handwritten content from a text image may refer to the relevant description of the embodiment of the method for removing handwritten content from a text image for a detailed description of a process of executing a method of removing written content from a text image. The overlapping parts will not be repeated here.

본 발명의 적어도 일 실시예는 저장 매체를 더 제공한다. 도 4는 본 발명의 적어도 일 실시예에서 제공하는 저장 매체의 개략도이다. 예를 들어, 도 4에 도시된 바와 같이, 저장 매체(500) 상에 하나 이상의 컴퓨터 판독 가능 명령(501)을 비일시적으로 저장할 수 있다. 예를 들어, 상기 컴퓨터 판독 가능 명령(501)이 컴퓨터에 의해 실행되면 상술한 텍스트 이미지에서 필기 내용을 제거하는 방법 중 하나 이상의 단계를 실행할 수 있다.At least one embodiment of the invention further provides a storage medium. 4 is a schematic diagram of a storage medium provided by at least one embodiment of the present invention. For example, as shown in FIG. 4 , one or more computer readable instructions 501 may be non-temporarily stored on a storage medium 500 . For example, when the computer readable instructions 501 are executed by a computer, one or more steps of the above-described method of removing handwritten contents from a text image may be executed.

예를 들어, 상기 저장 매체(500)는 상술한 텍스트 이미지에서 필기 내용을 제거하는 장치(300)에 적용될 수 있다. 예를 들어, 여기에는 텍스트 이미지에서 필기 내용을 제거하는 장치(300) 중의 메모리(301)가 포함될 수 있다.For example, the storage medium 500 may be applied to the device 300 for removing handwritten contents from the text image. For example, this may include a memory 301 in the device 300 that removes handwriting from a text image.

예를 들어, 저장 매체(500)에 관한 설명은 텍스트 이미지에서 필기 내용을 제거하는 장치(300)의 실시예 중 메모리에 대한 설명을 참조할 수 있다. 중복되는 부분은 여기에서 반복하여 설명하지 않기로 한다.For example, a description of the storage medium 500 may refer to a description of a memory among embodiments of the device 300 for removing handwritten content from a text image. The overlapping parts will not be repeated here.

도 5는 본 발명의 적어도 일 실시예에 따른 하드웨어 환경의 개략도이다. 본 발명의 실시예에서 제공하는 텍스트 이미지에서 필기 내용을 제거하는 장치는 인터넷 시스템에 적용될 수 있다.5 is a schematic diagram of a hardware environment according to at least one embodiment of the present invention. A device for removing handwritten content from a text image provided by an embodiment of the present invention may be applied to an Internet system.

도 5에서 제공하는 컴퓨터 시스템을 이용하여 본 발명에 언급된 텍스트 이미지에서 필기 내용을 제거하는 장치를 구현할 수 있다. 이러한 유형의 컴퓨터 시스템에는 개인용 컴퓨터, 노트북 컴퓨터, 태블릿 PC, 휴대폰 및 임의 스마트 디바이스가 포함된다. 본 실시예에서 특정 시스템은 기능 블록도를 이용하여 사용자 인터페이스를 포함한 하드웨어 플랫폼을 해석하였다. 이러한 컴퓨터 시스템은 범용 목적의 컴퓨터 디바이스, 또는 특수 목적의 컴퓨터 디바이스를 포함할 수 있다. 2가지 컴퓨터 디바이스는 모두 본 실시예 중의 텍스트 이미지에서 필기 내용을 제거하는 장치를 구현하는 데 사용될 수 있다. 컴퓨터 시스템은 현재 설명된 텍스트 이미지에서 필기 내용을 제거하는 방법을 구현하는 데 필요한 정보의 임의 어셈블리를 실시할 수 있다. 예를 들어, 컴퓨터 시스템은 컴퓨터 디바이스에 의해 그 하드웨어 디바이스, 소프트웨어 프로그램, 펌웨어 및 기타 조합에 의해 구현될 수 있다. 용이성 관점에서, 도 5는 컴퓨터 디바이스만 제도하였다. 그러나 본 실시예에 설명된 텍스트 이미지에서 필기 내용을 제거하는 방법을 구현하는 데 필요한 정보의 관련 컴퓨터 기능은 분산 방식으로, 한 세트의 유사한 플랫폼에 의해 실시된다. 이는 컴퓨터 시스템의 처리 부하를 분산시킨다.A device for removing writing contents from a text image mentioned in the present invention can be implemented using the computer system provided in FIG. 5 . Computer systems of this type include personal computers, notebook computers, tablet PCs, mobile phones and any smart device. In this embodiment, a specific system analyzes a hardware platform including a user interface using a functional block diagram. Such a computer system may include a general purpose computer device or a special purpose computer device. Both computer devices can be used to implement the device for removing handwritten content from text images in this embodiment. A computer system may implement any assembly of the information necessary to implement the presently described method of removing handwritten content from an image of text. For example, a computer system may be implemented by a computer device by its hardware device, software program, firmware, and other combinations. For ease of use, Figure 5 only depicts a computer device. However, the related computer functions of the information required to implement the method for removing handwritten content from text images described in this embodiment are implemented by a set of similar platforms in a distributed manner. This distributes the processing load of the computer system.

도 5에 도시된 바와 같이, 컴퓨터 시스템은 통신 포트(250)를 포함할 수 있다. 이와 연결된 것은 데이터 통신을 구현하는 네트워크이다. 예를 들어, 통신 포트(250)는 상기에서 설명한 이미지 획득 부재(403)와 통신을 수행할 수 있다. 컴퓨터 시스템은 프로그램 명령을 실행하기 위한 프로세서 세트(220)(즉, 상기에서 설명한 프로세서)를 더 포함할 수 있다. 프로세서 세트(220)는 적어도 하나의 프로세서(예를 들어, CPU)로 구성될 수 있다. 컴퓨터 시스템은 하나의 내부 통신 버스(210)를 포함할 수 있다. 컴퓨터 시스템은 상이한 형식의 프로그램 저장 유닛 및 데이터 저장 유닛(즉, 상기에서 설명한 메모리 또는 저장 매체)을 포함할 수 있다. 예를 들어, 하드 디스크(270), 읽기 전용 메모리(ROM)(230), 랜덤 액세스 메모리(RAM)(240)는 컴퓨터 처리 및/또는 통신에 사용되는 다양한 데이터 파일, 및 프로세서 세트(220)에 의해 실행 가능한 프로그램 명령을 저장하는 데 사용될 수 있다. 컴퓨터 시스템은 하나의 입력/출력 어셈블리(260)를 포함할 수 있다. 입력/출력 어셈블리(260)는 컴퓨터 시스템과 다른 어셈블리(예를 들어, 사용자 인터페이스(280)이며, 사용자 인터페이스(280)는 상기에서 설명한 디스플레이일 수 있음) 사이의 입력/출력 데이터 흐름을 지원할 수 있다. 컴퓨터 시스템은 통신 포트(250)를 통해 정보 및 데이터를 송수신할 수도 있다.As shown in FIG. 5 , the computer system may include a communications port 250 . Connected to this is a network that implements data communication. For example, the communication port 250 may communicate with the image acquisition member 403 described above. The computer system may further include a processor set 220 (ie, the processor described above) for executing program instructions. The processor set 220 may include at least one processor (eg, CPU). The computer system may include one internal communication bus 210 . A computer system may include program storage units and data storage units (ie, the memory or storage media described above) in different formats. For example, hard disk 270 , read-only memory (ROM) 230 , random access memory (RAM) 240 may be used in various data files and processor set 220 used for computer processing and/or communication. It can be used to store program instructions executable by The computer system may include one input/output assembly 260 . Input/output assembly 260 may support input/output data flow between a computer system and another assembly (eg, user interface 280, which may be a display as described above). . The computer system may send and receive information and data through communication port 250 .

일부 실시예에 있어서, 상술한 컴퓨터 시스템은 인터넷 통신 시스템 중의 서버를 구성하는 데 사용될 수 있다. 인터넷 통신 시스템의 서버는 서버 하드웨어 디바이스, 또는 서버 그룹일 수 있다. 서버 그룹 내의 각 서버는 유선 또는 무선 네트워크에 의해 연결될 수 있다. 서버 그룹은 데이터 센터와 같이 집중형일 수 있다. 서버 그룹은 분산형 시스템과 같이 분산형일 수도 있다.In some embodiments, the computer system described above may be used to configure a server in an Internet communication system. A server of an Internet communication system may be a server hardware device or a group of servers. Each server in the server group can be connected by a wired or wireless network. Server groups can be centralized, such as in a data center. Server groups can also be distributed, such as distributed systems.

본 발명의 블록도 및/또는 흐름도 중의 각 블록, 및 블록도 및/또는 흐름도 중의 블록의 조합은 규정된 기능 또는 동작을 실행하는 전용의 하드웨어 기반 시스템으로 구현할 수 있다. 또는 전용 하드웨어와 컴퓨터 프로그램 명령의 조합으로 구현할 수 있음에 유의한다. 본 기술 분야의 당업자에게 있어서, 하드웨어 방식으로 구현하는 것, 소프트웨어 방식으로 구현하는 것 및 소프트웨어와 하드웨어 조합 방식으로 구현하는 것이 모두 동등하다는 것은 공지된 사실이다.Each block in the block diagram and/or flow diagram, and the combination of blocks in the block diagram and/or flow diagram of the present invention, can be implemented as a dedicated hardware-based system that executes specified functions or operations. Alternatively, it should be noted that it may be implemented as a combination of dedicated hardware and computer program instructions. It is known to those skilled in the art that hardware implementation, software implementation, and software/hardware combination are all equivalent.

본 발명은 하기 몇 가지를 더 설명할 필요가 있다.The present invention needs to further explain the following several things.

(1) 본 발명 실시예의 첨부 도면은 본 발명 실시예과 관련된 구조에 불과하며, 다른 구조는 통상적인 설계를 참조할 수 있다.(1) The accompanying drawings of the embodiments of the present invention are merely structures related to the embodiments of the present invention, and other structures may refer to conventional designs.

(2) 명확성을 위해, 본 발명 실시예를 설명하기 위한 첨부 도면에서 층 또는 구조의 두께와 크기는 확대되었다. 층, 막, 영역 또는 기판과 같은 요소가 다른 요소의 "위"또는 "아래"에 위치할 때, 해당 요소는 다른 요소의 "위" 또는 "아래"에 "직접" 위치하거나 중간 요소가 존재할 수 있음을 이해할 수 있다.(2) For clarity, the thickness and size of layers or structures are enlarged in the accompanying drawings for explaining the embodiments of the present invention. When an element such as a layer, film, region or substrate is positioned “above” or “below” another element, that element may be positioned “directly” “above” or “below” the other element, or intervening elements may exist. can understand that there is

(3) 충돌이 없는 한, 본 발명의 실시예 및 실시예 중의 특징은 서로 조합되어 새로운 실시예를 얻을 수 있다.(3) As long as there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.

상기 내용은 본 발명의 구체적인 실시방식에 불과하며, 본 발명의 보호 범위는 이에 한정되지 않는다. 본 발명의 보호 범위는 청구범위의 보호 범위를 기준으로 해야 한다.The above is merely a specific implementation mode of the present invention, and the scope of protection of the present invention is not limited thereto. The protection scope of the present invention should be based on the protection scope of the claims.

Claims (13)

텍스트 이미지에서 필기 내용을 제거하는 방법에 있어서,
처리할 텍스트 페이지의 입력 이미지를 획득하는 단계 - 상기 입력 이미지는 필기 영역을 포함하고, 상기 필기 영역은 필기 내용을 포함함 -;
이미지 분할 모델을 이용해 상기 입력 이미지를 식별하여, 상기 필기 내용의 초기 필기 픽셀을 획득하는 단계;
상기 초기 필기 픽셀에 대해 블러링 처리를 수행하여, 필기 픽셀 마스크 영역을 획득하는 단계;
상기 필기 픽셀 마스크 영역을 기반으로 상기 필기 영역 중의 상기 필기 내용을 결정하는 단계; 및
상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
A method for removing handwriting from a text image,
acquiring an input image of a text page to be processed, wherein the input image includes a writing area, and the writing area includes writing content;
identifying the input image using an image segmentation model to obtain an initial handwritten pixel of the handwritten content;
performing a blurring process on the initial handwritten pixel to obtain a handwritten pixel mask area;
determining the handwritten content in the writing area based on the writing pixel mask area; and
and removing the handwritten content from the input image to obtain an output image.
제1항에 있어서,
상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는,
상기 초기 필기 픽셀의 픽셀값 및 상기 필기 픽셀 마스크 영역의 위치를 기반으로, 상기 입력 이미지에서 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀을 결정하고, 상기 입력 이미지 중의 상기 필기 픽셀 마스크 영역 내용을 제거하여, 중간 출력 이미지를 획득하는 단계; 및
상기 중간 출력 이미지에 대해 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 복원을 수행하여, 상기 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
Obtaining an output image by removing the handwritten content from the input image,
determine non-written pixels in the handwritten pixel mask area in the input image based on the pixel value of the initial handwritten pixel and the position of the handwritten pixel mask area, and remove the content of the handwritten pixel mask area in the input image; obtaining an intermediate output image; and
and performing restoration of non-written pixels in the handwritten pixel mask area on the intermediate output image to obtain the output image.
제1항에 있어서,
상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는,
상기 초기 필기 픽셀의 픽셀값 및 상기 필기 픽셀 마스크 영역의 위치를 기반으로, 상기 입력 이미지에서 상기 필기 픽셀 마스크 영역 중의 비필기 픽셀을 결정하는 단계; 및
상기 필기 픽셀 마스크 영역 중의 비필기 픽셀 및 상기 필기 픽셀 마스크 영역을 기반으로 상기 입력 이미지 중의 상기 필기 내용을 제거하여, 상기 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
Obtaining an output image by removing the handwritten content from the input image,
determining a non-writing pixel in the handwritten pixel mask area in the input image based on the pixel value of the initial handwritten pixel and the position of the handwritten pixel mask area; and
and obtaining the output image by removing the handwritten content in the input image based on the non-written pixels in the handwritten pixel mask area and the handwritten pixel mask area. How to.
제1항에 있어서,
상기 입력 이미지에서 상기 필기 내용을 제거하여 출력 이미지를 획득하는 단계는,
상기 입력 이미지로부터 상기 필기 내용을 절단 제거하여 중간 출력 이미지를 획득하는 단계; 및
상기 중간 출력 이미지에 대해 이진화 처리를 수행하여, 상기 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
Obtaining an output image by removing the handwritten content from the input image,
obtaining an intermediate output image by cutting and removing the handwritten content from the input image; and
and obtaining the output image by performing binarization on the intermediate output image.
제1항에 있어서,
상기 입력 이미지에서 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계는,
대체 픽셀을 획득하는 단계; 및
상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
Obtaining the output image by removing the handwritten content from the input image,
obtaining replacement pixels; and
and removing the handwritten content from the input image by replacing pixels of the handwritten content using the replacement pixels to obtain the output image.
제5항에 있어서,
상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 상기 출력 이미지를 획득하는 단계는,
상기 대체 픽셀을 이용해 상기 필기 내용의 픽셀을 대체하여, 상기 입력 이미지로부터 상기 필기 내용을 제거하여 중간 출력 이미지를 획득하는 단계; 및
상기 중간 출력 이미지에 대해 이진화 처리를 수행하여, 상기 출력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 5,
Obtaining the output image by removing the handwritten content from the input image by using the replacement pixel to replace the pixel of the handwritten content,
obtaining an intermediate output image by removing the handwritten content from the input image by replacing pixels of the handwritten content using the replacement pixels; and
and obtaining the output image by performing binarization on the intermediate output image.
제5항에 있어서,
상기 대체 픽셀은 상기 필기 내용의 픽셀에 따라 픽셀 인접 영역 기반으로 계산한 이미지 복원 알고리즘을 통해 획득하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 5,
The method of claim 1 , wherein the replacement pixels are obtained through an image restoration algorithm calculated based on pixel adjacent areas according to pixels of the handwritten content.
제5항에 있어서,
대체 픽셀을 획득하는 상기 단계는 영역 식별 모델을 이용해 상기 입력 이미지를 식별하여 상기 필기 영역을 획득하는 단계를 더 포함하고, 상기 대체 픽셀은 상기 필기 영역에서 상기 필기 내용의 픽셀을 제외한 어느 하나의 픽셀이거나; 또는
상기 대체 픽셀은 상기 필기 영역에서 상기 필기 내용의 픽셀을 제외한 모든 픽셀의 픽셀값의 평균값인 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 5,
The step of acquiring the replacement pixel further includes acquiring the writing area by identifying the input image using a region identification model, wherein the replacement pixel is any pixel in the writing area excluding the pixel of the handwritten content. is; or
Wherein the replacement pixel is an average value of pixel values of all pixels in the writing area except for the pixel of the writing content.
제1항 내지 제8항 중 어느 한 항에 있어서,
상기 처리할 텍스트 페이지의 입력 이미지를 획득하는 단계는,
상기 처리할 텍스트 페이지의 원본 이미지를 획득하는 단계 - 상기 원본 이미지는 처리할 텍스트 영역을 포함함 - ;
상기 원본 이미지에 대해 에지 검출을 수행하여, 상기 원본 이미지 중의 상기 처리할 텍스트 영역을 결정하는 단계; 및
상기 처리할 텍스트 영역에 대해 정규화 처리를 수행하여 상기 입력 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to any one of claims 1 to 8,
The step of acquiring an input image of the text page to be processed,
obtaining an original image of the text page to be processed, wherein the original image includes a text area to be processed;
determining the text area to be processed in the original image by performing edge detection on the original image; and
and obtaining the input image by performing normalization processing on the text area to be processed.
제1항에 있어서,
상기 이미지 분할 모델은 상기 입력 이미지를 분할하는 사전 학습된U-Net 모델인 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
Wherein the image segmentation model is a pretrained U-Net model for segmenting the input image.
제1항에 있어서,
가우시안 필터 함수를 통해 상기 초기 필기 픽셀에 대해 블러링 처리를 수행하고, 상기 초기 필기 픽셀의 영역을 확대하여, 상기 필기 픽셀 마스크 영역을 획득하는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 방법.
According to claim 1,
The method of claim 1 , further comprising performing a blurring process on the initial handwritten pixel through a Gaussian filter function and enlarging an area of the initial handwritten pixel to obtain the handwritten pixel mask area.
텍스트 이미지에서 필기 내용을 제거하는 장치에 있어서,
컴퓨터 판독 가능 명령을 비일시적으로 저장하는 데 사용되는 메모리; 및
상기 컴퓨터 판독 가능 명령을 실행하는 데 사용되는 프로세서를 포함하고, 상기 컴퓨터 판독 가능 명령이 상기 프로세서에 의해 실행되면 제1항 내지 제11항 중 어느 한 항에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법이 실행되는 것을 특징으로 하는 텍스트 이미지에서 필기 내용을 제거하는 장치.
An apparatus for removing handwriting from a text image, comprising:
memory used for non-transitory storage of computer readable instructions; and
A method comprising a processor used to execute the computer readable instructions, wherein when the computer readable instructions are executed by the processor, removing handwritten contents from a text image according to any one of claims 1 to 11. A device for removing handwriting from a text image, characterized in that the execution.
컴퓨터 판독 가능 명령을 비일시적으로 저장하는 저장 매체에 있어서,
상기 컴퓨터 판독 가능 명령이 컴퓨터에 의해 실행되면 제1항 내지 제11항 중 어느 한 항에 따른 텍스트 이미지에서 필기 내용을 제거하는 방법이 실행될 수 있는 저장 매체.
A storage medium for non-temporarily storing computer readable instructions,
A storage medium capable of executing the method of removing writing contents from a text image according to any one of claims 1 to 11 when the computer readable command is executed by a computer.
KR1020227037762A 2020-04-10 2021-02-09 Method, apparatus and storage media for removing handwriting from text image KR20220160660A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN202010278143.4 2020-04-10
CN202010278143.4A CN111488881A (en) 2020-04-10 2020-04-10 Method, device and storage medium for removing handwritten content in text image
PCT/CN2021/076250 WO2021203832A1 (en) 2020-04-10 2021-02-09 Method and device for removing handwritten content from text image, and storage medium

Publications (1)

Publication Number Publication Date
KR20220160660A true KR20220160660A (en) 2022-12-06

Family

ID=71794780

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020227037762A KR20220160660A (en) 2020-04-10 2021-02-09 Method, apparatus and storage media for removing handwriting from text image

Country Status (5)

Country Link
US (1) US20230222631A1 (en)
JP (1) JP2023523152A (en)
KR (1) KR20220160660A (en)
CN (1) CN111488881A (en)
WO (1) WO2021203832A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111275139B (en) * 2020-01-21 2024-02-23 杭州大拿科技股份有限公司 Handwritten content removal method, handwritten content removal device, and storage medium
CN111488881A (en) * 2020-04-10 2020-08-04 杭州睿琪软件有限公司 Method, device and storage medium for removing handwritten content in text image
CN112070708B (en) * 2020-08-21 2024-03-08 杭州睿琪软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
CN112150394B (en) * 2020-10-12 2024-02-20 杭州睿琪软件有限公司 Image processing method and device, electronic equipment and storage medium
CN112150365B (en) * 2020-10-15 2023-02-21 江西威力固智能设备有限公司 Expansion and shrinkage processing method of jet printing image and jet printing equipment
CN113781356A (en) * 2021-09-18 2021-12-10 北京世纪好未来教育科技有限公司 Training method of image denoising model, image denoising method, device and equipment
CN114283156B (en) * 2021-12-02 2024-03-05 珠海移科智能科技有限公司 Method and device for removing document image color and handwriting

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080055119A (en) * 2006-12-14 2008-06-19 삼성전자주식회사 Image forming apparatus and control method thereof
CN102521516A (en) * 2011-12-20 2012-06-27 北京商纳科技有限公司 Method and system for automatically creating error homework textbooks
US9525802B2 (en) * 2013-07-24 2016-12-20 Georgetown University Enhancing the legibility of images using monochromatic light sources
CN105898322A (en) * 2015-07-24 2016-08-24 乐视云计算有限公司 Video watermark removing method and device
CN109254711A (en) * 2018-09-29 2019-01-22 联想(北京)有限公司 Information processing method and electronic equipment
CN111275139B (en) * 2020-01-21 2024-02-23 杭州大拿科技股份有限公司 Handwritten content removal method, handwritten content removal device, and storage medium
CN111488881A (en) * 2020-04-10 2020-08-04 杭州睿琪软件有限公司 Method, device and storage medium for removing handwritten content in text image

Also Published As

Publication number Publication date
US20230222631A1 (en) 2023-07-13
WO2021203832A1 (en) 2021-10-14
JP2023523152A (en) 2023-06-02
CN111488881A (en) 2020-08-04

Similar Documents

Publication Publication Date Title
KR20220160660A (en) Method, apparatus and storage media for removing handwriting from text image
CN111275139B (en) Handwritten content removal method, handwritten content removal device, and storage medium
US20190304066A1 (en) Synthesis method of chinese printed character images and device thereof
JP5302258B2 (en) Method for automatic alignment of document objects
US8634644B2 (en) System and method for identifying pictures in documents
US9710704B2 (en) Method and apparatus for finding differences in documents
US20210342571A1 (en) Automated signature extraction and verification
WO2021233266A1 (en) Edge detection method and apparatus, and electronic device and storage medium
US20090016605A1 (en) System and method for creating an editable template from a document image
EP3940589B1 (en) Layout analysis method, electronic device and computer program product
US9262679B2 (en) System and method for identification and separation of form and feature elements from handwritten and other user supplied elements
CN114283156B (en) Method and device for removing document image color and handwriting
KR20170101125A (en) Information processing apparatus, information processing method, and storage medium
WO2022002002A1 (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN112070708B (en) Image processing method, image processing apparatus, electronic device, and storage medium
Nachappa et al. Adaptive dewarping of severely warped camera-captured document images based on document map generation
US11887393B2 (en) End-to-end system for extracting tabular data present in electronic documents and method thereof
JP7364639B2 (en) Processing of digitized writing
Bhaskar et al. Implementing optical character recognition on the android operating system for business cards
CN114241486A (en) Method for improving accuracy rate of identifying student information of test paper
CN114581928A (en) Form identification method and system
CN113793264A (en) Archive image processing method and system based on convolution model and electronic equipment
CN112101356A (en) Method and device for positioning specific text in picture and storage medium
US9020295B1 (en) Image glyph enhancement
JP5277750B2 (en) Image processing program, image processing apparatus, and image processing system