ECE 472/572 - Dgtal Image Processng Lecture 6 Geometrc and Radometrc Transformaton 09/27/ Roadmap Introducton Image format vector vs. btmap IP vs. CV vs. CG HLIP vs. LLIP Image acquston Percepton Structure of human ee Brghtness adaptaton and Dscrmnaton Image resoluton Image enhancement Enhancement vs. restoraton Spatal doman methods Pont-based methods Log trans. vs. Power-law Contrast stretchng vs. HE Gra-level vs. Bt plane slcng Image averagng prncple Mask-based methods - spatal flter Smoothng vs. Sharpenng flter Lnear vs. Non-lnear flter Smoothng average vs. Gaussan vs. medan Sharpenng UM vs. st vs. 2nd dervatves Frequenc doman methods Understandng Fourer transform Implementaton n the frequenc doman Low-pass flters vs. hgh-pass flters vs. homomorphc flter Geometrc correcton Affne vs. Perspectve Homogeneous coordnates Inverse vs. forward transform Composte General Model dstorton wth polnomal Least square soluton 2 Questons Affne vs. Perspectve Forward vs. Inverse Composte vs. Sequental Homogeneous coordnate General geometrc s 3
Usage Image correcton Color nterpolaton Forensc analss Entertanment effect http://www.mp-sb.mpg.de/resources/fam/demos.html 4 http://w3.mpa.br/~morph/ Affne s " u " a Preserve lnes and parallel lnes a 2 a 3 " x Homogeneous coordnates v a 2 a 22 a 23 0 0 General form a a2 a3! a2 a22 a23! 0 0!" Specal matrces R: rotaton, S: scalng, T: translaton, H: shear cosθ snθ 0 sx 0 0 0 tx hx 0 R snθ cosθ 0,S 0 s 0,T 0 t,h h 0 0 0 0 0 0 0 0 0 5 6 2
3 7 Composte vs. Sequental Orgnal Image fx, R H T S Transformed Image gu, v u v " S T H R x " R H T S C 8 Forward vs. Inverse transforms u v " C x " Forward transform C u v x Inverse transform 9 Examples - Shear h 0.2 hx 0.2 hx h 0.2
Examples Translaton + Rotaton theta PI/4 theta PI/4 tx -40, t 60 0 Perspectve Preserve parallel lnes onl when the are parallel to the projecton plane. Otherwse, lnes converge to a vanshng pont General form " a a 2 a 3 a 2 a 22 a 23 a 3 0, a 32 0 a 3 a 32 u " a a 2 a 3 x v " a 2 a 22 a 23,u u " w ",v v " w " w " a 3 a 32 Determne the coeffcents u " a a 2 a 3 x v " a 2 a 22 a 23,u u " w ",v v " w " w " a 3 a 32 8 unknowns, 4-pont least squares 0,0 0,255 0,0 0,255 255,0 255,255 255,0 5,5 2 4
Example - PT 3 General approaches Fnd teponts Spatal 4 Example CCD buttng msalgnment greater than 50 mcron x-ra senstve scntllator fber optcs CCD arra 242 x 52 9/27/ 5 5
Sources of dstortons defects n the producton of fber-optc tapers mperfect compresson and cuttng dfferent lght transfer effcenc across the whole surface 9/27/ 6 Geometrc correcton map close approxmaton P u, v x, control pont nterpolaton T u, v x, x, u, v map exactl 9/27/ 7 Spatal Blnear equaton x ˆ r u,v a u + a 2 v + a 3 uv + a 4 ˆ s u,v b u + b 2 v + b 3 uv + b 4 n-th degree polnomal " x ˆ " ˆ P xu,v d " a krs u r s v P u,v b krs u r s k 0 r+s k v Use nformaton from teponts to solve coeffcents Exact soluton Least square soluton ε mn m 2 2 a, b [ x xˆ + ˆ ] 0 8 6
How s t appled? Step : Choose a set of te ponts x, : coordnates of te ponts n the orgnal or dstorted mage u,v : coordnates of te ponts n the corrected mage Step 2: Decde on whch degree of polnomal to use to model the nverse of the dstorton, e.g., x ˆ r u,v a u + a 2 v + a 3 uv + a 4 ˆ s u,v b u + b 2 v + b 3 uv + b 4 Step 3: Solve the coeffcents of the polnomal usng least-squares approach Step 4: Use the derved polnomal model to correct the entre orgnal mage X [ x 0 x x 24 ] T Y [ 0 24 ] T " u 0 v 0 u 0 v 0 u W v u v u 24 v 24 u 24 v 24 A W X,B W Y W W T W W T A [ a a 2 a 3 a 4 ] T B [ b b 2 b 3 b 4 ] T For each u,v n the corrected mage, fnd the correspondng x, n the orgnal mage and use ts ntenst as the ntenst at u,v. 9 Example Geometrc correcton Geometrc correcton of mages from butted CCD arras 20 Example - Color correcton Teponts are colors R, G, B, nstead of spatal coordnates 2 7
Example - Image warpng 22 Image warpng Two-pass mesh warpng b Douglas Smthe Reference: G. Wolberg, Dgtal Image Warpng, 990 23 Example From Joe Howell and Cor McKa, ECE472, Fall 2000 24 8
Example 2 From Adam Mller, Truman Bonds, Randal Waldrop, ECE472, Fall 2000 25 9