13. A system for preprocessing an image for optical character recognition (OCR), wherein the image comprises Arabic text and non-text items, the system comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to: determine a plurality of components associated with at least one of the Arabic text and the non-text items, wherein a component comprises a set of connected pixels; calculate a first set of characteristic parameters associated with the plurality of components; merge the plurality of components based on the first set of characteristic parameters to form at least one of at least one sub-word and at least one word; calculate a second set of characteristic parameters of the at least one of each subword and each word, wherein the second set of characteristic parameters is one of a line height, a word spacing, and a line spacing; group at least two sub-words based on the second set of characteristic parameters to form one of at least one sub-word and at least one word; segment the at least one sub word and the at least one word into at least one horizontal line based on at least one of a line height and a line spacing; identify at least one component associated with the at least one horizontal line comprising a height greater than a factor of the line height; determine a center of each horizontal line of the at least one horizontal line, wherein the center is a mid point between a top edge and a bottom edge of each horizontal line; calculate a distance between at least one of the center and the top edge, and the center and the bottom edge; and determine orientation of the image based on the distance.
15. The system of claim 13 , wherein for determining the plurality of components the processor is further configured to: perform a raster scan across the image; identify a plurality of pixels associated with at least one of the plurality of components corresponding to at least one sweep of the raster scan; and aggregate the plurality of pixels based on an interconnection between the plurality of pixels to form at least one set of connected pixels.