color image processing - university of california, irvinemajumder/dip/classes/color.pdf · color...
TRANSCRIPT
![Page 1: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/1.jpg)
Color Image Color Image ProcessingProcessing
![Page 2: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/2.jpg)
What is color?What is color?
• Selective emission/reflectance of different wavelengths
![Page 3: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/3.jpg)
What is color?What is color?
Illumination Reflectance
![Page 4: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/4.jpg)
What is color stimuli?What is color stimuli?
Illumination Reflectance
X
![Page 5: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/5.jpg)
What is perceived color?What is perceived color?
• The response generated by a stimulus in the cones gives the perceived color
• Three responses
X
Response of three human cones
![Page 6: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/6.jpg)
Computations on ColorComputations on Color
• Very difficult using spectrums• Can we have some sort of coordinate
space to define color?
![Page 7: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/7.jpg)
TristimulusTristimulus ValuesValues
• Integration over wavelength
XX = = ∫∫C(C(λλ)x()x(λλ) = ) = ∑∑ C(C(λλ)x()x(λλ))λ=400
λ=700
λ
YY = = ∫∫C(C(λλ)y()y(λλ) = ) = ∑∑ C(C(λλ)y()y(λλ))λ=400
λ=700
λ
ZZ = = ∫∫C(C(λλ)z()z(λλ) = ) = ∑∑ C(C(λλ)z()z(λλ))λ=400
λ=700
λ
![Page 8: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/8.jpg)
CIE XYZ SpaceCIE XYZ Space
• Real colors span a sub-set of the XYZ space
• Two different stimuli can have same XYZ values–Metamerism
![Page 9: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/9.jpg)
How does this help?How does this help?
• Additive color mixtures modeled by addition in XYZ space
• When spectrums get added–Displays
Wavelength
Pow
er
CC11((λλ) )
CC22((λλ))
![Page 10: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/10.jpg)
Can there be any other Can there be any other mixture?mixture?
• Subtractive like paint• Cannot be modeled by CIE XYZ space
Wavelength
Pow
er
CC11((λλ) )
CC22((λλ))
![Page 11: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/11.jpg)
What does it not offer?What does it not offer?
• No physical feel as to how colors are arranged
• How do brightness change?• How does hue change?
![Page 12: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/12.jpg)
What are the perceived What are the perceived properties?properties?
• Intensity– Sum of the spectrum– Energy under the spectrum
• Hue– Mean wavelength of the spectrum– What wavelength sensation is dominant?
• Saturation– Standard deviation of the spectrum– How much achromatic/gray component?
• Chrominance – Hue and saturation
![Page 13: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/13.jpg)
CIE XYZ spaceCIE XYZ space
• Intensity (I) – X+Y+Z• Chrominance (x,y) - (X/I, Y/I)
–Chromaticity chart–Projection on a plane with normal (1,1,1)–Reduction of dimension–Similar to 3D to 2D in geometry
![Page 14: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/14.jpg)
What does this mean?What does this mean?
• Scaling a vector (kX,kY,kZ)– (x,y) does not change–Each vector from (0,0,0) is an iso-
chrominance line–Each vector map to a point in the
chromaticity chart
![Page 15: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/15.jpg)
Chromaticity CoordinatesChromaticity Coordinates
• Shows all the visible colors
• Achromatic Colors are at (0.33,0.33)– Why?– Called white point
• The saturated colors at the boundary – Spectral Colors
White Point
![Page 16: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/16.jpg)
Chromaticity ChartChromaticity Chart
• Exception is purples– Non-spectral region
in the boundary
• All colors on straight line from white point to a boundary has the same spectral hue– Dominant
wavelength
White Point
![Page 17: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/17.jpg)
Chromaticity ChartChromaticity Chart
• What happens here?– Complimentary
wavelength– When mixed generate
achromatic color
• Purity (Saturation)– How far shifted
towards the spectral color
– Ratio of a/b– Purity =1 implies
spectral color with maximum saturation
White Point (W)
a
b P
B
P
B’
![Page 18: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/18.jpg)
LuminanceLuminance
• Perceived brightness–Based on eye’s response
• Same brightness green looks brighter than blue or red
• This is proportional to Y
![Page 19: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/19.jpg)
How to add colors?How to add colors?
• Add (X,Y,Z) coordinates• What does this mean in terms of
brightness and chrominance?–Add brightness–Linear combination of chrominance in
proportion of the brightness• Look for errors in literature (I and not Y)
![Page 20: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/20.jpg)
What is the RGB color?What is the RGB color?
X = Xr Xg Xb i rY = Yr Yg Yb i gZ = Zr Zg Zb i b
( Xr ,Yr ,Zr )
( Xg ,Yg,Zg )
( Xb ,Yb ,Zb )
Z
X
Y
![Page 21: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/21.jpg)
Color reproducibilityColor reproducibility
• Only a subset of the 3D CIE XYZ space called 3D color gamut
• Projection of the 3D color gamut on the same plane with normal (1,1,1)–Triangle–2D color gamut
• Cannot describe brightness range reproducibility
![Page 22: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/22.jpg)
Specification ProtocolsSpecification Protocols
• Brightness or Luminance
• 2D gamut–Large if using
more saturated primaries
![Page 23: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/23.jpg)
Current standards and devicesCurrent standards and devices
![Page 24: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/24.jpg)
Gamut TransformationGamut Transformation
• Assume linear gamma• [X Y Z 1] T = M [R G B 1] T
• Two devices– [X Y Z 1] T = M1 [R1 G1 B1 1] T
– [X Y Z 1] T = M2 [R2 G2 B2 1] T
• [R2 G2 B2 1]T = M2-1[X Y Z 1]
= M2-1M1[R1 G1 B1 1]T
![Page 25: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/25.jpg)
Gamut TransformationGamut Transformation
• How to get the matrix from the standard spec?
• Given (Y,x,y) or (I,x,y) for the three vectors, you can compute (X,Y,Z)– (x. Y/y, Y, (1-x-y). Y/y)– (x.I, y.I, (1-x-y).I)
• Does not change the color, finds the new coordinates when using the new basis
![Page 26: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/26.jpg)
ProblemProblem
![Page 27: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/27.jpg)
Problem: Out of Gamut colorsProblem: Out of Gamut colors
![Page 28: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/28.jpg)
Gamut MatchingGamut Matching
• Find a common color gamut defined by Rc, Gc, Bc
• Find the common function Mc
– [X Y Z 1]T = Mc [Rc Gc Bc 1]T
• For any device i– [Ri Gi Bi 1]T = Mi
-1Mc [Rc Gc Bc 1]T
![Page 29: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/29.jpg)
Two gamutTwo gamut
![Page 30: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/30.jpg)
Find their intersectionFind their intersection
Need not be a parallelopipped
![Page 31: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/31.jpg)
Find the common gamutFind the common gamut
![Page 32: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/32.jpg)
Find the mapping functionFind the mapping function
![Page 33: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/33.jpg)
Gamut MappingGamut Mapping
• Changing the actual colors–Mapping color in one gamut to another
in the new gamut
• If just dealing with two devices, may choose to move colors from one gamut to another
![Page 34: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/34.jpg)
What is gamma function?What is gamma function?
X = Xr Xg Xb h r ( i r )Y = Yr Yg Yb h g ( i g )Z = Zr Zg Zb h b ( i b )
( Xr ,Yr ,Zr )
( Xg ,Yg,Zg )
( Xb ,Yb ,Zb )
![Page 35: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/35.jpg)
Tone Mapping OperatorTone Mapping Operator
• How the input value maps to output intensity
• Affects brightness, contrast and saturation
![Page 36: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/36.jpg)
Tone Mapping OperatorTone Mapping Operator
• How the input value maps to output intensity
• Affects brightness, contrast and saturation
![Page 37: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/37.jpg)
Transfer FunctionTransfer Function
• Monotonic, smooth with no flat regions• Brightness and contrast controls
![Page 38: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/38.jpg)
Image CorrectionImage Correction
![Page 39: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/39.jpg)
Color BalanceColor Balance
• Relative proportions of primaries while forming a color
• Affects hue, saturation and brightness
• Can be changed by changing the transfer function
![Page 40: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/40.jpg)
Color BalancingColor Balancing
![Page 41: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/41.jpg)
QuantizationQuantization
• Digitization of color• Gray scale – infinite grays between 0
and 1–8 bit representation – 256 levels–A range of grays represented by a
single value
• Any value is assigned to one of k values
• Choose number of levels and range of each level
![Page 42: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/42.jpg)
Quantization ErrorQuantization Error
g
Q(g)
Quantization Error
Uniform Quantization
Maximum Error = ½ Step Size
Step Size
![Page 43: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/43.jpg)
Is it constant across all levels?Is it constant across all levels?
• Only when linear transfer function• Usually non-linear transfer function• Quantization error changes with
input
![Page 44: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/44.jpg)
Gamma FunctionGamma Function
• Usually a gamma transfer function–O = Iγ
Display Gamma
Input Intensity
Out
put I
nten
sity
![Page 45: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/45.jpg)
NonNon--Uniform QuantizationUniform Quantization
• Note how quantization changes
• Non-uniform step size
• Maximum Error–½ of maximum step
size• # of levels is the
color resolution–# of bits
Display Gamma
Input Intensity
Out
put I
nten
sity
![Page 46: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/46.jpg)
Color ResolutionColor Resolution
Analog Image 4 Steps 8 Steps 16 Steps
32 Steps64 Steps
Quantization Artifacts
![Page 47: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/47.jpg)
DitheringDithering
• What if the color resolution is low?–Newsprint – Bi-level, only black and
white
• Can we expand the # of colors?–Spatial integration of eye
• Trading off spatial resolution for intensity resolution
![Page 48: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/48.jpg)
DitheringDithering
• Represented by a dither matrix• nxn pixels, bi-level intensity, can
produce n2+1 intensities• If more than two levels – k levels
–n2. (k-1) +1–Used for increasing the color resolution
0 2
1 3
![Page 49: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/49.jpg)
DitheringDithering
• If more than two levels – k levels–n2. (k-1) +1–For k = 4 (0,1,2,3) and n=2
![Page 50: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/50.jpg)
ExamplesExamples
Loss of tone and details(Intensity and Spatial Resolution)
![Page 51: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/51.jpg)
Subtractive Color SystemSubtractive Color System
• Layers of cyan, yellow and magenta dyes– Absorb red, blue and
green light
• Depends on the illuminant
• Act as absorption filter– Ideally block filters
• Overlaying all the three dyes absorbs all wavelengths creating black
![Page 52: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/52.jpg)
Creation of a colorCreation of a color
• CMY = (1, 1, 1) –RGB
• (0.25, 0.5, 0.75) = (1, 1, 1) – (0.75, 0.5, 0.25)
• This works only for block filters
![Page 53: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/53.jpg)
Real Real FiiltersFiilters
• Are not block filters• Cross talk across
different filters• Due to ink impurities• Grays should be
formed by equal amount of three primaries– Seldom happens
![Page 54: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/54.jpg)
Why use black?Why use black?
• Better contrast• Use of inexpensive black in place of
expensive colored dyes• Superimposing multiple dyes cause
tearing of wet paper• K for key• Not an independent primary
– Hence makes dark colors darker
![Page 55: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/55.jpg)
How to use black?How to use black?
• Initially only for neutral colors– Called undercolor removal (UCR)
• Colors with three components– Minimum of the three is the gray
component
• Full gray component replacement– Only in inkjets where registration is a
problem
• Partial gray component replacement– To achieve the best contrast
![Page 56: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/56.jpg)
Gray BalancingGray Balancing
• The first step in printing is to decide how much of GCR to be used for the neutral grays
• However, every gray needs to be decided separately
• Called gray balancing • Usually done by iteration• No simple tristimulus model to decide
components
![Page 57: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/57.jpg)
Dependency on ContentDependency on Content
• Discussed content independent• Can also be done by understanding
the color distribution of the particular content
• Usually non-linear
![Page 58: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/58.jpg)
Image CompositingImage Compositing
Mosaic Blending
![Page 59: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/59.jpg)
Image CompositingImage Compositing
![Page 60: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/60.jpg)
Compositing ProcedureCompositing Procedure1. Extract Sprites (e.g using Intelligent Scissors in Photoshop)
Composite by David Dewey
2. Blend them into the composite (in the right order)
![Page 61: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/61.jpg)
Replacing pixels rarely worksReplacing pixels rarely works
Problems: boundries & transparency (shadows)
Binary mask
![Page 62: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/62.jpg)
Two Problems:Two Problems:
Semi-transparent objects
Pixels too large
![Page 63: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/63.jpg)
Alpha ChannelAlpha Channel• Add one more channel:
– Image(R,G,B,alpha)• Encodes transparency (or pixel coverage):
– Alpha = 1: opaque object (complete coverage)
– Alpha = 0: transparent object (no coverage)
– 0<Alpha<1: semi-transparent (partial coverage)
• Example: alpha = 0.3
![Page 64: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/64.jpg)
Alpha BlendingAlpha Blending
alphamask
Icomp = αIfg + (1-α)Ibg
shadow
![Page 65: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/65.jpg)
Alpha HackingAlpha Hacking……
No physical interpretation, but it smoothes the seams
![Page 66: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/66.jpg)
FeatheringFeathering
01
01
+
=Encoding as transparency
Iblend = αIleft + (1-α)Iright
![Page 67: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/67.jpg)
Setting alpha: simple averageSetting alpha: simple average
Alpha = .5 in overlap region
![Page 68: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/68.jpg)
Setting alpha: center seamSetting alpha: center seam
Alpha = logical(dtrans1>dtrans2)
Distancetransform
![Page 69: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/69.jpg)
Setting alpha: blurred seamSetting alpha: blurred seam
Alpha = blurred
Distancetransform
![Page 70: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/70.jpg)
Setting alpha: center weightingSetting alpha: center weighting
Alpha = dtrans1 / (dtrans1+dtrans2)
Distancetransform
Ghost!
![Page 71: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/71.jpg)
Affect of Window SizeAffect of Window Size
0
1 left
right0
1
![Page 72: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/72.jpg)
Affect of Window SizeAffect of Window Size
0
1
0
1
![Page 73: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/73.jpg)
Good Window SizeGood Window Size
0
1
“Optimal” Window: smooth but not ghosted
![Page 74: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/74.jpg)
Type of Blending functionType of Blending function
Linear(Only function continuity)
Spline or Cosine(Gradient continuity also)
![Page 75: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/75.jpg)
What is the Optimal Window?What is the Optimal Window?• To avoid seams
– window = size of largest prominent feature• To avoid ghosting
– window <= 2*size of smallest prominent feature
Natural to cast this in the Fourier domain• largest frequency <= 2*size of smallest frequency• image frequency content should occupy one “octave” (power of two)
FFT
![Page 76: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/76.jpg)
Frequency Spread is WideFrequency Spread is Wide
• Idea (Burt and Adelson)– Compute Band pass images for L and R
• Decomposes Fourier image into octaves (bands)
– Feather corresponding octaves Li with Ri
• Splines matched with the image frequency content• Multi-resolution splines• If resolution is changed, the width can be the same
– Sum feathered octave images
FFT
![Page 77: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/77.jpg)
Octaves in the Spatial DomainOctaves in the Spatial Domain
• Bandpass Images
Lowpass Images
![Page 78: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/78.jpg)
Pyramid BlendingPyramid Blending
0
1
0
1
0
1
Left pyramid Right pyramidblend
![Page 79: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/79.jpg)
Pyramid BlendingPyramid Blending
![Page 80: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/80.jpg)
laplacianlevel
4
laplacianlevel
2
laplacianlevel
0
left pyramid right pyramid blended pyramid
![Page 81: Color Image Processing - University of California, Irvinemajumder/DIP/classes/color.pdf · Color Image Processing. What is color? • Selective emission/reflectance of different wavelengths](https://reader034.vdocuments.us/reader034/viewer/2022051405/5a711fa97f8b9aac538c8adc/html5/thumbnails/81.jpg)
LaplacianLaplacian Pyramid: BlendingPyramid: Blending
• General Approach:1.Build Laplacian pyramids LA and LB
from images A and B2.Build a Gaussian pyramid GR from
selected region R3.Form a combined pyramid LS from LA
and LB using nodes of GR as weights:• LS(i,j) = GR(i,j,)*LA(I,j) + (1-
GR(i,j))*LB(I,j)
4.Collapse the LS pyramid to get the final blended image