3

I am looking for a strategy to find rectangular blank spaces in an image (in this case a scanned text document).

My initial thought was to base it on some sort of floodfill algorithm modified for growing rectangles. I've played with Hough Transforms a bit but didn't get the right results (quite possibly because I didn't tune it properly for text blocks).

Before I pull out all my hair, does anyone have any suggestions for algorithms or strategies to accomplish something like this? (I've attached a link to a quick example I mocked up)

Thanks!

http://f.cl.ly/items/0K2b2V231c1a2T0E350L/Untitled%203.png

2
  • It would be great if you could post your input and output images separately, so that it can make it easier for us to work on the images. Commented Mar 19, 2018 at 16:26
  • And could you exactly define "rectangular blank space"? The term seems ambiguous to me. The example images have overlapping rectangles, which makes it a little more confusing. Commented Mar 19, 2018 at 16:35

2 Answers 2

1

The simplest thing I would do is; take a white pixel (assume your image is binary), and start to enlarge it with in x and y direction separately. Once an enlargement process hit a black pixel stop enlarging in that direction. But you should keep enlarging the region in other direction until it hits a black pixel too. Otherwise you will get only square pixels.

Then you must save which positions assigned to a region so a pixel should not be assigned to more than one region. Also you must have threshold values for the size in each direction (length and width), therefore you can avoid so many regions.

Sign up to request clarification or add additional context in comments.

Comments

0

How about applying the Hit-Or-Miss transform on the binary image?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.