Computer Graphics
Chapter Seven
Color Image Processing
TheuseofcolorImageProcessingismotivated
bytwoprincipalfactors:
Colorisapowerfuldescriptor
Humanscandistinguishbetweenthousandsofcolor
shadesandintensitiescomparedtoaboutonlytwo
dozenshadesofgray
Color Image Processing
Full Color Processing vs Pseudo-Color Processing
InFullColorProcessingtheimageinquestiontypically
areacquiredwithaFull-Colorsensore.g.ColorTV
cameraorColorScanner
InPseudo-colorProcessingtheproblemisofassigninga
colortoaparticularmonochromeintensityorarangeof
intensities
Color Fundamentals
Thecolorsthathumans andsome
animalsperceiveinanobjectare
determinedbythenatureoflight
reflectedfromtheobject
Achromatic vs Chromatic Light
Achromatic(voidofcolor)Light:Itsonly
contributeisits‘Intensity’oramount
ChromaticLight:spanstheelectromagnetic
spectrumfromapproximately400to700nm
Quantities for description of quantity of Chromatic
Source of Light
Threebasicquantitiesareusedtodescribethequantityofa
chromaticsourceoflight:
Radiance
Luminance
Brightness
Human Perception
Detailedexperimentalevidenceshasestablishedthatthe6
to7millionconesinthehumaneyecanbedividedinto
threeprincipalsensingcategories,correspondingroughlyto
red,greenandblue
Approximately65%ofallconesaresensitivetoRedLight,
33%aresensitivetoGreenLightandabout2%are
sensitivetoBlueLight(mostsensitive)
Human Perception
DuetotheseabsorptioncharacteristicofHumanEye
colorsareseenasvariablecombinationsoftheso-called
‘PrimaryColors’Red,GreenandBlue
Theprimarycolorscanbeaddedtoproducesecondary
colorsofLight
Magenta(Red+Blue)
Cyan(Green+Blue)
Yellow(Red+Green)
Absorption of Light by red, green and blue
cones in Human Eye
Mixingthethreeprimariesorasecondarywithitsopposite
primarycolorsintherightintensitiesproduceswhitelight
Primary Color of Light vs Primary Color of Pigments
Red,GreenandBlueColorsarePrimaryColorsofLight
InPrimaryColorofPigmentsaprimarycolorisdefinedas
theonethatsubtractsorabsorbsaprimarycolorofLight
andreflectsortransmitstheothertwo
ThereforethePrimaryColorsofPigmentsareMagenta,
CyanandYellowandsecondarycolorsareRed,Greenand
Blue
Apropercombinationofthreepigmentprimariesora
secondarywithitsoppositeprimaryproducesBlack
ColorTelevisionReceptionisanexampleoftheadditive
natureofLightColors
RGB Color Cube
Thetotalnumberofcolorsina24Bitimageis
(2
8
)
3
=16,777,216(>16million)
Generating RGB image
CMY and CMYK Color Model
Cyan,magenta,andyellowarethesecondarycolorswithrespecttothe
primarycolorsofred,green,andblue.However,inthissubtractivemodel,
theyaretheprimarycolorsandred,green,andblue,arethesecondaries.
Inthismodel,colorsareformedbysubtraction,whereaddingdifferent
pigmentscausesvariouscolorsnottobereflectedandthusnottobeseen.
Here,whiteistheabsenceofcolors,andblackisthesumofallofthem.
Thisisgenerallythemodelusedforprinting.
Mostdevicesthatdepositcolorpigmentsonpaper(suchasColorPrinters
andCopiers)requiresCMYdatainputorperformRGBtoCMYconversion
internally
C
M
Y
R
G
B
=
1.00
1.00
1.00
-
CMY and CMYK Color Model
CMYisaSubtractiveColorModel
EqualamountsofPigmentprimaries(Cyan,Magentaand
Yellow)shouldproduceBlack
Inpracticecombiningthesecolorsforprintingproduces
a“Muddy-Black”color
Soinordertoproduce“True-Black”afourthcolor
“Black”isaddedgivingrisetoCMYKmodel
CMY Color Model
CMY Color Model
HSI Color Model
Hue(dominantcolourseen)
Wavelengthofthepurecolourobservedinthesignal.
Distinguishesred,yellow,green,etc.
Morethe400huescanbeseenbythehumaneye.
Saturation(degreeofdilution)
Inverseofthequantityof“white”presentinthesignal.A
purecolourhas100%saturation,thewhiteandgrey
have0%saturation.
Distinguishesredfrompink,marinebluefromroyalblue,
etc.
About20saturationlevelsarevisibleperhue.
Intensity
Distinguishesthegraylevels.
HSI Color Model
SeparatesoutintensityIfromthecoding
Twovalues(Hue&Saturation)encodechromaticity
Intensityencodemonochromepart.
Hueandsaturationofcolorsrespondcloselytotheway
humansperceivecolor,andthusthismodelissuitedfor
interactivemanipulationofcolorimages.
Properties of HSI (HSV)
HueHisdefinedbyanangle
SaturationSmodelsthepurityofthecolor
I=(R+G+B)/3
Conversion from RGB to HSI
GivenanimageinRGBcolorformat,theHcomponentofeach
RGBpixelisobtainedusingtheequation:
Basics of Full Color Image Processing
•Full color image processing fall into 2 categories.
•In1
st
categoryweprocesseachcomponentimage
individuallyandthenformacompositeprocessedcolor
imagefromtheindividuallyprocessedcomponent.
•In2
nd
categoryweworkwithcolorpixelsdirectly.
Becausefullcolorimageshaveatleastthree
components,colorpixelsarereallyvectors.
•LetcrepresentanarbitraryvectorinRGBcolorspace:
Basics of Full Color Image Processing
•Colorcomponentsarethefunctionofco-ordinates(x,y)so
wecanwriteitas:
•ForanimageofsizeMxNthereareMNsuchvectors,
c(x,y),forx=0,1,2,…,M-1;y=0,1,2,…,N-1
Color Transformations
• Si=Ti(r1,r2,…,rn)i=1,2,3,….n
riandSiarevariablesdenotingthecolorcomponentsoff(x,y)and
g(x,y)atanypoint(x,y).
nisthenoofcolorcomponents
{T1,T2,…..,Tn}isasetoftransformationorcolormappingfunctions.
• Note that n transformations combine to produce a single
transformation T
Color Transformations
•Thecolorspacechosendeterminethevalueofn.
•IfRGBcolorspaceisselectedthenn=3&r1,r2,r3denotesthered,
blueandgreencomponentsoftheimage.
•IfCMYKcolorspaceisselectedthenn=4&r1,r2,r3,r4denotesthe
cyan,hue,magentaandblackcomponentsoftheimage.
•Supposewewanttomodifytheintensityofthegivenimage
usingg(x,y)=k*f(x,y)where0<k<1
Color Complements
•ThehuesoppositetooneanotherontheColorCirclearecalled
Complements.
•ColorComplementtransformationisequivalenttoimagenegative
inGrayscaleimages
Color Complements
Color Slicing
•Highlightingaspecificrangeofcolorsinanimageisusefulfor
separatingobjectsfromtheirsurroundings.
•Displaythecolorsofinterestsothattheyaredistinguishedfrom
background.
•Onewaytosliceacolorimageistomapthecoloroutsidesome
rangeofinteresttoanonprominentneutralcolor.
Histogram Processing
•Colorimagesarecomposed
ofmultiplecomponents,
howeveritisnotsuitableto
process each plane
independentlyincaseof
histogramequalization.This
resultsinerroneouscolor.
•Amorelogicalapproachis
to spread the color
intensitiesuniformly,leaving
thecolorsthemselves(hue,
saturation)unchanged.
•HSIapproachisideally
suitedtothistypeof
approach.
Color Image Smoothing
•Colorimagescanbesmoothedinthesamewayasgrayscale
images,thedifferenceisthatinsteadofscalargraylevelvalueswe
mustdealwithcomponentvectorsofthefollowingform:
•TheaverageoftheRGBcomponentvectorinthisneighborhood
is:
Color Image Smoothing
•Werecognizethecomponentsofthisvectorasthescalar
imagesthatwouldbeobtainedbyindependentlysmoothing
eachplaneofthestartingRGBimageusingconventionalgray
scaleneighborhoodprocessing.
•Thusweconcludethatsmoothingbyneighborhoodaveraging
canbecarriedoutonapercolorplanebasis.
Color Image Smoothing
Color Image Smoothing
Color Image Sharpening
Noise in Color Images
•Noiseincolorimagescanberemovedthroughvariousnoise
modelswhichweuseinImageRestorationincasethenoise
contentofacolorimagehasthesamecharacteristicsineach
colorchannel.
•Butitispossibleforcolorchannelstobeaffecteddifferentlyby
noisesointhiscasenoiseareremovedfromtheimageby
independentlyprocessingeachplane
•Removenoisebyapplyingsmoothingfilters(e.ggaussian,
average,median)toeachplaneindividuallyandthencombine
theresult.
Discussion points
1.what are the different color model
and their application in computer
graphics?
2.Describe the common practices that
colors can be used in computer
graphics?
3.Explain noise in image processing
and how it can be eliminated?