KR20230146384A - Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition - Google Patents

Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition Download PDF

Info

Publication number
KR20230146384A
KR20230146384A KR1020220045352A KR20220045352A KR20230146384A KR 20230146384 A KR20230146384 A KR 20230146384A KR 1020220045352 A KR1020220045352 A KR 1020220045352A KR 20220045352 A KR20220045352 A KR 20220045352A KR 20230146384 A KR20230146384 A KR 20230146384A
Authority
KR
South Korea
Prior art keywords
area
word box
average value
document image
box
Prior art date
Application number
KR1020220045352A
Other languages
Korean (ko)
Inventor
여동훈
윤인용
Original Assignee
주식회사 하나금융티아이
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 하나금융티아이 filed Critical 주식회사 하나금융티아이
Priority to KR1020220045352A priority Critical patent/KR20230146384A/en
Publication of KR20230146384A publication Critical patent/KR20230146384A/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/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19147Obtaining sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • 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/19Recognition using electronic means
    • G06V30/19007Matching; Proximity measures
    • G06V30/19073Comparing statistics of pixel or of feature values, e.g. histogram matching
    • 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/20Combination of acquisition, preprocessing or recognition functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text

Abstract

본 발명은 학습 데이터의 생성 기술에 관한 것으로서, 상세하게는 이미지 내에 존재하는 텍스트를 검출 및 인식하는 모델을 학습할 때 학습 데이터로 사용되는 문서 이미지의 레이블을 최적화할 수 있는 문서 이미지의 레이블 조절 장치 및 방법에 관한 것이다. 이를 위해, 본 발명에 따른 문서 이미지의 레이블 조절 방법은 컴퓨팅 장치에서 수행되는 문서 이미지의 레이블 조절 방법으로서, 문서 이미지를 그레이 스케일로 변환하는 제1 단계와, 상기 문서 이미지의 단어 박스로부터 외곽으로 k 픽셀 떨어진 외곽 단어 박스를 설정하는 제2 단계와, 상기 외곽 단어 박스에서 상기 단어 박스 영역을 제외한 부분의 픽셀 색상들의 제1 평균값을 계산하는 제3 단계와, 상기 단어 박스 영역의 픽셀 색상들의 제2 평균값을 계산하는 제4 단계와, 상기 단어 박스 영역을 제2 평균값보다 밝은 제1 영역 및 제2 평균값보다 어두운 제2 영역으로 구분하는 제5 단계와, 제2 평균값이 제1 평균값보다 크면 제1 영역을 글자 영역으로 설정하고 그렇지 않으면 제2 영역을 글자 영역으로 설정하는 제6 단계와, 상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정하는 제7 단계와, 상기 최소 영역 사각형을 네 방향으로 n 픽셀만큼 늘린 단어 박스를 출력하는 제8 단계를 포함하여, 상기 n 픽셀만큼 늘린 단어 박스를 이용해 상기 제2 단계 내지 제8 단계를 소정 횟수만큼 반복하는 것을 특징으로 한다.The present invention relates to a technology for generating learning data, and more specifically, to a document image label adjustment device capable of optimizing the label of a document image used as learning data when learning a model for detecting and recognizing text existing in an image. and methods. To this end, the method for adjusting the label of a document image according to the present invention is a method of adjusting the label of a document image performed on a computing device, which includes a first step of converting the document image into gray scale, and k to the outside of the word box of the document image. A second step of setting an outer word box that is pixel apart, a third step of calculating a first average value of pixel colors of a portion of the outer word box excluding the word box area, and a second step of calculating a first average value of pixel colors of the portion of the outer word box excluding the word box area. A fourth step of calculating an average value, a fifth step of dividing the word box area into a first area brighter than the second average value and a second area darker than the second average value, and if the second average value is greater than the first average value, the first area A sixth step of setting the area as a text area, otherwise setting the second area as a text area, a seventh step of setting a minimum area rectangle including the set text area, and dividing the minimum area rectangle in four directions. Including an eighth step of outputting a word box stretched by n pixels, the second to eighth steps are repeated a predetermined number of times using the word box stretched by n pixels.

Description

텍스트 검출 및 인식 학습을 위해 사용되는 문서 이미지의 레이블 조절 장치 및 방법{Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition}Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition}

본 발명은 학습 데이터의 생성 기술에 관한 것으로서, 상세하게는 이미지 내에 존재하는 텍스트를 검출 및 인식하는 모델을 학습할 때 학습 데이터로 사용되는 문서 이미지의 레이블을 최적화할 수 있는 문서 이미지의 레이블 조절 장치 및 방법에 관한 것이다. The present invention relates to a technology for generating learning data, and more specifically, to a document image label adjustment device capable of optimizing the label of a document image used as learning data when learning a model for detecting and recognizing text existing in an image. and methods.

이미지 내에 있는 텍스트를 검출하기 위해서는 각 단어의 위치를 나타내는 박스의 좌표를 구해야 한다. 텍스트 검출 과정은 학습된 심층신경망(DNN)을 통해 이미지에서 각 박스의 위치(네 꼭지점의 좌표)를 유추할 수 있다. 텍스트 검출을 위한 심층신경망을 학습하기 위해서는 문서 이미지와 정답 박스의 위치가 입력 데이터로 필요하다. In order to detect text in an image, the coordinates of the box indicating the location of each word must be obtained. The text detection process can infer the location of each box (coordinates of the four vertices) in the image through a learned deep neural network (DNN). In order to learn a deep neural network for text detection, the document image and the location of the answer box are required as input data.

텍스트 검출 과정을 통해 박스의 좌표를 구하면, 검출된 박스 이미지로부터 텍스트 인식 과정을 통해 각 박스 내의 글자를 인식할 수 있다. 텍스트 인식 과정은 학습된 심층신경망을 통해 박스 이미지 내에 있는 글자를 유추할 수 있다. 텍스트 인식을 위한 심층신경망을 학습하기 위해서는 박스 이미지와 정답 문자열이 입력 데이터로 필요하다. If the coordinates of the box are obtained through the text detection process, the letters in each box can be recognized through the text recognition process from the detected box image. The text recognition process can infer letters in the box image through a learned deep neural network. In order to learn a deep neural network for text recognition, box images and answer strings are required as input data.

이와 같이, 텍스트 검출 및 인식을 위한 심층신경망을 학습하기 위해서는 문서 이미지, 정답 박스 정보 및 정답 문자열 정보를 포함하는 학습 데이터가 필요한데, 종래에는 이러한 학습 데이터를 사람이 수작업으로 생성하였다.In this way, in order to learn a deep neural network for text detection and recognition, learning data including document images, answer box information, and answer string information are required. Conventionally, such learning data was manually created by humans.

즉, 학습에 사용할 글자가 포함된 다수의 문서 이미지가 주어지면 사람이 일정한 박스 기준에 맞춰 직접 박스를 설정하는 작업을 수행해야 한다. In other words, when a number of document images containing letters to be used for learning are given, a person must manually set the boxes according to certain box standards.

그러나 사람이 박스 기준을 정확히 지키기 어렵기 때문에 문서 인식의 검출 정확도가 및 인식률을 극대화하는데 문제점이 있다. However, because it is difficult for people to accurately follow the box standards, there are problems in maximizing the detection accuracy and recognition rate of document recognition.

(선행기술문헌 1) 한국공개특허공보 제10-2005-0072699호(Prior Art Document 1) Korea Patent Publication No. 10-2005-0072699

본 발명은 상기와 같은 문제점을 해결하기 위해 창안된 것으로서, 본 발명의 목적은 텍스트 검출 및 인식을 위한 심층신경망 학습에 사용되는 학습 데이터를 빠르고 정확하게 생성하는 것이다. The present invention was created to solve the above problems, and the purpose of the present invention is to quickly and accurately generate learning data used in deep neural network learning for text detection and recognition.

이를 위해, 본 발명에 따른 문서 이미지의 레이블 조절 방법은 컴퓨팅 장치에서 수행되는 문서 이미지의 레이블 조절 방법으로서, 문서 이미지를 그레이 스케일로 변환하는 제1 단계와, 상기 문서 이미지의 단어 박스로부터 외곽으로 k 픽셀 떨어진 외곽 단어 박스를 설정하는 제2 단계와, 상기 외곽 단어 박스에서 상기 단어 박스 영역을 제외한 부분의 픽셀 색상들의 제1 평균값을 계산하는 제3 단계와, 상기 단어 박스 영역의 픽셀 색상들의 제2 평균값을 계산하는 제4 단계와, 상기 단어 박스 영역을 제2 평균값보다 밝은 제1 영역 및 제2 평균값보다 어두운 제2 영역으로 구분하는 제5 단계와, 제2 평균값이 제1 평균값보다 크면 제1 영역을 글자 영역으로 설정하고 그렇지 않으면 제2 영역을 글자 영역으로 설정하는 제6 단계와, 상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정하는 제7 단계와, 상기 최소 영역 사각형을 네 방향으로 n 픽셀만큼 늘린 단어 박스를 출력하는 제8 단계를 포함하여, 상기 n 픽셀만큼 늘린 단어 박스를 이용해 상기 제2 단계 내지 제8 단계를 소정 횟수만큼 반복하는 것을 특징으로 한다.To this end, the method for adjusting the label of a document image according to the present invention is a method of adjusting the label of a document image performed on a computing device, which includes a first step of converting the document image into gray scale, and k to the outside of the word box of the document image. A second step of setting an outer word box that is pixel apart, a third step of calculating a first average value of pixel colors of a portion of the outer word box excluding the word box area, and a second step of calculating a first average value of pixel colors of the portion of the outer word box excluding the word box area. A fourth step of calculating an average value, a fifth step of dividing the word box area into a first area brighter than the second average value and a second area darker than the second average value, and if the second average value is greater than the first average value, the first area A sixth step of setting the area as a text area, otherwise setting the second area as a text area, a seventh step of setting a minimum area rectangle including the set text area, and dividing the minimum area rectangle in four directions. Including an eighth step of outputting a word box stretched by n pixels, the second to eighth steps are repeated a predetermined number of times using the word box stretched by n pixels.

또한, 본 발명에 따른 문서 이미지의 레이블 조절 방법은 컴퓨팅 장치에서 수행되는 문서 이미지의 레이블 조절 방법으로서, 문서 이미지를 그레이 스케일로 변환하는 단계와, 상기 문서 이미지의 단어 박스로부터 외곽으로 일정 간격 떨어진 외곽 단어 박스를 설정하는 단계와, 상기 단어 박스 내부 및 상기 외곽 단어 박스에서 상기 단어 박스를 제외한 부분에 대해 각각 픽셀 평균값을 계산하는 단계와, 상기 계산한 픽셀 평균값에 근거해 상기 단어 박스에서 글자 영역을 설정하는 단계와, 상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정하는 단계를 포함한다. In addition, the method of adjusting the label of a document image according to the present invention is a method of adjusting the label of a document image performed on a computing device, comprising the steps of converting the document image into gray scale, and an edge spaced at a predetermined distance from the word box of the document image. Setting a word box, calculating an average pixel value for the inside of the word box and a portion of the outer word box excluding the word box, and dividing a character area in the word box based on the calculated average pixel value. It includes a step of setting and a step of setting a minimum area rectangle including the set character area.

또한, 본 발명에 따른 문서 이미지의 레이블 조절 장치는 정답 단어 박스 및 정답 문자열 정보가 포함된 문서 이미지를 입력받아 그레이 스케일로 변환하는 이미지 변환부와, 상기 문서 이미지의 단어 박스로부터 외곽으로 일정 간격 떨어진 위치에 외곽 단어 박스를 생성하는 단어박스 생성부와, 상기 단어 박스 내부 및 상기 외곽 단어 박스에서 상기 단어 박스를 제외한 부분에 대해 각각 픽셀 색상 평균값을 계산하고 상기 계산한 픽셀 색상 평균값에 근거해 상기 단어 박스에서 글자 영역을 설정하는 글자 영역 설정부를 포함한다. In addition, the device for adjusting the label of a document image according to the present invention includes an image conversion unit that receives a document image containing the correct word box and correct answer string information and converts it into gray scale, and an image converter that is spaced at a certain distance outside the word box of the document image. A word box creation unit that creates an outer word box at a position, calculates an average pixel color for the inside of the word box and a portion of the outer word box excluding the word box, and calculates the word based on the calculated average pixel color. Includes a text area setting unit that sets the text area in the box.

상술한 바와 같이, 본 발명은 텍스트 검출 및 인식을 위한 심층신경망 학습에 사용되는 학습 데이터를 빠르고 정확하게 생성할 수 있는 효과가 있다. As described above, the present invention has the effect of quickly and accurately generating learning data used for deep neural network learning for text detection and recognition.

본 발명에 따르면 다양한 폰트, 배경 색상, 스타일을 갖는 문서 이미지에서 사람에 따라 각기 다른 기준으로 작성된 학습 데이터를 정확한 기준에 맞는 학습 데이터로 정제 가능하여, 학습에 필요한 양질의 학습 데이터 확보를 위한 시간과 노력을 최소화 할 수 있으며, 그러한 정제된 학습 데이터를 통해 더욱 향상된 텍스트 검출 및 인식 모델을 생성할 수 있는 탁월한 효과가 있다. According to the present invention, it is possible to refine learning data created according to different standards for each person from document images with various fonts, background colors, and styles into learning data that meets accurate standards, saving time and time for securing quality learning data necessary for learning. Effort can be minimized, and there is an excellent effect of creating more improved text detection and recognition models through such refined learning data.

도 1은 본 발명에 따른 문서 이미지의 레이블 조절 장치의 내부 구성도.
도 2는 본 발명에 따른 문서 이미지의 레이블 조절 방법의 순서도.
도 3은 본 발명에 따른 외곽 단어 박스를 생성한 모습을 나타낸 도면.
도 4는 본 발명에 따른 최소 영역 사각형을 생성한 모습을 나타낸 도면.
도 5는 본 발명에 따른 문서 이미지의 단어 박스에 대한 크기 조절 모습을 나타낸 도면.
1 is an internal configuration diagram of a device for labeling a document image according to the present invention.
Figure 2 is a flowchart of a method for adjusting the label of a document image according to the present invention.
Figure 3 is a diagram showing the creation of an outer word box according to the present invention.
Figure 4 is a diagram showing the creation of a minimum area rectangle according to the present invention.
Figure 5 is a diagram showing size adjustment of a word box of a document image according to the present invention.

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. Below, with reference to the attached drawings, embodiments of the present invention will be described in detail so that those skilled in the art can easily implement the present invention.

그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein.

그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.In order to clearly explain the present invention in the drawings, parts that are not related to the description are omitted, and similar parts are given similar reference numerals throughout the specification.

명세서 전체에서, 어떤 부분이 어떤 구성 요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성 요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다.Throughout the specification, when a part is said to “include” a certain component, this means that it may further include other components rather than excluding other components, unless specifically stated to the contrary.

또한, 명세서에 기재된 "……부", "…… 모듈" 의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다.In addition, the terms "...unit" and "...module" used in the specification refer to a unit that processes at least one function or operation, which may be implemented as hardware, software, or a combination of hardware and software.

이하, 도면을 참조로 하여 본 발명의 실시예에 따른 텍스트 검출 및 인식 학습을 위해 사용되는 문서 이미지의 레이블 조절 장치 및 방법 대하여 상세히 설명한다.Hereinafter, an apparatus and method for adjusting labels of document images used for text detection and recognition learning according to an embodiment of the present invention will be described in detail with reference to the drawings.

도 1은 본 발명에 따른 문서 이미지의 레이블 조절 장치의 내부 구성을 나타낸 것이다. Figure 1 shows the internal configuration of a device for adjusting labels for document images according to the present invention.

본 발명에 따른 문서 이미지의 레이블 조절 장치는 텍스트 검출 및 인식 학습을 위한 학습 데이터로서 사용되는 문서 이미지에 대한 레이블 조절 작업을 수행하는 장치이다. 문서 이미지의 레이블 조절 장치는 퍼스널 컴퓨터이거나 전용 컴퓨팅 장치가 될 수 있다. The label adjustment device for document images according to the present invention is a device that performs a label adjustment task on document images used as learning data for text detection and recognition learning. The device for labeling document images may be a personal computer or a dedicated computing device.

도 1을 참조하면, 문서 이미지의 레이블 조절 장치는 이미지 변환부(10), 단어박스 생성부(20), 글자영역 설정부(30) 등을 포함한다. Referring to FIG. 1, the device for adjusting the label of a document image includes an image conversion unit 10, a word box creation unit 20, and a character area setting unit 30.

이미지 변환부(10)는 정답 데이터(정답 단어 박스, 정답 문자열 정보)가 포함된 문서 이미지를 입력받아 그레이 스케일로 변환한다. The image conversion unit 10 receives a document image containing correct answer data (correct answer word box, correct answer string information) and converts it to gray scale.

단어박스 생성부(20)는 문서 이미지의 기본 단어 박스로부터 외곽으로 k 픽셀 떨어진 위치에 새로운 단어 박스를 생성(설정)한다. 새로운 단어 박스를 외곽 단어 박스라고 명명한다. 단어박스 생성부(20)에서 생성한 외곽 단어 박스 정보는 글자영역 설정부(30)로 전달된다. The word box creation unit 20 creates (sets) a new word box at a location k pixels away from the basic word box of the document image. The new word box is named the outer word box. The outer word box information generated by the word box creation unit 20 is transmitted to the character area setting unit 30.

단어박스 생성부(20)는 단어 박스 내의 글자 영역을 포함하는 최소 영역 사각형을 생성하고, 최소 영역 사각형을 네 방향(상하좌우)으로 n 픽셀만큼 늘린 단어 박스를 생성(출력)할 수 있다. 최소 영역 사각형을 늘린 새로운 단어 박스를 보정 단어 박스라고 명명한다. The word box generator 20 may generate a minimum area rectangle including the letter area within the word box, and generate (output) a word box in which the minimum area rectangle is extended by n pixels in four directions (up, down, left, and right). The new word box with the minimum area rectangle increased is called the corrected word box.

기본 단어 박스에서 k 픽셀만큼 늘린 외곽 단어 박스와 최소 영역 사각형에서 n 픽셀만큼 늘린 보정 단어 박스에 대해서는 후술하기로 한다. The outer word box, which is expanded by k pixels from the basic word box, and the corrected word box, which is expanded by n pixels from the minimum area rectangle, will be described later.

단어박스 생성부(20)는 외곽 단어 박스 및 보정 단어 박스를 일정한 횟수만큼 반복적으로 생성하여 단어 박스의 크기를 조절해 나가면서 레이블 보정된 문서 이미지를 최종 출력하게 된다. The word box generator 20 repeatedly generates the outer word box and the corrected word box a certain number of times, adjusts the size of the word box, and finally outputs the label-corrected document image.

글자영역 설정부(30)는 기본 단어 박스 및 외곽 단어 박스 내의 픽셀 색상들의 평균값을 계산하고 픽셀 색상 평균값에 근거해 최초 단어 박스 영역에서 글자영역을 설정한다. 글자영역 설정부(30)에서 설정한 글자영역 정보는 단어박스 생성부(20)로 전달된다. The text area setting unit 30 calculates the average value of pixel colors in the basic word box and the outer word box and sets the text area in the initial word box area based on the average pixel color value. The character area information set in the character area setting unit 30 is transmitted to the word box creation unit 20.

도 2는 본 발명에 따른 문서 이미지의 레이블 조절 방법의 순서도를 나타낸 것이다. Figure 2 shows a flowchart of a method for adjusting the label of a document image according to the present invention.

도 2에 도시된 각 단계는 본 발명에 따른 문서 이미지의 레이블 조절 장치에서 수행된다. 구체적으로 각 단계는 문서 이미지의 레이블 조절 장치의 각 기능(이미지 변환, 수치 계산 등)을 가진 해당 소프트웨어 또는 하드웨어에 의해 수행되나, 설명의 편의 상 문서 이미지의 레이블 조절 장치가 각 단계를 수행하는 것으로 설명한다. Each step shown in Figure 2 is performed in the device for adjusting the label of a document image according to the present invention. Specifically, each step is performed by the corresponding software or hardware with each function (image conversion, numerical calculation, etc.) of the document image label adjuster, but for convenience of explanation, it is assumed that the document image label adjuster performs each step. Explain.

도 2를 참조하면, 문서 이미지의 레이블 조절 장치는 정답 데이터를 포함한 문서 이미지를 입력받고 문서 이미지에 대해 그레이 스케일 변환을 수행한다(S10). 그레이 스케일 변환에 의해 문서 이미지의 모든 픽셀이 0~255 사이의 값으로 표현된다. Referring to FIG. 2, the device for adjusting the label of a document image receives a document image including correct answer data and performs gray scale conversion on the document image (S10). By gray scale conversion, all pixels in the document image are expressed as values between 0 and 255.

문서 이미지가 그레이 스케일 변환되면, 문서 이미지의 레이블 조절 장치는 문서 이미지에 들어 있는 단어 박스에 대해 외곽 단어 박스를 설정한다(S20).When the document image is converted to gray scale, the label control device for the document image sets an outer word box for the word box contained in the document image (S20).

즉, 도 3에 도시된 바와 같이, 문서 이미지의 레이블 조절 장치는 문서 이미지의 기본 단어 박스(2)로부터 외곽으로 k 픽셀 떨어진 위치에 외곽 단어 박스(1)를 설정한다. 이때 k 값은 기본 단어 박스(2)의 높이와 너비의 0.1 배가 되는 값이 될 수 있다. That is, as shown in FIG. 3, the label adjustment device for the document image sets the outer word box (1) at a location k pixels away from the basic word box (2) of the document image. At this time, the k value can be 0.1 times the height and width of the basic word box (2).

외곽 단어 박스(1)가 설정되면, 문서 이미지의 레이블 조절 장치는 외곽 단어 박스(1)와 기본 단어 박스(2)에 속하는 픽셀 색상의 평균값을 계산한다(S30).When the outer word box (1) is set, the label adjustment device of the document image calculates the average value of the pixel colors belonging to the outer word box (1) and the basic word box (2) (S30).

구체적으로 문서 이미지의 레이블 조절 장치는 외곽 단어 박스(1)에서 기본 단어 박스(2) 영역을 제외한 부분의 픽셀 색상들의 평균값을 계산한다. 이 부분의 픽셀 색상 평균값을 제1 평균값이라고 명명한다. Specifically, the label control device for the document image calculates the average value of the pixel colors of the outer word box (1) excluding the basic word box (2) area. The average pixel color value of this portion is called the first average value.

이어서 기본 단어 박스(2) 영역의 픽셀 색상들의 평균값을 계산한다. 이 부분의 픽셀 색상 평균값을 제2 평균값이라고 명명한다.Next, the average value of the pixel colors in the basic word box (2) area is calculated. The average pixel color value of this portion is called the second average value.

제1 평균값과 제2 평균값이 구해지면, 문서 이미지의 레이블 조절 장치는 단어 박스 내의 글자 영역을 설정한다(S40).Once the first and second average values are obtained, the label control device for the document image sets the character area within the word box (S40).

구체적으로 문서 이미지의 레이블 조절 장치는 기본 단어 박스(2) 영역에서 상기 계산한 제2 평균값보다 밝은 픽셀 부분을 제1 영역으로 하고 제2 평균값보다 어두운 픽셀 부분을 제2 영역으로 하여 기본 단어 박스(2) 영역을 구분한다. Specifically, the label control device for the document image sets the pixel portion brighter than the calculated second average value in the basic word box (2) area as the first area and the pixel portion darker than the second average value as the second area to create the basic word box ( 2) Divide the area.

그리고 나서 제2 평균값이 제1 평균값보다 크면 제1 영역을 글자 영역으로 설정하고, 제2 평균값이 제1 평균값 이하이면 제2 영역을 글자 영역으로 설정한다. Then, if the second average value is greater than the first average value, the first area is set as the text area, and if the second average value is less than the first average value, the second area is set as the text area.

그레이 스케일에서 밝은 색일수록 큰 값을 갖고 어두운 색일수록 작은 값을 가지기 때문에, 제2 평균값이 제1 평균값보다 크다는 것은 글자가 배경보다 밝은 색상을 띄고 있다는 의미이므로 제1 영역(밝은 색 영역)이 글자 영역이 되고, 제2 평균값이 제1 평균값 이하이면 글자가 배경보다 어두운 색상을 띄고 있다는 의미이므로 제2 영역(어두운 색 영역)이 글자 영역이 된다. In the gray scale, brighter colors have larger values and darker colors have smaller values. Therefore, if the second average value is larger than the first average value, it means that the text has a brighter color than the background, so the first area (light color area) is the text area. If the second average value is less than the first average value, it means that the text has a darker color than the background, so the second area (dark color area) becomes the text area.

다음, 문서 이미지의 레이블 조절 장치는 상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정한다(S50).Next, the label control device for the document image sets the minimum area rectangle including the set text area (S50).

즉, 도 4에 도시된 바와 같이, 영역(3)을 포함하는 사각형 중에서 가장 작은 면적을 가진 사각형(4)을 설정하는 방식으로, 글자 영역을 포함하는 가장 작은 면적을 가진 최소 영역 사각형을 설정하게 된다. That is, as shown in FIG. 4, the minimum area rectangle with the smallest area including the text area is set by setting the rectangle 4 with the smallest area among the rectangles containing the area 3. do.

최소 영역 사각형을 설정하면, 문서 이미지의 레이블 조절 장치는 최소 영역 사각형을 네 방향으로 n 픽셀만큼 늘린 보정 단어 박스를 출력한다. 본 발명의 실시예에서 최소 영역 사각형을 네 방향에서 2 픽셀만큼 늘려 보정 단어 박스를 생성할 수 있다. When the minimum area rectangle is set, the label adjuster for the document image outputs a correction word box with the minimum area rectangle stretched by n pixels in four directions. In an embodiment of the present invention, a correction word box can be created by increasing the minimum area rectangle by 2 pixels in four directions.

이미지 상에서 글자가 검은색으로 보이더라도 그 글자의 바깥 부분에는 회색에 가까운 색상이 존재한다. 즉, 배경이 흰색일 때 검은색 글자와 흰색 배경이 혼합되어 회색으로 존재하게 된다. 이렇게 회색에 가까운 픽셀들도 글자 영역에 해당하는데 해당 픽셀의 값이 제2 평균값 근처에 있어서 글자 영역 설정 단계(S40)에서 제외될 가능성이 있기 때문에 보정 단어 박스를 생성하는 것이다. Even if the letters appear black in the image, the outer part of the letters has a color close to gray. In other words, when the background is white, the black text and the white background are mixed and appear gray. Pixels close to gray also correspond to the text area, and since the value of the corresponding pixel is near the second average value, there is a possibility that it will be excluded from the text area setting step (S40), so a correction word box is created.

이후, 문서 이미지의 레이블 조절 장치는 상기 단계(S20) 내지 단계(S60)가 소정 횟수 반복되었는지 확인하여(S70), 소정 횟수에 도달하지 않았으면 상기 단계(S20) 내지 단계(S60)를 다시 수행하게 된다.Thereafter, the device for adjusting the label of the document image checks whether the steps (S20) to (S60) have been repeated a predetermined number of times (S70), and if the predetermined number of times has not been reached, the steps (S20) to (S60) are performed again. I do it.

이처럼 소정 횟수만큼 단계(S20~S60)를 반복하게 되면 정확히 글자를 포함하는 단어 박스가 생성되고 더 이상 박스의 크기에 변화가 발생하지 않게 된다. If the steps (S20 to S60) are repeated a predetermined number of times, a word box containing exactly the letters is created, and the size of the box no longer changes.

도 5는 본 발명에 따른 문서 이미지의 단어 박스에 대한 크기 조절 모습을 나타낸 것이다.Figure 5 shows the size adjustment of the word box of a document image according to the present invention.

도 5를 참조하면, (a)는 단어 박스 영역(5)이 기준보다 큰 경우를 나타낸 것이고, (b)는 단어 박스 영역(5)이 기준보다 작은 경우를 나타낸 것이고, (c)는 본 발명에 따른 레이블 조절에 의해 단어 박스 영역(7)이 기준에 맞게 보정된 것을 나타낸 것이다. Referring to Figure 5, (a) shows the case where the word box area (5) is larger than the standard, (b) shows the case where the word box area (5) is smaller than the standard, and (c) shows the case where the word box area (5) is smaller than the standard. This shows that the word box area (7) has been corrected to meet the standard by adjusting the label according to .

본 발명에 따른 레이블 자동 조절을 통해 기준에 맞는 정확한 단어 박스 크기를 생성할 수 있어서, 보정된 단어 박스가 수작업으로 만든 단어 박스보다 글자 영역을 완전히 타이트하게 포함할 수 있다. 이에 따라 텍스트 검출 과정에서 더욱 타이트한 단어 박스 영역을 검출하고 있고, 텍스트 인식 과정에서 주변 노이즈의 영향을 줄일 수 있어서 더욱 정확한 글자 인식이 가능하게 된다. By automatically adjusting the label according to the present invention, it is possible to create an accurate word box size that meets the standard, so that the corrected word box can completely cover the character area more tightly than a manually created word box. Accordingly, a tighter word box area is detected in the text detection process, and the influence of surrounding noise can be reduced in the text recognition process, enabling more accurate character recognition.

이상에서 설명한 본 발명의 실시예는 장치 및 방법을 통해서만 구현이 되는 것은 아니며, 본 발명의 실시예의 구성에 대응하는 기능을 실현하는 프로그램 또는 그 프로그램이 기록된 기록 매체를 통해 구현될 수도 있다. The embodiments of the present invention described above are not only implemented through devices and methods, but can also be implemented through programs that implement functions corresponding to the configurations of the embodiments of the present invention or recording media on which the programs are recorded.

이상에서 본 발명의 실시예에 대하여 상세하게 설명하였지만 본 발명의 권리범위는 이에 한정되는 것은 아니고 다음의 청구범위에서 정의하고 있는 본 발명의 기본 개념을 이용한 당업자의 여러 변형 및 개량 형태 또한 본 발명의 권리범위에 속하는 것이다.Although the embodiments of the present invention have been described in detail above, the scope of the present invention is not limited thereto, and various modifications and improvements made by those skilled in the art using the basic concept of the present invention defined in the following claims are also possible. It falls within the scope of rights.

10: 이미지 변환부 20: 단어박스 생성부
30: 글자영역 설정부
10: Image conversion unit 20: Word box creation unit
30: Character area setting section

Claims (12)

컴퓨팅 장치에서 수행되는 문서 이미지의 레이블 조절 방법에 있어서,
문서 이미지를 그레이 스케일로 변환하는 제1 단계와,
상기 문서 이미지의 단어 박스로부터 외곽으로 k 픽셀 떨어진 외곽 단어 박스를 설정하는 제2 단계와,
상기 외곽 단어 박스에서 상기 단어 박스 영역을 제외한 부분의 픽셀 색상들의 제1 평균값을 계산하는 제3 단계와,
상기 단어 박스 영역의 픽셀 색상들의 제2 평균값을 계산하는 제4 단계와,
상기 단어 박스 영역을 제2 평균값보다 밝은 제1 영역 및 제2 평균값보다 어두운 제2 영역으로 구분하는 제5 단계와,
제2 평균값이 제1 평균값보다 크면 제1 영역을 글자 영역으로 설정하고 그렇지 않으면 제2 영역을 글자 영역으로 설정하는 제6 단계와,
상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정하는 제7 단계와,
상기 최소 영역 사각형을 네 방향으로 n 픽셀만큼 늘린 단어 박스를 출력하는 제8 단계를 포함하여,
상기 n 픽셀만큼 늘린 단어 박스를 이용해 상기 제2 단계 내지 제8 단계를 소정 횟수만큼 반복하는 것을 특징으로 하는 방법.
In a method of adjusting the label of a document image performed on a computing device,
A first step of converting the document image to gray scale,
A second step of setting an outer word box k pixels away from the word box of the document image;
A third step of calculating a first average value of pixel colors of a portion of the outer word box excluding the word box area;
a fourth step of calculating a second average value of pixel colors in the word box area;
A fifth step of dividing the word box area into a first area brighter than the second average value and a second area darker than the second average value;
a sixth step of setting the first area as a text area if the second average value is greater than the first average value; otherwise, setting the second area as a text area;
A seventh step of setting a minimum area rectangle including the set character area,
Including an eighth step of outputting a word box in which the minimum area rectangle is stretched by n pixels in four directions,
A method characterized in that the second to eighth steps are repeated a predetermined number of times using the word box increased by the n pixels.
제1항에 있어서,
상기 외곽 단어 박스는 상기 문서 이미지의 단어 박스로부터 단어 박스의 높이 및 너비의 각각 0.1 배만큼 떨어져 있는 것을 특징으로 하는 방법.
According to paragraph 1,
The method characterized in that the outer word box is separated from the word box of the document image by 0.1 times the height and width of the word box, respectively.
제1항에 있어서,
상기 n 픽셀만큼 늘린 단어 박스는 상기 최소 영역 사각형을 네 방향으로 각각 2 픽셀만큼 늘린 단어 박스인 것을 특징으로 하는 방법.
According to paragraph 1,
The method characterized in that the word box expanded by n pixels is a word box expanded by 2 pixels in each of the four directions of the minimum area rectangle.
제1항에 있어서,
상기 최소 영역 사각형은 글자 영역을 포함하는 사각형 중에서 가장 작은 면적을 가진 사각형인 것을 특징으로 하는 방법.
According to paragraph 1,
The method is characterized in that the minimum area rectangle is a rectangle with the smallest area among the rectangles including the text area.
컴퓨팅 장치에서 수행되는 문서 이미지의 레이블 조절 방법에 있어서,
문서 이미지를 그레이 스케일로 변환하는 단계와,
상기 문서 이미지의 단어 박스로부터 외곽으로 일정 간격 떨어진 외곽 단어 박스를 설정하는 단계와,
상기 단어 박스 내부 및 상기 외곽 단어 박스에서 상기 단어 박스를 제외한 부분에 대해 각각 픽셀 평균값을 계산하는 단계와,
상기 계산한 픽셀 평균값에 근거해 상기 단어 박스에서 글자 영역을 설정하는 단계와,
상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 설정하는 단계를 포함하는 방법.
In a method of adjusting the label of a document image performed on a computing device,
converting the document image to gray scale;
Setting an outer word box at a certain distance outside the word box of the document image;
Calculating average pixel values for the inside of the word box and the outer word box excluding the word box;
setting a character area in the word box based on the calculated pixel average value;
A method comprising setting a minimum area rectangle including the set character area.
제5항에 있어서,
상기 최소 영역 사각형을 네 방향으로 소정의 픽셀만큼 늘린 단어 박스를 출력하는 단계를 더 포함하는 것을 특징으로 하는 방법.
According to clause 5,
The method further comprising outputting a word box obtained by extending the minimum area rectangle by a predetermined number of pixels in four directions.
제5항에 있어서,
상기 외곽 단어 박스를 설정하는 단계부터 상기 최소 영역 사각형을 설정하는 단계까지 소정 횟수만큼 반복하는 단계를 더 포함하는 것을 특징으로 하는 방법.
According to clause 5,
The method further comprising repeating the step of setting the outer word box to the step of setting the minimum area rectangle a predetermined number of times.
정답 단어 박스 및 정답 문자열 정보가 포함된 문서 이미지를 입력받아 그레이 스케일로 변환하는 이미지 변환부와,
상기 문서 이미지의 단어 박스로부터 외곽으로 일정 간격 떨어진 위치에 외곽 단어 박스를 생성하는 단어박스 생성부와,
상기 단어 박스 내부 및 상기 외곽 단어 박스에서 상기 단어 박스를 제외한 부분에 대해 각각 픽셀 색상 평균값을 계산하고 상기 계산한 픽셀 색상 평균값에 근거해 상기 단어 박스에서 글자 영역을 설정하는 글자 영역 설정부를 포함하는 문서 이미지의 레이블 조절 장치.
An image conversion unit that receives a document image containing the correct word box and correct answer string information and converts it into gray scale;
a word box generator that creates an outer word box at a predetermined distance outside the word box of the document image;
A document including a text area setting unit that calculates an average pixel color for the inside of the word box and a portion of the outer word box excluding the word box, and sets a text area in the word box based on the calculated average pixel color. Label adjuster for images.
제8항에 있어서,
상기 단어박스 생성부는 상기 설정한 글자 영역을 포함하는 최소 영역 사각형을 생성하는 것을 특징으로 하는 문서 이미지의 레이블 조절 장치.
According to clause 8,
The label control device for a document image, wherein the word box generator generates a minimum area rectangle including the set character area.
제9항에 있어서,
상기 단어박스 생성부는 상기 최소 영역 사각형을 네 방향으로 소정의 픽셀만큼 늘린 단어 박스를 출력하는 것을 특징으로 하는 문서 이미지의 레이블 조절 장치.
According to clause 9,
The label control device for a document image, wherein the word box generator outputs a word box obtained by extending the minimum area rectangle by a predetermined number of pixels in four directions.
제8항에 있어서,
상기 글자 영역 설정부는 상기 외곽 단어 박스에서 상기 단어 박스 영역을 제외한 부분의 외곽 픽셀 색상 평균값(제1 평균값)을 계산하고 상기 단어 박스 영역의 내부 픽셀 색상 평균값(제2 평균값)을 계산하여, 상기 단어 박스 영역을 제2 평균값보다 밝은 제1 영역 및 제2 평균값보다 어두운 제2 영역으로 구분하고, 제2 평균값이 제1 평균값보다 크면 제1 영역을 글자 영역으로 설정하고 그렇지 않으면 제2 영역을 글자 영역으로 설정하는 것을 특징으로 하는 문서 이미지의 레이블 조절 장치.
According to clause 8,
The letter area setting unit calculates an average color value (first average value) of outer pixels of a portion of the outer word box excluding the word box area and calculates an average color value (second average value) of inner pixels of the word box area, and calculates the average color value (second average value) of the inner pixel color of the word box area. The box area is divided into a first area brighter than the second average value and a second area darker than the second average value, and if the second average value is greater than the first average value, the first area is set as the text area. Otherwise, the second area is set as the text area. A label control device for document images, characterized in that setting.
제8항에 있어서,
상기 단어 박스로부터 외곽으로 일정 간격 떨어진 위치는 단어 박스의 높이 및 너비의 각각 0.1 배만큼 떨어져 있는 위치인 것을 특징으로 하는 문서 이미지의 레이블 조절 장치.
According to clause 8,
A label adjusting device for a document image, wherein a position located at a predetermined distance outside the word box is a position separated by 0.1 times the height and width of the word box.
KR1020220045352A 2022-04-12 2022-04-12 Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition KR20230146384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220045352A KR20230146384A (en) 2022-04-12 2022-04-12 Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020220045352A KR20230146384A (en) 2022-04-12 2022-04-12 Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition

Publications (1)

Publication Number Publication Date
KR20230146384A true KR20230146384A (en) 2023-10-19

Family

ID=88507805

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220045352A KR20230146384A (en) 2022-04-12 2022-04-12 Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition

Country Status (1)

Country Link
KR (1) KR20230146384A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050072699A (en) 2004-01-06 2005-07-12 마이크로소프트 코포레이션 Positionally encoded document image analysis and labeling

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050072699A (en) 2004-01-06 2005-07-12 마이크로소프트 코포레이션 Positionally encoded document image analysis and labeling

Similar Documents

Publication Publication Date Title
US10223585B2 (en) Page segmentation of vector graphics documents
US10671892B1 (en) Apparatuses, methods, and systems for 3-channel dynamic contextual script recognition using neural network image analytics and 4-tuple machine learning with enhanced templates and context data
US20090055159A1 (en) Translation apparatus, translation method and computer readable medium
US11574489B2 (en) Image processing system, image processing method, and storage medium
US10558849B2 (en) Depicted skin selection
JPH0721319A (en) Automatic determination device of asian language
US20150262030A1 (en) Image processing device, image processing method, and image processing program
JP2012199901A (en) Document modification detecting method by character comparison using character shape feature
JP2015088046A (en) Image display device, image display method and program
US5966464A (en) Character recognition method and apparatus, including generation of a degree of belief
KR102121654B1 (en) Deep Learning Based Automatic Gesture Recognition Method and System
JPH07168948A (en) Improving method for quality of document image
JPH04233094A (en) Method and apparatus for analyzing image
KR20210140844A (en) Table data storing system and method on the electronic document
US20080144977A1 (en) Method and System for Adaptive Recognition of Distorted Text in Computer Images
WO2021034841A1 (en) Apparatus and methods for converting lineless tables into lined tables using generative adversarial networks
CN103530625A (en) Optical character recognition method based on digital image processing
KR20230146384A (en) Apparatus and method for label refinement of document images used in machine-learning of text detection and recognition
CN111695554B (en) Text correction method and device, electronic equipment and storage medium
US9208381B1 (en) Processing digital images including character recognition using ontological rules
US20230071008A1 (en) Computer-readable, non-transitory recording medium containing therein image processing program for generating learning data of character detection model, and image processing apparatus
Kshetry Image preprocessing and modified adaptive thresholding for improving OCR
KR102490044B1 (en) Method of image data augmentation for learning of objects detecting, computer-readable storage medium and computer program
KR20220061541A (en) System for local optimization of objects detector based on deep neural network and method for creating local database thereof
US10007871B2 (en) Image processing apparatus, image processing method, and storage medium that converts drawing data generated by an application program into print data to be printed