<<

Whatisfor?

1 2 3 4 5 6 7 8 9 Color

• Physics – isEMradiationofdifferentfrequencies. – Superpositionprinciple • Perception – 3cones>3Dcolorspace.(Metamers). – Convexsubsetof3Dlinearspace. • ColorSpaces – RGB– standardrepresentation,Monitors,OpenGL – HSV– Moreintuitive • MorePerception – Constancy • Refs:H&BChapter12;“TheFoundationsofColorMeasurement andColorPerception”,byBrianWandell:

10 Newton’sdrawing:

(Wandell)

(Varshney)

11 Colorisafunction

(Angelopoulou)

12 Superposition

• Lightislinear. • LightfromsourceA+lightfromsource B=LightfromsourcesA&B. – Anycolorisacombinationofpure. • Doublingintensityofsourcedoubles amountoflightreachingus.

HumanColorPerception

•Cones allowcolor perception. •3typesofcones sensitivetodifferent frequencies •Perceptualcolor dependsonhow theseare stimulated.

13 Metamers

(Wandell)

Perceptualcolorspace

• 3D • Convexsubspace – Conesdon’thavenegativeresponse • Ingeneral,anythreecolorsprojected ontothisspacespanit. – Butnotwithnonnegativecoefficients. – Sonotallcolorscanbeproducedby (positive)combinationsofRGB

14 Grassman’s Additivity Law

• Colormatchingfollowssuperposition • Ifweknowhowtoproduceallpure colors,wecanproduceanycolor.

AdditiveColorModelRGB

• Mix,,primariestogetcolors • CartesianCoordinateSystemwithoriginas. • Usedindisplaydevices:CRTs,LCDs.

Green (0,1,0) (1,1,0) (1,1,1) (0,1,1)

Black Red (0,0,0) (1,0,0) Blue (0,0,1) (1,0,1)

15 ColorVocabulary • :Distinguishesamongcolors – red,yellow,blue • Saturation:Color Purity (differencefromwhite) – blueandskyblue • Value:overallintensityoflight. • :Perceivedintensityofreflectedlight – blueanddarkershadesofblue • Brightness:Perceivedintensityofselfluminous objects • Artists: – Tint:Addwhite(decreasesaturation) – Shade:Addblack(decreaselightness)

http://neuro.physik.unimarburg.de/~wachtler/cc.html

16 Ourcolorvisionisbasedonsignalsofthethreephotoreceptor typeswhichrespondtolightofthreedifferentwavelength regions.Butifwelookatanobject,itscolorthatweperceive is notonlydeterminedbythespectralcompositionofthelight comingfromtheobject.Objectcolorsdependonthecontextin whichtheobjectisseen. Lookattheimagebelow.Ontheleftaresixcolorfieldsona field,representingsixobjectsonabackground.Ontheright, esentially thesamearrrangement isshown,butallcolorshavea slightlybluishtint.Itisasifweseethesamesceneundera bluishillumination.Incidentally,thespectralcompositionofthe lightcomingfromthethreefieldsin the upper row on the right side are exactly the same asthoseof the lower row on the left side .Furthermore,thecolorsontherightthatmatchmost closelythoseontheleftaretheonesinthecorresponding positionsofthescenes,notthosewiththesamephysical spectrum:

ColorConstancy

• AredobjectwillproduceawidevarietyofRGB values,dependingonthelight. • Separatecolorofmaterialsfromcoloroflight. – Possibleifweassumesomedistributionofcolorsinthe scene. • Interestingalgorithmsexist – Mostlyforsomewhatcontrolled/idealizedconditions – Usefulinapplications,butnotsomuchinnaturalimages – Thismakesithardtousecolorinrecognition. – Segmentationcanbeokaslongasislocally constant.

17 ColorQuantization

Compressionbyusingasmallsetof colors. • Representeachcolorwithoneofthese. • Soweneedtopickasmallnumberof colorssothatallthecolorsintheimage are“close” totheminsomeway. • Costfunctionofkmeansisnatural. – Spatialpositionisirrelevant.

FullColor 64 16

8 4

18 Kmeansclustering

• Bruteforcedifficultbecausemanyspheres, manypixels. • Assumeallspheressameradius;justneed spherecenters. • Iterativemethod. – Ifweknewcenters,itwouldbeeasytoassign pixelstoclusters. – Ifweknewwhichpixelsineachcluster,itwould beeasytofindcenters. – Soguesscenters,assignpixelstoclusters,pick centersforclusters,assignpixelstoclusters,.

Whyisthisbetter?

• Withagreedyalgorithm,oncewemake adecisionwecannotundoit. • Withaniterativealgorithm,wecan makechanges.

19 KmeansAlgorithm

1. Initialize– Pickkrandomclustercenters – Pickcenters near data.Heuristics:uniform distributioninrangeofdata;randomlyselect datapoints. 2. Assigneachpointtonearestcenter. 3. Makeeachcenteraverageofptsassigned toit. 4. Gotostep2.

Let’sconsiderasimpleexample.Supposewe wanttoclusterblackandwhiteintensities,andwe havetheintensities:13811.Supposewestart withcentersc1=7andc2=10.Weassign1,3,8 toc1,11toc2.Thenweupdatec1=(1+3+8)/3= 4,c2=11.Thenweassign1,3toc1and8and11 toc2.Thenweupdatec1=2,c2=9½.Thenthe algorithmhasconverged.Noassignments change,sothecentersdon’tchange.

20 KmeansProperties

• Wecanthinkofthisastryingtofindtheoptimal solutionto: – Givenpointsp1 pn,findcentersc1ck – andfindmappingf:{p1pn}>{c1ck} – thatminimizesC=(p1f(p1))^2++(pnf(pn))^2. • EverystepreducesC. – Themeanistheptthatminimizessumofsquareddistance toasetofpoints.Sochangingthecentertobethemean reducesthisdistance. – Whenwereassignapointtoaclosercenter,wereduceits distancetoitsclustercenter. • Convergence:sincethereareonlyafinitesetof possibleassignments.

LocalMinima

• However,algorithmmightnotfindthebest possibleassignmentsandcenters. • Considerpoints0,20,32. – Kmeanscanconvergetocentersat10,32. – Ortocentersat0,26. • Heuristicsolutions – Startwithmanyrandomstartingpointsandpick thebestsolution.

21 HistogramTesselation

• Wecanthinkofclusteringasanother waytodivideahistogramintobins. • Eachclusterisabin. • Binsareadaptedtothedata – Thewidthofbinsisassmallaspossible.

EM

• LikeKmeanswith 2 − pi −c j softassignment. e σ 2 – Assignpointpartlyto f ( p ) = 2 allclustersbasedon j i − pi −c j σ 2 probabilityitbelongs ∑ e toeach. j – Computeweighted Clustercentersarecj. averages(cj)and variance (σ).

22 AlsoUsefulforImage Segmentations

Twoclustersincolorspace.

23