Ask Your Question
0

Detect Contours

asked 2018-08-20 06:54:17 -0600

Jack Daniels gravatar image

updated 2018-08-20 06:58:09 -0600

I am working on a text detection problem from image. The primary task is to identify blocks of text and then use the ones needed. The first step itself is a big mess, because the image are not standard size. Anyways, I have tried a lot of algorithms (Canny Edge Detection, Robert Cross) coupled with Laplacian as well as Gaussian Blur but they are not yielding efficient results. I am attaching some images. I need nutrition and ingredients.

Image 1 : https://ibb.co/bW0Nxe Image 2 : https://ibb.co/cwT9ce

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-08-20 08:54:27 -0600

You do not need edge and contours detectors, but algorithms designed for finding text in scenes. Do not reinvent the wheel and have a look at the text detection algorithms that are plug and play:

And there are tons of other approaches out there. Personally I have been using the stroke width transform approach quite successfully.

edit flag offensive delete link more

Comments

The problem is I don't need the complete text. If you see the image, I only need specific text blocks. I have used EAST in other approach where I was clustering text first. Here, I want contours first and then use EAST on them.

Jack Daniels gravatar imageJack Daniels ( 2018-08-20 12:26:38 -0600 )edit

I only need specific text blocks --> knowing the process inside those algorithms, to me it seems better to detect all text first, then remove blocks you do not need afterwards. That goes faster than cutting up the process beforehand. At least thats my experience for the stroke width transform.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-21 02:54:58 -0600 )edit

Thanks for the help. But I would still like to try this approach. I had a different pipeline with EAST before where I was clustering the text, but I want to try this approach as well. I need to get that text block (contour in this approach), and then want to do the elimination. Can you help me with that?

Jack Daniels gravatar imageJack Daniels ( 2018-08-21 03:22:53 -0600 )edit

Can you somehow define a mask of regions you are interested in?

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-21 03:33:15 -0600 )edit

That's the problem. I'm not sure of the region because the images are not standard. I don't know where the area (area of interest) will be for any random image.

Jack Daniels gravatar imageJack Daniels ( 2018-08-21 03:38:08 -0600 )edit

Okay but there is a contradiction, if you do not know beforehand where to look, than you cannot limit the text retrieval in any way ...

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-21 03:49:55 -0600 )edit

I can still remove noise based on the contour area or the dimensions of contour. But first I want to make sure I am detecting majority text block.

Jack Daniels gravatar imageJack Daniels ( 2018-08-21 03:52:57 -0600 )edit

Then why not go for SWT, than in the returning binary map, apply opening, so you get white blocks. Find contours and retrieve the largest one. That will be your region of interest right?

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-21 04:21:39 -0600 )edit
1

I will give it a try and get back to you. Thanks for the suggestion.

Jack Daniels gravatar imageJack Daniels ( 2018-08-21 04:37:31 -0600 )edit

The output is very similar to east, and selecting contours is not easy in this case. I want to select contours first then look for text in them, that also helps in results where I don't have to look for bounding boxes line wise and can print the results block wise. Most of the nutrition facts are getting detected by my current approach, it's the free text that's hard to comprehend.

Jack Daniels gravatar imageJack Daniels ( 2018-08-21 06:37:43 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-20 06:54:17 -0600

Seen: 1,234 times

Last updated: Aug 20 '18