Lecture 5 Image Characterization ch. 4 of Machine Vision by Wesley E. Snyder & Hairong Qi Spring2016 18-791(CMUECE):42-735(CMUBME):BioE 2630(Pitt) Dr.JohnGaleotti The content of thes e s lides by John G aleotti, © 2012 - 2016 Carnegie Mellon U nivers ity (CMU ), was made pos s ible in part by N IH N LMcontract# HHSN 276201000580P, and is licens ed under aCreative Commons Attribution-N o nC om me rcial 3.0U nported Licens e. Toview acopy ofthis licens e, vis ithttp:/ / creativecommo ns .or g/ licens es / by- nc/ 3.0/ or s endaletter toCreative Commons , 171 2nd Street, Suite 300, San Francis co, California, 94105, U SA. Permis s ions beyond the s copeof this licens emay be available either from CMU or byemailing itk@ galeotti.net. The mos t recent vers ion of thes e s lides may be acces s edonline via http://itk.galeotti. ne t/ Digital Images §Howaretheyformed? §Howcantheyberepresented? 2 1 Image Representation §Hardware §Storage §Manipulation §Human §Conceptual §Mathematical 3 Iconic Representation §Whatyouthinkofasanimage,… §Camera §X-Ray §CT §MRI §Ultrasound §2D,3D,… §etc 4 2 Iconic Representation §Andwhatyoumightnot Range Image Corresponding Intensity Image Images from CESAR lab at Oak Ridge National Laboratory, Sourced from the USF Range Image Database: http://marathon.csee.usf.edu/range/DataBase.html Acknowledgement thereof requested with redistribution. 5 Functional Representation §AnEquation §Typicallycontinuous §Fittotheimagedata §Sometimes theentireimage §Usuallyjustasmallpieceofit §Examples(QuadraticSurfaces): §Explicit: §Implicit: z = ax 2 + by 2 + cxy + dx + ey + f 0 = ax 2 + by 2 + cz 2 + dxy + exz + fyz + gx + hy + iz + j 6 3 Linear Representation §Unwindtheimage § “Raster-scan”it §Entireimageisnowavector § Nowwecandomatrixoperationson it! § Oftenusedinresearchpapers Probabilistic & Relational Representations § Probability & Graphs § Discussed later (if at all) 7 Spatial Frequency Representation §Think“Fourier Transform” §MultipleDimensions! §Variesgreatlyacross differentimageregions §HighFreq.=Sharpness §StevenLehar ’sdetails: http://sharp.bu.edu/~sle har/fourier/fourier.html 8 4 Image Formation §Samplingananalogsignal §Resolution § #Samplesperdimension,OR § Smallestclearlydiscernablephysicalobject §DynamicRange § #bits/pixel(quantizationaccuracy),OR § Rangeofmeasurableintensities § Physicalmeaningofmin&maxpixelvalues § light, density,etc. 9 Dynamic Range Example (A slice from a Renal Angio CT: 8 bits, 4 bits, 3 bits, 2 bits) 10 5 FYI: Python Code for the Dynamic Range Slide importSimpleITK assitk # aprocessedslicefromhttp://pubimage.hcuge.ch:8080/DATA/CENOVIX.zip img =sitk.ReadImage( “UpperChestSliceRenalAngioCT-Cenovix.tif") out4=sitk.Image(512,512,sitk.sitkUInt8) out3=sitk.Image(512,512,sitk.sitkUInt8) out2=sitk.Image(512,512,sitk.sitkUInt8) y=0 while y<512: x=0 while x<512: #print"img ",x,y,"=",img[x,y] out4[x,y]=(img[x,y]>> 4)<<4 out3[x,y]=(img[x,y]>> 5)<<5 out2[x,y]=(img[x,y]>> 6)<<6 x= x+1 y= y+ 1 11 An Aside: The Correspondence Problem §MyDefinition: § Giventwodifferentimagesofthesame(orsimilar) objects, foranypointinoneimage determinetheexactcorresponding pointintheother image §Similar(identical?)toregistration §Quitepossibly, itisTHEproblemincomputer vision 12 6 Image Formation: Corruption Ideal f(x,y) Camera,CT, MRI,… Measured g(x,y) §Thereisanidealimage § Itiswhatwearephysicallymeasuring §Nomeasuringdeviceisperfect § Measuringintroducesnoise § g(x,y) = D( f(x,y) ), where D is the distortion function §Often,noise isadditiveandindependent ofthe idealimage 13 Image Formation: Corruption §Noiseisusually nottheonlydistortion §Iftheotherdistortions are: § linear& § space-invariant thentheycanalways berepresentedwiththe convolution integral! §Totalcorruption: g ( x, y) = ∫∫ f (α, β ) h ( x − α, y − β ) dα d β + n ( x, y) −∞…∞ 14 7 The image as a surface §Intensity→ height § In2Dcase,but conceptsextendtoND §z = f ( x, y ) §Describesasurface inspace § Becauseonlyone z valueforeachx, y pair § Assumesurfaceiscontinuous (interpolatepixels) 15 Isophote §“Uniformbrightness” §C = f ( x, y ) §Acurve (2D)orsurface(3D)inspace §Alwaysperpendiculartoimagegradient §Why? 16 8 Isophotes & Gradient §Isophotes arelike contourlinesona topography (elevation)map. §Atanypoint,the gradientisalways atarightangleto theisophote! 17 Ridges §Onedefinition: §Localmaximaoftherateofchangeofgradient direction §Sound confusing? §Justthinkofridgelinesalongamountain §Ifyouneedit,look itup § SnyderreferencesMaintz 18 9 Medial Axis §Skeletalrepresentation §Definedforbinaryimages §Thisincludes segmentedimages! §“Ridgesinscale-space” §Detailshavetowait(ch. 9) Image courtesy of TranscenData Europe http://www.fegs.co.uk/motech.html http://sog1.me.qub.ac.uk/Research/medial/medial.php 19 Neighborhoods §Terminology § 4-connected vs.8-connected § Side/Face-connectedvs.vertex-connected § Maximally-connectedvs.minimallyconnected (ND) §Connectivity paradox § Duetodiscretization Is this shape closed? §Candefineotherneighborhoods § Adjacencynot necessarilyrequired ? Is this pixel connected to the outside? 20 10 Curvature §Computecurvatureateverypointina(range) image § (Oron asegmented3Dsurface) §Basedondifferentialgeometry §Formulas areinyourbook §2scalarmeasuresofcurvaturethatareinvariant toviewpoint, derivedfromthe2principal curvatures,(K1 , K2 ): § Meancurvature (arithmeticmean) § Gausscurvature(product) § =0ifeither K1 =0or K2 =0 21 11