Read patterns from paper?

Hi everyone!

Im am curious to see if it's possible to use an arduino board together with some kind of reader to detect patterns on the back of folded paper.
If you look at the attached image you can see several black blocks aligned in a diagonal shape. Thats the shape I want to detect as an OK pattern, but if these blocks aren't aligned in a diagonal shape, thats bad.
So I was thinking if the technology behind a barcode scanner would work. Either the Laser-scanner type or Linear CCD type.
The folded paper (see picture) will be moving in the direction of the arrow and the red lines that I have painted would simulate the "scanner".
Could either the Laser or the LCCD turn these blocks into this?
0001000000
0000100000
0000010000
0000001000
0000000100
0000000010
0000000001

How would you do it?

Or will it be a hard struggle against the grey shadow-areas?

Best Regards
Niclas

bild.jpg

It will be on the edge of an Arduino UNO capabilities, but possible.

To solve such problem, you need to have several scan lines in memory in 8 bit greyscale ( 1 byte per pixel) . and search for maxima / minima in that array.

you need to have (I think) at least 5 scan lines (more is better) of 50 pixels ==> 250 bytes.
you need so much to detect the contours of the black area (left right top bottom), and to be able to discriminate it from noise single black pixels. After you made these 5 scan lines you can generate the "0001000000" and then reuse the scan lines arrays. I would think of using a laser pointer which reflects on white and not on black.

Furthermore by applying threshold you can apply run length encoding on after every single scan line reducing the needed memory.

What kind of performance do you have in mind?