Ask Your Question

zoosy's profile - activity

2020-08-25 14:04:39 -0600 received badge  Notable Question (source)
2019-04-29 17:36:09 -0600 received badge  Popular Question (source)
2015-10-15 00:53:04 -0600 commented answer How to find biggest white zone in an scanned image

Hi Sturkmen,

I've installed openCV in CentOS... I've managed to modify the script in order to give more arguments from command line and also to save the image using imwrite. The scale down to speed the process it's perfect, because with scale=1 it takes a very very long time.

I have to play to this line of code:

if( contours.size()== 1 & contours[0].size() < 5 )

because it's happening what I wrote above: the contour stops if few pixels (from pharanteses or commas) are in their way. If I use more, let's say 8, then the contour continues giving me a bigger white zone. Then, I can take the coordinates and compute the final 4 coordinates. The 2 corrections doesn't help in this case.

I'll be back with the final script that gives me what I need...

Your help is much appreciated!

Zoosy

2015-10-14 12:12:10 -0600 commented answer How to find biggest white zone in an scanned image

I'll play with it right now and will try to understand the logic.

Thank you again and I'll let you know the results.

Best regards, Zoosy

2015-10-14 11:15:57 -0600 answered a question How to find biggest white zone in an scanned image

OK, I've been playing with sturkmen's script with around 10 images (invoices) and here are 2 examples of something that stops the script from getting the right area. If the contour has some long characters (parentheses or even commas) the script doesn't go forward. In other words, the findContours function is very strict.

Now, the question is: Can I ignore 5-10 pixels around the text to get the right contours? I've looked in the opencv manual, but didn't find anything like that at findContours function.

Thank you all again for your time!

First original image:

original1

Script result:

result1

Second original image:

original2

Script result:

result2

2015-10-13 08:37:30 -0600 received badge  Student (source)
2015-10-13 00:55:01 -0600 commented answer How to find biggest white zone in an scanned image

Hi sturkmen,

Thank you for your reply... I'll give it a try today and I'll get back to let you all know the result. I'll make some tests on multiple layouts.

I'll be back :)

Zoosy

2015-10-13 00:52:32 -0600 commented question How to find biggest white zone in an scanned image

Hi Balaji, I've uploaded the original image in the problem body

Hi theodore, the pattern is not the same... the invoices are from multiple vendors of my client. That's why I need to find a suitable zone to put my barcode.

Thank you all for your involvement!

2015-10-13 00:49:38 -0600 received badge  Editor (source)
2015-10-12 11:50:56 -0600 commented question How to find biggest white zone in an scanned image

My problem is to find an area suitable to put the barcode... so, in other words, the barcode is applied after I find the suitable area.

2015-10-12 10:55:38 -0600 asked a question How to find biggest white zone in an scanned image

Hi all,

I have a project and I'm stuck... can you please help me to move on?

I'm scanning some documents for a client and I have to apply a software barcode on the first page of the documents, but without covering information ... so I have to find the biggest white zone on the image.

If it's important, I'm scanning in B&W (binary).

I'll upload an example to understand what I mean. The red zone seems to be the biggest white zone in this image and I want to put the barcode in the middle. What I need is to find the coordinates of the white zone. The original image is down below.

example

Original image:

original