4. The method of claim 1 , wherein the image is obtained by correcting skew using a modified Hough transform, wherein the modified Hough transform is adapted for the Arabic text.
1. A method of preprocessing an image for optical character recognition (OCR), wherein the image comprises a plurality of columns, each column of the plurality of columns comprising text, the method comprising: determining a plurality of components associated with the text, wherein a component comprises a series of connected pixels; calculating a line height and a column spacing associated with the plurality of components; associating at least one component of the plurality of components with a column of the plurality of columns based on at least one of the line height and the column spacing; calculating a first set of characteristic parameters for each column of the plurality of columns; merging the plurality of components of each column of the plurality of columns based on the first set of characteristic parameters to form at least one of at least one sub-word and at least one word; merging a first plurality of words, subwords, or a combination thereof to be processed as a first region; merging a second plurality of words, subwords, or a combination thereof to be processed as a second region wherein at least a portion of the second region vertically overlaps at least a portion of the first region; wherein calculating a word spacing associated with each column comprises creating a histogram of spaces between consecutive components of the plurality of components associated with each column, identifying a frequently occurring space from the histogram, the frequently occurring space being within a threshold range determined by the line height, and computing the word spacing based on the frequently occurring space; and wherein calculating the line spacing associated with each column comprises creating a histogram of a plurality of horizontal projections of the plurality of components associated with each column, a horizontal projection of the plurality of horizontal projections indicating a number of pixels associated with the plurality of components corresponding to each sweep of a raster scan, calculating an average distance between two consecutive maximum horizontal projections, and computing the line spacing based on the average distance.