Вы находитесь на странице: 1из 25

Image Restoration & Color Fundamentals

Lecture 7
Sankalp Kallakuri
elsanky@gmail.com
Constrained Least Squares Filtering

• Wiener filter needs knowledge of the noise PSD as well


as the PSD of the Undegraded Image.

• Estimates of the noise PSD aren’t always accurate.

• In the least squares filter only the noise characteristics


are needed and can be gathered from the degraded
image.

• The wiener filter is optimal in an average sense


the least squares filter is optimal to each image it is
applied to.
Example of Restoration from Motion
Deblurring & Additive Noise

http://www.mathworks.com/products/image/demos.html?file=
/products/demos/shipping/images/ipexwiener.html
Geometric Transformations

• They can be divided into two


types
1) spatial transformations
2) grey level interpolations
Spatial Transformations
The geometric distortion in an image can be expressed as

x  r ( x, y)
y  s( x, y)
If the distortion functions are known analytical functions then the
original image can be reconstructed form the distorted image directly.
Spatial Transformations

The distortion functions may not be known and in that case the
distortion functions are obtained by using Tie Points

The locations of the Tie Points is exactly known in the original and the
distorted images.

s( x, y)  c5 x  c6 y  c7 xy  c8
r ( x, y)  c1 x  c2 y  c3 xy  c4

The value of the image over a scan is picked by passing the indices
throught the distortion function and picking the value at the output image.
Grey Level Interpolation

• The spatial transformation may lead to non integer values for


the location hence there may be need to interpolate the value
from the closest integer locations.

Nearest Neighbor, Cubic and Bilinear Interpolation are among


the commonly used interpolations.

Nearest Neighbor Interpolation


Color Image Processing
Visible Spectrum
• Two types: Full Color and violet 380–450 nm
Pseudo Color Processing.

blue 450–495 nm
• Full Color is where the color is
obtained from the scanner or
camera. green 495–570 nm

• Pseudo Color is when the


color is to be allotted to a yellow 570–590 nm
certain gray scale image.
orange 590–620 nm
• Certain gray scale methods
are directly applicable to the
color images whereas some red 620–750 nm
need modifications.
Color Basics

• Green objects mostly reflect radiation in the green region


of the spectrum.
• Intensity maps to  gray levels
• Radiance is the total amount of energy that flows from
the light source. Measured in watts (W).
• Luminance is the perceived brightness measured in
lumens (lm).
• Color perception in the human eye is carried out by
cones. 65% are sensitive to red 33% are sensitive to
green and 2% are sensitive to blue.
Primary and Secondary colors

• Red Green Blue primary colors


• [Red+Blue] magenta
[Blue+Green] cyan secondary colors
[Red+Green] yellow

magenta
red blue

yellow cyan

Additive Mixing Subtractive Mixing

light pigments
Color Basics

Brightness, hue and saturation are characteristics used to


distinguish Colors.

Hue is an attribute that maps to the wavelength red orange yellow


are hues.

Saturation is the amount of white light mixed with the hue.

Pure colors like red are fully saturated pink is not saturated

Tristimulus values X
x
X Y  Z
Y
y
X Y  Z
Z
z
X Y  Z
Chromaticity Diagram

Point of equal energy is white.

The colors along the boundary are the


Saturated colors

A straight line joining two points on this


diagram can show all possible shades
obtainable by mixing different proportions
of those two colors.

A line from the point of equal energy to


the boundary will show all shades of
that hue.

A triangle with 3 fixed vertices cant


Enclose the tongue shape hence 3 primary
Colors arent sufficient to reproduce all colors.
Color Models
• Color Models are spatial representations of the color
palettes, any point in the space would be representing a
color.

• RGB is the most popular for cameras and monitors.

• CMY and CMYK for color printing.

• HSI is close to the way humans perceive color and


decouples the color and grey scale information in an
image allowing application of the grey scale processing
techniques.
RGB Color Model

• The RGB color model is based on a cartesian coordinate


system.

8 bits per color plane


3 color planes
Results in 16,777,216 colors

Most displays may not have the


ability to display all such colors
Hence a subset called Safe RGB
has been developed.

www.mathworks.com image processing toolbox


Web Safe RGB Color Model
6 shades of each color
These numbers are used to
digit hexadecimal decimal
define all the web safe colors
0 00 0
3 33 51 Each triplet is made up of 24 bits
6 66 102 Each color plane 8 bits.
9 99 153 8 bits consist of 2 hex numbers.
C or (12) CC 204
The 6 numbers yield (6)3 = 216
F or (15) FF 255 colors

For Example pure bright red


would be FF0000

RGB safe color cube


Web Safe RGB Color Model
*000* 300 600 900 C00 *F00* *003* 303 603 903 C03 *F03*
006 306 606 906 C06 F06 009 309 609 909 C09 F09
00C 30C 60C 90C C0C F0C *00F* 30F 60F 90F C0F *F0F*
030 330 630 930 C30 F30 033 333 633 933 C33 F33
036 336 636 936 C36 F36 039 339 639 939 C39 F39
03C 33C 63C 93C C3C F3C 03F 33F 63F 93F C3F F3F
060 360 660 960 C60 F60 063 363 663 963 C63 F63
066 366 666 966 C66 F66 069 369 669 969 C69 F69
06C 36C 66C 96C C6C F6C 06F 36F 66F 96F C6F F6F
090 390 690 990 C90 F90 093 393 693 993 C93 F93
096 396 696 996 C96 F96 099 399 699 999 C99 F99
09C 39C 69C 99C C9C F9C 09F 39F 69F 99F C9F F9F
0C0 3C0 6C0 9C0 CC0 FC0 0C3 3C3 6C3 9C3 CC3 FC3
0C6 3C6 6C6 9C6 CC6 FC6 0C9 3C9 6C9 9C9 CC9 FC9
0CC 3CC 6CC 9CC CCC FCC 0CF 3CF 6CF 9CF CCF FCF
*0F0* 3F0 *6F0* 9F0 CF0 *FF0* 0F3 *3F3* *6F3* 9F3 CF3 *FF3*
*0F6* *3F6* 6F6 9F6 *CF6* *FF6* 0F9 3F9 6F9 9F9 CF9 FF9
*0FC* *3FC* 6FC 9FC CFC FFC *0FF* *3FF* *6FF* 9FF CFF *FFF*

Web-Safe Colors
CMY and CMYK model

• The color printers use a model which is subtractive. i.e


a Cyan pigment will not reflect any Red light when
illuminated by white light.

 C  1  R 
 M   1  G 
    
 Y  1  B 

The printing devices internally do a RGB to CMY conversion .

The black obtained by mixing all the CMY components looks


muddy hence an additional black component is added to
make the CMYK model.
HSI Color Map

• The human color perception is closer to the HSI model.


• We describe objects as light or dark and having a certain
color.
white

cyan yellow

blue red

black

Intensity [gray scale] is along the line from black


RGB color model
to white saturation is perpendicular distance from
this intensity axis
HSI Color Model

Usually Red is considered zero degrees


Pseudocolor Image Processing

Pseudocolor Image Processing is used to assign colors to grey


scale images.

The reason is that an instant the human eye can discern


thousands of colors and intensities but only a few grey levels.

Intensity Slicing

The grey level images are


quantized into several levels
where each level is mapped
to a particular color.
Grey Level to Color Transformations

Red Transformation fr(x,y)

Green Transformation fg(xy)

Blue Transformation fb(x,y)

g1(x,y) hr(xy)
f1(x,y) Transformation T1
g2(xy)
f2(x,y) Transformation T2 hb(xy)
Additional
Processing
gk(x,y)
hg(xy)
fk(x,y) Transformation T3
Color Image Processing

• Histograms [some may be only on the I


component of HSI]
• Smoothing/Sharpening
• Complements and Slicing
• Segmentation
• Compression
Tone and Color Corrections

• The different print media as well as monitors of different types


should be able to correctly display color gamut.
• A device independent color model is used.
• The most common being CIELAB

The L* a* b* color components are given by

Y    X   Y    Y   Z 
L  116  h   16 a  500h   h  b  200h   h 
 Yw    X w   Yw    Yw   Z w 

q  0.008856
{ q
3
h(q) 
7.787q  16 / 116 q  0.008856
Tone and Color Corrections

• Xw, Yw and Zw are the white tristimulus values


which match with the white of the CIE
chromaticity diagram.

• L* a* b* colorimetric, perceptually uniform and


device independent.

• It is not a directly displayable format.

• Decouples intensity from color useful in image


manipulation and compression.
Tone and Color Corrections

• Saturation is corrected after correcting the tonal


range.

• Tonal range is also called the images key type.


Which could be high low or medium.

• The transformations can be carried out


individually in any of the color planes.

• The transformations are similar to the grey level


piecewise linear and power law transformations
Mid Terms next week
• Bring Calculators
• Pencils eraser scale
• Closed book exam

Вам также может понравиться