12.07.2015 Views

A new method for perspective correction of document images

A new method for perspective correction of document images

A new method for perspective correction of document images

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

if y belongs to the three-dimensional representation <strong>of</strong> the <strong>document</strong>, due to the geometrical properties <strong>of</strong> theproblem and those <strong>of</strong> the translation and rotation matrices defined above, it is straight<strong>for</strong>ward to see thatG · (y,1) T = (x 1 ,x 2 ,0,1) T . (6)This last equation, jointly with (2), establish a relationship between any point z on the captured image and thecorresponding point on the original <strong>document</strong> plane x. Nevertheless, due to the particular structure <strong>of</strong> matrixG, we show next that the computational cost <strong>of</strong> the inverse trans<strong>for</strong>mation can be reduced. In order to do so,we define(E G −1 RZ (−γ) R= D y 0 ·Y (−β) R X (−α) 00 T 1where G is non-singular, as |G| = 1. Taking into account that the third component <strong>of</strong> the rightmost term <strong>of</strong> (6)is null, one can write ⎛ ⎞ ⎛⎞ ⎛ ⎞z 1 e 11 e 12 e 14 x 1λ ⎝ z 2⎠ = ⎝ e 21 e 22 e 24⎠ ⎝ x 2⎠ ,z 3 e 31 e 32 e 34 1so defining⎛E R ⎝⎞e 11 e 12 e 14e 21 e 22 e 24⎠ ,e 31 e 32 e 34the original plane coordinates <strong>of</strong> an arbitrary <strong>document</strong> point will verify(x 1 ,x 2 ,1) T = λE −1R (z 1,z 2 ,z 3 ) T , (7)as long as E R is non-singular. For studying the invertibility <strong>of</strong> E R , its determinant is calculated, yieldingη |E R | = ( z 0 1 sin(γ) − z 0 2 cos (γ) ) sin (α) + [ z 0 3 cos (β) + ( z 0 1 cos (γ) + z 0 2 sin (γ) ) sin (β) ] cos (α) .Hence, definings i R X (α)R Y (β)R Z (γ)y i , (8)<strong>for</strong> i = 0, · · · ,3, it is easy to see that η = s 0 3, so E R will be non-singular if and only if the non-translated butrotated version <strong>of</strong> y 0 has a non-null third component. In order to see in which scenarios this condition is verified,we will take into account that x i = s i − R X (α) R Y (β) R Z (γ)y 0 , where i = 0, · · · ,3, so it is easy to concludethat both versions <strong>of</strong> the corners <strong>of</strong> the <strong>document</strong> (x i and s i ), will hold the same geometrical relationshipsbetween them. Specifically, the s i ’s are the vertices <strong>of</strong> a shifted version <strong>of</strong> the recovered <strong>document</strong>, so theydefine a plane. Furthermore, since α, β and γ were chosen to produce x i ’s verifiying x i 3 = 0, we have thatη = s 0 3 = s 1 3 = s 2 3 = s 3 3. There<strong>for</strong>e, given that the rotations defined by (8) do not modify the geometricalstructure <strong>of</strong> the problem described by the y coordinates system, the above equation implies that E R will benon-invertible just when the camera center and the four corners <strong>of</strong> the three-dimensional representation <strong>of</strong> the<strong>document</strong> y i are coplanar, i.e. when one takes the picture <strong>of</strong> the <strong>document</strong> sideways.Assuming that the degenerate case explained above is not verified, so η ≠ 0, and taking into account thatz 3 = f, (7) yields( ) [(x1 (E−1= λR ) 11 (E −1R ) ) ( ) (12 z1 (E−1x 2 (E −1R ) 21 (E −1R ) + fR ) )]1322 z 2 (E −1R ) ,23with (E −1R ) ij the (i,j) element <strong>of</strong> E −1R, so a simple relationship between z and x is obtained. The requiredelements <strong>of</strong> (E R ) −1 can be computed using the following <strong>for</strong>mulas(E −1R ) 11 = 1 [z0η 3 cos (α) cos (γ) + ( z3 0 sin (β) sin(γ) − z2 0 cos (β) ) sin (α) ] ,(E −1R ) 12 = 1 [z0η 1 cos (β) sin (α) − z3 0 cos (γ) sin (α) sin(β) + z3 0 cos (α) sin (γ) ] ,(E −1R ) 13 = 1 [(z0η 2 cos (γ) − z1 0 sin(γ) ) sin(α) sin (β) − ( z1 0 cos (γ) + z2 0 sin(γ) ) cos (α) ] ,),

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!