WO2021117128A1 - 帳票画像処理システム - Google Patents

帳票画像処理システム Download PDF

Info

Publication number
WO2021117128A1
WO2021117128A1 PCT/JP2019/048267 JP2019048267W WO2021117128A1 WO 2021117128 A1 WO2021117128 A1 WO 2021117128A1 JP 2019048267 W JP2019048267 W JP 2019048267W WO 2021117128 A1 WO2021117128 A1 WO 2021117128A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
form image
character recognition
query
search
Prior art date
Application number
PCT/JP2019/048267
Other languages
English (en)
French (fr)
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 PCT/JP2019/048267 priority Critical patent/WO2021117128A1/ja
Publication of WO2021117128A1 publication Critical patent/WO2021117128A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition

Definitions

  • the present invention relates to a form image processing system, a form image processing method, and a form image processing program.
  • character recognition processing is executed for the raster image of the form, and table data is generated from the text data (arrangement of character codes) obtained by the character recognition processing.
  • template data (or format data) that defines a form layout such as an area to be processed for character recognition in a raster image and text attributes (names, etc.) such as character strings and numerical values included in the area. (Also called) is used, and character recognition processing is executed for the area specified by the template data.
  • template data corresponding to each form is required for a plurality of forms having different layouts.
  • a column area surrounded by ruled lines is detected in the form image, the characters recognized in the table structure area are used as the item name of the column area, and the coordinate values of the column area are specified as format data. (See, for example, Patent Document 1).
  • the order number and the order number are arranged above and below one cell, in the above-mentioned technique, the order number and the order number are recognized as one column, and the order number is used as the data of the one column. Since the values 000111,000120 and the order number values 5162-01,0189-11 are classified, the values of the two items are improperly mixed in one column in the table data.
  • the present invention has been made in view of the above problems, and obtains a form image processing system, a form image processing method, and a form image processing program capable of appropriately generating table data from a wider variety of forms. With the goal.
  • the form image processing system is a search partial image specified by a query condition based on a target form image acquisition unit that acquires a form image to be processed and template data including one or a plurality of query conditions.
  • a query condition in the partial image search unit that searches the form image and detects the partial image corresponding to the search partial image in the form image, and the partial image detected in the form image based on the template data. It is provided with a character recognition processing unit that executes character recognition processing for a designated character recognition area.
  • a search partial image specified by a query condition is included in the form image based on a step of acquiring a form image to be processed and template data including one or a plurality of query conditions.
  • the step of searching with, and detecting the partial image corresponding to the search partial image in the form image, and in the character recognition area specified by the query condition in the partial image detected in the form image based on the template data includes a step of executing character recognition processing.
  • the form image processing program causes the computer to function as the above-mentioned target form image acquisition unit, the above-mentioned partial image search unit, and the above-mentioned character recognition processing unit.
  • a form image processing system capable of appropriately generating table data from a wider variety of forms can be obtained.
  • FIG. 1 is a block diagram showing a configuration of a form image processing system according to an embodiment of the present invention.
  • FIG. 2 is a diagram showing an example (part) of a sample form image.
  • FIG. 3 is a diagram showing an example of a query area designated by the user and a character recognition area in the query area on the sample form image shown in FIG.
  • FIG. 4 is a diagram for explaining the components of the query condition.
  • FIG. 5 is a diagram illustrating an example of template data including query conditions.
  • FIG. 6 is a diagram showing an example (part) of a form image to be processed.
  • FIG. 7 is a diagram showing an example of a character recognition area in the partial image detected in the form image shown in FIG. 6 according to the query condition.
  • FIG. 1 is a block diagram showing a configuration of a form image processing system according to an embodiment of the present invention.
  • FIG. 2 is a diagram showing an example (part) of a sample form image.
  • FIG. 3 is a diagram showing an example
  • FIG. 8 is a diagram showing another example (part) of the sample form image, and an example of the query area designated by the user and the character recognition area in the query area on the sample form image.
  • FIG. 9 is a diagram showing an example of table data generated based on the text data obtained by the character recognition process for the character recognition area shown in FIG. 7.
  • FIG. 10 is a flowchart illustrating a template data generation process in the system according to the first embodiment.
  • FIG. 11 is a flowchart illustrating the form image processing in the system according to the first embodiment.
  • FIG. 1 is a block diagram showing a configuration of a form image processing system according to an embodiment of the present invention.
  • the form image processing system shown in FIG. 1 is mounted on one information processing device (computer or the like), and the processing units described later in the system are distributed to a plurality of information processing devices capable of data communication with each other. It may be implemented. Further, such a plurality of information processing devices may include a GPU (Graphics Processing Unit) that processes a specific operation in parallel.
  • GPU Graphics Processing Unit
  • the system shown in FIG. 1 includes a storage device 1, an input device 2, a display device 3, a communication device 4, an image reading device 5, and an arithmetic processing unit 6.
  • the storage device 1 is a non-volatile storage device such as a flash memory or a hard disk, and stores various data and programs.
  • the input device 2 and the display device 3 are user interfaces, the input device 2 is a keyboard, a mouse, a touch panel, etc. that detect a user operation and output as an electric signal, and the display device 3 is an operation screen for the user. It is a liquid crystal display that displays such as.
  • the form image processing program 11 is stored in the storage device 1.
  • the storage device 1 stores one or a plurality of template data described later, as needed.
  • the form image processing program 11 may be stored in a portable computer-readable recording medium such as a CD (Compact Disk). In that case, for example, the program 11 is installed from the recording medium to the storage device 1. Further, the program 11 may be one program or a collection of a plurality of programs.
  • the communication device 4 is a device capable of data communication such as a network interface, a peripheral device interface, and a modem, and performs data communication with other devices as needed.
  • the image reading device 5 optically reads the form image from the form and generates image data (raster image data, etc.) of the form image.
  • the image reading device 5 is a scanner, a network scanner, or the like connected by a peripheral device interface such as USB (Universal Serial Bus).
  • the form is, for example, a document (for example, a purchase order, a delivery note, an invoice, a receipt, etc.) in which details such as goods, services, and money as consideration for various transactions are described in a predetermined layout. ..
  • the layout of forms is often different for each trading company, but each trading company often uses a form with a fixed layout.
  • the layout of the form may be a complicated layout as described above, or the layout of the form may change depending on the content of the form as described above. In many cases, the position of the value of each item in the layout of the form does not change, but as described above, the specific item changes depending on the content.
  • the arithmetic processing unit 6 is a computer equipped with a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), etc., and loads a program from the ROM, the storage device 1 or the like into the RAM, and the CPU By executing it, it operates as various processing units.
  • the arithmetic processing unit 6 operates as the template data generation unit 21 and the form image processing unit 22.
  • the template data generation unit 21 generates template data corresponding to the layout of the style from the sample form image having the layout of the same style as the form image to be processed. For example, a form image of one of a plurality of forms having a layout of a certain style is used as a sample form image.
  • the template data generation unit 21 includes a sample form image acquisition unit 31, a query condition setting unit 32, a column definition unit 33, and a template data generation unit 34.
  • the sample form image acquisition unit 31 acquires the above-mentioned sample form image.
  • the sample form image acquisition unit 31 reads out a sample form image as image data stored in the storage device 1, or a sample form as image data received by the communication device 4 from a server or host device (not shown). An image is acquired, or a sample form image as image data generated from a certain form by the image reading device 5 is acquired.
  • the query condition setting unit 32 specifies (a) a query area specified by a user operation in the sample form image and a character recognition area in the query area, and (b) searches for an image of the query area in the sample form image. It is extracted as a partial image, and (c) a query condition indicating the search partial image and the character recognition area (that is, the position and size of the character recognition area in the search partial image) is generated.
  • FIG. 2 is a diagram showing an example (part) of a sample form image.
  • FIG. 3 is a diagram showing an example of a query area designated by the user and a character recognition area in the query area on the sample form image shown in FIG.
  • FIG. 4 is a diagram for explaining the components of the query condition.
  • the query condition setting unit 32 displays a sample form image as shown in FIG. 2, for example, on the display device 3.
  • the user operates the input device 2 to specify a desired area as a query area on the sample form image.
  • the query condition setting unit 32 detects the user operation on the input device 2 and specifies the query area (that is, the position and size of the query area).
  • the query area is a rectangular area, and the coordinate values of the two vertices on the diagonal of the rectangular area are specified.
  • the coordinate value of one vertex of the query area as a rectangular area, and the horizontal and vertical sizes are specified.
  • the user operates the input device 2 and designates one or a plurality of desired areas in the query area as the character recognition area corresponding to the query area.
  • the query condition setting unit 32 detects the user operation by the input device 2 and specifies the character recognition area (that is, the position and size of the character recognition area).
  • the character recognition area is a rectangular area, and the coordinate values of the two vertices on the diagonal line of the rectangular area are specified.
  • the coordinate value of one vertex of each character recognition area as a rectangular area, and the horizontal and vertical sizes are specified.
  • a query condition indicating the search partial image and the character recognition area (that is, the position and size of the character recognition area in the search partial image) can be obtained.
  • the query condition setting unit 32 includes a query type in each query condition.
  • the query type is a first query type or a second query type.
  • the second query type causes all partial images corresponding to the search partial image to be detected in the form image in the image search in the form image processing.
  • the column definition unit 33 associates a column attribute with each character recognition area set in the query area.
  • the user operates the input device 2 to correspond to each character recognition area, and the column attribute (column heading, column head of the column) in which the text data obtained from the character recognition area in the form image processing is arranged is arranged. Enter the data type (numerical value, character string, amount of money, etc.).
  • the column definition unit 33 identifies the column attribute specified by the user operation and associates it with each character recognition area.
  • the template data generation unit 34 generates template data including one or more query conditions (and column attributes) generated as described above, and stores the template data in a predetermined storage device (storage device 1, a server (not shown, etc.)).
  • a predetermined storage device storage device 1, a server (not shown, etc.).
  • FIG. 5 is a diagram illustrating an example of template data including query conditions.
  • the template data includes one or more query condition records.
  • One query condition record corresponds to one query condition.
  • the query condition record includes a query area ID, a query type, a file path to a partial image file for search, and a character recognition area list.
  • the character recognition area list contains a link (reference) to the character recognition area data.
  • One character recognition area data indicates the position information of one character recognition area (the position (number of pixels) of the character recognition area relative to the reference position (predetermined vertex) of the search partial image).
  • the search partial image is stored together with the template data as a search partial image file.
  • the form image processing unit 22 uses the template data generated from the sample form having the same layout as the form image to be processed, and performs the form image processing on the form image to be processed. Execute.
  • the form image processing unit 22 includes a template data selection unit 41, a target form image acquisition unit 42, a partial image search unit 43, a character recognition processing unit 44, and a table data generation unit 45.
  • the template data selection unit 41 selects one template data according to the form image to be processed from one or a plurality of template data stored in the storage device 1 or a server (not shown) according to, for example, a user operation on the input device 2. Select and read.
  • This template data includes one or more query conditions.
  • the target form image acquisition unit 42 acquires the form image to be processed.
  • the target form image acquisition unit 42 reads out the form image as image data stored in the storage device 1, or outputs the form image as image data received by the communication device 4 from a server or host device (not shown). It is acquired, or a form image as image data generated from a form by the image reading device 5 is acquired.
  • the partial image search unit 43 searches for the search partial image specified by the query condition included in the template data in the acquired form image, and the search portion. A partial image corresponding to the image is detected in the form image.
  • the partial image search unit 43 moves the attention area of the same size as the partial image one pixel at a time in the form image, and the attention area of the form image at each position is similar to the search partial image.
  • the degree is calculated, and the partial image corresponding to the search partial image is detected based on the similarity.
  • this similarity is calculated based on the features of the image.
  • this similarity can be determined by existing calculation methods (SSD (Sum of Squared Difference) method, SAD (Sum of Absolute Difference) method, NCC (Normalized Cross Correlation) method, ZNCC (Zero means Normalized Cross Correlation) method, etc.). It is calculated.
  • the partial image search unit 43 obtains a predetermined number of partial images N from the one having the largest similarity as described above.
  • the query type of the query condition is the second query type, all the partial images whose similarity exceeds the predetermined threshold value are detected.
  • this threshold value is specified according to the user operation at the time of template data generation, and is included in the query condition. Alternatively, this threshold value is set according to the user operation at the time of form image processing.
  • FIG. 6 is a diagram showing an example (part) of a form image to be processed.
  • FIG. 7 is a diagram showing an example of a character recognition area in the partial image detected in the form image shown in FIG. 6 according to the query condition shown in FIG.
  • FIG. 8 is a diagram showing another example (part) of the sample form image, and an example of the query area designated by the user and the character recognition area in the query area on the sample form image.
  • forms having the same layout are created so that the positions of the text (numerical value) images in a cell in a certain column are substantially the same as shown in FIG. ..
  • the number of rows differs depending on the form, so the second query type is specified, and a partial image of such an indefinite row. Are all detected.
  • the first query type is specified and partial images of a specific number of rows are detected. For example, even if you want to include text in a line with an indefinite position such as "total" shown in FIG. 8 in the table data, the position is automatically specified by image search and a partial image of such a line is detected. .. Therefore, in one template data, a partial image of such an indefinite line is detected at any position.
  • the character recognition processing unit 44 Based on the template data, the character recognition processing unit 44 identifies the character recognition area specified by the query condition in the partial image detected in the form image, and executes the character recognition process for the character recognition area. ..
  • the table data generation unit 45 generates table data having text data obtained by character recognition processing in a predetermined data format (for example, CSV (Character-Separated Values)) in the form image processing.
  • a predetermined data format for example, CSV (Character-Separated Values)
  • FIG. 9 is a diagram showing an example of table data generated based on the text data obtained by the character recognition process for the character recognition area shown in FIG. 7. For example, when the character recognition area is specified as shown in FIG. 7, the table data as shown in FIG. 9 is generated from the form shown in FIG.
  • the table data generation unit 45 may generate a plurality of table data corresponding to each query condition, or each of them.
  • a plurality of table data corresponding to the query condition may be integrated into one table data.
  • a plurality of table data may be concatenated in the vertical direction and integrated into one table data, or a plurality of table data may be concatenated in the horizontal direction and integrated into one table data. Good.
  • the template data generation unit 21 and the form image processing unit 22 may be mounted on separate information processing devices (server, personal computer, etc.) in one information processing device (server, personal computer, etc.). , Only one of the template data generation unit 21 and the form image processing unit 22 may be implemented.
  • sample form and the form may be digital data
  • sample form image and the form image may be those obtained from the sample form and the form as the digital data (raster image, etc.), respectively.
  • FIG. 10 is a flowchart illustrating the template data generation process in the system according to the first embodiment.
  • the user selects a sample form image and specifies it using the input device 2. For example, the user selects a sample form, sets it in the image reading device 5, and causes the image reading device 5 to read the sample form image from the sample form. Alternatively, for example, the user uses the input device 2 to select a sample form image from the list of stored form images.
  • the sample form image acquisition unit 31 acquires the image data of the sample form image specified by the user (step S1).
  • the query condition setting unit 32 displays the sample form image on the display device 3 based on the image data.
  • the user operates the input device 2 to specify a desired rectangular area as a query area on the sample form image.
  • the user queries so that in addition to the text image part to be recognized as a character, an invariant part such as a ruled line surrounding the text image part (that is, a part whose content does not change between a plurality of forms) is included.
  • the query condition setting unit 32 specifies a designated query area (position and size of the query area) based on the user operation (step S2), and searches for a partial image of the specified query area from the sample form image. It is extracted as a partial image (step S3).
  • the query condition setting unit 32 superimposes and displays a frame line indicating the query area on the sample form image. As a result, the user can visually recognize the query area on the sample form image.
  • the user specifies a desired rectangular area inside the specified query area as a character recognition area on the displayed sample form image. For example, at this time, the user specifies the character recognition area so that the text image portion to be recognized is included and other objects such as ruled lines are not included.
  • the query condition setting unit 32 specifies the designated character recognition area based on the user operation (step S4).
  • This character recognition area is data (for example,) that can specify the relative position and size of the query area (that is, the search partial image) from a predetermined reference point in the query area (that is, the search partial image).
  • this relative position is represented by the distance from the reference point, and this distance and size is represented by the number of pixels.
  • One character recognition area corresponds to one column in the table data described later.
  • the query condition setting unit 32 includes a dialog for inputting column attributes (column heading, data type, etc.) of the column corresponding to the designated character recognition area. Is displayed on the display device 3. The user operates the input device 2 and inputs column attributes (column headings as free text, data type selected from the list, etc.) in the dialog or the like. The query condition setting unit 32 identifies the input column attribute and associates it with the character recognition area (step S5).
  • the query condition setting unit 32 displays a dialog or the like for inputting the query type of the query condition currently being set on the display device 3.
  • the user operates the input device 2 and inputs a query type to the dialog or the like.
  • the query condition setting unit 32 identifies the input query type and associates it with the query condition (step S6).
  • the query condition setting unit 32 has, for the specified query area, (a) a partial image for search specified as described above, (b) character recognition area data (relative position information, size information, column attributes, etc.), and (C) In the query type, a query condition record is generated and added to the template data for the sample form image (step S7).
  • the query condition setting unit 32 displays, for example, a dialog for inputting whether or not to set another query condition on the display device 3. The user selects whether or not to set another query condition, and inputs the input device 2 to the dialog.
  • the query condition setting unit 32 determines whether or not to set another query condition according to such a user operation (step S8).
  • the query condition setting unit 32 determines that another query condition is to be set, it returns to step S2 and sets another query condition for the sample form image (steps S2 to S7).
  • the query condition setting unit 32 determines that another query condition is not set
  • the query condition record indicating the query condition set so far and the search partial image file are used to provide template data for the sample form image. It is generated (step S9) and stored as one file in the storage device 1 or the like, or registered in a database (not shown).
  • FIG. 11 is a flowchart illustrating form image processing (processing for generating table data from a form image to be processed) in the system according to the first embodiment.
  • template data obtained from a sample form (sample form image) having the same layout as the form (form image) to be processed in the form image.
  • Form image processing is executed with the template data.
  • the template data selection unit 41 displays a list of saved template data on the display device 3 and reads out the template data selected by the user operation in the list (step S11).
  • the user selects the form image to be processed and specifies it using the input device 2. For example, the user selects a form to be processed, sets it in the image reading device 5, and causes the image reading device 5 to read the form image from the form. Alternatively, for example, the user uses the input device 2 to select a form image to be processed from a list of stored form images.
  • the target form image acquisition unit 42 acquires the image data of the form image designated by the user (step S12).
  • the partial image search unit 43 selects one unprocessed (unselected) query condition in the selected template data (step S13), and searches for the search partial image specified by the selected query condition.
  • an image search is executed on the acquired form image as described above (step S14).
  • the character recognition processing unit 44 identifies the character recognition area in the partial image found by the image search based on the position information and the size information of the character recognition area in the query condition (step S15). ), The character recognition process is executed for the image in the character recognition area, and the text data (character code) corresponding to the text image included in the character recognition area is specified (step S16). At this time, the character recognition process may be executed in consideration of the data type specified in the column attribute of the character recognition area.
  • the character recognition processing unit 44 associates one or a plurality of text data obtained corresponding to each character recognition area with each other as text data arranged in one column.
  • the table data generation unit 45 generates table data in a predetermined data format from the data of one or a plurality of columns obtained corresponding to the one or a plurality of character recognition areas (step S17).
  • the partial image search unit 43 determines whether or not all the query conditions in the selected template data have been processed (step S18), and returns to step S13 if at least one query condition has not been processed. , The same processing (steps S13 to S16) is executed together with the character recognition processing unit 44, and the table data generation unit 45 adds the newly generated column data to the table data (step S17). Alternatively, after the processing of all the query conditions is completed, the table data may be collectively generated from the column data obtained in the processing.
  • the form image processing for the form image ends.
  • the form image processing using the corresponding template data is executed for the form image specified by the user, and the table data corresponding to the form image is obtained.
  • the target form image acquisition unit 42 acquires the form image to be processed.
  • the partial image search unit 43 searches the form image for the search partial image specified by the query condition based on the template data including one or a plurality of query conditions, and one or one corresponding to the search partial image. A plurality of partial images are detected in the form image.
  • the character recognition processing unit 44 executes character recognition processing on the character recognition area specified by the query condition in each partial image detected in the form image.
  • the character recognition area is specified based on the query condition in the partial image in the form image detected corresponding to the search partial image specified in the query condition in the template data, so that the layout is complicated.
  • table data can be generated with a desired column array. Therefore, table data is appropriately generated from a wider variety of forms.
  • the table data generation unit 45 uses the text data obtained by the character recognition process corresponding to one character recognition area as one column, and the first column thereof.
  • the heading of one column is set based on the column attribute associated with one character recognition area, and there are multiple columns of the same heading corresponding to the character recognition area of multiple query conditions. Merges the plurality of columns into one column.
  • the template data generation unit 21 (a) reduces the resolution of the sample form image to a predetermined resolution, and (b) reduces the resolution of the sample form image to a predetermined resolution.
  • the image of the query area is extracted as a partial image for search.
  • the partial image search unit 43 (c) reduces the form image from the default resolution to the predetermined resolution, and (d) reduces the form image to the predetermined resolution.
  • the search partial image is searched in the image, the partial image corresponding to the search partial image is detected in the form image reduced to the predetermined resolution, and the character recognition processing unit 44 detects based on the template data.
  • the character recognition area in the partial image is specified, and the character recognition process is executed for the character recognition area at the default resolution.
  • the partial image in the form image corresponding to the search image search is detected in a short time. Will be done.
  • the table data generation unit 45 when the character code (text data) is not obtained as a result of the character recognition process, the table data generation unit 45 indicates that there is no value in the corresponding cell.
  • Dummy data first dummy data
  • the table data generation unit 45 synthesizes table data based on a plurality of query conditions, the column obtained under one query condition may be used as another query. If the condition cannot be obtained, dummy data (second dummy data) may be inserted in the cell corresponding to the table data of the other query condition in the column.
  • the above-mentioned first dummy data and the second dummy data may be standard texts different from each other.
  • the character recognition area may be adjusted so that the object fits within the character recognition area.
  • the form image processing is performed so that the two match.
  • the target form image may be enlarged, reduced, rotated, or the like as appropriate.
  • the template data is manually selected according to the user operation corresponding to the form (form image) to be processed in the form image processing, but instead, the template data selection unit is used.
  • the 41 may automatically select the template data corresponding to the sample form image having the maximum similarity based on the similarity between the form image to be processed in the form image and the sample form image.
  • the template data generation unit 34 associates the corresponding sample form image as an image file with the template data and saves it in a predetermined storage device at the time of generating the template data, and (b) the template data.
  • the form image to be processed by the form image and the sample form image corresponding to one or a plurality of stored template data are displayed.
  • the similarity is calculated, one template data corresponding to the sample form image having the maximum similarity is selected, and (c) the form image processing is executed using the selected template data.
  • the form image to be processed and the sample form image are each reduced by a predetermined magnification, and the similarity between the reduced form image to be processed and the sample form image after reduction is determined between the form image to be processed and the sample. It may be calculated as the degree of similarity with the form image.
  • the reduced form image to be processed and the reduced sample form image are each converted into a binary image, and the reduced processed form image as a binary image and the reduced binary image are reduced.
  • the degree of similarity with the later sample form image may be calculated as the degree of similarity between the form image to be processed and the sample form image.
  • a form image to be processed before reduction, after reduction, or after reduction and binarization
  • a sample form image before reduction, after reduction, or after reduction and binarization
  • Is compared for each pixel, and the number of pixels whose pixel values match (or the number corresponding to the number of pixels) is calculated as the degree of similarity.
  • an image before reduction, after reduction, or after reduction and binarization may be generated and used in advance.
  • the present invention can be applied to, for example, the generation of table data corresponding to a form image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Abstract

対象帳票画像取得部42は、処理対象となる帳票画像を取得する。部分画像検索部43は、1または複数のクエリ条件を含むテンプレートデータに基づいて、そのクエリ条件により指定された検索用部分画像を帳票画像内で検索し、その検索用部分画像に対応する1または複数の部分画像を帳票画像において検出する。文字認識処理部44は、そのテンプレートデータに基づいて、帳票画像内で検出された各部分画像における、そのクエリ条件により指定された文字認識領域に対して文字認識処理を実行する。

Description

帳票画像処理システム
 本発明は、帳票画像処理システム、帳票画像処理方法、および帳票画像処理プログラムに関するものである。
 ある帳票画像処理方法では、帳票のラスター画像に対して文字認識処理が実行され、文字認識処理で得られたテキストデータ(文字コードの配列)で表データが生成される。
 その際、一般的に、ラスター画像において文字認識処理の対象となる領域、その領域に含まれる文字列や数値などのテキストの属性(名称など)などといった帳票レイアウトを定義したテンプレートデータ(あるいはフォーマットデータとも呼ばれる)が使用され、テンプレートデータにより指定された領域に対して文字認識処理が実行される。
 したがって、一般的に、レイアウトが異なる複数の帳票に対して、それぞれの帳票に対応したテンプレートデータが必要になる。
 そのようなテンプレートデータ(フォーマットデータ)を帳票画像から自動的に生成する技術が提案されている。
 あるシステムでは、帳票画像内において罫線で囲まれたカラム領域が検出され、表組み領域内で認識された文字がそのカラム領域の項目名とされ、そのカラム領域の座標値がフォーマットデータとして特定されている(例えば特許文献1参照)。
特開平11-73472号公報
 しかしながら、上述の技術では、特殊なレイアウトの帳票や、実際の帳票の内容によって位置が変わる項目を有する帳票などから表データを適切に生成することは困難である。
 例えば後述の図2に示すような、1つのカラムにおける各セル内で上下に異なる複数の項目(例えば図2における「受注番号」と「注文番号」)の値が配置されるような複雑なレイアウトの帳票については、1カラムのデータとして複数の項目の値が検出されて混在してしまい、表データが適切に生成されない。
 つまり、受注番号と注文番号とが1つのセルの上下に配列されているため、上述の技術では、受注番号および注文番号が1つのカラムとして認識され、その1つのカラムのデータとして、受注番号の値000111,000120および注文番号の値5162-01,0189-11が分類されるため、表データにおいて、2つの項目の値が1つのカラムにおいて不適切に混在してしまう。
 また、例えば後述の図8に示すような、実際の帳票内の発注件数や受注件数によって位置(表の上下方向での位置)が変わる項目「合計」の値を文字認識し表データに含める場合、上述の技術では、そのような項目のすべての位置に応じた多数のテンプレートデータを使用する必要があり、現実的ではない。つまり、上述の技術では、そのような帳票からそのような項目(例えば、上述の「合計」)の値を文字認識し表データに含めることは困難である。
 本発明は、上記の問題に鑑みてなされたものであり、より多様な帳票から表データを適切に生成することが可能な帳票画像処理システム、帳票画像処理方法、および帳票画像処理プログラムを得ることを目的とする。
 本発明に係る帳票画像処理システムは、処理対象となる帳票画像を取得する対象帳票画像取得部と、1または複数のクエリ条件を含むテンプレートデータに基づいて、クエリ条件により指定された検索用部分画像を帳票画像内で検索し、その検索用部分画像に対応する部分画像を帳票画像において検出する部分画像検索部と、テンプレートデータに基づいて、帳票画像内で検出された部分画像における、クエリ条件により指定された文字認識領域に対して文字認識処理を実行する文字認識処理部とを備える。
 本発明に係る帳票画像処理方法は、処理対象となる帳票画像を取得するステップと、1または複数のクエリ条件を含むテンプレートデータに基づいて、クエリ条件により指定された検索用部分画像を帳票画像内で検索し、その検索用部分画像に対応する部分画像を帳票画像において検出するステップと、テンプレートデータに基づいて、帳票画像内で検出された部分画像における、クエリ条件により指定された文字認識領域に対して文字認識処理を実行するステップとを備える。
 本発明に係る帳票画像処理プログラムは、コンピューターを、上述の対象帳票画像取得部、上述の部分画像検索部、および上述の文字認識処理部として機能させる。
 本発明によれば、より多様な帳票から表データを適切に生成することが可能な帳票画像処理システム、帳票画像処理方法、および帳票画像処理プログラムが得られる。
 本発明の上記又は他の目的、特徴および優位性は、添付の図面とともに以下の詳細な説明から更に明らかになる。
図1は、本発明の実施の形態に係る帳票画像処理システムの構成を示すブロック図である。 図2は、サンプル帳票画像の一例(一部)を示す図である。 図3は、図2に示すサンプル帳票画像上で、ユーザーにより指定されたクエリ領域およびそのクエリ領域内の文字認識領域の一例を示す図である。 図4は、クエリ条件の構成要素について説明する図である。 図5は、クエリ条件を含むテンプレートデータの一例について説明する図である。 図6は、処理対象となる帳票画像の一例(一部)を示す図である。 図7は、クエリ条件に従って図6に示す帳票画像で検出された部分画像内の文字認識領域の一例を示す図である。 図8は、サンプル帳票画像の別の例(一部)、およびそのサンプル帳票画像上で、ユーザーにより指定されたクエリ領域およびそのクエリ領域内の文字認識領域の一例を示す図である。 図9は、図7に示す文字認識領域に対する文字認識処理で得られたテキストデータに基づき生成された表データの一例を示す図である。 図10は、実施の形態1に係るシステムにおけるテンプレートデータ生成処理について説明するフローチャートである。 図11は、実施の形態1に係るシステムにおける帳票画像処理について説明するフローチャートである。
 以下、図に基づいて本発明の実施の形態を説明する。
実施の形態1.
 図1は、本発明の実施の形態に係る帳票画像処理システムの構成を示すブロック図である。図1に示す帳票画像処理システムは、1台の情報処理装置(コンピューターなど)に実装されているが、そのシステムにおける後述の処理部を、互いにデータ通信可能な複数の情報処理装置に分散させて実装されるようにしてもよい。また、そのような複数の情報処理装置には、特定の演算を並列処理するGPU(Graphics Processing Unit)が含まれていてもよい。
 図1に示すシステムは、記憶装置1、入力装置2、表示装置3、通信装置4、画像読取装置5、および演算処理装置6を備える。
 記憶装置1は、フラッシュメモリー、ハードディスクなどの不揮発性の記憶装置であって、各種データやプログラムを格納する。入力装置2および表示装置3は、ユーザーインターフェイスであって、入力装置2は、ユーザー操作を検出し電気信号として出力するキーボード、マウス、タッチパネルなどであり、表示装置3は、ユーザーに対して操作画面などを表示する液晶ディスプレイなどである。
 この実施の形態では、記憶装置1に、帳票画像処理プログラム11が格納されている。記憶装置1には、必要に応じて、1または複数の後述のテンプレートデータが格納される。なお、帳票画像処理プログラム11は、CD(Compact Disk)などの可搬性のあるコンピュータ読み取り可能な記録媒体に格納されていてもよい。その場合、例えば、その記録媒体から記憶装置1へプログラム11がインストールされる。また、プログラム11は、1つのプログラムでも、複数のプログラムの集合体でもよい。
 通信装置4は、ネットワークインターフェイス、周辺機器インターフェイス、モデムなどのデータ通信可能な装置であって、必要に応じて、他の装置とデータ通信を行う。
 画像読取装置5は、帳票から帳票画像を光学的に読み取り、帳票画像の画像データ(ラスタイメージデータなど)を生成する。例えば、画像読取装置5は、USB(Universal Serial Bus)などの周辺機器インターフェイスで接続されたスキャナー、ネットワークスキャナーなどである。
 ここで、帳票とは、例えば、各種取引に関する物品、サービス、対価としての金銭などの明細が所定のレイアウトで記載された書類(例えば、発注書、納品書、請求書、領収書など)である。帳票のレイアウトは、取引企業ごとに異なることが多いが、各取引企業は、一定のレイアウトの帳票を使うことが多い。また、帳票のレイアウトが上述のような複雑なレイアウトである場合や、帳票のレイアウトが上述のように帳票の内容によって変わる場合がある。帳票のレイアウト内の各項目の値の位置は、変わらないものが多いが、上述のように、特定の項目は、内容によって変わる。
 演算処理装置6は、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)などを備えるコンピューターであって、プログラムを、ROM、記憶装置1などからRAMにロードしCPUで実行することで、各種処理部として動作する。ここでは、プログラム11を実行することで、演算処理装置6は、テンプレートデータ生成部21、および帳票画像処理部22として動作する。
 テンプレートデータ生成部21は、帳票画像処理の対象となる帳票画像と同一様式のレイアウトを有するサンプル帳票画像から、その様式のレイアウトに対応するテンプレートデータを生成する。例えば、ある様式のレイアウトを有する複数の帳票のうちの1つの帳票画像がサンプル帳票画像とされる。テンプレートデータ生成部21は、サンプル帳票画像取得部31、クエリ条件設定部32、カラム定義部33、およびテンプレートデータ生成部34を備える。
 サンプル帳票画像取得部31は、上述のサンプル帳票画像を取得する。例えば、サンプル帳票画像取得部31は、記憶装置1に格納されている画像データとしてのサンプル帳票画像を読み出したり、図示せぬサーバーやホスト装置から通信装置4により受信された画像データとしてのサンプル帳票画像を取得したり、画像読取装置5によりある帳票から生成された画像データとしてのサンプル帳票画像を取得したりする。
 クエリ条件設定部32は、(a)サンプル帳票画像において、ユーザー操作で指定されたクエリ領域およびそのクエリ領域内の文字認識領域を特定し、(b)サンプル帳票画像におけるクエリ領域の画像を検索用部分画像として抽出し、(c)検索用部分画像および文字認識領域(つまり、検索用部分画像内での文字認識領域の位置とサイズ)を示すクエリ条件を生成する。
 図2は、サンプル帳票画像の一例(一部)を示す図である。図3は、図2に示すサンプル帳票画像上で、ユーザーにより指定されたクエリ領域およびそのクエリ領域内の文字認識領域の一例を示す図である。図4は、クエリ条件の構成要素について説明する図である。
 具体的には、クエリ条件設定部32は、例えば図2に示すようなサンプル帳票画像を表示装置3に表示する。ユーザーは、入力装置2を操作して、サンプル帳票画像上で、所望の領域をクエリ領域として指定する。クエリ条件設定部32は、例えば図3に示すように、そのユーザー操作を入力装置2で検出してクエリ領域(つまり、クエリ領域の位置およびサイズ)を特定する。例えば、クエリ領域は、矩形領域であり、その矩形領域の対角線上の2頂点の座標値が特定される。あるいは、矩形領域としてのクエリ領域の1頂点の座標値、並びに横方向および縦方向のサイズが特定される。
 さらに、ユーザーは、入力装置2を操作して、そのクエリ領域に対応して、そのクエリ領域内の1または複数の所望の領域を、文字認識領域として指定する。クエリ条件設定部32は、例えば図3に示すように、そのユーザー操作を入力装置2で検出して文字認識領域(つまり、文字認識領域の位置およびサイズ)を特定する。例えば、各文字認識領域は、矩形領域であり、その矩形領域の対角線上の2頂点の座標値が特定される。あるいは、矩形領域としての各文字認識領域の1頂点の座標値、並びに横方向および縦方向のサイズが特定される。
 このようにして、例えば図4に示すように、検索用部分画像および文字認識領域(つまり、検索用部分画像内での文字認識領域の位置とサイズ)を示すクエリ条件が得られる。
 さらに、この実施の形態では、クエリ条件設定部32は、各クエリ条件に、クエリタイプを含める。そのクエリタイプは、第1クエリタイプまたは第2クエリタイプである。
 第1クエリタイプは、帳票画像処理での画像検索において、検索用部分画像に対応する所定個数N(例えばN=1)の部分画像を帳票画像において検出させる。なお、第1クエリタイプにおいて、複数の異なる個数Nに対応させる場合には、上述の個数Nもクエリ条件に含められる。
 第2クエリタイプは、帳票画像処理での画像検索において、検索用部分画像に対応するすべての部分画像を帳票画像において検出させる。
 カラム定義部33は、クエリ領域内に設定された各文字認識領域にカラム属性を関連付ける。ユーザーは、入力装置2を操作して、各文字認識領域に対応して、帳票画像処理でその文字認識領域から得られたテキストデータが配列されるカラムのカラム属性(カラムの見出し、そのカラムのデータ種別(数値、文字列、金額など)など)を入力する。カラム定義部33は、そのように、ユーザー操作で指定されたカラム属性を特定し、各文字認識領域に関連付ける。
 テンプレートデータ生成部34は、上述のようにして生成された1または複数のクエリ条件(およびカラム属性)を含むテンプレートデータを生成し、所定の記憶装置(記憶装置1、図示せぬサーバーなど)に記憶する。
 図5は、クエリ条件を含むテンプレートデータの一例について説明する図である。
 例えば図5に示すように、テンプレートデータは、1または複数のクエリ条件レコードを含む。1つのクエリ条件レコードは、1つのクエリ条件に対応する。クエリ条件レコードは、クエリ領域ID、クエリタイプ、検索用部分画像ファイルへのファイルパス、および文字認識領域リストを含む。文字認識領域リストは、文字認識領域データへのリンク(参照)を含む。1つの文字認識領域データは、1つの文字認識領域の位置情報(検索用部分画像の基準位置(所定の頂点)からの相対的な文字認識領域の位置(画素数))を示す。
 なお、検索用部分画像は検索用部分画像ファイルとしてテンプレートデータとともに記憶される。
 図1に戻り、帳票画像処理部22は、処理対象の帳票画像と同一様式のレイアウトを有するサンプル帳票から生成されたテンプレートデータを使用して、その処理対象の帳票画像に対して帳票画像処理を実行する。帳票画像処理部22は、テンプレートデータ選択部41、対象帳票画像取得部42、部分画像検索部43、文字認識処理部44、および表データ生成部45を備える。
 テンプレートデータ選択部41は、例えば入力装置2に対するユーザー操作に従って、記憶装置1または図示せぬサーバーに記憶されている1または複数のテンプレートデータから、処理対象の帳票画像に応じた1つのテンプレートデータを選択し読み出す。
 このテンプレートデータは、1または複数のクエリ条件を含む。
 対象帳票画像取得部42は、処理対象となる帳票画像を取得する。例えば、対象帳票画像取得部42は、記憶装置1に格納されている画像データとしての帳票画像を読み出したり、図示せぬサーバーやホスト装置から通信装置4により受信された画像データとしての帳票画像を取得したり、画像読取装置5により帳票から生成された画像データとしての帳票画像を取得したりする。
 部分画像検索部43は、選択されたテンプレートデータに基づいて、そのテンプレートデータに含まれているクエリ条件により指定された検索用部分画像を、取得された帳票画像内で検索し、その検索用部分画像に対応する部分画像をその帳票画像において検出する。
 具体的には、部分画像検索部43は、帳票画像において、部分画像と同一サイズの注目領域を1画素ずつ移動させていき、各位置での帳票画像の注目領域と検索用部分画像との類似度を計算し、その類似度に基づいて、検索用部分画像に対応する部分画像を検出する。例えば、この類似度は、画像の特徴量に基づき計算される。例えば、この類似度は、既存の計算方法(SSD(Sum of Squared Difference)法、SAD(Sum of Absolute Difference)法、NCC(Normalized Cross Correlation)法、ZNCC(Zero means Normalized Cross Correlation)法など)で計算される。
 また、この実施の形態では、部分画像検索部43は、(a)クエリ条件のクエリタイプが第1クエリタイプである場合には、上述の類似度が最も大きいほうから所定個数Nの部分画像を検出し、(b)クエリ条件のクエリタイプが第2クエリタイプである場合には、上述の類似度が所定閾値を超えている部分画像をすべて検出する。なお、この閾値は、例えば、テンプレートデータ生成時に、ユーザー操作に従って指定され、クエリ条件に含められる。あるいは、この閾値は、帳票画像処理時にユーザー操作に従って設定される。
 図6は、処理対象となる帳票画像の一例(一部)を示す図である。図7は、図4に示すクエリ条件に従って図6に示す帳票画像で検出された部分画像内の文字認識領域の一例を示す図である。図8は、サンプル帳票画像の別の例(一部)、およびそのサンプル帳票画像上で、ユーザーにより指定されたクエリ領域およびそのクエリ領域内の文字認識領域の一例を示す図である。
 なお、通常、図6に示すように、同一様式のレイアウトの帳票は、図6に示すように、あるカラムにおけるセル内でのテキスト(数値)画像の位置が略同一になるように作成される。
 例えば図4に示すクエリ条件(検索用部分画像および文字認識領域)で図6に示す帳票画像内の部分画像が検索されると、第2クエリタイプの場合、例えば図7に示すように、6つの部分画像が検出される。
 例えば図6に示すような不定数の行におけるテキストを表データに含めたい場合には、帳票によって行の数が異なるため、第2クエリタイプが指定され、そのような不定数の行の部分画像がすべて検出される。
 一方、一定数(上述のN個)の行におけるテキストを表データに含めたい場合には、第1クエリタイプが指定され、特定の数の行の部分画像が検出される。例えば図8に示す「合計」のような位置が不定である行におけるテキストを表データに含めたい場合でも、画像検索によって自動的に位置が特定され、そのような行の部分画像が検出される。したがって、1つのテンプレートデータで、そのような位置不定な行がどの位置になっても、その行の部分画像が検出される。
 文字認識処理部44は、テンプレートデータに基づいて、帳票画像内で検出された部分画像において、クエリ条件により指定された文字認識領域を特定し、その文字認識領域に対して文字認識処理を実行する。
 表データ生成部45は、帳票画像処理において、文字認識処理で得られたテキストデータを有する表データを所定のデータ形式(例えばCSV(Character-Separated Values)など)で生成する。
 図9は、図7に示す文字認識領域に対する文字認識処理で得られたテキストデータに基づき生成された表データの一例を示す図である。例えば図7に示すように文字認識領域が特定された場合、図6に示す帳票から図9に示すような表データが生成される。
 例えば図7に示すような1つのセルの上下に複数項目(受注番号と注文番号)の値が配列されていても、図9に示すように、それらの項目に対して、1つずつ別々のカラムのデータが生成される。
 ここで、1つのテンプレートデータに複数のクエリ条件が含まれている場合、表データ生成部45は、それぞれのクエリ条件に対応して複数の表データを生成するようにしてもよいし、それぞれのクエリ条件に対応する複数の表データを1つの表データに統合するようにしてもよい。その場合、複数の表データを縦方向に連結して1つの表データに統合するようにしてもよいし、複数の表データを横方向に連結して1つの表データに統合するようにしてもよい。
 なお、上述のテンプレートデータ生成部21と帳票画像処理部22とを別々の情報処理装置(サーバー、パーソナルコンピューターなど)に実装してもよく、1台の情報処理装置(サーバー、パーソナルコンピューターなど)に、テンプレートデータ生成部21および帳票画像処理部22の一方のみを実装してもよい。
 また、ここで、サンプル帳票および帳票はデジタルデータでもよく、サンプル帳票画像および帳票画像は、そのデジタルデータとしてのサンプル帳票および帳票からそれぞれ得られたもの(ラスター画像など)でもよい。
 次に、実施の形態1に係るシステムの動作について説明する。
 一連の帳票に対して帳票画像処理を実行して表データを生成したい場合、まず、その一連の帳票からサンプル帳票が選択され、そのサンプル帳票から得られるサンプル帳票画像に対してテンプレートデータ生成処理が実行され、その後、テンプレートデータ生成処理で生成されたテンプレートデータを使用して、一連の帳票の帳票画像に対して帳票画像処理が順番に行われ、自動的に表データが生成される。
 ここで、テンプレートデータ生成処理および帳票画像処理について説明する。
(a)テンプレートデータ生成処理
 図10は、実施の形態1に係るシステムにおけるテンプレートデータ生成処理について説明するフローチャートである。
 ユーザーは、サンプル帳票画像を選択し、入力装置2を使用して指定する。例えば、ユーザーは、サンプル帳票を選択し、画像読取装置5にセットし、画像読取装置5に、サンプル帳票からサンプル帳票画像を読み取らせる。あるいは、例えば、ユーザーは、入力装置2を使用して、保存されている帳票画像のリストからサンプル帳票画像を選択する。サンプル帳票画像取得部31は、ユーザーにより指定されたサンプル帳票画像の画像データを取得する(ステップS1)。
 クエリ条件設定部32は、その画像データに基づき、サンプル帳票画像を表示装置3に表示する。サンプル帳票画像が表示されると、ユーザーは、入力装置2を操作して、サンプル帳票画像上で、所望の矩形領域をクエリ領域として指定する。例えば、ユーザーは、このとき、文字認識すべきテキスト画像部分の他、そのテキスト画像部分を囲む罫線などといった不変部分(つまり、複数帳票の間で内容が変わらない部分)が含まれるように、クエリ領域を指定する。クエリ条件設定部32は、そのユーザー操作に基づいて、指定されたクエリ領域(クエリ領域の位置およびサイズ)を特定し(ステップS2)、サンプル帳票画像から、特定したクエリ領域の部分画像を、検索用部分画像として抽出する(ステップS3)。
 例えば、クエリ条件設定部32は、クエリ領域を示す枠線を、サンプル帳票画像に重畳して表示する。これにより、ユーザーは、サンプル帳票画像上で、クエリ領域を視認できる。
 次に、ユーザーは、表示されているサンプル帳票画像上で、指定したクエリ領域内部の所望の矩形領域を、文字認識領域として指定する。例えば、ユーザーは、このとき、文字認識すべきテキスト画像部分が含まれ、罫線などの他のオブジェクトが含まれないように、文字認識領域を指定する。クエリ条件設定部32は、そのユーザー操作に基づいて、指定された文字認識領域を特定する(ステップS4)。この文字認識領域は、クエリ領域(つまり、検索用部分画像)内での、クエリ領域(つまり、検索用部分画像)内の所定の基準点からの相対位置およびサイズを特定可能なデータ(例えば、文字認識領域の2頂点の相対位置の座標値、文字認識領域の1頂点の相対位置の座標値と縦および横のサイズとの対など)で表される。例えば、この相対位置は、基準点からの距離で表され、この距離およびサイズは、画素数で表される。1つの文字認識領域は、後述の表データにおける1つのカラムに対応する。
 このようにして、文字認識領域が特定されると、クエリ条件設定部32は、指定された文字認識領域に対応するカラムのカラム属性(カラムの見出し、データ種別など)を入力するためのダイアログなどを表示装置3に表示する。ユーザーは、入力装置2を操作して、そのダイアログなどに対して、カラム属性(自由テキストとしてのカラム見出し、リストから選択されたデータ種別など)を入力する。クエリ条件設定部32は、入力されたカラム属性を特定し、その文字認識領域に関連付ける(ステップS5)。
 さらに、クエリ条件設定部32は、現在設定中のクエリ条件のクエリタイプを入力するためのダイアログなどを表示装置3に表示する。ユーザーは、入力装置2を操作して、そのダイアログなどに対して、クエリタイプを入力する。クエリ条件設定部32は、入力されたクエリタイプを特定し、当該クエリ条件に関連付ける(ステップS6)。
 クエリ条件設定部32は、指定されたクエリ領域について、上述のように特定された(a)検索用部分画像、(b)文字認識領域データ(相対位置情報、サイズ情報、カラム属性など)、および(c)クエリタイプで、クエリ条件レコードを生成し、当該サンプル帳票画像に対するテンプレートデータに追加する(ステップS7)。
 このようにして、1つのクエリ条件が設定されると、クエリ条件設定部32は、例えば、別のクエリ条件を設定するか否かを入力するためのダイアログを表示装置3に表示する。ユーザーは、別のクエリ条件を設定するか否かを選択して、入力装置2でダイアログに入力する。
 クエリ条件設定部32は、別のクエリ条件を設定するか否かを、このようなユーザー操作などに従って判定する(ステップS8)。
 クエリ条件設定部32は、別のクエリ条件を設定すると判定した場合、ステップS2に戻り、当該サンプル帳票画像についての別のクエリ条件の設定を行う(ステップS2~S7)。
 一方、クエリ条件設定部32は、別のクエリ条件を設定しないと判定した場合、これまでに設定されたクエリ条件を示すクエリ条件レコードおよび検索用部分画像ファイルで、当該サンプル帳票画像に対するテンプレートデータを生成し(ステップS9)、1つのファイルとして記憶装置1などに格納したり、図示せぬデータベースに登録したりする。
 このようにして、ユーザー所望のテンプレートデータが生成され保存される。
(b)帳票画像処理
 図11は、実施の形態1に係るシステムにおける帳票画像処理(処理対象の帳票画像から表データを生成する処理)について説明するフローチャートである。
 1または複数のテンプレートデータが準備された後、ユーザーは、帳票画像処理の対象となる帳票(帳票画像)と同一のレイアウトを有するサンプル帳票(サンプル帳票画像)から得られたテンプレートデータを選択し、そのテンプレートデータで帳票画像処理を実行させる。
 テンプレートデータ選択部41は、保存されているテンプレートデータのリストを表示装置3に表示し、そのリストにおいてユーザー操作により選択されたテンプレートデータを読み出す(ステップS11)。
 次に、ユーザーは、処理対象の帳票画像を選択し、入力装置2を使用して指定する。例えば、ユーザーは、処理対象の帳票を選択し、画像読取装置5にセットし、画像読取装置5に、その帳票から帳票画像を読み取らせる。あるいは、例えば、ユーザーは、入力装置2を使用して、保存されている帳票画像のリストから処理対象の帳票画像を選択する。対象帳票画像取得部42は、ユーザーにより指定された帳票画像の画像データを取得する(ステップS12)。
 なお、適用されるテンプレートデータのサンプル帳票画像の解像度と同じ解像度の帳票画像が取得される。
 そして、部分画像検索部43は、選択されたテンプレートデータ内の未処理(未選択)のクエリ条件を1つ選択し(ステップS13)、選択したクエリ条件により指定されている検索用部分画像を検索キーとして、取得された帳票画像において画像検索を上述のように実行する(ステップS14)。
 文字認識処理部44は、取得された帳票画像において、その画像検索で発見された部分画像における文字認識領域を、クエリ条件内の文字認識領域の位置情報およびサイズ情報に基づいて特定し(ステップS15)、その文字認識領域の画像に対して文字認識処理を実行し、その文字認識領域に含まれるテキスト画像に対応するテキストデータ(文字コード)を特定する(ステップS16)。なお、このとき、文字認識領域のカラム属性で指定されているデータ種別を考慮して文字認識処理を実行するようにしてもよい。
 文字認識処理部44は、各文字認識領域に対応して得られた1または複数のテキストデータを、1つのカラムで配列されるテキストデータとして互いに関連付ける。
 そして、表データ生成部45は、1または複数の文字認識領域に対応して得られた1または複数のカラムのデータから、所定のデータ形式で表データを生成する(ステップS17)。
 部分画像検索部43は、選択されたテンプレートデータ内のすべてのクエリ条件が処理されたか否かを判定し(ステップS18)、少なくとも1つのクエリ条件が処理されていない場合には、ステップS13に戻り、同様の処理(ステップS13~S16)を、文字認識処理部44とともに実行し、表データ生成部45は、新たに生成されたカラムのデータを表データに追加する(ステップS17)。あるいは、すべてのクエリ条件の処理が完了した後に、その処理で得られたカラムのデータから表データを一括して生成するようにしてもよい。
 一方、部分画像検索部43は、選択されたテンプレートデータ内のすべてのクエリ条件が処理されたと判定した場合、当該帳票画像に対する帳票画像処理は終了する。
 このようにして、ユーザーにより指定された帳票画像に対して、対応するテンプレートデータを使用した帳票画像処理が実行され、その帳票画像に対応する表データが得られる。
 なお、テンプレートデータが生成されているレイアウトの帳票については、テンプレートデータ生成処理を再度実行する必要はなく、保存されているテンプレートデータを使用して帳票画像処理が実行される。
 以上のように、上記実施の形態1によれば、対象帳票画像取得部42は、処理対象となる帳票画像を取得する。部分画像検索部43は、1または複数のクエリ条件を含むテンプレートデータに基づいて、そのクエリ条件により指定された検索用部分画像を帳票画像内で検索し、その検索用部分画像に対応する1または複数の部分画像を帳票画像において検出する。文字認識処理部44は、そのテンプレートデータに基づいて、帳票画像内で検出された各部分画像における、そのクエリ条件により指定された文字認識領域に対して文字認識処理を実行する。
 これにより、テンプレートデータにおけるクエリ条件で指定された検索用部分画像に対応して検出された、帳票画像内の部分画像内で、クエリ条件に基づき文字認識領域が特定されるため、複雑なレイアウトの帳票画像でも、所望のカラム配列で表データを生成することができる。したがって、より多様な帳票から表データが適切に生成される。
実施の形態2.
 実施の形態2に係る帳票画像処理システムでは、表データ生成部45は、上述のように、1つの文字認識領域に対応して文字認識処理で得られたテキストデータを1つのカラムとし、その1つの文字認識領域に関連付けられているカラム属性に基づいて1つのカラムの見出しを設定しており、さらに、複数のクエリ条件の文字認識領域に対応して同一の見出しの複数のカラムがある場合には、その複数のカラムを1つのカラムに統合する。
 なお、実施の形態2に係る帳票画像処理システムのその他の構成および動作については実施の形態1と同様であるので、その説明を省略する。
実施の形態3.
 実施の形態3に係る帳票画像処理システムでは、テンプレートデータ生成部21は、(a)サンプル帳票画像の解像度を所定の解像度に低下させ、(b)その所定の解像度に低下させたサンプル帳票画像におけるクエリ領域の画像を検索用部分画像として抽出する。
 また、実施の形態3に係る帳票画像処理システムでは、部分画像検索部43は、(c)帳票画像をデフォルト解像度からその所定の解像度に低下させ、(d)その所定の解像度に低下させた帳票画像内で検索用部分画像を検索し、検索用部分画像に対応する部分画像を、その所定の解像度に低下させた帳票画像において検出し、文字認識処理部44は、テンプレートデータに基づいて、検出された部分画像における文字認識領域を特定し、デフォルト解像度での文字認識領域に対して文字認識処理を実行する。
 なお、実施の形態3に係る帳票画像処理システムのその他の構成および動作については実施の形態1または実施の形態2と同様であるので、その説明を省略する。
 以上のように、上記実施の形態3によれば、部分画像検索部43における画像検索が縮小画像で行われるため、検索用画像検索に対応する、帳票画像内の部分画像が、短時間で検出される。
 なお、上述の実施の形態に対する様々な変更および修正については、当業者には明らかである。そのような変更および修正は、その主題の趣旨および範囲から離れることなく、かつ、意図された利点を弱めることなく行われてもよい。つまり、そのような変更および修正が請求の範囲に含まれることを意図している。
 例えば、上記実施の形態1,2,3において、表データ生成部45は、文字認識処理の結果として文字コード(テキストデータ)が得られなかった場合には、対応するセルに、値なしを示すダミーデータ(第1ダミーデータ)を挿入してもよく、また、表データ生成部45は、複数のクエリ条件による表データを合成した際に、あるクエリ条件で得られたカラムが、別のクエリ条件で得られない場合には、当該カラムにおいて、当該別のクエリ条件の表データに対応するセルには、ダミーデータ(第2ダミーデータ)を挿入してもよい。さらに、上述の第1ダミーデータおよび第2ダミーデータは、互いに異なる定型のテキストとされてもよい。そのようにすることで、表データにおいて、本来的にデータがないセルか、文字認識結果で値が得られなかったセルかが明確区別されて、ユーザーに認識される。
 また、上記実施の形態1,2,3において、帳票画像の文字認識領域に対して文字認識処理を実行する前に、文字認識領域の境界(枠)と帳票画像内のオブジェクト(文字認識対象のテキスト画像)とが交差している場合には、当該オブジェクトが文字認識領域内の収まるように文字認識領域を調整するようにしてもよい。
 さらに、上記実施の形態1,2,3において、サンプル帳票画像の形状と、帳票画像処理の対象となる帳票画像の形状とが一致しない場合、帳票画像処理において、両者が一致するように、処理対象となる帳票画像の拡大、縮小、回転などを適宜行うようにしてもよい。
 さらに、上記実施の形態1,2,3では、帳票画像処理の対象となる帳票(帳票画像)に対応してユーザー操作に従って手動でテンプレートデータが選択されるが、その代わりに、テンプレートデータ選択部41が、帳票画像処理の対象となる帳票画像とサンプル帳票画像との類似度に基づいて、類似度が最大であるサンプル帳票画像に対応するテンプレートデータを自動的に選択するようにしてもよい。その場合、例えば、(a)テンプレートデータ生成部34が、テンプレートデータ生成時に、対応するサンプル帳票画像を画像ファイルとしてそのテンプレートデータに関連付けて所定の記憶装置に保存しておき、(b)テンプレートデータ選択部41が、帳票画像処理の対象となる帳票画像の帳票画像処理の前に、帳票画像処理の対象となる帳票画像と、保存されている1または複数のテンプレートデータに対応するサンプル帳票画像との類似度を計算し、類似度が最大であるサンプル帳票画像に対応する1つのテンプレートデータを選択し、(c)選択されたテンプレートデータを使用して帳票画像処理が実行される。その際、処理対象の帳票画像とサンプル帳票画像とをそれぞれ所定の倍率で縮小し、縮小後の処理対象の帳票画像と縮小後のサンプル帳票画像との類似度を、処理対象の帳票画像とサンプル帳票画像との類似度として計算するようにしてもよい。さらに、その際、縮小後の処理対象の帳票画像と縮小後のサンプル帳票画像とをそれぞれ2値画像に変換し、2値画像としての縮小後の処理対象の帳票画像と2値画像としての縮小後のサンプル帳票画像との類似度を、処理対象の帳票画像とサンプル帳票画像との類似度として計算するようにしてもよい。なお、ここでは、例えば、処理対象の帳票画像(縮小前、縮小後、または縮小かつ2値化後のもの)とサンプル帳票画像(縮小前、縮小後、または縮小かつ2値化後のもの)とを画素ごとに比較し、画素値が一致する画素の数(あるいはその画素数に対応する数)を類似度として計算する。また、テンプレートデータと関連付けて保存するサンプル帳票画像として、縮小前、縮小後、または縮小かつ2値化後のものを予め生成して使用するようにしてもよい。
 本発明は、例えば、帳票画像に対応する表データの生成に適用可能である。

Claims (7)

  1.  処理対象となる帳票画像を取得する対象帳票画像取得部と、
     1または複数のクエリ条件を含むテンプレートデータに基づいて、前記クエリ条件により指定された検索用部分画像を前記帳票画像内で検索し、前記検索用部分画像に対応する部分画像を前記帳票画像において検出する部分画像検索部と、
     前記テンプレートデータに基づいて、前記帳票画像内で検出された前記部分画像における、前記クエリ条件により指定された文字認識領域に対して文字認識処理を実行する文字認識処理部と、
     を備えることを特徴とする帳票画像処理システム。
  2.  前記テンプレートデータを生成するテンプレートデータ生成部をさらに備え、
     前記テンプレートデータ生成部は、(a)サンプル帳票画像において、ユーザー操作で指定されたクエリ領域および前記クエリ領域内の前記文字認識領域を特定し、(b)前記サンプル帳票画像における前記クエリ領域の画像を前記検索用部分画像として抽出し、(c)前記検索用部分画像および前記文字認識領域を示す前記クエリ条件を生成すること、
     を特徴とする請求項1記載の帳票画像処理システム。
  3.  前記クエリ条件は、クエリタイプとして、前記検索用部分画像に対応する所定個数の部分画像を前記帳票画像において検出させる第1クエリタイプおよび前記検索用部分画像に対応するすべての部分画像を前記帳票画像において検出させる第2クエリタイプのいずれかを有し、
     前記部分画像検索部は、(a)前記帳票画像において、前記部分画像と同一サイズの注目領域を1画素ずつ移動させていき、各位置での前記帳票画像の前記注目領域と前記検索用部分画像との類似度を計算し、(b1)前記クエリ条件のクエリタイプが前記第1クエリタイプである場合には、前記類似度が最も大きいほうから前記所定個数の前記部分画像を検出し、(b2)前記クエリ条件のクエリタイプが前記第2クエリタイプである場合には、前記類似度が所定閾値を超えている前記部分画像をすべて検出すること、
     を特徴とする請求項1記載の帳票画像処理システム。
  4.  前記文字認識処理で得られたテキストデータを有する表データを生成する表データ生成部をさらに備え、
     前記テンプレートデータは、前記文字認識領域に関連付けてカラム属性を有し、
     前記表データ生成部は、(a)1つの文字認識領域に対応して前記文字認識処理で得られたテキストデータを1つのカラムとし、(b)前記1つの文字認識領域に関連付けられている前記カラム属性に基づいて前記1つのカラムの見出しを設定し、(c)複数の前記クエリ条件の前記文字認識領域に対応して同一の見出しの複数のカラムがある場合には、前記複数のカラムを1つのカラムに統合すること、
     を特徴とする請求項1記載の帳票画像処理システム。
  5.  前記テンプレートデータ生成部は、(a)前記サンプル帳票画像の解像度を所定の解像度に低下させ、(b)前記所定の解像度に低下させた前記サンプル帳票画像における前記クエリ領域の画像を前記検索用部分画像として抽出し、
     前記部分画像検索部は、(c)前記帳票画像をデフォルト解像度から前記所定の解像度に低下させ、(d)前記所定の解像度に低下させた前記帳票画像内で前記検索用部分画像を検索し、前記検索用部分画像に対応する部分画像を、前記所定の解像度に低下させた前記帳票画像において検出し、
     前記文字認識処理部は、前記テンプレートデータに基づいて、前記部分画像における前記文字認識領域を特定し、前記デフォルト解像度での前記文字認識領域に対して文字認識処理を実行すること、
     を特徴とする請求項1記載の帳票画像処理システム。
  6.  処理対象となる帳票画像を取得するステップと、
     1または複数のクエリ条件を含むテンプレートデータに基づいて、前記クエリ条件により指定された検索用部分画像を前記帳票画像内で検索し、前記検索用部分画像に対応する部分画像を前記帳票画像において検出するステップと、
     前記テンプレートデータに基づいて、前記帳票画像内で検出された前記部分画像における、前記クエリ条件により指定された文字認識領域に対して文字認識処理を実行するステップと、
     を備えることを特徴とする帳票画像処理方法。
  7.  コンピューターを、
     処理対象となる帳票画像を取得する対象帳票画像取得部、
     1または複数のクエリ条件を含むテンプレートデータに基づいて、前記クエリ条件により指定された検索用部分画像を前記帳票画像内で検索し、前記検索用部分画像に対応する部分画像を前記帳票画像において検出する部分画像検索部、および
     前記テンプレートデータに基づいて、前記帳票画像内で検出された前記部分画像における、前記クエリ条件により指定された文字認識領域に対して文字認識処理を実行する文字認識処理部
     として機能させる帳票画像処理プログラム。
PCT/JP2019/048267 2019-12-10 2019-12-10 帳票画像処理システム WO2021117128A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/048267 WO2021117128A1 (ja) 2019-12-10 2019-12-10 帳票画像処理システム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/048267 WO2021117128A1 (ja) 2019-12-10 2019-12-10 帳票画像処理システム

Publications (1)

Publication Number Publication Date
WO2021117128A1 true WO2021117128A1 (ja) 2021-06-17

Family

ID=76329946

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/048267 WO2021117128A1 (ja) 2019-12-10 2019-12-10 帳票画像処理システム

Country Status (1)

Country Link
WO (1) WO2021117128A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1173472A (ja) * 1997-08-29 1999-03-16 Oki Electric Ind Co Ltd フォーマット情報登録方法及びocrシステム
JP2019159932A (ja) * 2018-03-14 2019-09-19 富士ゼロックス株式会社 情報処理装置及びプログラム

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1173472A (ja) * 1997-08-29 1999-03-16 Oki Electric Ind Co Ltd フォーマット情報登録方法及びocrシステム
JP2019159932A (ja) * 2018-03-14 2019-09-19 富士ゼロックス株式会社 情報処理装置及びプログラム

Similar Documents

Publication Publication Date Title
US9613267B2 (en) Method and system of extracting label:value data from a document
JP4347677B2 (ja) 帳票ocrプログラム、方法及び装置
JP4461769B2 (ja) 文書検索・閲覧手法及び文書検索・閲覧装置
US20110157215A1 (en) Image output device, image output system and image output method
US11475688B2 (en) Information processing apparatus and information processing method for extracting information from document image
US11303769B2 (en) Image processing system that computerizes documents with notification of labeled items, control method thereof, and storage medium
US11321558B2 (en) Information processing apparatus and non-transitory computer readable medium
RU2605078C2 (ru) Сегментация изображения для верификации данных
US11348331B2 (en) Information processing apparatus and non-transitory computer readable medium
CN114529933A (zh) 一种合同数据差异性的比对方法、装置、设备和介质
JP2021140831A (ja) 帳票画像処理システム、帳票画像処理方法、および帳票画像処理プログラム
CN113806472B (zh) 一种对文字图片和图像型扫描件实现全文检索的方法及设备
JP4983464B2 (ja) 帳票画像処理装置及び帳票画像処理プログラム
WO2021117128A1 (ja) 帳票画像処理システム
JP5657401B2 (ja) 文書処理装置、及び文書処理プログラム
JP2000322417A (ja) 画像ファイリング装置及び方法及び記憶媒体
JP4347675B2 (ja) 帳票ocrプログラム、方法及び装置
JP4518212B2 (ja) 画像処理装置及びプログラム
JP4517822B2 (ja) 画像処理装置及びプログラム
JP2022090469A (ja) 書式定義装置、書式定義方法、及びプログラム
JP5051174B2 (ja) 帳票辞書生成装置、帳票識別装置、帳票辞書生成方法、及びプログラム
JP2013182459A (ja) 情報処理装置、情報処理方法及びプログラム
JP7358838B2 (ja) 情報処理装置、及び情報処理プログラム
US11995908B2 (en) Information processing device and non-transitory computer readable medium
JP3817442B2 (ja) 画像認識装置、画像認識方法、及び画像認識方法を実現するプログラムとこのプログラムの記録媒体

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19955863

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19955863

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP