You are on page 1of 52

RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

INSTRUCTOR’S MATERIALS
PowerPoint Slides

MULTIMEDIA
Chapter -3

Image
RANJAN PAREKH

PROPRIETARY MATERIAL. © 2013 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any
form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their
individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission. 1
RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Contents
• Image Data Representation
• Image Acquisition
• Image Processing
• Binary Image Processing
• Grayscale Image Processing
• Color Image Processing
• Image Output on Monitors
• Image Output on Printers
• Image File Formats
• Image Processing Software

INSTRUCTOR'S MATERIALS Chapter – 3 : 2


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Data Representation


• Overview
– Pixel : Intensity (V) and Location (L)
– Binary image : 1-bit representation : 0 ≤ V ≤ 1
– Grayscale image : 8-bit representation : 0 ≤ V ≤ 255
– Color image : 24-bit representation : R (0 ≤ VR ≤ 255), G (0 ≤ VG ≤ 255), B (0 ≤ VB ≤ 255)

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 3


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Acquisition
• Scanner
– Light reflected from document falls on set of electronic sensors called CCD (charge coupled device)
– The sensors convert light into electrical signals which are fed to an ADC to convert to digital values
– A scanning software helps to save the values to a digital image file.
– The software also specifies parameters like image size, resolution, file type, color & tonal corrections
– The CCD produces signals proportional to the luminance information of a pixel
– For color scans, three CCDs per pixel is used along with optical splitters
– Generally 3 types of scanners used : flatbed scanners, drum scanners, bar-code scanners

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 4


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Acquisition
• Scanner software
– Software used to specify output path, file type, bit depth, dimensions, brightness/contrast, color etc.
– Graphical interface enables users to change/ set these values
– Certain transformation operations like invert, flip etc. might also be possible
– Users can preview output image before finally saving them

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 5


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Acquisition
• Scanned image
– Quality of scanned image is determined mostly by its resolution and bit-depth
– Resolution determines how closely pixel information is acptured
– Optical resolution refers to the actual number of sensor elements per unit inch of the scan head
– Interpolated resolution use interpolation techniques to increase resolution
– Color-depth indicates the total numbers of colors that can be represented

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 6


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Acquisition
• Digital Camera
– In a digital camera light from an object is focused by a lens onto a CCD array
– Electrical signals generated from CCD are digitized via an ADC
– To reduce space requirements images are compressed by passing through a signal processor
– A CAMERA mode enables one to capture images
– A PLAY mode allows one to browse through the stored images and manipulate them
– Other facilities might include self-timer, automatic flash, inbuilt microphones etc.

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 7


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Acquisition
• Interface Standards
– Provides standardized interfaces between hardware devices like scanner or digital camera, and
image capture software
– TWAIN and ISIS form an intermediate layer between software applications and devices, so that
these do not need to communicate directly with each other
– Applications send image acquisition request to the interface layer which are passed on to the device
– The device sends the acquired image data to the interface layer which are passed on to the
application

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 8


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing
• Overview
– Low-level image processing involves reading pixel values of digital images and modifying their color
and tonal qualities like brightness and contrast
– Mid-level image processing involves generation of attribute values from image pixels e.g.
segmentation borders, histograms, edge contours etc.
– High-level image processing involves semantic recognition of objects from images e.g. sky, grass,
water, rock, buildings etc.
– Data analysis and visualization tools like MATLAB are frequently used in image processing tasks by
treating images as matrices of pixel values
– Image enhancement implies improving visual clarity of images
– Image restoration involves improving a degraded image to its original condition
– Image segmentation involves partitioning images into constituent parts
– Image compression involves a set of techniques to compress file size of images
– Image indexing is a set of techniques enabling quick and efficient searching of images

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 9


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing
• Basic operations
– Reading an image and displaying information related to it
– Displaying part or whole of the image
– Conversions between color and grayscale versions
– Changing image quality and resolution
– Writing images back to disk in specified formats

– Associated MATLAB commands : imread, imshow, imfinfo, rgb2gray, size, whos, imwrite

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 10


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing
• Arithmetic operations
– Involve addition of two or more images, aslo with scalars : I3 = I1 + I2, I4 = I1 + K
– Subtraction of images : D1 = I6 – I5, D2 = |I6 – I5|
– Multiplication of an image with a scalar quantity : I8 = I7 * K, I9 = I8/K
– Linear combinations :
I10 = 0.2*I1 + 0.8*I8, I11 = – 0.2*I1 + 0.8*I8, I12 = 0.8*I1 + 0.2*I8, I13 = 0.8*I1 – 0.2*I8

– Associated MATLAB commands : imadd, imsubtract, imabsdiff, immutiply, imdivide, imlincomb

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 11


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing
• Correlation and convolution
– Involves sliding a filter mask or kernel containing a set of coefficients over an image
– Kernel is moved in a sequential manner from left to right and top to bottom
– At any position of the kernel the image pixel below the center of the kernel is allotted a new value
– New value is generated by multiplying the neighbouring pixel values within the boundary of kernel
by coefficients of the kernel and adding them up.
– Correlation and convolution is similar except for the latter the kernel is first rotated by 90 degrees
– Associated MATLAB commands : imfilter

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 12


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing
• Affine transformations
– Involves linear combination of translation, rotation, scaling
– Translation : portions of images moved by adding increments to their locations along X and Y axes
– Rotation : portions of images rotated by an angle about a pivot point in CW or CCW directions
– Scaling : dimensions of image portions changed by multiplying scalar quantities along X and Y axes
– Associated MATLAB commands : imrotate, imresize

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 13


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Binary Image Processing


• Morphological operations
– Dilation : enlarges boundaries of foreground pixels
– Erosion : shrinks boundaries of foreground pixels
– Opening : erosion followed by dilation
– Closing : dilation followed by erosion
– Thinning : thickness of lines are reduced, like erosion
– Thickening : thickness of lines are increased, like dilation
– Skeletonization : thinning followed by erosion
– Edge detection : detects high contrast edges in images

– Associated MATLAB commands : im2bw, bwmorph, imdilate,


imerode, imopen, imclose,

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 14


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Binary Image Processing


• Logical operations
– Involves changing image pixels based on logical relations : AND, OR, NOT, XOR
– Associated MATLAB commands : min, max

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 15


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Edge detection operators
– Involves detection of high frequency edges in an image
– Sobel masks for detecting horizontal and vertical edges

– Prewitt masks for detecting horizontal and vertical edges

– Roberts masks for detecting horizontal and vertical edges

– Associated MATLAB commands : rgb2gray, edge, fspecial, imfilter

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 16


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Canny operator
– Image smoothed with Gaussian filter
– Edge strength computed at each point
– Edge direction calculated
– Edge direction digitized
– Pixels along edge are converted to maximum values
– Each pixel determined to be an edge pixel or not using two thresholds (hysteresis)

• LoG operator
– Image is convolved with Gaussian function after which the second derivative is computed
– Masks similar to those below are used

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 17


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Intensity transformations
– Refers to transformations related to adjustments of pixel intensities
– Mapping of pixels from input image to output image is done using gamma curve
– Brighter values are produced using γ < 1 and darker values are produced using γ > 1
– An intensity band, say [0.2, 0.5], can be expanded to full range [0, 1]
– Images can be inverted using a mapping of [0, 1] to [1, 0]
– Associated MATLAB commands : imadjust

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 18


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Histogram Processing
– Histogram is defined as the relation between pixel frequencies against gray levels
– Represented as a discrete function h(rk) = nk where rk is the intensity at level k and nk is number of
pixels having intensity rk
– Histogram equalization is the modification of the histogram to distribute a narrow range of gray
values across the entire available range
– Histogram equalization generally leads to a marked improvement in tonal quality of an image
– Histograms are usually depicted pictorially using a bar graph
– Associated MATLAB commands : imhist, plot, bar

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 19


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Logical Operations
– AND operation is represented by minimum value of corresponding pixels
– OR operation is represented by maximum value of corresponding pixels
– NOT operation is represented by the inverse pixel value (subtracted from 255)
– Associated MATLAB commands : min, max, uint8, double

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 20


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Discrete Fourier Transform (DFT)
– Converts an image from spatial to frequency domain
– The (u,v)-th frequency term is given by the following where f(x,y) is the (x,y)-th
pixel of an image having dimensions M by N

– The inverse transform depicts conversion of frequency domain signal back to


time domain values

– Magnitude and phase angle of transform is

– Associated MATLAB commands : fft2, fftshift

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 21


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Discrete Cosine Transform (DCT)
– Converts an image from spatial to frequency domain but uses only real values
– The (u,v)-th frequency term is given by the following where f(x,y) is the (x,y)-th
pixel of an image having dimensions M by N

– The inverse transform depicts conversion of frequency domain signal back to


time domain values

– Associated MATLAB command : dct2

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 22


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Discrete Wavelet Transform (DWT)
– Similar to DFT but uses small waves of varying frequency and limited duration,
as basis functions
– Analyzes the signal at different resolutions by decomposing into an
approximation coefficient and a number of detail coefficients
– The 2D DWT of an M by N image A is given by

– B : blur or approximation coefficient, represents average value of A


– H : horizontal detail coefficient, represents differences along rows of A
– V :vertical detail coefficient, represents differences along columns of A
– D :diagonal detail coefficient, represents differences along diagonals of A
– Associated MATLAB commands : wavedec2, appcoef2, detcoef2

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 23


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Noise modeling
– Noise refers to unwanted random variation in image pixels generated due to reasons like
interference, digitization, defects of lenses, motion etc.
– Small random dots arising due to amplification distortions is called Gaussian noise.
– A mixture of bright and dark spots is called salt-and-pepper noise
– Average blurring is produced by defects in lenses
– Motion blurring is produced due to motion of camera and/or objects
– Associated MATLAB commands : imnoise, fspecial, imfilter

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 24


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Image filtering in spatial domain
– Filtering is used to either suppress high-frequency components using a low-
pass filter or suppress low-frequency components using a high-pass filter
– Spatial domain filtering is performed directly in spatial domain by convolving
image by filter function
– Mean filter : each pixel replaced by mean value of its neighbours including itself
– Often a 3 × 3 or 5× 5 kernel is used.
– Median filter : each pixel in the image is replaced by the median of the pixel
values in the neighbourhood i.e. within the kernel window.
– Especially effective in removing salt-and-pepper noise
– A Gaussian filter uses a kernel whose coefficients are generated using a
Gaussian function. Such filters produce a blurring effect
– Associated MATLAB commands : imfilter, medfilt2, imnoise, fspecial

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 25


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Grayscale Image Processing


• Image filtering in frequency domain
– Frequency domain filtering is done by converting the image to frequency domain and multiplying
with DFT of filter function
– Convolution operation in spatial domain becomes a multiplication operation in frequency domain
– F, H, G are the frequency domain representations of f, h, g
– Associated MATLAB commands : fft2, fftshift, fspecial, imfilter, mesh

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 26


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Seeing color
– Depends on 3 factors : nature of light, physiology of human vision, interaction of light with matter
– Light is a form of electromagnetic radiation, visible spectrum ranges from 400 to 700 nm in wavelength
– Light enters through the retina of eye and falls on rod/cone cells which produce color sensations
– When light falls on an object part of it gets absorbed and the remaining part gets reflected
– The wavelengths present in the reflected light cause different sensations of color

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 27


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Color models and spaces
– Used in recognizing and expressing information related to color
– Most of the colors we see can be derived by mixing a few elementary colors, called primary colors,
– A color model defines the primary colors and the range of values they can take.
– The color gamut is the total range of colors the model can represent
– Color models like RGB and CMY are called device dependent, as the color shades they produce
depend on the physical properties of devices
– RGB model used for monitors, has a larger gamut than CMY used for printers
– This implies that all colors viewed on a screen cannot be printed out

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 28


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• CIE XYZ
– Color model defined by CIE based on tri-stimulus values of color X, Y,
Z derived from peak sensitivities of photo-receptors in human eye
– Derived parameters x, y, z, called color matching functions, indicate
chromatic responses of a standard observer
– Plotting x and y for all visible colors, produces the CIE chromacity
diagram which is the projection of XYZ space onto the XY plane
– Luminosity function is the average visual sensitivity of the human
eye to lights of different wavelength.
– Color temperature of a light source is the temperature in Kelvin (K)
of a black-body radiator that radiates light of same color
– Color temperature of white point specification D65 is 6504K and D50
is 5003K
– Chromacity values of D65 are (x=0.313, y=0.331) for 10°
– Chromacity values of D50 are (x=0.347, y=0.359) for 10°

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 29


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• CIE LAB
– Derived from CIE XYZ model with objective of making it more perceptually uniform
– L represents lightness, ‘a’ represents the red-green axis and ‘b’ represents the yellow-blue axis
– CIE LAB closely matches with human perception of color and is used during color calibration for
conversion of color spaces from one device to another
– CIE LAB is not device dependent and its gamut is larger than both RGB and CMYK

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 30


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• RGB
– RGB (red green blue) model is used to describe behaviour of colored lights emitting from screens
and monitors.
– Called additive model as all three primary colors add up to produce white
– Equal amounts of primary colors (R, G, B) produce secondary colors cyan, yellow, magenta
– RGB color cube consists of primary and secondary colors at the 6 vertices and white and black at the
other two.
– Proportions of colors are represented in range 0 to 255

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 31


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• sRGB
– A color space with defined chromacity values created by HP and
Microsoft defined in ITU-T Rec. 709
– Occupies 35% of LAB color space and uses D65 white point

Chromacity Red Green Blue White


x 0.64 0.3 0.15 0.3127
y 0.33 0.6 0.06 0.3290
z 0.03 0.1 0.79 0.3583

• AdobeRGB
– A color space created by Adobe with defined chromacity values
– Occupies 50.6% of LAB color space and uses D65 white point

Chromacity Red Green Blue White


x 0.64 0.21 0.15 0.3127
y 0.33 0.71 0.06 0.3290
z 0.03 0.08 0.79 0.3583

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 32


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• CMYK
– CMY (cyan magenta yellow) model is used to describe behaviour of colored inks on paper.
– Called subtractive model as all three primary colors combine to produce black
– Equal amounts of primary colors (C, M, Y) produce secondary colors red, green, blue.
– To account for impurities of ink, pure black (K) color added to the model
– CMY color cube consists of primary and secondary colors at the 6 vertices and white and black at
the other two.
– Proportions of colors are represented in range 0 to 100.

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 33


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• HSV
– HSV (hue saturation value) model is based on human perception of color.
– Hue H is the actual color measured in angles on a circular surface, and
ranges from 0 for red, 120 for green and 240 for blue
– Saturation S is the amount of gray added to the color and ranges from 1
for saturated colors to 0 for white
– Value V indicates level of illumination on the color and ranges from 0 for
black to 1 for white
– HSV model appears as an inverted cone, derived from the RGB cube
– H is measured along circumference of the cone base
– S is measured radially from center to periphery of the base
– V is measured vertically from apex to base of cone
– RGB colors can be converted to HSV and vice versa
– Associated MATLAB commands : rgb2hsv, hsv2rgb

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 34


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


HSL
• HSL
– HSL (hue saturation lightness) model is similar to HSV but
instead of an inverted cone, it looks like a double cone
– Hue H is the actual color measured in angles on a circular
surface, and ranges from 0 for red, 120 for green and 240 for
blue
– Saturation S ranges from 1 for saturated colors to 0 for gray
– Lightness L ranges from 0 for black, 0.5 for saturated colors and
1 for white
– Conceptually HSL is considered more improved than HSV as it is
symmetrical with respect to saturation and lightness

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 35


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Indexed Mode Image
– Indexed image has a data matrix X and color matrix M
– RGB values are inserted in a color map and data matrix contains index value of each color in map
– The first image contains 2 colors, 0 and 1, whose distribution is given in XI and actual values in MI
– The second image contains 3 colors, 0, 1 and 2, whose distribution is given in XJ actual values in MJ
– The color map, also called CLUT (color look up table) is represented by 8-bit index values, and hence
can compress a 24-bit image by about 3 times
– Associated MATLAB commands : rgb2ind

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 36


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Color transformations
– An RGB image can be separated into constituent
color channels, each channel requiring 8-bit
information
– When converting an RGB image to indexed
mode, the total number of colors can be
specified
– Associated MATLAB commands : rgb2ind

– Pre-defined color maps can be used to change


the color combinations of an existing image
– Pre-defined color maps include : hot, bone,
copper, pink, flag, colorcube, jet, prism, cool,
autumn, winter, summer

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 37


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Color transformations
– An RGB image can be converted to a grayscale image by
combining the individual R, G, B values to a single value within
range [0, 255]

– The simplest way is to use the average of the three values as


value of the gray shade i.e. Y = (R+G+B)/3

– However sensitivity of human eye is different for different colors


and a more accurate representation is Y = 0.3R + 0.6G + 0.1B
– When an indexed image is converted to grayscale,
corresponding to each color in its color map, a gray shade is
computed
– Associated MATLAB commands : rgb2gray

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 38


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Color transformations (contd.)
– A grayscale image is converted to binary mode by specifying a threshold
– If the original pixel value is less than the threshold, it is assigned value 0, otherwise value 1
– Larger thresholds results in darker images
– Color images are first converted to grayscale and then they are converted to binary images
– Associated MATLAB commands : rgb2gray, im2bw

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 39


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Arithmetic operations
– On color images arithmetic operations work the same way as grayscale or binary images, with the
difference that all three color matrices are affected
– Linear combination of color images can produce new colors not present in original images

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 40


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Logical Operations
– On color images logical operations work the same way as
grayscale or binary images, with the difference that all three
color matrices are affected

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 41


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Intensity transformations
– On color images work the same way as
grayscale or binary images but all three
color matrices are affected

• Noise modeling
– On color images work the same way as
grayscale or binary images, but all three
color matrices are affected

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 42


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Color Image Processing


• Edge Detection
– Done by convolving with a mask similar to a grayscale
image
– A color image when convolved with a Laplacian mask
produce an edge detected image
– This when subtracted from the original image produce a
sharpened image with well defined edges
– This process can be repeated for more sharpened looks

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 43


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Monitors


• Display Considerations
– Size of an image on screen is determined by pixel dimensions of the image and the size and settings
of the monitor
– Color-depth supported by the monitor determines the total numbers of colors viewable on screen
– Monitor resolution determines whether the image on screen looks bigger, smaller or the same size
as the original image
– Viewing mode determines what part of the screen is occupied by the image

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 44


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Monitors


• Gamma correction
– A perfectly linear gradient from black to white is distorted by the monitor because of its non-linear
characteristics
– Equal increments in pixel values do not result in equal increments in screen brightness e.g. 50%
increase in pixel brightness produces 20% increase in screen brightness
– This can be represented by a gamma function whose value is around 2.5
– Output pixel Po is changed from the input pixel Pi by a gamma factor γ

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 45


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Monitors


• Gamma correction
– To prevent pictures from being excessively dark, a gamma correction is applied
– Value of input pixel is increased by (1/γ) which is then reduced by the CRT by factor γ to arrive
at the desired value

– Physically gamma correction is applied through a CLUT between the image and monitor
– A full correction of 2.5 makes the image excessively bright hence a partial correction of 1.7 is
actually applied

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 46


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Monitors


• Color management
– Color of images are device dependent and hence varies from monitor to monitor
– A color management system (CMS) is a set of software tools used to maintain consistent color
throughout the print production process
– ICC (International Color Consortium) established a standard by which device profiles are stored in
ICC files and a CMM (color management module) uses these profiles to make color corrections
– A device color space is first translated to a device-independent color space like CIE LAB
– Then it is translated back to another device space to determine what changes in color values are
needed to maintain the same color shade

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 47


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Printers


• LASER printer
– Consists of a photoconductor drum on which a charging roll applies uniform negative charge
– A LASER beam creates a charge image on the photoconductor drum
– The developer roll applies powdered toner on charge image
– The transfer roll attracts toner particles onto the paper
– The hot roll heats the toner particles to melt them
– The pressure roll fuses the melted toner with the paper
– The cleaning blade removes the residue and prepares the drum for the next cycle
– Colored printing is produced using cyan, magenta, yellow and black toners

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 48


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Printers


• Inkjet printer
– In thermal type, ink emission is initiated by heating liquid ink in a reservoir
– Expansion forces ink out of a nozzle onto the paper
– Limitations : ink should not decompose on heating, heating cooling cycle impose speed restriction
– Used by Canon and HP
– In alternative piezo-electric type, a piezo crystal is used to force ink out of reservoir
– Electric current through piezo crystal force it to oscillate and create pressure on ink reservoir
– Advantages : no heating required, ink can be manufactured with more flexibility, no speed
restrictions, more control over sizes of ink droplets by varying current through crystal

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 49


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Output on Printers


• Adjusting print resolutions
– Let w and h be width and height of image in pixels
– Let R be the resolution in dpi
– Printed dimensions W and H of image is given by following

– To reduce W and H to W’ and H’ (W’ < W, H’ < H) but keep w and h intact
– Resolution R to be increased to R’ (R’ > R) given by

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 50


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image File Formats


• BMP
– Native uncompressed format for Window, supports 24-bit images

• JPEG
– 24-bit lossy compressed format based on Transform coding, for viewing photographic images

• GIF
– 8-bit format based on CLUT, supports transparency, suitable graphics, maps, logo etc.

• TIFF
– 24-bit format based on lossless compression like LZW, for printing and archiving images

• PNG
– 24-bit lossless compression for Web applications, supports transparency

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 51


RANJAN PAREKH Principles of MULTIMEDIA, 2E © 2013 Tata McGraw-Hill Education

Image Processing Software


• Major Features
– Object selection
– Color selection
– Painting and Drawing
– Anti-aliasing and Dithering
– Gradients
– Text
– Transformations
– Tonal adjustments and Color adjustments
– Retouching
– Layers
– Channels
– Cloning
– Masks
– Erase and Move
– Thresholding
– Filters

CONTENTS INSTRUCTOR'S MATERIALS Chapter – 3 : 52

You might also like