摘要 |
PROBLEM TO BE SOLVED: To provide a document recognition device for quickly and accurately executing the determination processing of a writing direction and a vertical direction.SOLUTION: A document recognition device 1 determines a rectangular scanning range 21 with respect to the region of document image data 20 (S1). Then, the document recognition device 1 scans a vertical scanning line 23, and counts the number of areas sandwiched between areas including the pixels of character colors, which do not include the pixels of the character colors, and calculates it as the number of vertical blank areas 27 of each vertical scanning line 23 (S3). In the same way, the document recognition device 1 scans a horizontal scanning line 24, and calculates the number of horizontal blank areas 28 of each horizontal scanning line 24 (S4). Then, the document recognition device 1 determines the line head position of document image data 20 on the basis of the number of the vertical blank areas 27 and the number of the horizontal blank area 28, and when the line head position is right or left, calculates a horizontal histogram 29, and when the line head position is up or down, calculates a vertical histogram 30, and determines a writing direction and a vertical direction on the basis of the line head position and the position of the peak of either the horizontal histogram 29 or the vertical histogram 30. |