# How to detect blocks of texts in document images

I am planning to detect texts from document text images like below:

GOAL:

WORK DONE: I have tried to solve this with some scene text detection algorithms like EAST Text detector and PixelLink. But it only provides result in such a way it detects each and every word individually as below, which is obvious:

What method can help me detect blocks of texts as mentioned under GOAL.

EDIT :

I don't want extract all texts via OCR. What I want instead is to detect texts based on their visual positional arrangement. See in the image, texts positioned together are detected as blocks. And my result should contain all the bounding box co-ordinates of all the detected text blocks.

• If you are able to get to words, why don't you try to reconstruct the paragraphs by the geometry of the text? Simply put, words on the same row can be ordered according to the x coordinate to build the sentences. You might need to allow for some tollerance to noise/variation, but this should be easily manageable. Otherwise, it is difficult to determine what does it mean that two words are in the same text box, which can be easily observed in your headers and footers. Feb 25 '19 at 8:53
• Possible duplicate of How to label and detect the document text images Feb 25 '19 at 10:04
• @HFulcher well that refers to extract all the texts in the image through OCR, what I'm trying to solve is to detect text blocks based on their positional arrangement. I don't want to perform OCR, I need only the bounding boxes co-ordinates
– DGS
Feb 25 '19 at 10:43
• @HFulcher Thanks for letting me know this. I have edited my question.
– DGS
Feb 25 '19 at 11:29
• @DGS not a problem, hope you get an answer :) Feb 25 '19 at 11:30

• @DGS I assume you already have the center position of each word $w$ as $(x_w, y_w)$, now apply DBSCAN for clustering (it is a mainstream library), then use two points (min x, min y) and (max x, max y) that are calculated from words in each cluster as the bounding box of block (assuming top-left of page is (0, 0)). Your done! Mar 14 '19 at 12:11