Project by Arie Kozak
ο¨ Given photograph with sheet of paper with text only, infer shape of the surface and plot it in 3d. ο¨ Single (infinite) light source from above, using reflectance map (paper is nearly Lambertian 1 surface): π π, π = π 2 +π 2 +1 ο¨ The surface is assumed to be constant in one direction.
ο¨ Mark it using personal biological visual system.
ο¨ Divide the image into two connected sub- images divided by red border.
ο¨ Use thresholding twice: after high pass and original image. Text found in the intersection.
ο¨ Constant albido assumption for ink, doesnβt work, use (cubic) interpolation. ο¨ Smooth image with Gaussian kernel before to reduce βsharpening effectβ (lateral inhibition), and also after.
ο¨ Maximum intensity point in image => p = q = 0. Use parabolic approximation according to B.K.P. Horn's chapter 11: πΌ π¦, π§ = πΌ 0 + 0.5(ππ¦ 2 + ππ¦π§ + ππ§ 2 ) π = ππΌ ππ¦ = ππ¦ + ππ§, π = ππΌ ππ§ = ππ§ + ππ¦ 1 2π½(π¦, π§) 2 = 0.5 π 2 + π 2 + 1 πΉ π¦, π§ = = 0.5 π 2 + π 2 π¦ 2 + π + π ππ¦π§ + 0.5 π 2 + π 2 π§ 2 + 1
πΉ π¦π¦ = π 2 + π 2 πΉ π§π§ = π 2 + π 2 πΉ π¦π§ = π + π π ο¨ Solution 2 β 2πΉ π§π§ πΉ π¦π¦ + πΉ π¦π¦ 2 + 4πΉ π¦π§ π 4 πΉ π§π§ 2 2 β 2πΉ π¦π§ 4 = 0 + π 2 β2πΉ π§π§ πΉ π¦π§ 2 πΉ π¦π¦ + πΉ π¦π§ ο¨ Only solutions with a<0,c<0 are relevant.
ο¨ Identify βclustersβ β areas of local maxima/minima. All points within certain % of highest intensity values.
ο¨ Start with H = 0, perform for each cluster separately.
ο¨ Find closest clusters A and B; B with known height. ο¨ For points in A close to B, calculate expected height according to B. ο¨ Find closest points using Voronoi diagram.
ο¨ Find relative height between A and B. If π π , π π is current and expected height of point i accordingly, find relative height x, such that error will be minimal: π π π¦ = (π π + π¦ β π π ) 2 β πππ π π π¦ = 1 π (π π β π π ) π
ο¨ Find direction v, in which H is constant => derivative is 0. βπ: π π β π€ = 0, π π = (π π , π π ) ο¨ Find least square line, its directions is perpendicular to v.
ο¨ If v is new x-axis, calculate projection of all points to YZ plane.
ο¨ Use polyline approximation. Given number of desired points = number of clusters + 2, the desired error can be approximated using binary search. ο¨ Example β 5 points:
ο¨ Finally, use spline, on polyline edge points.
ο¨ Not perfect, usually works sufficiently.
ο¨ Detect sheet of paper automatically. ο¨ Relax assumptions (light direction, H is constant in one direction). ο¨ Improve clusters search. ο¨ Replace/improve polyline approximation. ο¨ Use this for text recognition.
Recommend
More recommend