Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing text while processing the image

I am working on an application where I need feature like Cam Scanner where document is to be detected in an image. For that I am using Canny Edge detection followed by Hough Transform.

The results look promising but the text in the document is creating issues as explained via images below:

Original Image Original Image

After canny edge detection After Canny Edge detcetion

After hough transform After Hough Transform

My issue lies in the third image, the text in original mage near the bottom has forced hough transform to detect the horizontal line(2nd cluster from bottom).

I know I can take the largest quadrilateral and that would work fine in most cases, but still I want to know any other ways where in this processing I can ignore the effect of text on the edges.

Any help would be appreciated.

like image 238
Akashdeep Saluja Avatar asked Dec 26 '16 16:12

Akashdeep Saluja


People also ask

Can I remove text from an image?

WebinPaint is an easy way out if you are looking to remove text from a picture online. This web tool can easily remove the text or any other unwanted content from your photos such as watermarks, logos, objects, and more. This online tool is also able to repair old photos, digital facial retouching, and more.

How do you remove unwanted text from a picture?

Remove text from JPEG with ScanWritr eraser tool To remove text from image you can use ScanWritr's eraser tool. Just go to the ScanWritr web and upload the file you want to edit. Erase unwanted text or background, then fill document, sign it, preview it, export it and that's it.

How can I remove text from a picture without harming the background free?

How to remove text from a picture? You can remove text from an image without deleting the background easily using Fotor's free online photo object removal tool. Just upload the picture you want to edit to Fotor, brush over the unwanted text and Fotor'll remove it for you.

Which app is used to remove text from the image?

As it name implies, Remove Object from Photo is also one of the best app that can remove text from photo. It offers brush tool, lasso tool, and quick eraser to remove unwanted object in the photo. You can just refer to the simple steps below to use your Android smartphone to remove it.


2 Answers

I solved the issue of text with the help of median filter of size 15(square) in an image of 500x700.

Median filter doesn't affect the boundaries of the paper, but can help eliminate the text completely.

Using that I was able to get much more effective boundaries.

like image 170
Akashdeep Saluja Avatar answered Sep 29 '22 08:09

Akashdeep Saluja


Another approach you could try is to use thresholding to find the paper boundaries. This would create a binary image. You can then examine the blobs of white pixels and see if any are large enough to be the paper and have the right dimensions. If it fits the criteria, you can find the min/max points of this blob to represent the paper.

There are several ways to do the thresholding, including iterative, otsu, and adaptive.

Also, for best results you may have to dilate the binary image to close the black lines in the table as shown in your example.

like image 30
brad Avatar answered Sep 29 '22 07:09

brad