2

I have a scanned image of a document which has multiple boxes which may or may not contain signatures. I am able to identify the boxes, but now I want to figure out which boxes contain signatures. I tried to compare the image with the reference blank box image. Ideally pixel match should do,but my images can be tilted by some angle, which makes it tough. I am programming in .NET.

Any suggestions?

Edited on Jan 04: I have asked this question on Nov 25. At that time, the solution proposed was to check count the number of black pixels in the image. That worked for me. However, the performance of the application is bad now. Because, it has to check black pixels on 20 rectangles of 100*1000 size.

Is there any better to solution to determine if a image is blank?

ave
  • 287
  • 13
  • 27
Boolean
  • 14,266
  • 30
  • 88
  • 129
  • Can you use Sampling? Or reduce the resolution of the image first before comparing? – Ian Apr 13 '10 at 08:00

3 Answers3

5

Perhaps you could sum the number of pixels matching the 'blank' colour, and then sum the number of pixels not matching the blank colour. If the number of non-blank pixels is over a certain level, then assume that there is a signature? Logically, an empty box will contain almost entirely blank pixels, and a box with a signature in it will contain a lot less blank pixels.

Edit: One extra point - you will want to have a degree of tolerance for what is a 'blank' pixel colour, otherwise a bit of dust or gradient that arose while scanning will cause a non-blank pixel.

Alistair Evans
  • 36,057
  • 7
  • 42
  • 54
  • You can try this approach using a sum for each one of at least 16 gradients of gray between white and black. This is going to give you a somehow gradient signature as Kazar explains. – backslash17 Nov 25 '09 at 16:27
  • Could you not simply maintain a blank and notblank counter, and then for each pixel, allow an RGB value of +/- (some magic number) away from a fixed 'blank' color? If it inside those limits, increment the blank counter, else, increment the notblank counter. – Alistair Evans Nov 25 '09 at 16:36
  • I actually counted the number of pixels and I am able to distinguish between blank and filled boxes. Thanks for the simple answer. – Boolean Nov 27 '09 at 04:25
0

You should try to normalise the rotation of the images first. One way to do this is to place markers on the page which can be lined up (a black square in each corner of the page is what I have seen used before) to ensure that the page's rotation is correct before you try to identify the signatures.

Rich
  • 15,602
  • 15
  • 79
  • 126
  • Actually I am using EMGU CV to identify the rectangles in the image and EMGU CV is returning slightly tilted rectangles. How can I normalize these images. – Boolean Nov 25 '09 at 16:03
-1

Maybe the quickest way is to perform an MD5 Hash on the byte stream of the image and compare the results? Look here for further info on this.

Hope this helps, Best regards, Tom.

t0mm13b
  • 34,087
  • 8
  • 78
  • 110
  • 1
    Isn't MD5 hash going to vary greatly for even small changes. I think it will work for identical images but not for variations. – Boolean Nov 25 '09 at 16:01
  • If one bit is off in the image the md5 hash will be completely different. – Michael G Nov 25 '09 at 16:01
  • Yes, that will be the major problem with this approach. It's not a very good or usable idea :-) – Joey Nov 25 '09 at 16:02