# A Proposal of Printed Table Digitization Algorithm with Image Processing
## 1 Introduction  
Nowadays, _digital transformation (DX)_ is the key concept to changing the working styles and improving the operations in governments, companies, and schools. In [1], DX is defined as the strategy of enabling business innovations predicated on the incorporation of digital technologies into operational processes, products, solutions, and customer interactions. DX can leverage the opportunities of new technologies and their impacts on businesses by focusing on the creation and monetization of digital assets. Therefore, any data should be digitized and processed by computers and networks.  
Unfortunately, a lot of data and information are still handled on paper. People often feel comfortable accessing data and managing them on paper. Actually, a lot of data printed on paper were originally generated using computers digitally and were printed out using software fronts. Therefore, data on paper are often digitized using an _optical character recognition (OCR)_ software. However, when the paper contains tables, it is difficult to digitalize them correctly, because, in a table, the characters are usually separated by rows and columns, called _cells_, and the characters in one cell are related to each other. Thus, the recognition of the characters in a table while keeping the relationships between the cells is far more difficult than that of normal texts.  
Therefore, the research question in this paper is \"how to convert a printed table on paper into an Excel table by keeping the relationships between the cells in the table?\". Table formats can be diverse among documents, which further increases the difficulty ofthe solution to this question. To control the difficulty, we limit the table layouts to two that have been commonly used in this paper. For both layouts, it is possible to find and keep the relationships between the left-side cells and the right-side cells in each row for every column.  
In the first layout, the table structure is a simple grid, which is the basic one. In this layout, the number of columns is constant from the first row to the last row in the table, and the number of rows is also constant from the leftmost column to the rightmost column, as shown in Figure 1. In the second layout, the table structure is a little bit more complex. The number of columns is constant from the top row to the bottom row in the table, but the number of rows may increase at some columns from the leftmost column to the rightmost column, as shown in Figure 2.  
In this paper, we propose the _printed table digitization algorithm_ for digitizing a printed table on paper using image processing techniques and an _optical character recognition (OCR)_ software. The table layout is limited to either one of the abovementioned layouts. In this algorithm, first, the printed table is divided into a collection of _cells_ where the topology information between the cells is extracted. Second, the characters in each cell are digitized by applying the OCR software. Finally, the digitized data are arranged into one _Excel_ table using the topology information. We implement the proposed algorithm on _Python_ using _OpenCV_ for the image processing library and _Tesseract_ for the OCR software.  
For evaluations, we applied the proposal to 19 scanned and 17 screenshotted table images. The results show that for any image, the _Excel_ file is generated with the correct structure, and some characters are misrecognized by the adopted OCR software. The improvement will be in future works.  
The rest of this paper is organized as follows: Section 2 discusses related works in the literature. Section 3 introduces the adopted software in this paper. Section 4 describes the target table layout printed on paper. Section 5 presents the proposed algorithm. Section 6 evaluates the proposal. Finally, Section 7 concludes this paper with future works.