KR102328034B1 - Database building device that can build a knowledge database from a table-inserted image and operating method thereof - Google Patents

Database building device that can build a knowledge database from a table-inserted image and operating method thereof Download PDF

Info

Publication number
KR102328034B1
KR102328034B1 KR1020190168680A KR20190168680A KR102328034B1 KR 102328034 B1 KR102328034 B1 KR 102328034B1 KR 1020190168680 A KR1020190168680 A KR 1020190168680A KR 20190168680 A KR20190168680 A KR 20190168680A KR 102328034 B1 KR102328034 B1 KR 102328034B1
Authority
KR
South Korea
Prior art keywords
image
matrix
mxn
text
texts
Prior art date
Application number
KR1020190168680A
Other languages
Korean (ko)
Other versions
KR20210077251A (en
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 KR1020190168680A priority Critical patent/KR102328034B1/en
Publication of KR20210077251A publication Critical patent/KR20210077251A/en
Application granted granted Critical
Publication of KR102328034B1 publication Critical patent/KR102328034B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • G06K9/00456
    • 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/413Classification of content, e.g. text, photographs or tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Algebra (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Character Input (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치 및 그 동작 방법이 개시된다. 본 발명에 따른 데이터베이스 구축 장치 및 그 동작 방법은 표가 삽입된 이미지에 대하여, 상기 이미지를 구성하는 복수의 화소들의 색상 값에 따른 이미지 행렬을 생성한 후, 상기 이미지 행렬에 수직선 필터와 수평선 필터를 적용하여 상기 이미지로부터 표를 구성하는 수직선들과 수평선들을 검출하고, 상기 수직선들과 상기 수평선들에 의해 생성되는 복수의 셀들에, 상기 이미지로부터 OCR을 통해 추출한 복수의 텍스트들을 삽입하여 제1 표가 삽입된 전자 문서를 생성하며, 상기 제1 표에 삽입된 필드명과 데이터를 기초로 하는 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 표가 삽입된 이미지로부터 지식 데이터베이스를 구축할 수 있다.Disclosed are a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted, and an operating method thereof. A database building apparatus and an operating method thereof according to the present invention generate an image matrix according to color values of a plurality of pixels constituting the image with respect to an image in which a table is inserted, and then add a vertical line filter and a horizontal line filter to the image matrix. The first table is generated by detecting vertical lines and horizontal lines constituting the table from the image by applying it, and inserting a plurality of texts extracted from the image through OCR into a plurality of cells generated by the vertical lines and the horizontal lines. By generating an embedded electronic document and storing a plurality of data sets based on field names and data inserted into the first table in a data storage, a knowledge database can be built from the image into which the table is embedded.

Description

표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치 및 그 동작 방법{DATABASE BUILDING DEVICE THAT CAN BUILD A KNOWLEDGE DATABASE FROM A TABLE-INSERTED IMAGE AND OPERATING METHOD THEREOF}A database building device capable of constructing a knowledge database from an image in which a table is inserted, and an operating method thereof

본 발명은 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치 및 그 동작 방법에 대한 것이다.The present invention relates to a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted, and a method for operating the same.

최근, 이미지로부터 문자를 인식할 수 있는 다양한 OCR(Optical Character Reader) 관련 기술들이 등장하면서, 이를 이용한 다양한 응용 서비스가 제공되고 있다.Recently, as various OCR (Optical Character Reader)-related technologies capable of recognizing a character from an image have appeared, various application services using the technology have been provided.

예컨대, 이미지로부터 문자를 인식하여 해당 문자에 대한 자동 번역 기능을 제공하는 서비스나 주변 사물의 간판 이미지에서 문자를 인식하여 주변 사물에 대한 관련 정보를 인터넷을 통해 검색하여 제공하는 서비스들이 존재한다.For example, there exist a service that recognizes a character from an image and provides an automatic translation function for the character, or a service that recognizes a character from a sign image of a nearby object and searches for related information on a nearby object through the Internet.

한편, 사람들은 병원에서 진료를 받은 뒤 진료비 영수증과 처방전을 받을 때 일반적으로 인쇄된 종이 문서 형태의 진료비 영수증과 처방전을 받는다. 또한, 학생들은 학교에서 시험을 치른 뒤, 인쇄된 종이 문서 형태의 시험 성적표를 받는다. On the other hand, when people receive medical bills and prescriptions after receiving treatment at a hospital, they usually receive receipts and prescriptions in the form of printed paper documents. Students also receive test scores in the form of printed paper documents after taking the test at school.

그러나, 종이 문서는 보관한 지 오래되면, 보관했던 장소를 잃어버릴 염려도 있고, 나중에 해당 문서를 참조할 필요가 있는 경우, 스마트폰과 같은 전자 기기를 통하여 바로바로 확인할 수 없다는 불편함이 있다. However, when a paper document is stored for a long time, there is a risk of losing the place where it was stored, and when it is necessary to refer to the document later, there is an inconvenience in that it cannot be checked immediately through an electronic device such as a smartphone.

관련하여, 종이 문서를 스캔하여 보관할 수 있으나, 스캔 이미지는 표가 삽입된 이미지라 하여도 전자 문서 형식이 아닌 단순한 이미지 파일 형식으로 저장되므로, 규격화 및 편집이 가능한 전자 문서 형식으로 기록하고 싶은 경우에는, 일일이 표를 만들고, 표를 구성하는 복수의 셀들에 텍스트들을 하나하나 입력하는 과정을 거쳐야 한다는 불편함이 있다. In relation to this, paper documents can be scanned and stored, but even if the images with tables are inserted, the scanned images are saved in a simple image file format rather than an electronic document format. , it is inconvenient to have to go through the process of making a table one by one and inputting texts into a plurality of cells constituting the table one by one.

만약, 표가 삽입된 스캔 이미지로부터 표를 구성하는 선을 추출하고, OCR을 이용하여 표 내부에 기록된 텍스트들을 추출함으로써, 스캔 이미지로부터 표가 삽입된 전자 문서를 생성할 수 있다면, 사용자의 편의를 도모할 수 있을 것이다.If it is possible to generate an electronic document with a table inserted from the scanned image by extracting the lines constituting the table from the scanned image in which the table is inserted, and extracting the text recorded in the table using OCR, the user’s convenience will be able to promote

더불어, 특정 업무 조직 내에서 표가 삽입된 전자 문서가 공유될 경우, 다른 사용자의 단말에서 작성된 표의 데이터를 쉽게 획득하지 못하는 경우를 대비하여, 상기 전자 문서에 포함된 표의 데이터들을 하나의 지식 데이터베이스로 구축할 수 있다면, 같은 업무 조직 내에 속하는 사용자들이 손쉽게 업무 관련 데이터를 공유할 수 있어 유용할 것이다. In addition, in case an electronic document with a table inserted therein is shared within a specific business organization, data of a table included in the electronic document is converted into a single knowledge database in case data of a table prepared in another user's terminal cannot be easily obtained. If it can be built, it will be useful because users belonging to the same work organization can easily share work-related data.

따라서, 표가 삽입된 이미지를 전자 문서로 변환할 수 있고, 변환된 전자 문서에 삽입된 표의 데이터들을 기초로 지식 데이터베이스를 구축할 수 있는 기술에 대한 연구가 필요하다.Therefore, it is necessary to study a technique capable of converting an image having a table into an electronic document and building a knowledge database based on data of a table inserted into the converted electronic document.

본 발명에 따른 데이터베이스 구축 장치 및 그 동작 방법은 표가 삽입된 이미지에 대하여, 상기 이미지를 구성하는 복수의 화소들의 색상 값에 따른 이미지 행렬을 생성한 후, 상기 이미지 행렬에 수직선 필터와 수평선 필터를 적용하여 상기 이미지로부터 표를 구성하는 수직선들과 수평선들을 검출하고, 상기 수직선들과 상기 수평선들에 의해 생성되는 복수의 셀들에, 상기 이미지로부터 OCR을 통해 추출한 복수의 텍스트들을 삽입하여 제1 표가 삽입된 전자 문서를 생성하며, 상기 제1 표에 삽입된 필드명과 데이터를 기초로 하는 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능하도록 지원하고자 한다.A database building apparatus and an operating method thereof according to the present invention generate an image matrix according to color values of a plurality of pixels constituting the image with respect to an image in which a table is inserted, and then add a vertical line filter and a horizontal line filter to the image matrix. The first table is generated by detecting vertical lines and horizontal lines constituting the table from the image by applying it, and inserting a plurality of texts extracted from the image through OCR into a plurality of cells generated by the vertical lines and the horizontal lines. By creating an embedded electronic document and storing a plurality of data sets based on field names and data inserted in the first table in a data storage, it is intended to support the construction of a knowledge database from an image in which a table is inserted.

본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치는 표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있는 색상 값 저장부, 사용자로부터 제1 표 - 상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있음 - 가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n(n은 2이상의 자연수임)개, 세로 m(m은 2이상의 자연수임)개의 기설정된(predetermined) 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성하는 행렬 생성부, OCR(Optical Character Reader)을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보 - 상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미함 - 를 텍스트 저장소에 서로 대응시켜 저장하는 텍스트 저장부, 상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬 - 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬 - 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출하는 선 검출부, 상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성하는 전자 문서 생성부, 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 텍스트 삽입부, 상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인하는 텍스트 확인부, 상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성하는 데이터 세트 생성부 및 상기 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료하는 지식 데이터베이스 구축부를 포함한다.A database construction apparatus capable of constructing a knowledge database from an image into which a table is inserted according to an embodiment of the present invention includes a color value storage unit storing a range of color values predetermined as colors of lines constituting a table, and a first table from a user. - In the first table, at least one field name is inserted in each of the first row and first column - When a knowledge database construction command for the inserted first image is received, the first image is horizontally After dividing into rectangular areas having a predetermined size of 2 or more) and vertical m (m is a natural number of 2 or more), a rectangular region having a color corresponding to the color value range among the rectangular regions By assigning a code of 1 to , and a code of 0 to the remaining regions to binarize the first image, the first image is generated using an optical character reader (OCR), a matrix generator that generates an mxn image matrix. After extracting a plurality of texts present in an image, the plurality of texts and text position information in the first image for each of the plurality of texts - the text position information is the upper leftmost point of the first image means information on the relative position of each text in the first image based on Preset mxn vertical line filter matrix for detection - The mxn vertical line filter matrix is assigned a code of 1 to a component constituting a plurality of predetermined first columns among a plurality of columns constituting the mxn vertical line filter matrix, and , a matrix in which codes of 0 are assigned to components constituting the remaining columns - and a preset mxn horizontal line filter matrix for detecting a horizontal line in an image - The mxn horizontal line filter matrix is the mxn horizontal line filter matrix a preset among a plurality of rows constituting the By performing a matrix operation based on a matrix in which a code of 1 is assigned to components constituting the plurality of first rows and a code of 0 is assigned to components constituting the remaining rows, from the first image A line detector detecting a plurality of vertical lines and a plurality of horizontal lines constituting the first table, and after identifying a plurality of cells generated by the plurality of vertical lines and the plurality of horizontal lines, the plurality of cells an electronic document generating unit generating an electronic document having a second table inserted therein; a text insertion unit that completes the configuration of the second table inserted into the electronic document by inserting into After checking at least one first field name inserted into the first row and at least one second field name inserted into the first column of Copy, a vertical field name that is one of the at least one first field name, a horizontal field name that is one of the at least one second field name, and one text inserted into a cell corresponding to the vertical field name and the horizontal field name A data set generator generating a plurality of data sets from the second table inserted into the electronic document by configuring the data set of and a knowledge database construction unit that completes construction of the knowledge database for the first image.

또한, 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법은 표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있는 색상 값 저장부를 유지하는 단계, 사용자로부터 제1 표 - 상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있음 - 가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성하는 단계, OCR을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보 - 상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미함 - 를 텍스트 저장소에 서로 대응시켜 저장하는 단계, 상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬 - 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬 - 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출하는 단계, 상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성하는 단계, 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 단계, 상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인하는 단계, 상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성하는 단계 및 상기 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료하는 단계를 포함한다.In addition, the operating method of the database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention maintains a color value storage unit in which a range of color values predetermined as colors of lines constituting the table is stored. When a knowledge database construction command for a first image in which a first table is inserted, at least one field name is inserted in each of the first row and first column, is received from the user, the first table 1 After dividing an image into n horizontal and m vertical rectangular regions of predetermined sizes, a code of 1 is assigned to a rectangular region having a color corresponding to the color value range among the rectangular regions, and the remaining region generating an mxn image matrix by binarizing the first image by assigning a code of 0 to , extracting a plurality of texts present in the first image using OCR, text position information in the first image for each of a plurality of texts - the text position information is about a relative position of each text within the first image with respect to the upper leftmost point of the first image Meaning information - storing in correspondence with each other in a text storage, for the mxn image matrix, a preset mxn vertical line filter matrix for detecting a vertical line in an image - The mxn vertical line filter matrix is the mxn It is a matrix in which a code of 1 is assigned to a component constituting a plurality of preset first columns among a plurality of columns constituting the vertical filter matrix of A preset mxn horizontal line filter matrix for detecting a horizontal line in the Codes are assigned, and codes of 0 are assigned to the components that make up the remaining rows. is a matrix to which is assigned - detecting a plurality of vertical lines and a plurality of horizontal lines constituting the first table from the first image by performing a matrix operation based on the plurality of vertical lines and the plurality of horizontal lines. generating an electronic document in which a second table composed of the plurality of cells is inserted after identifying a plurality of cells generated by horizontal lines of Completing the configuration of the second table inserted into the electronic document by inserting each of the plurality of texts into the plurality of cells based on the text position information; After checking at least one first field name inserted into the first row and at least one second field name inserted into the first column among the plurality of texts inserted into the plurality of cells constituting the table, the first row and the checking text inserted into cells other than the first column, a vertical field name as one of the at least one first field name, a horizontal field name as one of the at least one second field name, and the vertical field name generating a plurality of data sets from the second table inserted into the electronic document by composing a text inserted into a cell corresponding to the horizontal field name into one data set, and storing the plurality of data sets in a data storage by storing, completing the construction of a knowledge database for the first image into which the first table is inserted.

본 발명에 따른 데이터베이스 구축 장치 및 그 동작 방법은 표가 삽입된 이미지에 대하여, 상기 이미지를 구성하는 복수의 화소들의 색상 값에 따른 이미지 행렬을 생성한 후, 상기 이미지 행렬에 수직선 필터와 수평선 필터를 적용하여 상기 이미지로부터 표를 구성하는 수직선들과 수평선들을 검출하고, 상기 수직선들과 상기 수평선들에 의해 생성되는 복수의 셀들에, 상기 이미지로부터 OCR을 통해 추출한 복수의 텍스트들을 삽입하여 제1 표가 삽입된 전자 문서를 생성하며, 상기 제1 표에 삽입된 필드명과 데이터를 기초로 하는 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 표가 삽입된 이미지로부터 지식 데이터베이스를 구축할 수 있다.A database building apparatus and an operating method thereof according to the present invention generate an image matrix according to color values of a plurality of pixels constituting the image with respect to an image in which a table is inserted, and then add a vertical line filter and a horizontal line filter to the image matrix. The first table is generated by detecting vertical lines and horizontal lines constituting the table from the image by applying it, and inserting a plurality of texts extracted from the image through OCR into a plurality of cells generated by the vertical lines and the horizontal lines. By generating an embedded electronic document and storing a plurality of data sets based on field names and data inserted into the first table in a data storage, a knowledge database can be built from the image into which the table is embedded.

도 1은 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 구조를 도시한 도면이다.
도 2 내지 도 4는 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치를 설명하기 위한 도면이다.
도 5는 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법을 도시한 순서도이다.
1 is a diagram illustrating a structure of a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention.
2 to 4 are diagrams for explaining a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention.
5 is a flowchart illustrating a method of operating a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention.

이하에서는 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명하기로 한다. 이러한 설명은 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였으며, 다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 본 명세서 상에서 사용되는 모든 용어들은 본 발명이 속하는 기술분야에서 통상의 지식을 가진 사람에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다.Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings. These descriptions are not intended to limit the present invention to specific embodiments, and should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. While describing each drawing, like reference numerals are used for similar components, and unless otherwise defined, all terms used in this specification, including technical or scientific terms, refer to those of ordinary skill in the art to which the present invention belongs. It has the same meaning as is commonly understood by those who have it.

본 문서에서, 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있다는 것을 의미한다. 또한, 본 발명의 다양한 실시예들에 있어서, 각 구성요소들, 기능 블록들 또는 수단들은 하나 또는 그 이상의 하부 구성요소로 구성될 수 있고, 각 구성요소들이 수행하는 전기, 전자, 기계적 기능들은 전자회로, 집적회로, ASIC(Application Specific Integrated Circuit) 등 공지된 다양한 소자들 또는 기계적 요소들로 구현될 수 있으며, 각각 별개로 구현되거나 2 이상이 하나로 통합되어 구현될 수도 있다. In this document, when a part "includes" a certain component, it means that other components may be further included, rather than excluding other components, unless otherwise stated. In addition, in various embodiments of the present invention, each of the components, functional blocks or means may be composed of one or more sub-components, and the electrical, electronic, and mechanical functions performed by each component are electronic. A circuit, an integrated circuit, an ASIC (Application Specific Integrated Circuit), etc. may be implemented with various well-known devices or mechanical elements, and may be implemented separately or two or more may be integrated into one.

한편, 첨부된 블록도의 블록들이나 흐름도의 단계들은 범용 컴퓨터, 특수용 컴퓨터, 휴대용 노트북 컴퓨터, 네트워크 컴퓨터 등 데이터 프로세싱이 가능한 장비의 프로세서나 메모리에 탑재되어 지정된 기능들을 수행하는 컴퓨터 프로그램 명령들(instructions)을 의미하는 것으로 해석될 수 있다. 이들 컴퓨터 프로그램 명령들은 컴퓨터 장치에 구비된 메모리 또는 컴퓨터에서 판독 가능한 메모리에 저장될 수 있기 때문에, 블록도의 블록들 또는 흐름도의 단계들에서 설명된 기능들은 이를 수행하는 명령 수단을 내포하는 제조물로 생산될 수도 있다. 아울러, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 명령들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 가능한 실시예들에서는 블록들 또는 단계들에서 언급된 기능들이 정해진 순서와 달리 실행되는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 실질적으로 동시에 수행되거나, 역순으로 수행될 수 있으며, 경우에 따라 일부 블록들 또는 단계들이 생략된 채로 수행될 수도 있다.On the other hand, the blocks in the accompanying block diagram or steps in the flowchart are computer program instructions that are loaded in a processor or memory of equipment capable of data processing, such as a general-purpose computer, a special-purpose computer, a portable notebook computer, and a network computer, and perform specified functions. can be interpreted as meaning Since these computer program instructions may be stored in a memory provided in a computer device or in a memory readable by a computer, the functions described in the blocks of the block diagrams or the steps of the flowcharts are produced as articles of manufacture containing instruction means for performing the same. could be In addition, each block or each step may represent a module, segment, or portion of code comprising one or more executable instructions for executing the specified logical function(s). It should also be noted that, in some alternative embodiments, it is also possible for the functions recited in blocks or steps to be executed out of the prescribed order. For example, two blocks or steps shown one after another may be performed substantially simultaneously or in the reverse order, and in some cases, some blocks or steps may be omitted.

도 1은 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 구조를 도시한 도면이다. 1 is a diagram illustrating a structure of a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치(110)는 색상 값 저장부(111), 행렬 생성부(112), 텍스트 저장부(113), 선 검출부(114), 전자 문서 생성부(115), 텍스트 삽입부(116), 데이터 세트 생성부(117) 및 지식 데이터베이스 구축부(118)를 포함한다. Referring to FIG. 1 , a database building apparatus 110 capable of constructing a knowledge database from an image into which a table is inserted according to an embodiment of the present invention includes a color value storage unit 111 , a matrix generation unit 112 , and text storage. It includes a unit 113 , a line detection unit 114 , an electronic document generation unit 115 , a text insertion unit 116 , a data set generation unit 117 , and a knowledge database construction unit 118 .

색상 값 저장부(111)에는 표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있다.The color value storage unit 111 stores a range of color values that are predetermined as colors of lines constituting the table.

예컨대, 도 2 내지 도 4에서 볼 수 있듯이, 표를 구성하는 선의 색상이 하늘색 계열의 색상으로 이루어진 경우, 색상 값 저장부(111)에는 표를 구성하는 선의 색상으로 하늘색 계열의 색상 값 범위가 저장되어 있을 수 있다.For example, as shown in FIGS. 2 to 4 , when the color of the line constituting the table is made of the color of the sky blue series, the color value storage unit 111 stores the range of the color value of the light blue series as the color of the line constituting the table. may have been

행렬 생성부(112)는 사용자로부터 제1 표가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n(n은 2이상의 자연수임)개, 세로 m(m은 2이상의 자연수임)개의 기설정된(predetermined) 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성한다.When a knowledge database construction command for the first image into which the first table is inserted is received from the user, the matrix generating unit 112 displays n horizontally (n is a natural number greater than or equal to 2) the first image and m vertically (m is a natural number greater than or equal to 2). After dividing into rectangular regions of a predetermined size (which is a natural number equal to or greater than 2), a code of 1 is assigned to a rectangular region having a color corresponding to the color value range among the rectangular regions, and the remaining regions are An mxn image matrix is generated by binarizing the first image by assigning a code of 0 to .

여기서, 상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있다.Here, in the first table, at least one field name is inserted in each of the first row and the first column.

예컨대, 상기 제1 표는 도 2의 도면부호 210에 도시된 그림과 같이, 첫 번째 행(211)과 첫 번째 열(212)에 필드명이 삽입되어 있고, 내부 셀(213)에 각 필드명에 매칭되는 데이터가 삽입되어 있을 수 있다.For example, in the first table, field names are inserted in the first row 211 and first column 212 as shown in reference numeral 210 of FIG. Matching data may be inserted.

이때, 본 발명의 일실시예에 따르면, 행렬 생성부(112)는 평균 값 연산부(120) 및 행렬 생성 처리부(121)를 포함할 수 있다.In this case, according to an embodiment of the present invention, the matrix generation unit 112 may include an average value calculating unit 120 and a matrix generation processing unit 121 .

평균 값 연산부(120)는 상기 사용자로부터 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 상기 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 각각에 대해, 상기 사각 영역들 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산한다.When the average value calculating unit 120 receives a knowledge database construction command for the first image in which the first table is inserted from the user, the average value calculating unit 120 sets the first image in n horizontal and m vertical rectangular areas of the preset size. After dividing into , an average value of color values of a plurality of pixels constituting each of the rectangular regions is calculated for each of the rectangular regions.

행렬 생성 처리부(121)는 상기 사각 영역들 중 상기 복수의 화소들의 색상 값의 평균 값이 상기 색상 값 범위에 포함되는 사각 영역에 대해 1의 코드를 할당하고, 상기 색상 값 범위에 포함되지 않는 사각 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, 상기 m x n의 이미지 행렬을 생성한다.The matrix generation processing unit 121 assigns a code of 1 to a rectangular area in which the average value of the color values of the plurality of pixels among the rectangular areas is included in the color value range, and a square not included in the color value range. By assigning a code of 0 to a region and binarizing the first image, the mxn image matrix is generated.

예컨대, 도 2의 도면부호 210과 같이, 표가 삽입된 '이미지 1'(210)이 존재한다고 가정하자.For example, it is assumed that there is an 'image 1' 210 in which a table is inserted, as shown in reference numeral 210 of FIG. 2 .

평균 값 연산부(120)는 사용자로부터 표가 삽입된 '이미지 1'(210)에 대한 지식 데이터베이스 구축 명령이 수신되면, '이미지 1'(210)을 가로 n개, 세로 m개의 상기 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 각각에 대해, 상기 사각 영역들 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산할 수 있다.When a knowledge database construction command for 'image 1' 210 into which a table is inserted is received from the user, the average value calculating unit 120 aligns the 'image 1' 210 with n horizontal and m vertical values of the preset size. After dividing into rectangular regions, an average value of color values of a plurality of pixels constituting each of the rectangular regions may be calculated for each of the rectangular regions.

여기서, n이 '34', m이 '22'라고 가정하면, 평균 값 연산부(120)는 '이미지 1'(210)을 도면부호 220과 같이 가로 '34'개, 세로 '22'개의 기설정된 크기의 사각 영역들(220)로 분할할 수 있고, 사각 영역들(220) 각각에 대해, 사각 영역들(220) 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산할 수 있다.Here, assuming that n is '34' and m is '22', the average value calculating unit 120 calculates 'image 1' 210 by '34' horizontally and '22' vertically as shown by reference numeral 220. The size of the rectangular regions 220 may be divided, and for each of the rectangular regions 220 , an average value of color values of a plurality of pixels constituting each of the rectangular regions 220 may be calculated.

구체적으로, 평균 값 연산부(120)는 사각 영역들(220) 중 표를 구성하는 선의 영역(221)에 대해 하늘색 계열의 색상 값의 평균 값을 연산할 수 있고, 표 내부의 배경을 구성하는 영역(222)에 대해 하얀색 계열의 색상 값의 평균 값을 연산할 수 있으며, 글자를 구성하는 영역(223)에 대해 검은색 계열의 색상 값의 평균 값을 연산할 수 있다.Specifically, the average value calculating unit 120 may calculate the average value of the color values of the sky blue series with respect to the line region 221 constituting the table among the rectangular regions 220 , and the region constituting the background inside the table. An average value of white color values may be calculated for 222 , and an average value of black color values may be calculated for the region 223 constituting the character.

이후, 행렬 생성 처리부(121)는 사각 영역들(220) 중 상기 복수의 화소들의 색상 값의 평균 값이 앞선 예에서의 상기 색상 값 범위인 하늘색 계열에 포함되는 사각 영역에 대해 1의 코드를 할당하고, 상기 색상 값 범위인 하늘색 계열에 포함되지 않는 사각 영역에 대해 0의 코드를 할당함으로써, '이미지 1'(210)을 이진화할 수 있다. Thereafter, the matrix generation processing unit 121 assigns a code of 1 to a rectangular region included in the light blue series in which the average value of the color values of the plurality of pixels among the rectangular regions 220 is the color value range in the previous example. And, by assigning a code of 0 to a rectangular region that is not included in the sky blue series, which is the color value range, the 'image 1' 210 can be binarized.

즉, 행렬 생성 처리부(121)는 사각 영역들(220) 중 표를 구성하는 선의 영역(221)에 대해서는 1의 코드를 할당하고, 표 내부의 배경을 구성하는 영역(222)과 글자를 구성하는 영역(223)에 대해서는 0의 코드를 할당하여 '이미지 1'(210)을 이진화함으로써, 도면부호 230과 같은 '22' x '34'의 이미지 행렬(230)을 생성할 수 있다.That is, the matrix generation processing unit 121 assigns a code of 1 to the area 221 of the line constituting the table among the rectangular areas 220 , and the area 222 constituting the background of the table and the text constituting the text. By assigning a code of 0 to the region 223 and binarizing the 'image 1' 210 , an image matrix 230 of '22' x '34' such as 230 may be generated.

텍스트 저장부(113)는 OCR(Optical Character Reader)을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보를 텍스트 저장소(미도시)에 서로 대응시켜 저장한다.The text storage unit 113 extracts a plurality of texts present in the first image by using an optical character reader (OCR), and then extracts the plurality of texts and the plurality of texts in the first image for each of the plurality of texts. of the text location information is stored in correspondence with each other in a text storage (not shown).

여기서, 상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미한다.Here, the text position information means information on the relative position of each text in the first image with respect to the upper leftmost point of the first image.

또한, 상기 OCR은 종이에 인쇄되거나 손으로 쓴 문자를 광학적 수단에 의해 인식하여 컴퓨터 텍스트로 변환하는 입력 장치를 의미하는 것으로, 스마트폰을 통한 전자상거래 결제 시, 결제하려는 신용카드에 대한 정보를 직접 입력하는 대신 스마트폰에 내장된 카메라를 통해 촬영함으로써, 촬영된 신용카드의 이미지에서 카드 번호와 유효 기간 등이 자동으로 추출되는 등에 활용될 수 있다.In addition, the OCR refers to an input device that recognizes printed or handwritten characters on paper by optical means and converts them into computer text. By taking a picture through the camera built into the smartphone instead of inputting it, the card number and expiration date can be automatically extracted from the photographed credit card image.

관련해서, 도 3의 '이미지 1'(210)에 삽입된 표에는 'A', 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'라는 복수의 텍스트들이 입력되어 있다.In relation to this, in the table inserted in 'image 1' 210 of FIG. 3, 'A', 'B', 'a', 'I', 'data 1', 'data 2', 'data 3' and ' A plurality of texts of data 4' are input.

도 3을 참조하면, 텍스트 저장부(113)는 OCR을 이용하여 '이미지 1'(210) 내에 존재하는 상기 복수의 텍스트들인 'A', 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'를 추출한 후, 상기 복수의 텍스트들인 'A', 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'와 상기 복수의 텍스트들 각각에 대한 '이미지 1'(210) 내에서의 텍스트 위치 정보를 텍스트 저장소에 서로 대응시켜 저장할 수 있다.Referring to FIG. 3 , the text storage unit 113 uses OCR to store the plurality of texts 'A', 'B', 'A', 'I', and 'data present in the 'image 1' 210 . After extracting 1', 'Data 2', 'Data 3' and 'Data 4', the plurality of texts 'A', 'B', 'A', 'I', 'Data 1', 'Data 2' ', 'data 3' and 'data 4' and text location information in 'image 1' 210 for each of the plurality of texts may be stored in correspondence with each other in a text storage.

구체적으로, 텍스트 저장부(113)는 상기 복수의 텍스트들 중 'A'에 대한 텍스트 위치 정보로 '이미지 1'(210)의 최좌측 상단 지점(311)에서 'A'에 대한 텍스트 중간 지점(312)까지의 수평 거리(313)와 수직 거리(314)를 측정한 후, 'A'와, 'A'에 대한 텍스트 위치 정보인 수평 거리(313) 및 수직 거리(314)를 상기 텍스트 저장소에 서로 대응시켜 저장할 수 있다.Specifically, the text storage unit 113 is the text position information for 'A' among the plurality of texts, from the upper leftmost point 311 of 'Image 1' 210 to the middle point of the text for 'A' ( After measuring the horizontal distance 313 and the vertical distance 314 to They can be stored in correspondence with each other.

그리고 텍스트 저장부(113)는 같은 방식으로 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'에 대해서도 텍스트 위치 정보를 획득하여, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 텍스트 위치 정보를 상기 텍스트 저장소에 서로 대응시켜 저장할 수 있다. In the same way, the text storage unit 113 obtains text location information for 'B', 'A', 'I', 'Data 1', 'Data 2', 'Data 3' and 'Data 4'. , the plurality of texts and text location information for each of the plurality of texts may be stored in correspondence with each other in the text storage.

선 검출부(114)는 상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출한다.With respect to the mxn image matrix, the line detection unit 114 is based on a predetermined mxn vertical line filter matrix for detecting a vertical line in the image and a predetermined mxn horizontal line filter matrix for detecting a horizontal line in the image. By performing one matrix operation, a plurality of vertical lines and a plurality of horizontal lines constituting the first table are detected from the first image.

여기서, 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬이고, 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬이다.Here, in the mxn vertical line filter matrix, a code of 1 is assigned to a component constituting a plurality of preset first columns among a plurality of columns constituting the mxn vertical line filter matrix, and 0 is assigned to a component constituting the remaining columns. is a matrix to which codes of , and the mxn horizontal line filter matrix is assigned a code of 1 to components constituting a plurality of preset first rows among a plurality of rows constituting the mxn horizontal line filter matrix, and the remaining It is a matrix in which codes of 0 are assigned to the components constituting the rows.

관련해서, 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 상기 복수의 열들 중 미리 정해진 표 양식에 따라, 수직선에 대응하는 영역에 1의 코드가 할당되고, 수직선에 대응하지 않는 영역에 0의 코드가 할당되도록 미리 구성되어 있을 수 있다.In relation to this, in the mxn vertical line filter matrix, a code of 1 is assigned to an area corresponding to a vertical line according to a predetermined table format among the plurality of columns constituting the mxn vertical line filter matrix, and an area not corresponding to the vertical line It may be configured in advance so that a code of 0 is assigned to .

마찬가지로, 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 상기 복수의 행들 중 미리 정해진 표 양식에 따라, 수평선에 대응하는 영역에 1의 코드가 할당되고, 수평선에 대응하지 않는 영역에 0의 코드가 할당되도록 미리 구성되어 있을 수 있다.Similarly, in the mxn horizontal line filter matrix, a code of 1 is assigned to an area corresponding to a horizontal line according to a predetermined table format among the plurality of rows constituting the mxn horizontal line filter matrix, and a code of 1 is assigned to an area not corresponding to the horizontal line. It may be preconfigured to be assigned a code of zero.

이때, 본 발명의 일실시예에 따르면, 선 검출부(114)는 연산부(122) 및 선 검출 처리부(123)를 포함할 수 있다.In this case, according to an embodiment of the present invention, the line detection unit 114 may include a calculation unit 122 and a line detection processing unit 123 .

연산부(122)는 상기 m x n의 이미지 행렬과 상기 m x n의 수직선 필터 행렬 간의 아다마르 곱(Hadamard product)을 연산하여 m x n의 제1 연산 행렬을 생성하고, 상기 m x n의 이미지 행렬과 상기 m x n의 수평선 필터 행렬 간의 아다마르 곱을 연산하여 m x n의 제2 연산 행렬을 생성한 후, 상기 m x n의 제1 연산 행렬과 상기 m x n의 제2 연산 행렬 간의 논리합 연산(OR)을 수행하여 m x n의 제3 연산 행렬을 생성한다.The operation unit 122 calculates a Hadamard product between the mxn image matrix and the mxn vertical line filter matrix to generate an mxn first operation matrix, and the mxn image matrix and the mxn horizontal line filter matrix After generating a second operation matrix of mxn by calculating the Hadamard product between .

여기서, 아다마르 곱이란 같은 크기의 행렬 또는 벡터에서 각 성분을 곱하는 연산을 의미하는 것으로, '[a b c]'와 '[x y z]'라는 두 행렬이 있을 때, 상기 두 행렬 간의 아다마르 곱을 연산한 행렬은 '[ax by cz]'로 나타낼 수 있다.Here, the Hadamard product means an operation of multiplying each component in a matrix or vector of the same size. When there are two matrices '[abc]' and '[xyz]', A matrix can be expressed as '[ax by cz]'.

선 검출 처리부(123)는 상기 제1 이미지에서, 상기 m x n의 제3 연산 행렬을 구성하는 성분들 중 1의 코드가 할당된 성분들에 대응되는 지점들을 선을 구성하는 영역으로 확인함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 상기 복수의 수직선들과 상기 복수의 수평선들을 검출한다.In the first image, the line detection processing unit 123 identifies points corresponding to components to which a code of 1 is assigned among components constituting the mxn third operation matrix as regions constituting the line, From one image, the plurality of vertical lines and the plurality of horizontal lines constituting the first table are detected.

관련해서, 상기 제1 이미지에 대한 상기 m x n의 이미지 행렬이 하기의 수학식 1과 같은 '9' x '7' 행렬이라고 가정하고, 상기 m x n의 수직선 필터 행렬이 하기의 수학식 2와 같은 '9' x '7' 행렬이라고 가정하며, 상기 m x n의 수평선 필터 행렬이 하기의 수학식 3과 같은 '9' x '7' 행렬이라고 가정하고, 연산부(122)와 선 검출 처리부(123)의 동작을 설명하면 다음과 같다.In this regard, it is assumed that the mxn image matrix for the first image is a '9' x '7' matrix as in Equation 1 below, and the mxn vertical filter matrix is '9 as in Equation 2 below. Assume that it is a 'x'7' matrix, and it is assumed that the mxn horizontal line filter matrix is a '9' x '7' matrix as shown in Equation 3 below, and the operation of the operation unit 122 and the line detection processing unit 123 is performed. The explanation is as follows.

Figure 112019130333401-pat00001
Figure 112019130333401-pat00001

Figure 112019130333401-pat00002
Figure 112019130333401-pat00002

Figure 112019130333401-pat00003
Figure 112019130333401-pat00003

우선, 연산부(122)는 하기의 수학식 4와 같이 상기 '9' x '7'의 이미지 행렬과 상기 '9' x '7'의 수직선 필터 행렬 간의 아다마르 곱을 연산함으로써, 미리 정해진 표 양식에 따라 수직선에 대응하는 영역과 일치하는 영역만이 검출되도록 '9' x '7'의 제1 연산 행렬을 생성할 수 있다. First, the operation unit 122 calculates the Hadamard product between the image matrix of '9' x '7' and the vertical filter matrix of '9' x '7' as shown in Equation 4 below, and in a predetermined table form Accordingly, a first operation matrix of '9' x '7' may be generated so that only an area matching the area corresponding to the vertical line is detected.

Figure 112019130333401-pat00004
Figure 112019130333401-pat00004

그리고, 연산부(122)는 하기의 수학식 5와 같이, 상기 '9' x '7'의 이미지 행렬과 상기 '9' x '7'의 수평선 필터 행렬 간의 아다마르 곱을 연산함으로써, 상기 미리 정해진 표 양식에 따라 수평선에 대응하는 영역과 일치하는 영역만이 검출되도록 '9' x '7'의 제2 연산 행렬을 생성할 수 있다. In addition, the operation unit 122 calculates the Hadamard product between the image matrix of '9' x '7' and the horizontal line filter matrix of '9' x '7', as shown in Equation 5 below, by calculating the predetermined table A second operation matrix of '9' x '7' may be generated so that only an area matching the area corresponding to the horizontal line is detected according to the style.

Figure 112019130333401-pat00005
Figure 112019130333401-pat00005

그 이후, 연산부(122)는 하기의 수학식 6과 같이, 상기 '9' x '7'의 제1 연산 행렬과 상기 '9' x '7'의 제2 연산 행렬 간의 논리합 연산(OR)을 수행함으로써, '9' x '7'의 제3 연산 행렬을 생성할 수 있다.After that, the operation unit 122 performs an OR operation between the first operation matrix of '9' x '7' and the second operation matrix of '9' x '7' as shown in Equation 6 below. By doing so, a third operation matrix of '9' x '7' may be generated.

Figure 112019130333401-pat00006
Figure 112019130333401-pat00006

이렇게, 연산부(122)를 통해, 상기 수학식 6에서와 같은 상기 '9' x '7'의 제3 연산 행렬이 생성되면, 선 검출 처리부(123)는 제1 이미지에서, 상기 '9' x '7'의 제3 연산 행렬을 구성하는 성분들 중 1의 코드가 할당된 성분들에 대응되는 지점들을 선을 구성하는 영역으로 확인함으로써, 도 4에 도시된 그림과 같이, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출할 수 있다.In this way, when the third operation matrix of '9' x '7' as in Equation 6 is generated through the operation unit 122 , the line detection processing unit 123 in the first image, the '9' × By identifying points corresponding to the components to which the code of 1 is assigned among the components constituting the third operation matrix of '7' as regions constituting the line, as shown in FIG. 4, from the first image A plurality of vertical lines and a plurality of horizontal lines constituting the first table may be detected.

전자 문서 생성부(115)는 상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성한다.The electronic document generator 115 identifies a plurality of cells generated by the plurality of vertical lines and the plurality of horizontal lines, and then generates an electronic document into which a second table composed of the plurality of cells is inserted.

텍스트 삽입부(116)는 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료한다.The text insertion unit 116 inserts each of the plurality of texts into the plurality of cells based on the text position information in the first image for each of the plurality of texts, thereby inserting the text into the electronic document. Complete the configuration of the above second table.

이때, 본 발명의 일실시예에 따르면, 텍스트 삽입부(116)는 삽입 지점 연산부(124) 및 삽입 처리부(125)를 포함할 수 있다.In this case, according to an embodiment of the present invention, the text insertion unit 116 may include an insertion point calculating unit 124 and an insertion processing unit 125 .

삽입 지점 연산부(124)는 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각에 대한 상기 전자 문서 내에서의 텍스트 삽입 지점을 연산한다.The insertion point calculating unit 124 calculates a text insertion point in the electronic document for each of the plurality of texts based on the text position information in the first image for each of the plurality of texts. .

여기서, 상기 텍스트 삽입 지점은 상기 전자 문서의 최좌측 상단 지점을 기준으로 상기 텍스트 위치 정보에 따른 위치를 연산한 지점을 의미한다.Here, the text insertion point means a point at which a position according to the text location information is calculated based on the upper leftmost point of the electronic document.

삽입 처리부(125)는 상기 복수의 텍스트들 각각에 대하여, 상기 전자 문서에 삽입된 상기 제2 표를 구성하는 상기 복수의 셀들 중 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀을 확인한 후, 상기 복수의 텍스트들 각각을 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료한다.The insertion processing unit 125 selects, for each of the plurality of texts, a cell including the text insertion point for each of the plurality of texts among the plurality of cells constituting the second table inserted into the electronic document. After checking, by inserting each of the plurality of texts into a cell including the text insertion point for each of the plurality of texts, the construction of the second table inserted into the electronic document is completed.

예컨대, 전술한 예에 따라 도 3을 참조하여 설명하면, 삽입 지점 연산부(124)는 우선, 상기 복수의 텍스트들 중 'A'에 대한 텍스트 위치 정보인 '이미지 1'(210)의 최좌측 상단 지점(311)에서 'A'에 대한 텍스트 중간 지점(312)까지의 수평 거리(313)와 수직 거리(314)를 기초로, 상기 전자 문서 내에서의 최좌측 상단 지점을 기준으로 한 수직 거리(313)와 수평 거리(314)에 따른 지점을 연산함으로써, 'A'에 대한 텍스트 삽입 지점을 연산할 수 있다.For example, as described with reference to FIG. 3 according to the above-described example, the insertion point calculating unit 124 first, the leftmost upper end of 'image 1' 210, which is text location information for 'A' among the plurality of texts. Based on the horizontal distance 313 and the vertical distance 314 from the point 311 to the text midpoint 312 for 'A', the vertical distance ( 313) and the horizontal distance 314 are calculated, the text insertion point for 'A' may be calculated.

이와 같은 방식으로, 삽입 지점 연산부(124)는 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'에 대해서도, '이미지 1'(210) 내에서의 상기 텍스트 위치 정보를 기초로, 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4' 각각에 대한 상기 전자 문서 내에서의 텍스트 삽입 지점을 연산할 수 있다.In this way, the insertion point calculating unit 124 also for 'B', 'A', 'I', 'Data 1', 'Data 2', 'Data 3' and 'Data 4', 'Image 1' Based on the text position information within 210, the electronic You can calculate the text insertion point within a document.

이후, 삽입 처리부(125)는 상기 복수의 텍스트들인 'A', 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4' 각각에 대하여, 상기 전자 문서에 삽입된 상기 제2 표를 구성하는 상기 복수의 셀들 중 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀을 확인한 후, 상기 복수의 텍스트들 각각을 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료할 수 있다.Thereafter, the insertion processing unit 125 is inserted into each of the plurality of texts 'A', 'B', 'A', 'I', 'Data 1', 'Data 2', 'Data 3' and 'Data 4'. In relation to, after identifying a cell including the text insertion point for each of the plurality of texts among the plurality of cells constituting the second table inserted into the electronic document, each of the plurality of texts is inserted into the plurality of texts. By inserting into a cell including the text insertion point for each of the texts, the construction of the second table inserted into the electronic document may be completed.

이렇게, 데이터베이스 구축 장치(110)는 상기 제1 이미지로부터 검출된 상기 복수의 수직선들과 상기 복수의 수평선들에 의해 구성되는 상기 제2 표가 삽입된 상기 전자 문서에, 상기 제1 이미지로부터 추출된 상기 복수의 텍스트들을 삽입함으로써, 상기 제1 이미지에 삽입된 상기 제1 표와 동일하게 구성된 표인 상기 제2 표가 삽입된 전자 문서가 생성되도록 지원할 수 있다.In this way, the database building apparatus 110 is extracted from the first image in the electronic document in which the second table constituted by the plurality of vertical lines and the plurality of horizontal lines detected from the first image is inserted. By inserting the plurality of texts, it is possible to support generation of an electronic document in which the second table, which is a table configured the same as that of the first table inserted into the first image, is inserted.

그리고, 텍스트 확인부(117)는 상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인한다.In addition, when the configuration of the second table is completed, the text check unit 117 includes at least one first field inserted into a first row among the plurality of texts inserted into the plurality of cells constituting the second table. After checking the name and at least one second field name inserted into the first column, the text inserted into the cells other than the first row and the first column is checked.

데이터 세트 생성부(118)는 상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성한다. The data set generating unit 118 is configured to generate a vertical field name as one of the at least one first field name, a horizontal field name as one of the at least one second field name, and a cell corresponding to the vertical field name and the horizontal field name. By composing the text inserted into one data set, a plurality of data sets are generated from the second table inserted into the electronic document.

지식 데이터베이스 구축부(119)는 상기 복수의 데이터 세트들을 데이터 저장소(미도시)에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료한다.The knowledge database construction unit 119 stores the plurality of data sets in a data storage (not shown), thereby completing the construction of the knowledge database for the first image in which the first table is inserted.

관련해서, 앞선 예에 따라 '이미지 1'(210)에 삽입된 표와 동일하게 구성된 상기 제2 표의 구성이 완료되면, 텍스트 확인부(117)는 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들인 'A', 'B', '가', '나', '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4' 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명으로 'A' 및 'B'를 확인하고, 첫 번째 열에 삽입된 적어도 하나의 제2 필드명으로 '가' 및 '나'를 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트로 '데이터 1', '데이터 2', '데이터 3' 및 '데이터 4'를 확인할 수 있다.In relation to the above example, when the configuration of the second table configured to be the same as that of the table inserted in 'Image 1' 210 is completed, the text check unit 117 may At least inserted into the first row among the plurality of inserted texts 'A', 'B', 'A', 'I', 'Data 1', 'Data 2', 'Data 3' and 'Data 4' After checking 'A' and 'B' as one first field name, and checking 'A' and 'I' as at least one second field name inserted in the first column, the first row and first column 'Data 1', 'Data 2', 'Data 3', and 'Data 4' can be checked as text inserted in the remaining cells.

데이터 세트 생성부(118)는 상기 적어도 하나의 제1 필드명 중 'A'라고 하는 세로 필드명과 상기 적어도 하나의 제2 필드명 중 '가'라고 하는 가로 필드명, 및 'A'와 '가'에 대응되는 셀에 삽입된 '데이터 1'을 '(A, 가, 데이터 1)'이라고 하는 하나의 데이터 세트로 구성하는 방식으로, 'A', 'B'와 '가', '나' 각각에 대응하는 데이터 세트들을 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들인 '(A, 가, 데이터 1)', '(A, 나, 데이터 2)', '(B, 가, 데이터 3)' 및 '(B, 나, 데이터 4)'를 생성할 수 있다.The data set generating unit 118 is configured to include a vertical field name called 'A' among the at least one first field name, a horizontal field name called 'A' among the at least one second field name, and 'A' and 'A'. 'Data 1' inserted into the cell corresponding to ' is composed of one data set called '(A, A, Data 1)'. By constructing data sets corresponding to each of the plurality of data sets from the second table inserted into the electronic document, '(A, A, Data 1)', '(A, Me, Data 2)', '( B, A, Data 3)' and '(B, B, Data 4)' can be generated.

지식 데이터베이스 구축부(119)는 상기 복수의 데이터 세트들인 '(A, 가, 데이터 1)', '(A, 나, 데이터 2)', '(B, 가, 데이터 3)' 및 '(B, 나, 데이터 4)'를 데이터 저장소에 저장함으로써, 표가 삽입된 '이미지 1'(210)에 대한 지식 데이터베이스의 구축을 완료할 수 있다.The knowledge database building unit 119 is configured to construct the plurality of data sets '(A, A, Data 1)', '(A, Me, Data 2)', '(B, A, Data 3)' and '(B). , I, data 4)' can be stored in the data storage, thereby completing the construction of the knowledge database for the 'image 1' 210 in which the table is inserted.

도 5는 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법을 도시한 순서도이다.5 is a flowchart illustrating a method of operating a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention.

단계(S510)에서는 표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있는 색상 값 저장부를 유지한다.In step S510, a color value storage unit in which a color value range predetermined as the color of the line constituting the table is stored is maintained.

단계(S520)에서는 사용자로부터 제1 표(상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있음)가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성한다.In step S520, when a knowledge database building command is received from the user for the first image in which the first table (the first table has at least one field name inserted in each of the first row and first column) is received from the user, After dividing the first image into n horizontal and m vertical rectangular regions of predetermined sizes, a code of 1 is assigned to a rectangular region having a color corresponding to the color value range among the rectangular regions, An mxn image matrix is generated by binarizing the first image by assigning a code of 0 to the remaining regions.

단계(S530)에서는 OCR을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보(상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미함)를 텍스트 저장소에 서로 대응시켜 저장한다.In step S530, after extracting a plurality of texts existing in the first image using OCR, the plurality of texts and text position information (the text) in the first image for each of the plurality of texts The location information refers to information on the relative position of each text with respect to the upper leftmost point of the first image in the first image) in correspondence with each other and stores the text storage.

단계(S540)에서는 상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬(상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임)과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬(상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임)을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출한다.In step S540, for the mxn image matrix, a preset mxn vertical line filter matrix for detecting vertical lines in the image (the mxn vertical line filter matrix is one of the plurality of columns constituting the mxn vertical line filter matrix) A matrix in which a code of 1 is assigned to components constituting a plurality of preset first columns and codes of 0 are assigned to components constituting the remaining columns) and a preset mxn for detecting a horizontal line in an image A horizontal filter matrix of (the mxn horizontal line filter matrix is assigned a code of 1 to a component constituting a plurality of preset first rows among a plurality of rows constituting the mxn horizontal line filter matrix, and composing the remaining rows A plurality of vertical lines and a plurality of horizontal lines constituting the first table are detected from the first image by performing a matrix operation based on a matrix in which codes of 0 are assigned to components.

단계(S550)에서는 상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성한다.In step S550 , after checking a plurality of cells generated by the plurality of vertical lines and the plurality of horizontal lines, an electronic document into which a second table composed of the plurality of cells is inserted is generated.

단계(S560)에서는 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료한다.In step S560, each of the plurality of texts is inserted into the plurality of cells on the basis of the text position information in the first image for each of the plurality of texts, so that the Complete the configuration of the second table.

단계(S570)에서는 상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인한다.In step S570, when the construction of the second table is completed, at least one first field name inserted in the first row among the plurality of texts inserted into the plurality of cells constituting the second table and the first column After checking the name of the at least one inserted second field, text inserted into the remaining cells except for the first row and the first column is checked.

단계(S580)에서는 상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성한다.In step S580, a vertical field name that is one of the at least one first field name, a horizontal field name that is one of the at least one second field name, and a cell corresponding to the vertical field name and the horizontal field name are inserted By composing text into one data set, a plurality of data sets are generated from the second table inserted in the electronic document.

단계(S590)에서는 상기 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료한다.In step S590, by storing the plurality of data sets in a data storage, the construction of the knowledge database for the first image in which the first table is inserted is completed.

이때, 본 발명의 일실시예에 따르면, 단계(S520)에서는 상기 사용자로부터 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 상기 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 각각에 대해, 상기 사각 영역들 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산하는 단계 및 상기 사각 영역들 중 상기 복수의 화소들의 색상 값의 평균 값이 상기 색상 값 범위에 포함되는 사각 영역에 대해 1의 코드를 할당하고, 상기 색상 값 범위에 포함되지 않는 사각 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성하는 단계를 포함할 수 있다.At this time, according to an embodiment of the present invention, in step S520 , when a knowledge database construction command for the first image into which the first table is inserted is received from the user, the first image is displayed in n horizontally and vertically calculating an average value of color values of a plurality of pixels constituting each of the rectangular regions for each of the rectangular regions after dividing the m rectangular regions of the predetermined size; A code of 1 is assigned to a rectangular area in which the average value of the color values of the plurality of pixels is included in the color value range, and a code of 0 is assigned to a rectangular area not included in the color value range. by binarizing the image, generating an mxn image matrix.

또한, 본 발명의 일실시예에 따르면, 단계(S540)에서는 상기 m x n의 이미지 행렬과 상기 m x n의 수직선 필터 행렬 간의 아다마르 곱을 연산하여 m x n의 제1 연산 행렬을 생성하고, 상기 m x n의 이미지 행렬과 상기 m x n의 수평선 필터 행렬 간의 아다마르 곱을 연산하여 m x n의 제2 연산 행렬을 생성한 후, 상기 m x n의 제1 연산 행렬과 상기 m x n의 제2 연산 행렬 간의 논리합 연산을 수행하여 m x n의 제3 연산 행렬을 생성하는 단계 및 상기 제1 이미지에서, 상기 m x n의 제3 연산 행렬을 구성하는 성분들 중 1의 코드가 할당된 성분들에 대응되는 지점들을 선을 구성하는 영역으로 확인함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 상기 복수의 수직선들과 상기 복수의 수평선들을 검출하는 단계를 포함할 수 있다.In addition, according to an embodiment of the present invention, in step S540, a Hadamard product between the mxn image matrix and the mxn vertical filter matrix is calculated to generate an mxn first operation matrix, and the mxn image matrix and After generating an mxn second operation matrix by calculating the Hadamard product between the mxn horizontal line filter matrices, an OR operation is performed between the mxn first operation matrix and the mxn second operation matrix to perform a third operation matrix of mxn generating and in the first image, by identifying points corresponding to components to which a code of 1 is assigned among components constituting the mxn third operation matrix as regions constituting a line, the first image It may include detecting the plurality of vertical lines and the plurality of horizontal lines constituting the first table from

또한, 본 발명의 일실시예에 따르면, 단계(S560)에서는 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각에 대한 상기 전자 문서 내에서의 텍스트 삽입 지점(상기 텍스트 삽입 지점은 상기 전자 문서의 최좌측 상단 지점을 기준으로 상기 텍스트 위치 정보에 따른 위치를 연산한 지점을 의미함)을 연산하는 단계 및 상기 복수의 텍스트들 각각에 대하여, 상기 전자 문서에 삽입된 상기 제2 표를 구성하는 상기 복수의 셀들 중 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀을 확인한 후, 상기 복수의 텍스트들 각각을 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 단계를 포함할 수 있다.Further, according to an embodiment of the present invention, in step S560, the electronic document for each of the plurality of texts based on the text position information in the first image for each of the plurality of texts. calculating a text insertion point within In relation to, after identifying a cell including the text insertion point for each of the plurality of texts among the plurality of cells constituting the second table inserted into the electronic document, each of the plurality of texts is inserted into the plurality of texts. and completing the construction of the second table inserted into the electronic document by inserting the text into a cell containing the text insertion point for each of the texts.

이상, 도 5를 참조하여 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법에 대해 설명하였다. 여기서, 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법은 도 1 내지 도 4를 이용하여 설명한 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치(110)의 동작에 대한 구성과 대응될 수 있으므로, 이에 대한 보다 상세한 설명은 생략하기로 한다.As described above, with reference to FIG. 5, a method of operating a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention has been described. Here, in the operating method of the apparatus for constructing a database capable of constructing a knowledge database from an image into which a table is inserted according to an embodiment of the present invention, it is possible to construct a knowledge database from an image in which a table is inserted as described with reference to FIGS. 1 to 4 . Since it may correspond to the configuration of the operation of the database building apparatus 110, a more detailed description thereof will be omitted.

본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법은 컴퓨터와의 결합을 통해 실행시키기 위한 저장매체에 저장된 컴퓨터 프로그램으로 구현될 수 있다.The method of operating a database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention may be implemented as a computer program stored in a storage medium for execution through combination with a computer.

또한, 본 발명의 일실시예에 따른 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법은 컴퓨터와의 결합을 통해 실행시키기 위한 컴퓨터 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. In addition, the operating method of the database building apparatus capable of constructing a knowledge database from an image in which a table is inserted according to an embodiment of the present invention is implemented in the form of a computer program instruction for execution through combination with a computer and is stored in a computer readable medium. can be recorded. The computer-readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the art of computer software. Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic such as floppy disks. - includes magneto-optical media, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like.

이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. As described above, the present invention has been described with specific matters such as specific components and limited embodiments and drawings, but these are provided to help a more general understanding of the present invention, and the present invention is not limited to the above embodiments. , various modifications and variations are possible from these descriptions by those of ordinary skill in the art to which the present invention pertains.

따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.Therefore, the spirit of the present invention should not be limited to the described embodiments, and not only the claims to be described later, but also all those with equivalent or equivalent modifications to the claims will be said to belong to the scope of the spirit of the present invention. .

110: 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치
111: 색상 값 저장부 112: 행렬 생성부
113: 텍스트 저장부 114: 선 검출부
115: 전자 문서 생성부 116: 텍스트 삽입부
117: 텍스트 확인부 118: 데이터 세트 생성부
119: 지식 데이터베이스 구축부 120: 평균 값 연산부
121: 행렬 생성 처리부 122: 연산부
123: 선 검출 처리부 124: 삽입 지점 연산부
125: 삽입 처리부
110: Database building device capable of constructing a knowledge database from an image in which a table is inserted
111: color value storage unit 112: matrix generation unit
113: text storage unit 114: line detection unit
115: electronic document generating unit 116: text insertion unit
117: text confirmation unit 118: data set generation unit
119: knowledge database construction unit 120: average value calculation unit
121: matrix generation processing unit 122: operation unit
123: line detection processing unit 124: insertion point calculation unit
125: insert processing unit

Claims (10)

표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있는 색상 값 저장부;
사용자로부터 제1 표 - 상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있음 - 가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n(n은 2이상의 자연수임)개, 세로 m(m은 2이상의 자연수임)개의 기설정된(predetermined) 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성하는 행렬 생성부;
OCR(Optical Character Reader)을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보 - 상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미함 - 를 텍스트 저장소에 서로 대응시켜 저장하는 텍스트 저장부;
상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬 - 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬 - 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출하는 선 검출부;
상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성하는 전자 문서 생성부;
상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 텍스트 삽입부;
상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인하는 텍스트 확인부;
상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성하는 데이터 세트 생성부; 및
상기 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료하는 지식 데이터베이스 구축부
를 포함하고,
상기 행렬 생성부는
상기 사용자로부터 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 상기 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 각각에 대해, 상기 사각 영역들 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산하는 평균 값 연산부; 및
상기 사각 영역들 중 상기 복수의 화소들의 색상 값의 평균 값이 상기 색상 값 범위에 포함되는 사각 영역에 대해 1의 코드를 할당하고, 상기 색상 값 범위에 포함되지 않는 사각 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, 상기 m x n의 이미지 행렬을 생성하는 행렬 생성 처리부
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치.
a color value storage unit storing a range of color values predetermined as colors of lines constituting the table;
When a knowledge database building command is received from the user for the first image in which the first table, in which at least one field name is inserted in each of the first row and the first column, is received, the first image is created After dividing the rectangle into n horizontal (n is a natural number greater than or equal to 2) and m vertical (m is a natural number greater than or equal to 2) rectangular regions having a predetermined size, one of the rectangular regions corresponding to the color value range a matrix generator for generating an mxn image matrix by assigning a code of 1 to a rectangular region having a color and binarizing the first image by assigning a code of 0 to the remaining regions;
After extracting a plurality of texts present in the first image using an optical character reader (OCR), the plurality of texts and text position information in the first image for each of the plurality of texts - the text a text storage unit for storing information on the relative position of each text in the first image with respect to the upper leftmost point of the first image in correspondence with each other in a text storage;
For the mxn image matrix, a preset mxn vertical line filter matrix for detecting a vertical line in an image - The mxn vertical line filter matrix is a predetermined plurality of columns constituting the mxn vertical line filter matrix. It is a matrix in which a code of 1 is assigned to the components constituting 1 column and a code of 0 is assigned to the components constituting the remaining columns - and a preset mxn horizontal line filter matrix for detecting a horizontal line in an image - In the mxn horizontal line filter matrix, a code of 1 is assigned to a component constituting a plurality of preset first rows among a plurality of rows constituting the mxn horizontal line filter matrix, and a code of 0 is assigned to a component constituting the remaining rows. a line detection unit configured to detect a plurality of vertical lines and a plurality of horizontal lines constituting the first table from the first image by performing a matrix operation based on − is a matrix to which α is allocated;
an electronic document generating unit generating an electronic document into which a second table composed of the plurality of cells is inserted after checking a plurality of cells generated by the plurality of vertical lines and the plurality of horizontal lines;
The configuration of the second table inserted into the electronic document by inserting each of the plurality of texts into the plurality of cells based on the text position information in the first image for each of the plurality of texts text insert to complete;
When the configuration of the second table is completed, at least one first field name inserted in the first row among the plurality of texts inserted into the plurality of cells constituting the second table and at least one first field name inserted in the first column a text checking unit for checking the text inserted into cells other than the first row and the first column after checking the second field name;
A vertical field name that is one of the at least one first field name, a horizontal field name that is one of the at least one second field name, and a text inserted into a cell corresponding to the vertical field name and the horizontal field name are combined into one data. a data set generating unit that generates a plurality of data sets from the second table inserted in the electronic document by configuring them as a set; and
A knowledge database construction unit that completes construction of a knowledge database for the first image in which the first table is inserted by storing the plurality of data sets in a data storage
including,
The matrix generator
When a knowledge database construction command for the first image in which the first table is inserted is received from the user, the first image is divided into n horizontal and m vertical rectangular regions of the predetermined size, and then the an average value calculating unit for calculating an average value of color values of a plurality of pixels constituting each of the rectangular regions; and
A code of 1 is assigned to a rectangular region in which the average value of the color values of the plurality of pixels among the rectangular regions is included in the color value range, and a code of 0 is assigned to a rectangular region not included in the color value range. A matrix generation processing unit for generating the mxn image matrix by binarizing the first image by allocating
A database building device capable of constructing a knowledge database from an image with a table embedded in it.
삭제delete 제1항에 있어서,
상기 선 검출부는
상기 m x n의 이미지 행렬과 상기 m x n의 수직선 필터 행렬 간의 아다마르 곱(Hadamard product)을 연산하여 m x n의 제1 연산 행렬을 생성하고, 상기 m x n의 이미지 행렬과 상기 m x n의 수평선 필터 행렬 간의 아다마르 곱을 연산하여 m x n의 제2 연산 행렬을 생성한 후, 상기 m x n의 제1 연산 행렬과 상기 m x n의 제2 연산 행렬 간의 논리합 연산(OR)을 수행하여 m x n의 제3 연산 행렬을 생성하는 연산부; 및
상기 제1 이미지에서, 상기 m x n의 제3 연산 행렬을 구성하는 성분들 중 1의 코드가 할당된 성분들에 대응되는 지점들을 선을 구성하는 영역으로 확인함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 상기 복수의 수직선들과 상기 복수의 수평선들을 검출하는 선 검출 처리부
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치.
According to claim 1,
The line detection unit
A Hadamard product between the mxn image matrix and the mxn vertical line filter matrix is calculated to generate an mxn first operation matrix, and the Hadamard product between the mxn image matrix and the mxn horizontal line filter matrix is calculated an arithmetic unit for generating an mxn second operation matrix and then performing an OR operation (OR) between the mxn first operation matrix and the mxn second operation matrix to generate a mxn third operation matrix; and
In the first image, by identifying points corresponding to the components to which the code of 1 is assigned among the components constituting the mxn third operation matrix as regions constituting the line, the first table from the first image A line detection processing unit for detecting the plurality of vertical lines and the plurality of horizontal lines constituting the
A database building device capable of constructing a knowledge database from an image with a table embedded in it.
제1항에 있어서,
상기 텍스트 삽입부는
상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각에 대한 상기 전자 문서 내에서의 텍스트 삽입 지점 - 상기 텍스트 삽입 지점은 상기 전자 문서의 최좌측 상단 지점을 기준으로 상기 텍스트 위치 정보에 따른 위치를 연산한 지점을 의미함 - 을 연산하는 삽입 지점 연산부; 및
상기 복수의 텍스트들 각각에 대하여, 상기 전자 문서에 삽입된 상기 제2 표를 구성하는 상기 복수의 셀들 중 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀을 확인한 후, 상기 복수의 텍스트들 각각을 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 삽입 처리부
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치.
According to claim 1,
The text insertion unit
a text insertion point in the electronic document for each of the plurality of texts, based on the text position information within the first image for each of the plurality of texts, wherein the text insertion point is a an insertion point calculating unit that calculates a point at which the position according to the text position information is calculated based on the leftmost uppermost point; and
For each of the plurality of texts, after identifying a cell including the text insertion point for each of the plurality of texts among the plurality of cells constituting the second table inserted into the electronic document, the plurality of texts An insertion processing unit that completes the construction of the second table inserted into the electronic document by inserting each of the texts into a cell including the text insertion point for each of the plurality of texts
A database building device capable of constructing a knowledge database from an image with a table embedded in it.
표를 구성하는 선의 색상으로 미리 정해진 색상 값 범위가 저장되어 있는 색상 값 저장부를 유지하는 단계;
사용자로부터 제1 표 - 상기 제1 표는 첫 번째 행과 첫 번째 열 각각에 적어도 하나의 필드명이 삽입되어 있음 - 가 삽입된 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n(n은 2이상의 자연수임)개, 세로 m(m은 2이상의 자연수임)개의 기설정된(predetermined) 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 중 상기 색상 값 범위에 대응되는 색상을 갖는 사각 영역에 대해 1의 코드를 할당하고, 나머지 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, m x n의 이미지 행렬을 생성하는 단계;
OCR(Optical Character Reader)을 이용하여 상기 제1 이미지 내에 존재하는 복수의 텍스트들을 추출한 후, 상기 복수의 텍스트들과 상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 텍스트 위치 정보 - 상기 텍스트 위치 정보는 상기 제1 이미지의 최좌측 상단 지점을 기준으로 한 각 텍스트의 상기 제1 이미지 내에서의 상대적 위치에 대한 정보를 의미함 - 를 텍스트 저장소에 서로 대응시켜 저장하는 단계;
상기 m x n의 이미지 행렬에 대해, 이미지 내에서의 수직선을 검출하기 위한 기설정된 m x n의 수직선 필터 행렬 - 상기 m x n의 수직선 필터 행렬은 상기 m x n의 수직선 필터 행렬을 구성하는 복수의 열들 중 기설정된 복수의 제1 열들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 열들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 과 이미지 내에서의 수평선을 검출하기 위한 기설정된 m x n의 수평선 필터 행렬 - 상기 m x n의 수평선 필터 행렬은 상기 m x n의 수평선 필터 행렬을 구성하는 복수의 행들 중 기설정된 복수의 제1 행들을 구성하는 성분에 1의 코드가 할당되어 있고, 나머지 행들을 구성하는 성분에 0의 코드가 할당되어 있는 행렬임 - 을 기초로 한 행렬 연산을 수행함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 복수의 수직선들과 복수의 수평선들을 검출하는 단계;
상기 복수의 수직선들과 상기 복수의 수평선들에 의해 생성되는 복수의 셀들을 확인한 후, 상기 복수의 셀들로 구성되는 제2 표가 삽입된 전자 문서를 생성하는 단계;
상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각을 상기 복수의 셀들에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 단계;
상기 제2 표의 구성이 완료되면, 상기 제2 표를 구성하는 상기 복수의 셀들에 삽입된 상기 복수의 텍스트들 중 첫 번째 행에 삽입된 적어도 하나의 제1 필드명과 첫 번째 열에 삽입된 적어도 하나의 제2 필드명을 확인한 후, 첫 번째 행과 첫 번째 열을 제외한 나머지 셀들에 삽입된 텍스트를 확인하는 단계;
상기 적어도 하나의 제1 필드명 중 하나인 세로 필드명과 상기 적어도 하나의 제2 필드명 중 하나인 가로 필드명, 및 상기 세로 필드명과 상기 가로 필드명에 대응되는 셀에 삽입된 텍스트를 하나의 데이터 세트로 구성함으로써, 상기 전자 문서에 삽입된 상기 제2 표로부터 복수의 데이터 세트들을 생성하는 단계; 및
상기 복수의 데이터 세트들을 데이터 저장소에 저장함으로써, 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스의 구축을 완료하는 단계
를 포함하고,
상기 m x n의 이미지 행렬을 생성하는 단계는
상기 사용자로부터 상기 제1 표가 삽입된 상기 제1 이미지에 대한 지식 데이터베이스 구축 명령이 수신되면, 상기 제1 이미지를 가로 n개, 세로 m개의 상기 기설정된 크기의 사각 영역들로 분할한 후, 상기 사각 영역들 각각에 대해, 상기 사각 영역들 각각을 구성하는 복수의 화소들의 색상 값의 평균 값을 연산하는 단계; 및
상기 사각 영역들 중 상기 복수의 화소들의 색상 값의 평균 값이 상기 색상 값 범위에 포함되는 사각 영역에 대해 1의 코드를 할당하고, 상기 색상 값 범위에 포함되지 않는 사각 영역에 대해 0의 코드를 할당하여 상기 제1 이미지를 이진화함으로써, 상기 m x n의 이미지 행렬을 생성하는 단계
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법.
maintaining a color value storage unit in which a range of color values predetermined as colors of lines constituting a table is stored;
When a knowledge database building command is received from the user for the first image in which the first table, in which at least one field name is inserted in each of the first row and the first column, is received, the first image is created After dividing the rectangle into n horizontal (n is a natural number greater than or equal to 2) and m vertical (m is a natural number greater than or equal to 2) rectangular regions having a predetermined size, one of the rectangular regions corresponding to the color value range generating an mxn image matrix by binarizing the first image by assigning a code of 1 to a rectangular region having a color and assigning a code of 0 to the remaining regions;
After extracting a plurality of texts present in the first image using an optical character reader (OCR), the plurality of texts and text position information in the first image for each of the plurality of texts - the text location information means information on the relative position of each text with respect to the upper leftmost point of the first image in the first image - in correspondence with each other in a text storage;
For the mxn image matrix, a preset mxn vertical line filter matrix for detecting a vertical line in an image - The mxn vertical line filter matrix is a predetermined plurality of columns constituting the mxn vertical line filter matrix. It is a matrix in which a code of 1 is assigned to the components constituting 1 column and a code of 0 is assigned to the components constituting the remaining columns - and a preset mxn horizontal line filter matrix for detecting a horizontal line in an image - In the mxn horizontal line filter matrix, a code of 1 is assigned to a component constituting a plurality of preset first rows among a plurality of rows constituting the mxn horizontal line filter matrix, and a code of 0 is assigned to a component constituting the remaining rows. detecting a plurality of vertical lines and a plurality of horizontal lines constituting the first table from the first image by performing a matrix operation on the basis of which is a matrix;
generating an electronic document into which a second table composed of the plurality of cells is inserted after checking a plurality of cells generated by the plurality of vertical lines and the plurality of horizontal lines;
The configuration of the second table inserted into the electronic document by inserting each of the plurality of texts into the plurality of cells based on the text position information in the first image for each of the plurality of texts to complete;
When the configuration of the second table is completed, at least one first field name inserted in the first row among the plurality of texts inserted into the plurality of cells constituting the second table and at least one first field name inserted in the first column After checking the second field name, checking the text inserted into cells other than the first row and the first column;
A vertical field name that is one of the at least one first field name, a horizontal field name that is one of the at least one second field name, and a text inserted into a cell corresponding to the vertical field name and the horizontal field name are combined into one data. generating a plurality of data sets from the second table embedded in the electronic document by organizing into sets; and
Completing the construction of a knowledge database for the first image into which the first table is inserted by storing the plurality of data sets in a data storage;
including,
The step of generating the mxn image matrix is
When a knowledge database construction command for the first image in which the first table is inserted is received from the user, the first image is divided into n horizontal and m vertical rectangular regions of the predetermined size, and then the calculating, for each of the rectangular areas, an average value of color values of a plurality of pixels constituting each of the rectangular areas; and
A code of 1 is assigned to a rectangular area in which the average value of the color values of the plurality of pixels among the rectangular areas is included in the color value range, and a code of 0 is assigned to a rectangular area not included in the color value range. generating the mxn image matrix by binarizing the first image by assigning
A method of operating a database building apparatus capable of constructing a knowledge database from an image into which a table is inserted, comprising:
삭제delete 제5항에 있어서,
상기 복수의 수직선들과 상기 복수의 수평선들을 검출하는 단계는
상기 m x n의 이미지 행렬과 상기 m x n의 수직선 필터 행렬 간의 아다마르 곱(Hadamard product)을 연산하여 m x n의 제1 연산 행렬을 생성하고, 상기 m x n의 이미지 행렬과 상기 m x n의 수평선 필터 행렬 간의 아다마르 곱을 연산하여 m x n의 제2 연산 행렬을 생성한 후, 상기 m x n의 제1 연산 행렬과 상기 m x n의 제2 연산 행렬 간의 논리합 연산(OR)을 수행하여 m x n의 제3 연산 행렬을 생성하는 단계; 및
상기 제1 이미지에서, 상기 m x n의 제3 연산 행렬을 구성하는 성분들 중 1의 코드가 할당된 성분들에 대응되는 지점들을 선을 구성하는 영역으로 확인함으로써, 상기 제1 이미지로부터 상기 제1 표를 구성하는 상기 복수의 수직선들과 상기 복수의 수평선들을 검출하는 단계
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법.
6. The method of claim 5,
The step of detecting the plurality of vertical lines and the plurality of horizontal lines includes:
A Hadamard product between the mxn image matrix and the mxn vertical line filter matrix is calculated to generate an mxn first operation matrix, and the Hadamard product between the mxn image matrix and the mxn horizontal line filter matrix is calculated generating an mxn second operation matrix, and then performing an OR operation (OR) between the mxn first operation matrix and the mxn second operation matrix to generate a mxn third operation matrix; and
In the first image, by identifying points corresponding to the components to which the code of 1 is assigned among the components constituting the mxn third operation matrix as regions constituting the line, the first table from the first image detecting the plurality of vertical lines and the plurality of horizontal lines constituting
A method of operating a database building apparatus capable of constructing a knowledge database from an image into which a table is inserted, comprising:
제5항에 있어서,
상기 제2 표의 구성을 완료하는 단계는
상기 복수의 텍스트들 각각에 대한 상기 제1 이미지 내에서의 상기 텍스트 위치 정보를 기초로, 상기 복수의 텍스트들 각각에 대한 상기 전자 문서 내에서의 텍스트 삽입 지점 - 상기 텍스트 삽입 지점은 상기 전자 문서의 최좌측 상단 지점을 기준으로 상기 텍스트 위치 정보에 따른 위치를 연산한 지점을 의미함 - 을 연산하는 단계; 및
상기 복수의 텍스트들 각각에 대하여, 상기 전자 문서에 삽입된 상기 제2 표를 구성하는 상기 복수의 셀들 중 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀을 확인한 후, 상기 복수의 텍스트들 각각을 상기 복수의 텍스트들 각각에 대한 상기 텍스트 삽입 지점을 포함하는 셀에 삽입함으로써, 상기 전자 문서에 삽입된 상기 제2 표의 구성을 완료하는 단계
를 포함하는 표가 삽입된 이미지로부터 지식 데이터베이스의 구축이 가능한 데이터베이스 구축 장치의 동작 방법.
6. The method of claim 5,
Completing the configuration of the second table is
a text insertion point in the electronic document for each of the plurality of texts, based on the text position information within the first image for each of the plurality of texts, wherein the text insertion point is a calculating - which means a point at which a location according to the text location information is calculated based on the upper leftmost point; and
For each of the plurality of texts, after identifying a cell including the text insertion point for each of the plurality of texts among the plurality of cells constituting the second table inserted into the electronic document, the plurality of texts Completing the construction of the second table inserted into the electronic document by inserting each of the texts into a cell containing the text insertion point for each of the plurality of texts;
A method of operating a database building apparatus capable of constructing a knowledge database from an image into which a table is inserted, comprising:
제5항, 제7항 또는 제8항 중 어느 한 항의 방법을 컴퓨터와의 결합을 통해 실행시키기 위한 컴퓨터 프로그램을 기록한 컴퓨터 판독 가능 기록 매체.A computer-readable recording medium recording a computer program for executing the method of any one of claims 5, 7 or 8 through combination with a computer. 제5항, 제7항 또는 제8항 중 어느 한 항의 방법을 컴퓨터와의 결합을 통해 실행시키기 위한 저장매체에 저장된 컴퓨터 프로그램.A computer program stored in a storage medium for executing the method of any one of claims 5, 7 or 8 through combination with a computer.
KR1020190168680A 2019-12-17 2019-12-17 Database building device that can build a knowledge database from a table-inserted image and operating method thereof KR102328034B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190168680A KR102328034B1 (en) 2019-12-17 2019-12-17 Database building device that can build a knowledge database from a table-inserted image and operating method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190168680A KR102328034B1 (en) 2019-12-17 2019-12-17 Database building device that can build a knowledge database from a table-inserted image and operating method thereof

Publications (2)

Publication Number Publication Date
KR20210077251A KR20210077251A (en) 2021-06-25
KR102328034B1 true KR102328034B1 (en) 2021-11-17

Family

ID=76629066

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190168680A KR102328034B1 (en) 2019-12-17 2019-12-17 Database building device that can build a knowledge database from a table-inserted image and operating method thereof

Country Status (1)

Country Link
KR (1) KR102328034B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102413157B1 (en) * 2021-12-30 2022-06-24 주식회사 다리소프트 Hazardous object information management server which is able to collect and manage hazardous object information on the road through interworking with the information collecting terminal, equipped on a vehicle, and the operating method thereof
KR102413162B1 (en) * 2021-12-30 2022-06-24 주식회사 다리소프트 Hazardous object information management server which is able to estimate the actual size of the hazardous object on the road by interworking with the information collecting terminal equipped on a vehicle, and the operating method thereof

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312208A (en) 2001-04-11 2002-10-25 Mitsubishi Electric Corp Data warehouse system
JP4181892B2 (en) 2003-02-21 2008-11-19 キヤノン株式会社 Image processing method
JP2009277006A (en) 2008-05-14 2009-11-26 Fuji Xerox Co Ltd Information processor, document management system, information processing system, and program
KR101445171B1 (en) 2014-03-28 2014-10-02 주식회사 한글과컴퓨터 Apparatus and method for converting paper document into electronic document
KR101739540B1 (en) 2016-01-27 2017-06-08 주식회사 솔트룩스 System and method for building integration knowledge base based
KR101797573B1 (en) 2016-05-23 2017-11-14 주식회사 한글과컴퓨터 Web based spreadsheets service providing apparatus and method
KR101846342B1 (en) 2016-09-30 2018-04-09 주식회사 아이온커뮤니케이션즈 Computer readable medium for recording program performing method of managing electronic documents and system for managing electronic documents
KR101907029B1 (en) * 2017-08-24 2018-10-12 (주) 더존비즈온 Apparatus and method for generating table for creating document form automatically
CN108804400A (en) 2018-06-13 2018-11-13 深圳市轱辘汽车维修技术有限公司 A kind of electronic document processing method, device and relevant device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3184106B2 (en) * 1996-11-28 2001-07-09 日本電気移動通信株式会社 Fax data e-mail transfer system
KR20190095651A (en) * 2018-02-07 2019-08-16 삼성에스디에스 주식회사 Apparatus for generating training data for character learning and method thereof

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312208A (en) 2001-04-11 2002-10-25 Mitsubishi Electric Corp Data warehouse system
JP4181892B2 (en) 2003-02-21 2008-11-19 キヤノン株式会社 Image processing method
JP2009277006A (en) 2008-05-14 2009-11-26 Fuji Xerox Co Ltd Information processor, document management system, information processing system, and program
KR101445171B1 (en) 2014-03-28 2014-10-02 주식회사 한글과컴퓨터 Apparatus and method for converting paper document into electronic document
KR101739540B1 (en) 2016-01-27 2017-06-08 주식회사 솔트룩스 System and method for building integration knowledge base based
KR101797573B1 (en) 2016-05-23 2017-11-14 주식회사 한글과컴퓨터 Web based spreadsheets service providing apparatus and method
KR101846342B1 (en) 2016-09-30 2018-04-09 주식회사 아이온커뮤니케이션즈 Computer readable medium for recording program performing method of managing electronic documents and system for managing electronic documents
KR101907029B1 (en) * 2017-08-24 2018-10-12 (주) 더존비즈온 Apparatus and method for generating table for creating document form automatically
CN108804400A (en) 2018-06-13 2018-11-13 深圳市轱辘汽车维修技术有限公司 A kind of electronic document processing method, device and relevant device

Also Published As

Publication number Publication date
KR20210077251A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN110442744B (en) Method and device for extracting target information in image, electronic equipment and readable medium
US9710704B2 (en) Method and apparatus for finding differences in documents
US8254721B2 (en) Data input system, data input receiving device, data input receiving method and computer readable medium
CN106373447A (en) Intelligent paper marking system and method
JP2002279433A (en) Method and device for retrieving character in video
JP2022003579A (en) Business form input form creation device, business form input form creation method, and program
KR102328034B1 (en) Database building device that can build a knowledge database from a table-inserted image and operating method thereof
JP6882362B2 (en) Systems and methods for identifying images, including identification documents
CN108304815A (en) A kind of data capture method, device, server and storage medium
CN104408403A (en) Arbitration method and apparatus for inconsistent phenomenon of two pieces of entry information
CN111638792A (en) AR effect presentation method and device, computer equipment and storage medium
KR102300475B1 (en) Electronic device that can convert a table-inserted image into an electronic document and operating method thereof
KR102352726B1 (en) Electronic apparatus that can convert medical expenses receipt printed on paper into an electronic document and operating method thereof
JP5878004B2 (en) Multiple document recognition system and multiple document recognition method
Jayashree et al. Voice based application as medicine spotter for visually impaired
JP3898645B2 (en) Form format editing device and form format editing program
Pattnaik et al. A Framework to Detect Digital Text Using Android Based Smartphone
Van Nguyen et al. Digitalization of Administrative Documents A Digital Transformation Step in Practice
JP2006053622A (en) Document link information acquisition system
JP2021028770A (en) Information processing device and table recognition method
JP2020053891A (en) Information processing apparatus, information processing method, and program
JP5277750B2 (en) Image processing program, image processing apparatus, and image processing system
JP5298830B2 (en) Image processing program, image processing apparatus, and image processing system
EP4379677A1 (en) Image processing system, image processing method, and program
EP4379678A1 (en) Image processing system, image processing method, and program

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right