-3

I need to create iOS app and this app allow user to capture paper and automatically detect text-line and then extract each line as new image.

Example: Image contains 4 lines of text after process become 4 images and each image contain text line.

Anyone can help me please?

1 Answers1

1

1) First, 3x3 Gaussian blur or some other method to remove noise.

2) Adaptive threshold the image. You have the text as white and rest as black. [You can apply one step of erode after this if you see some small noise elements]

3) Create a kernel to work in x-direction for Dilation. Apply very big dilation like 10 or more. It will dilate you white text in horizontal direction only.

4) Now you have several white rectangles. Extract image from original image where rectangle size and position is taken from above resultant image. You can simply AND both images in case you just want to separate.

Good Luck and happy coding.

Pervez Alam
  • 1,246
  • 10
  • 20