1. A method for processing an image, the method comprising: segmenting, by one or more processors, the image into a first segmented layer and a second segmented layer; identifying, by the one or more processors, a region in the first segmented layer of the image based on at least a first value of plurality of first pixels in the first segmented layer; for a coordinate in the identified region: determining, by the one or more processors, if one or more second pixels, in a vicinity of a third pixel at the coordinate in the second segmented layer of the image, are representative of a set of text components based on at least a second value of each of the one or more second pixels; comparing, by the one or more processors, a first size of the identified region with at least an average size of the set of text components in the second segmented layer based on the determination; and merging, by the one or more processors, the identified region with the second segmented layer based on the comparison.