You are on page 1of 98





DIGITAL IMAGE PROCESSING UNIT I DIGITAL IMAGE FUNDAMENTALS AND TRANSFORMS Elements of visual perception – Image sampling and quantization basic relationship between pixels – Basic geometric transformations – Introduction to fourier transform and DFT – Properties of 2D fourier transform – FFT – Separable image transforms – Walsh- Hadamard – Discrete cosine transform, Haar, Slant-Karhunen – Love transforms. UNIT II IMAGE ENHANCEMENT TECHNIQUES Spatial domain methods: Basic grey level transformation – Histogram equalization – Image subtraction – Image averaging – Spatial filtering – Smoothing, sharpening filters – Laplacian filters – Frequency domain filters – Smoothing – Sharpening filters – Homomorphic filtering. UNIT III IMAGE RESTORATION Model of image degradation/restoration process – Noise models – Inverse filtering – Least mean square filtering – Constrained least mean square filtering – Blind imager– Pseudo inverse – Singular value decomposition. UNIT IV IMAGE COMPRESSION Lossless compression: variable length coding – LZW coding – Bit plane coding– Predictive coding– DPCM. Lossy Compression: Transform coding – Wavelet coding – Basics of image compression standards – JPEG, MPEG, basics of vector quantization. UNIT V IMAGE SEGMENTATION AND REPRESENTATION Edge detection – Thresholding – Region based segmentation – Boundary representation – Chair codes– Polygonal approximation – Boundary segments – Boundary descriptors – Simple descriptors– Fourier descriptors – Regional descriptors – Simple descriptors– Texture. TEXT BOOK 1. Rafael C. Gonzalez, Richard E. Woods, “Digital Image Processing”, 2nd Edition, Pearson Education, 2003. REFERENCES 1. William K. Pratt, “Digital Image Processing” , John Willey ,2001 2. Millman Sonka, Vaclav Hlavac, Roger Boyle, Broos/Colic, Thompson Learniy, Vision, “Image Processing Analysis and Machine”, 1999.

UNIT I DIGITAL IMAGE FUNDAMENTALS AND TRANSFORMS Elements of visual perception – Image sampling and quantization basic relationship between pixels – Basic geometric transformations – Introduction to fourier transform and DFT – Properties of 2D fourier transform – FFT – Separable image transforms – Walsh- Hadamard – Discrete cosine transform, Haar, Slant-Karhunen – Love transforms.


• There

are two types of projections (P) of interest to us:

1. Perspective Projection – Objects closer to the capture device appear bigger. Most image formation situations can be considered to be under this category, including images taken by camera and the human eye. 2. Ortographic Projection – This is “unnatural”. Objects appear the same size regardless of their distance to the “capture device”.

Both types of projections can be represented via mathematical formulas. Ortographic projection is easier and is sometimes used as a mathematical convenience.

λ). Z .Sensitivity • Once we have cp(x0. y 0). y 0. • V (λ ) is the sensitivity function of a capture device.° Inside the Camera . λ) the characteristics of the capture device take over. Each capture device has such a function which determines how sensitive it is in capturing the range of wavelengths (λ) present in cp(x0. • The result is an “image function” which determines the amount of reflected light that is captured at the camera coordinates (x0. y 0.

λ)V (λ)dλ (1) . y 0. y 0 ) = ° cp(x0.f (x 0 .

This is an unrealistic capture device which has sensitivity only to a single wavelength λ0 as determined by the delta function. However there are devices that get close to such “selective” behavior. y ) = = 0 ° 0 0 cp (x . λ)δ (λ − λ0 )dλ 3. y 0 . f2 (x 0 . y ) = 0 0 Z cp (x0 . y 0 ) = cp (x0 . y 0 . λ)V1 (λ)dλ 2. y . λ 0 ) Z Z Z cp (x0 . λ) 0 dλ . This is what happens if you take a picture without taking the cap off the lens of your camera. λ)V2 (λ)dλ = = cp (x 0 . y 0 . λ)V3 (λ)dλ = 0 0 Z cp (x0 . f 1 (x . f 3 (x . y 0 . y 0 . This is the most realistic of the three. Sensitivity is concentrated in a band around λ0 .Let us determine the image functions for the above sensitivity functions imaging the same scene: 1.

green and blue. ° . y 0. λ)VG (λ)dλ cp(x0. imagine that it has three sensors at each (x0. λ)VR (λ)dλ cp(x0. λ)VB (λ)dλ three image functions can be used by display devices (such as your monitor or your eye) to show a “color” image. y 0.Sensitivity and Color • For a camera that captures color images. y 0. y ) = fG (x0. y 0 ) = fB (x0. y 0 ) = • These 0 0 Z Z Z cp(x0. outputting three image functions: f R (x . y 0 ) with sensitivity functions tuned to the colors or wavelengths red.

Digital Image Formation • The image function fC (x0. fmax]. • Digital computers • We have to discretize: ° . values taken by the image function are real numbers which again vary in a continuum or interval fC (x0. x0max] and y0 ∈ the respective intervals. cannot process parameters/functions that vary in a continuum. y 0 ) is still a function 0 . y0 [ymin max ] which vary in a continuum given by • The of x0 ∈ [x0 min . y 0) ∈ [fmin.

j ) < fmin + (k + 1)∆Q for k = 0. j ) = Q(fC (i. j )) (4) where Q(fC (i. j = 0. j ) (i = 0. . fmax]. . N − 1. j ). . . P − 1 ° . ∀(i. j )) = (k + 1/2)∆Q + fmin if and only if fC (i. . . . fmin + (k + 1)∆Q ) if and only if fmin + k ∆Q ≤ fC (i. We have the second step of discretization left. • Discretize the values fC (i. • fC (i. j ) ∈ [fmin + k ∆Q. . . . ˆ f C(i. j ) ∈ [fmin . j ) to P levels as follows: Let ∆Q = fmax− Pfmin .Quantization • fC (i. . . M − 1).

let us say that ˆC(i. as taking integer values k where 0 ≤ k ≤ (5) ˆC (i. . .Quantization to P levels • Typically P = 28 = 256 and we have log2 (P ) = log2(28) = 8 bit quantization. .e. fmax and unless otherwise stated assume that the original digital images are quantized to 8 bits or 256 levels. j ) • To denote this refer to f 255. • We have thus achieved the second step of discretization. . • From now on omit references to fmin. 255} f ° . j ) ∈ {0. i..

B) Parameterization of Full Color Images ˆ ˆ fˆ → R (i. B ) parameterization of the “color space” of the full color image. fB(i. j ) full color image .(R. ° . j ). j ). j ) are called the (R. . j ).G. G. • There are other parameterizations. each with its own advantages and disadvantages. fG(i. f G(i. j ) ˆ and f B (i. ⇒ • ˆ f R ˆ (i. .

Hence we will mainly work with grayscale images in order to avoid the various nuances involved with different parameterizations. j ) • A grayscale or luminance image can be considered to be one of the components of a different parameterization. in this class will be on general processing. • Advantage: • Our emphasis ° .Grayscale Images ˆ “Grayscale” image f gray (i. It captures most of the “image information”.

. . • From now on suppress (ˆ)gray and denote an image as a matrix “A” (or .Images as Matrices • Recalling the image formation operations we have discussed. note that ˆ the image f gray (i. . j ) is an N × M matrix with integer entries in the range 0. 255. .

N − 1 . .. M − 1. j ) ∈ {0. the Laplacian. . . . . . . . . .B. 255} into a new matrix B which may not have integer entries! In these cases we must suitably scale and round the elements of B in order to display it as an image. . . . etc. . . Convolution and Correlation . . 255} for i = 0. j = 0. Computer Vision & Digital Image Processing Fourier Transform Properties. . j ) ∈ {0.) with elements A(i. . . • So we • Some will be processing matrices! processing will take we will do an image A with A(i.

v) – i.y) in the spatial domain .v+N) = F(u+N.e. only N values of each variable are required to obtain f(x. – Similar comments may be made for f(x.v) = F(u.v) = F(u+N. F(u.v) repeats itself infinitely for many values of u and v.v) in the frequency domain.y) from F(u.Periodicity of the Fourier transform • The discrete Fourier transform (and its inverse) are periodic with period N.v+N) • Although F(u. Only one period of the transform is necessary to specify F(u.

y) is real (true for all of our cases). move (shift) the origin of the transform to the point u=N/2 9-4 .-v) or.v)=F*(-u. the Fourier transform exhibits conjugate symmetry F(u.v) Implications of periodicity & symmetry • Consider a 1-D case: – F(u) = F(u+N) indicates F(u) has a period of length N – |F(u)| = |F(-u)| shows the magnitude is centered about the origin • Because the Fourier transform is formulated for values in the range from [0. the more interesting |F(u.v) is the complex conjugate of F(u.v)| = |F(-u.-v)| where F*(u. the result is two back-to-back half periods in this range • To display one full period in the range.N-1].Conjugate symmetry of the Fourier transform • If f(x.

n-1] Shifted spectrum with a full period in the same range Periodicity properties: 2-D Example .Periodicity properties Fourier spectrum with back-to-back half periods in the range [0.

y )} + ℑ{ f 2 ( x. y) 1 F (0.Distributivity & Scaling • The Fourier transform (and its inverse) are distributive over addition but not over multiplication • So. y )} • For two scalars a and b. y )} = ℑ{ f1 ( x. y ) + f 2 ( x. f ( x. y )} ℑ{ f1 ( x. for u=v=0. y ) = 1 N2 N −1 N −1 x =0 y = 0 ∑∑ f ( x.0) = 1 N N −1 N −1 x =0 y = 0 ∑∑ f ( x. af ( x. y) • From the definition of F(u.v). y )} ≠ ℑ{ f1 ( x. y )}× ℑ{ f 2 ( x. ℑ{ f1 ( x. y ) = . y ) ⇔ aF (u. v / b) ab Average Value • A widely used expression for the average value of a 2-D discrete function is: f ( x. by ) ⇔ F (u / a.0) N • Therefore. y ) × f 2 ( x. v) 1 f (ax. F (0.

y ) = ∂2 f ∂2 f 2 + 2 ∂x ∂y • From the definition of the 2-D Fourier transform. for u=1:128 for v=1:128 Fedge(u. Fedge=zeros(128).v). 0 .v). end end fedge=ifft2(Fedge). ℑ{∇ 2 f ( x. use the Laplacian % to construct an edge outlined % representation of the f(x. F=fft2(f).fmap]=bmpread('lena128. v) • The Laplacian operator is useful for outlining edges in an image The Laplacian: Matlab example % Given F(u.bmp'). y )} ⇔ −(2π ) 2 (u 2 + v 2 ) F (u .The Laplacian • The Laplacian of a two variable function f(x.^2*(u.^2)*F(u. image(real(fedge)).y) [f.colormap(gray(256).^2+v.y) is given as: ∇ 2 f ( x.v)=(2*pi).

• Example: Consider the following functions f(α ) and g(α ) f(α) g(α) 1 1/2 1 α 1 α 1-D convolution example • Compute g(-α) by folding g(α) about the origin g(α) 1/2 g(−α) 1/2 α 1 -1 α • Compute g(x-α) by displacing g(-α) by the value x g(−α) 1/2 -1 g(x−α) 1/2 α -1 x α .Convolution & Correlation • The convolution of two functions f(x) and g(x) is denoted f(x)*g(x) and is given by: f ( x) * g ( x) = ∫ f (α ) g ( x − α ) dα −∞ +∞ • Where α is a dummy variable of integration.

for any value x.α) 1 1 α 1 α 1-D convolution example (continued) • Thus we have 0 ≤ x ≤1 ⎧x / 2 ⎪ f ( x) * g ( x) = ⎨1 − x / 2 1 ≤ x ≤ 2 ⎪0 elsewhere. we multiply g(x-α) and f(α) and integrate from -∞ to +∞ • For 0≤x ≤ 1 we have For 1 ≤ x ≤ 2 we have f(α)g(x. f(x)*g(x) 1/2 1 2 x .α) 1 f(α)g(x. ⎩ • Graphically.1-D convolution example (continued) • Then.

• Graphically this is: A x0 x Aδ(x-x0) . Aδ(x-x0) is impulse of strength A at x=x0.Convolution and impulse functions • Of particular interest will be the convolution of a function f(x) with an impulse function δ(x-x0) +∞ −∞ ∫ f ( x)δ ( x − x 0 )dx = f ( x0 ) • The function δ(x-x0) may be viewed as having an area of unity in an infinitesimal neighborhood around x0 and 0 elsewhere. That is +∞ −∞ ∫δ (x − x 0 ) dx = ∫ δ ( x − x0 ) dx = 1 − x0 + x0 Convolution and impulse functions (continued) • We usually say that δ(x-x0) is located at x=x0 and the strength of the impulse is given by the value of f(x) at x=x0 • If f(x)=A then.

Convolution with an impulse function • Given f(x) is A f(α) • and g(x)=δ(x+T)+ δ(x)+ δ(x-T) α α -T T x g(α) Convolution with an impulse function (continued) • f(x)*g(x) is A −Τ α Τ x .

Convolution and the Fourier transform • f(x)*g(x) and F(u)G(u) form a Fourier transform pair • If f(x) has transform F(u) and g(x) has transform G(u) then f(x)*g(x) has transform F(u)G(u) f ( x ) * g ( x ) ⇔ F (u ) G (u ) f ( x ) g ( x ) ⇔ F (u ) * G (u ) • These two results are commonly referred to as the convolution theorem Frequency domain filtering • Enhancement in the frequency domain is straightforward – Compute the Fourier transform – Multiply the result by a filter transform function – Take the inverse transform to produce the enhanced image • In practice. some problems are not easily addressable by spatial techniques – Such as homomorphic filtering and some image restoration techniques . small spatial masks are used considerably more than the Fourier transform because of their simplicity of implementation and speed of operation • However.

e.v) is the Fourier transform of an image to be smoothed • The problem is to select an H(u.v) • We will consider zero-phase-shift filters that do not alter the phase of the transform (i.v) is the distance from the point (u. v ) F (u .v) that yields an appropriate G(u. v) = ⎨ ⎩0 if D(u. v) ≤ D 0 H (u .v) to the center of the frequency plane D (u . v ) = u 2 + v 2 H(u.Lowpass frequency domain filtering • Given the following relationship G (u. v) • where F(u.v) v u .v) in exactly the same manner) Ideal lowpass filter (ILPF) • A transfer function for a 2-D ideal lowpass filter (ILPF) is given as ⎧1 if D(u. they affect the real and imaginary parts of F(u. v) > D 0 • where D0 is a stated nonnegative quantity (the cutoff frequency) and D(u. v) = H (u .

v ) u =0 v = 0 • where P(u. v ) = R 2 (u . v) encompassed by the circle) .Ideal lowpass filter (ILPF) (continued) • The point D0 traces a circle from the frequency origin giving a locus of cutoff frequencies (all are at distance D0 from the origin) • One way to establish a set of “standard” loci is to compute circles that encompass various amounts of the total signal power PT N −1 N −1 • PT is given by PT = ∑∑ P (u . v) = F (u . a circle of radius r encompasses β percent of the power. where ⎡ ⎤ β = 100 ⎢∑∑ P (u .v) is given as P(u . v) + I 2 (u . v ) 2 • For the centered transform. v) / PT ⎥ (the summation ⎣ u v ⎦ is over all points (u.


Define sampling and quantization 27. What is meant by path? 36. 34. What are the steps involved in DIP? 16. Define Digital image? 14. Differentiate photopic and scotopic vision? 26. What is Image Transform? . What is geometric transformation? 40. 33. Write short notes on neighbors of a pixel. What do you meant by Color model?. What are the types of light receptors? 19. Define Tapered Quantization? 5. What is meant by pixel? 13. Write the expression to find the number of bits to store a digital image? 30. Define Resolutions? 12. List the hardware oriented color models? 8. Find the number of bits required to store a 256 X 256 image with 32 gray levels? 28. What do you meant by Zooming and shrinking of digital images? 32. What is Dynamic Range? 3. What is Hue of saturation? 9. 11. 7. What are the properties of Haar and slant transform. Specify the elements of DIP system? 18. What do you meant by Gray level? 6. Explain separability property in 2D fourier transform 10. Define Image? 2.UNIT 1 2 marks 1. Define Brightness? 4. Explain the types of connectivity.

(or) Explain various functional block of digital image processing # Image acquisition # Preprocessing # Segmentation # Representation and Description # Recognition and Interpretation 2. Write short notes on sampling and quantization. Adjacency.16 MARKS UNIT I 1. # Acquisition # Storage # Processing # Communication # Display 6.Cones and Rods 3. Explain the basic relationships between pixels? # Neighbors of a pixel # Connectivity. Path # Distance Measure # Arithmetic and Logic Operations . Describe the elements of visual perception. # Sampling # Quantization # Representing Digital Images 5. Describe image formation in the eye with brightness adaptation and discrimination # Brightness adaptation # Subjective brightness # Weber ratio #Mach band effect #simultaneous contrast 4. Explain the steps involved in digital image processing. # Cornea and Sclera # Choroid – Iris diaphragm and Ciliary body # Retina. Describe the functions of elements of digital image processing system with a diagram.

Discuss the properties and applications of 1)Hadamard transform 2)Hotelling transform . # Separability # Translation # Periodicity and Conjugate Symmetry # Rotation # Distribution and Scaling # Average Value # Laplacian # Convolution and correlation # Sampling 8. # FFT Algorithm # FFT Implementation 10. ( i )Explain convolution property in 2D fourier transform.7. Explain Fast Fourier Transform (FFT) in detail. Explain in detail the different separable transforms # Forward lD DFT & 2D DFT # Inverse lD DFT & 2D DFT # Properties 11. Explain the properties of 2D Fourier Transform. Explain Hadamard transformation in detail. # lD DHT # lD Inverse DHT # 2D DHT # 2D Inverse DHT 12. * lD Continuous * lD Discrete * lD convolution theorem * 2D continuous * 2D Discrete * 2D convolution theorem (ii) Find F (u) and |F (u)| 9.

Cx=E{(X-Mx)(X-Mx)} M T For M samples. Explain Haar transform in detail. Xl X2 . Consider a set of n or multi-dimensional discrete signal represented as column vector xl. Xn X= The mean vector is defined as Mx=E{x} Where E{x} is the expected value of x.# Properties of hadamard: Real and orthogonal fast transform faster than sine transform Good energy compaction for image # Appl: Image data compression. Cx=l/M ∑ (xk-Mx)(xk-Mx).MX) . filtering and design of course # Properties of hotelling: Real and orthogonal Not a fast transform Best energy compaction for image # Appl: Useful in performance evaluation & for finding performance bounds 13.…xn each having M elements. M For M vector samples mean vector is Mx=l/M ∑ Xk K=l T The co-variant matrix is. .x2. # Def P= 2P+q-l # Find h k (z) 14. K=l K-L Transform Y= A (X. Explain K-L transform in detail.

UNIT II IMAGE ENHANCEMENT TECHNIQUES Spatial domain methods: Basic grey level transformation – Histogram equalization – Image subtraction – Image averaging – Spatial filtering – Smoothing. • These pixel values in the input image may be difficult to distinguish . sharpening filters – Laplacian filters – Frequency domain filters – Smoothing – Sharpening filters – Homomorphic filtering. Dynamic Range. Visibility and Contrast Enhancement • Contrast enhancing point functions we have discussed earlier expand the dynamic range occupied by certain “interesting” pixel values in the input image.

. learn how to calculate hB (l) given hA(l) and the point function • The relationship • You must g ( l ): – Usually via writing a matlab script that computes hB (l) from hA(l) and g(l).and the goal of contrast enhancement is to make them “more visible” in the output image. between hB (l) and hA(l) may not be straightforward as we have already discussed in Lecture 2. – By sketching hB (l) given the sketches for hA(l) and g(l). • Don’t forget we have a limited dynamic range (0 − 255) at our disposal. j )) results in a new histogram hB (l) for the output image that is different from hA(l). Point Functions and Histograms • In general a point operation/function B (i. j ) = g (A(i.

° .

.“Unexp ected” Effect of some Point Functions − B has ∼ 10 times as few distinct pixel values. − Note also the vertical axis scaling in hB (l).

rounding. • Given an • g (l) . j )) Suppose g(l) represents an overall point function which includes contrast stretching/compression. j ) = g (A(i.Stretched/Compressed Pixel Value Ranges • B (i. may not be “continuous” or connected and it also may not be composed of connected line segments. image matrix A. emphasis/de-emphasis. normalizing etc. B (i. j ) = g(A(i. j )) is also an image matrix.

regions. from an image is a very difficult problem. etc. cars etc.. histogram based image segmentation is a very simple algorithm that is sometimes utilized as an initial guess at the “true” segmentation of an image. requiring sophisticated algorithms that work in tandem. then segmentation is the decomposition of an image into these objects and regions by associating or “lab elling” each pixel with the object that it corresponds to. Computer automated segmentation is a difficult problem. such as segmenting humans. It is still considered unsolved and is actively researched. segmentation.Image Segmentation • If one views an image as depicting a scene composed of different objects. • Most • • “High level” • Based ° . on point processing. humans can easily segment an image.

. the pixels with pixel values within each Rt via a point function. t = 1. . . . . where T is the total number of segments. typically obtained as a range of pixel values that correspond to a hill of hA(l). 255) into “discrete” intervals Rt = [at. . . decompose the range of pixel values (0.Histogram Based Image Segmentation • For a given image. ° . T . . bt ]. is assumed to be composed of • Each Rt is • “Lab el” • Main Assumption: Each object pixels with similar pixel values.

Limitations • Histogram based segmentation operates on each image pixel independently. B4. the main assumption is that objects must be composed of pixels with similar pixel values. In practice. For example. independent processing ignores a second important property: Pixels within an object should be spatially connected. • This • ° . As mentioned earlier. one would use histogram based segmentation in tandem with other algorithms that make sure that computed objects/regions are spatially connected. B3. B5 group spatially disconnected objects/regions into the same segment.

j )). j ) = g A (A(i.e. i. then possible irrespective of hA(l) our aim is to make hB (l) as uniform/flat as • Histogram equalization will help us: an image such that: ∗ Pixel values that occur frequently in A occupy a bigger dynamic range in B.. – Stretch/Compress ∗ Pixel values that occur infrequently in A occupy a smaller dynamic range in B. ° .e. e • If B (i. we will now design a special point function gA which is called the histogram equalizing point function for A. i. get compressed and become less visible..Histogram Equalization • For e (l ) a given image A. • The e techniques we are going to use to get g A (l) are also applicable in histogram modification/specification. get stretched and become more visible. – Compare images by “mapping” their histograms into a standard histogram and sometimes “undo” the effects of some unknown processing.

Note that g1(l) ∈ [0. • Let g1(l) = Pl k =0 pA (k ) • Image A ⇒ •in “equalize image” ⇒ B (i. j ) = ge ( A(i.Histogram Equalizing Point Function . . to obtain the equalized image. to construct geA(A(i. j )) fast. A general pB (l) will not be a uniform probability mass function but hopefully it will be close. j )). you can use >> B = gAe(A + 1). 1]. • In matlab >> help filter • Assuming you gAe is an array that contains the computed g e (l)A .

stretches the range of pixel values that occur frequently in A. compresses the range of pixel values that occur infrequently in ° .Stretching and Compression e •g A (l ) e •g A (l ) A.

Example ° .

compare their equalized versions.Comparison/“Undoing” Instead of comparing A and C. ° .

1 .contd.Comparison/“Undoing” .

Histogram Equalization

• gl (l) =


k =0 pA (k )

= gl (l) — gl (l — 1) = pA(l) =

h A (l ) NM

(l = 1, . . . , 255).

e • gA (l) = round(255gl (l)) image A.

is the histogram equalizing point function for the

• B (i, j ) = g e A (A(i, j ))

is the histogram equalized version of A. • In general, histogram equalization stretches/compresses an image such that:
– Pixel values that occur frequently in A occupy a bigger dynamic range in B, i.e., get stretched and become more visible. – Pixel values that occur infrequently in A occupy a smaller dynamic range in B, i.e., get compressed and become less visible.

• Histogram

equalization is not ideal, i.e., in general B will have a “flatter” histogram than A, but pB (l) is not guaranteed to be uniform (flat).

Random Images - Images of White Noise

• A single outcome of a χ ∈ [0, 1] in matlab: >> • An N × M • An N × M

continuous amplitude uniform random variable
x = rand(1, 1);

matrix of outcomes of a continuous amplitude uniform random variable χ ∈ [0, 1] in matlab: >> X = rand(N, M ); image matrix of outcomes of a discrete amplitude uniform random variable Θ ∈ {0, 1, . . . 255} in matlab: >> A = round(255 ∗ X ); gaussian random variable

• A single outcome of a continuous amplitude χ (µ = 0, σ 2 = 1) in matlab: >> x = randn(1, 1); • An N × M • An N ×M

matrix of outcomes of a continuous amplitude gaussian random variable χ (µ = 0, σ2 = 1) in matlab: >> X = randn(N, M ); image matrix of outcomes of a discrete amplitude “gaussian” random variable Θ ∈ {0, 1, . . . 255}: A(i, j ) = g s X (X (i, j )).


Warning • Remember. two totally different images may have very similar his- tograms. .

. . . we would like to generate an image C such that hC (l) ∼ hB (l).bility mass function pB (l)).Histogram Matching Specification • Given images A and B. using point processing we would like to generate an image C from A such that hC (l) ∼ hB (l). . . . 255).age. . • More generally. . • Histogram matching/specification enables us to “match” the grayscale distribution in one image to the grayscale distribution in another im. (l = 0. given an image A and a histogram hB (l) (or sample proba. . 255). (l = 0.

y) . What is histogram? Explain histogram equalization. Explain image enhancement in the frequency domain. r(x. Explain the 2 categories of image enhancement. What is contrast stretching? 4. Specify the objective of image enhancement technique. 6. What is meant by masking? 7. Explain spatial filtering in image enhancement. Define image subtraction. # Smoothing filters # Sharpening filters # Homomorphic filtering 7.Define Histogram. # used for highlighting fine details # HPF-output gets sharpen and background becomes darker # High boost. Write the application of sharpening filters? 16 Marks 1. y) # Calculate the enhanced image g(x. y) .First and Second order derivatives Appl: # Medical image # electronic printing # industrial inspection 5. Explain Homomorphic filtering in detail. 3.What is meant by Histogram Equilisation 9. # f(x. # P(rk) = nk/n # Ps(s) = l means histogram is arranged uniformly.UNIT II 2 Marks 1. 8. What are image sharpening filters. 10. Explain the various types of it. What is meant by laplacian filter? 11. Gray level Slicing. Discuss the image smoothing filter with its model in the spatial domain. What is grey level slicing? 5. Explain the types of gray level transformation used for image enhancement. # Basics # Smoothing filters # Sharpening filters 6. 2. Differentiate linear spatial filter and non-linear spatial filter.output gets sharpen but background remains unchanged # Derivative. Bit plane Slicing) 2. y) = i(x. # LPF-blurring # Median filter – noise reduction & for sharpening image 4. 3. # Linear (Negative and Identity) # Logarithmic( Log and Inverse Log) # Power_law (nth root and nth power) # Piecewise_linear (Constrast Stretching.

UNIT III IMAGE RESTORATION Model of image degradation/restoration process – Noise models – Inverse filtering – Least mean square filtering – Constrained least mean square filtering – Blind imager– Pseudo inverse – Singular value decomposition. Image restoration • Restoration is an objective process that attempts to recover an image that has been degraded – A priori knowledge of the degradation phenomenon – Restoration techniques generally oriented toward modeling the degradation – Application of the inverse process to “recover” the original image – Involves formulating some criterion (criteria) of “goodness” that is used to measure the desired result .

y) η ( x. f ( x. y) Degradation Function H g ( x. – The more that is known about H and the noise term the closer the estimate can be • Various types of restoration filters are used to accomplish this. some knowledge about H. the objective is to produce an estimate of the original image.Image restoration (continued) • Removal of blur by a deblurring function is an example restoration technique • We will consider the problem only from where a degraded digital image is given – Degradation source will not be considered here • Restoration techniques may be formulated in the – Frequency domain – Spatial domain Image degradation/restoration process • Given g(x. y ) .y). and some knowledge about the noise term. y ) + Noise Restoration filter(s) fˆ ( x.

we will assume that noise is independent of spatial coordinates and uncorrelated to the image . then the degraded image can be described as the convolution of h and f with an added noise term: g ( x. the noise is usually called white noise • A carry over from the fact that white light contains nearly all frequencies in the visible spectrum in basically equal proportions – Excepting spatially periodic noise. the representation is: G (u.y) is the spatial domain representation of the degradation function. v) + N (u . Noise models • Common sources of noise – Acquisition • Environmental conditions (heat. v ) F (u . y ) + η ( x. if the Fourier spectrum of the noise is constant.Image degradation/restoration process • If H is a linear. y ) ∗ f ( x. v) • Each term in this expression is the Fourier transform of the of the corresponding terms in the equation above. y ) • h(x. light). position invariant process. • In the frequency domain. imaging sensor quality – Transmission • Noise in transmission channel • Spatial and frequency properties of noise – Frequency properties of noise refer to the frequency content of noise in the Fourier sense – For example. y ) = h ( x. v) = H (u .

is given to the right as: • In this case. z. approximately 70% of the values of z will be within within one standard deviation • Approximately 95% of the values of z will be within within two standard deviations p( z) = where z represents intensity z represents the mean (average) value of z 1 2π σ e −( z − z ) 2 / 2σ 2 σ is the standard deviation σ 2 is the variance of z .Noise probability density functions • With respect to the spatial noise term. we will be concerned with the statistical behavior of the intensity values. • May be treated as random variables characterized by a probability density function (PDF) • Common PDFs used will describe: – – – – – – Gaussian noise Rayleigh noise Erlang (Gamma) noise Exponential noise Uniform noise Impulse (salt-and-pepper) noise Gaussian noise • Gaussian (normal) noise models are simple to consider • The PDF of a Gaussian random variable.

from the origin • The basic shape of this PDF is skewed to the right – Can be useful in approximating skewed histograms Erlang (Gamma) noise • The PDF of Erlang noise is given as: ⎧ a b z b −1 − az ⎪ e p ( z ) = ⎨ (b − 1)! 0 where z represents intensity z =b/a for z ≥ 0 for z < 0 σ 2 = b / a2 • a > 0.Rayleigh noise • The PDF of Rayleigh noise is given as: ⎧2 ⎪ ( z − a )e − ( z − a ) p( z ) = ⎨ b ⎪ ⎩0 where z represents intensity z = a + πb / 4 b(4 − π ) 4 2 / b for z ≥ a for z < a σ2 = • Note the displacement. by a. b is a positive integer .

Exponential noise • The PDF of exponential noise is given as: ⎧ae − az p( z) = ⎨ ⎩0 where z = 1/ a for for z z≥ <0 0 z represents intensity σ 2 = 1/ a2 • a>0 • This PDF is a special case of the Erlang PDF with b=1 Uniform noise • The PDF of uniform noise is given as: ⎧ 1 ⎪ if a ≤ z ≤ b p( z ) = ⎨ b − a 0 otherwise where z represents intensity z= a +b 2 (b − a ) 2 = 12 σ2 .

Impulse (salt-and-pepper) noise • The PDF of (bipolar) impulse noise is given as: ⎧ Pa for z = a ⎪ p( z) = ⎨ P b for z = b ⎪ ⎩ 0 otherwise • If b>a then any pixel with intensity b will appear as a light dot in the image • Pixels with intensity a will appear as a dark dot Example noisy images .

Example noisy images (continued) .


a uniform gray surface under uniform illumination) • Study characteristics of resulting image(s) to develop an indicator of system noise .Sample periodic images and their spectra 50 50 100 100 150 150 200 200 250 50 100 150 200 250 250 50 100 150 200 250 122 124 126 128 130 132 134 136 105 110 115 120 125 130 135 140 145 150 Estimation of noise parameters • Noise parameters can often be estimated by observing the Fourier spectrum of the image – Periodic noise tends to produce frequency spikes • Parameters of noise PDFs may be known (partially) from sensor specification – Can still estimate them for a particular imaging setup – One method • Capture a set of “flat” images from a known setup (i.e.

then the mean and variance are all that is needed to construct a model for the noise (i.…L-1 • denote the probability estimates of the intensities of the pixels in S. then a constant (with the exception of the noise) area of the image is needed to calculate Pa and Pb probabilities for the impulse PDF .e.2. estimate the PDF function of the noise from small strips of reasonably constant background intensity • Consider a subimage (S) and let ps(zi). i=0. then the Rayleigh shape parameters (a and b) can be calculated using the mean and variance – If the noise is impulse. the mean and the variance completely define the Gaussian PDF) – If the shape is Rayleigh.1. • L is the number of possible intensities in the image • The mean and the variance of the pixels in S are given by: z = ∑ zi p ( z ) and σ =0 s i i L −1 2 = ∑ ( z i − z ) 2 p ( zi ) i =0 s L −1 Estimation of noise parameters (continued) • The shape of the noise histogram identifies the closest PDF match – If the shape is Gaussian.Estimation of noise parameters (continued) • If only a set of images already generated by a sensor are available.

Histograms from noisy strips of an area of an image Restoration in the presence of noise only –spatial filtering • When only additive random noise is present. spatial filtering is commonly used to restore images • Common types – Mean filters – Order-Statistic filters – Adaptive filters .

t ) mn ( s . y ) = ⎢ f g ( s . but tends to loose less detail in the process .t )∈S xy – Achieves smoothing comparable to the arithmetic mean filter.t )∈S xy – The operation is generally implemented using a spatial filter of size m*n in which all coefficients have value 1/mn – A mean filter smoothes local variations in an image – Noise is reduced as a result of blurring Mean filters (geometric) • Geometric mean filter – A restored pixel is given by the product of the pixels in an area defined by a window (neighborhood).Mean filters (arithmetic) • Arithmetic mean filter – Computes the average value of a corrupted image g(x. y ) = ∑ g ( s.y) in the area defined by a window (neighborhood) 1 ˆ f ( x. t )⎥ ∏ ⎢ ⎣( s . raised to the power 1/mn 1 ⎡ ⎤ mn ˆ ( x.

t )∈S xy ∑ 1 g (s. t ) – Works well for salt noise (fails for pepper noise) – Works well for Gaussian noise also .Arithmetic and geometric mean filter examples Mean filters (harmonic) • Harmonic mean filter – A restored pixel is given by the expression fˆ ( x. y ) = mn ( s .

t ) Q – – – – – Q is the order of the filter Works well for salt and pepper noise (cannot do both simultaneously) +Q eliminates pepper noise. t ) Q +1 ( s .Mean filters (contraharmonic) • Contraharmonic mean filter – A restored pixel is given by the expression ˆ ( x. -Q eliminates salt noise Q=0 → arithmetic mean filter Q=-1 → harmonic mean filter Contraharmonic mean filter examples .t )∈S xy ∑ g ( s. y ) = f ( s .t )∈S xy ∑ g ( s.

Contraharmonic mean filter examples .

Explain homogenity property in Linear Operator? 8. 5. Explain additivity property in Linear Operator? 4. •The SVD transform gives best energy packing efficiency for any given image.UNIT III 2 Marks 1. Explain image degradation model /restoration process in detail. Define Gray-level interpolation? 12. # Calculate f^ # Calculate F^(u. # Properties •The SVD transform varies drastically from image to image. > Direct measurement > Indirect estimation . # Image degradation model /restoration process diagram # Degradation model for Continuous function # Degradation model for Discrete function – l_D and 2_D 6. What is meant by Inverse filtering? Explain.minimum solution of linear equation and finding rank of large matrices. What are the two approaches for blind image restoration? Explain in detail. # U= m=l∑rψ√λm mφ T This equation is called as singular value decomposition of an image. What is the use of wiener filter in image restoration. Explain. •The SVD transform is useful in the design of filters finding least square. Define circulant matrix? 10. What is meant by Image Restoration? 2. What are the two methods of algebraic approach? 11. What are the two properties in Linear Operator? 3.What is meant by least mean square filter? 14. # Recovering i/p from its o/p # Calculate f^(x. Explain the algebra approach in image restoration. v) 3. How a degradation process is modeled? 5. Explain singular value decomposition and specify its properties. y) 4. Write the properties of Singular value Decomposition(SVD)? 16 Marks 1. What is pseudo inverse filter? 13. # Unconstrained # Constrained 2.

basics of vector quantization. International Electro-technical Commission (IEC) etc. Objectives At the end of this lesson. Describe the hierarchical JPEG approach. 10. image compression and coding tools and techniques. Without the availability of standards. the international standardization agencies. Describe the progressive JPEG approach through successive approximation. International Telecommunications Union (ITU). Towards the objective of setting up coding standards. 5. encoders and decoders can not communicate with each other. have formed expert groups and solicited proposals from industries. In this lesson. universities and research laboratories. This has resulted in establishing standards for bi-level (facsimile) images and continuous tone (gray scale) images. Introduction With the rapid developments of imaging technology. 7. Describe the progressive JPEG approach through spectral selection. the service providers will have to support a variety of formats to meet the needs of the customers and the customers will have to install a number of decoders to handle a large number of data formats. 9. Explain the need for standardization in image transmission and reception. Present the block diagrams of JPEG encoder and decoder. Illustrate the interleaved and non-interleaved ordering for color images. we are going to discuss the . it is necessary to evolve coding standards so that there is compatibility and interoperability between the image communication and storage products manufactured by different vendors. 3. Describe the baseline JPEG approach. Convert YUV images from RGB. MPEG. Describe the lossless JPEG approach. 6. such as International Standards Organization (ISO). 4. Name the coding standards for fax and bi-level images and state their characteristics. 8.UNIT IV IMAGE COMPRESSION Lossless compression: variable length coding – LZW coding – Bit plane coding– Predictive coding– DPCM. 2. Lossy Compression: Transform coding – Wavelet coding – Basics of image compression standards – JPEG. the students should be able to: 1.

Modified Huffman (MH) and Modified Relative Element Address Designate (MREAD) standards are used for text-based documents. These standards use the coding and compression techniques – both lossless and lossy which we have already studied in the previous lessons. but more recent .highlighting features of these standards. The first part of this lesson is devoted to the standards for bi-level image coding.

An uncompressed image would require transmission of 3. JBIG1 also supports progressive mode in which a reduced resolution starting layer image is followed by the transmission of progressively higher resolution layers. We are going to discuss in details about the Joint Photographic Experts Group (JPEG) standard and its different modes. end-of. such as baseline (sequential).000 bits for this scanned page. along with special end-of-line (EOL). proposed by the Joint Bi-level Experts Group uses a larger region of support for coding the pixels. which proceed in the direction of left to right in top to bottom order and also in between the scan lines. Coding Standards for Fax and Bi-level Images Consider an A4-sized (8. Binary pixel values are directly fed into an arithmetic coder. (b) Modified Relative Element Address Designate (MREAD): This algorithm uses a two-dimensional run length coding to take advantage of vertical spatial redundancy. along with horizontal spatial (EOP) and synchronization codes. The coding standards have exploited this redundancy to compress bi-level images. The MH algorithm on an average achieves a compression ratio of 20:1 on simple text documents. The position of each black-to-white or white-to-black transition is coded relative to a reference element in the current scan line. The compression ratios of JBIG1 standard is slightly better than that of MREAD for text images but has an improvement of 8-to-1 for binary halftone images. The compression ratio is improved to 25:1 for this algorithm. . The latter part of this lesson is devoted to the standards for continuous tone images. It is however seen that most of the information on the scanned page is highly correlated along the scan lines.5 in x 11 in) scanned page having 200 dots/in. proposed by the Joint bi-level experts’ group (JBIG) can efficiently encode handwritten characters and binary halftone images. The JBIG1 standard. Other than the sequential mode just described. The coding standards proposed for bi-level images are: (a) Modified Huffman (MH): This algorithm performs one-dimensional run length coding of scan lines.740. which utilizes a sequential template of nine adjacent and previously coded pixels plus one adaptive pixel to form a 10-bit context.standards like JBIG1 and JBIG2. It uses the previous scan line as a reference when coding the current line. progressive. hierarchical and lossless. (c) JBIG1: The earlier two algorithms just mentioned work well for printed texts but are inadequate for handwritten texts or binary halftone images (continuous images converted to dot patterns).

it becomes a token for a new class.(d) JBIG2: This is a more recent standard proposed by the Joint bi-level Experts Group. as frequently observed in Optical Character Recognition (OCR). Only in recent times. The JBIG2 standard is seen to be 20% more efficient than the JBIG1 standard for lossless compression. nor any unique IDCT algorithms. . The theory of the DCT has been already discussed in lesson-8 and will not be repeated here. It uses a soft pattern matching approach to provide a solution to the problem of substitution errors in which an imperfectly scanned symbol is wrongly matched to a different symbol. It should however be mentioned that to preserve freedom for innovation and customization within implementations. JPEG Encoder Figure shows the block diagram of a JPEG encoder. where p is the number of bits ( of each mark. which has the following components: (a) Forward Discrete Cosine Transform (FDCT): The still images are first partitioned into non-overlapping blocks of size 8x8 and the image samples are shifted from unsigned integers with range [0. known as JPEG is the most widely used one. Of these. JPEG neither specifies any unique FDCT algorithm. This new token is then coded using JBIG1 with a fixed template of previous pixels around the current mark. JPEG is a very simple and easy to use standard that is based on the Discrete Cosine Transform (DCT). the new standard JPEG-2000 has its implementations in still image coding systems.2 p − 1] to signed integers with range [− 2 p −1 . JBIG2 codes the bit. p = 8 ). In case a good match cannot be found for the current mark. Continuous tone still image coding standards A different set of standards had to be created for compressing and coding continuous tone monochrome and color images of any size and sampling rate. rather than its matched class index.2 p −1 ]. the Joint Photographic Expert Group (JPEG)’s first standard.

Huffman coding requires that one or more sets of coding tables are specified by the application. The same table used for compression is used needed to decompress it. level) pair. The quantized coefficients are zig-zag scanned. (c) Entropy Coder: This is the final processing step of the JPEG encoder.The implementations may therefore differ in precision and JPEG has specified an accuracy test as a part of the compliance test. It performs the inverse operation of the JPEG encoder. The DC coefficient is encoded as a difference from the DC coefficient of the previous block and the 63 AC coefficients are encoded into (run. The baseline sequential JPEG uses Huffman only. Modes of Operation in JPEG The JPEG standard supports the following four modes of operation: • Baseline or sequential encoding . as described in lesson-8. but not a requirement. Psycho-visual experiments have led to a set of quantization tables and these appear in ISOJPEG standard as a matter of information. The baseline JPEG uses only two sets of Huffman tables – one for DC and the other for AC. (b) Quantization: Each of the 64 coefficients from the FDCT outputs of a block is uniformly quantized according to a quantization table. each step-size should be chosen as the perceptual threshold or for “just noticeable distortion”. JPEG Decoder Figure shows the block diagram of the JPEG decoder. Since the aim is to compress the images without visible artifacts. The JPEG standard specifies two entropy coding methods – Huffman and arithmetic coding. but codecs with both methods are specified for the other modes of operation.

In baseline encoding. the first scan sends some specified low frequency DCT coefficients within each block. Hierarchical encoding Lossless encoding Baseline Encoding: Baseline sequential coding is for images with 8-bit samples and uses Huffman coding only. Each of these approaches is described below. Progressive Encoding: Unlike baseline encoding. It is very convenient for browsing applications. Each scan follows the zig zag ordering. With the first scan. It encodes and decodes complete 8x8 blocks with full precision one at a time and supports interleaving of color components. There are two forms of progressive encoding: (a) spectral selection approach and (b) successive approximation approach. which are higher in frequency than the previous scan. Here all the 64 DCT coefficients in a block are of 8-bit resolution and successive blocks are stacked . the quality of the image is refined. The spectral select on approach. You must have experienced this while downloading web pages containing images.• • • Progressive encoding (includes spectral selection and successive approximation approaches). since each scan contains only a part of the complete information. This procedure is called spectral selection. because each band typically contains coefficients which occupy a lower or higher part of the frequency spectrum for that 8x8 block. DC difference and zig-zag ordering proceeds. each block is encoded in a single left-to-right and top-to-bottom scan. bands of coefficients. where crude reconstruction quality at the early scans may be sufficient for quick browsing of a page. as done in baseline encoding. rather than a single one. quantization. but takes much less time to encode and decode. quantization and entropy coding. The corresponding reconstructed image obtained at the decoder from the first scan therefore appears blurred as the details in the forms of high frequency components are missing. are encoded and therefore the reconstructed image gets richer with details. In subsequent scans. The FDCT. each block in progressive encoding is encoded in multiple scans. In order to claim JPEG compatibility of a product it must include the support for at least the baseline encoding system. Progressive scanning through spectral selection: In this approach. as compared to the single scan of baseline encoding. a crude form of image can be reconstructed at the decoder and with successive scans.

Progressive scanning through successive approximation: This is also a multiple scan approach. starting with the most significant ones and progressively considering the lower frequency ones. The steps involved in hierarchical encoding may be summarized below: • • • Obtain the reduced resolution images starting with the original and for each. . The successive approximation approach. the finest resolution image on the lowermost layer and reduced resolution images on the successive upper layers. as described above. The organization of the DCT coefficients and the stacking of the blocks are same as before. but not to their full quantized accuracy. Here. the next lower significant bits of the coefficients are added and so on until all the bits are sent. The resulting reconstruction quality is good even from the early after the other in the scanning order. The spectral selection approach performs the slicing of coefficients horizontally and picks up a band of coefficients. Interpolate and up-sample it by a factor of two horizontally and/or vertically. Decode the above reduced resolution image. The successive approximation approach performs the slicing operation vertically and picks up a group pf bits. using the identical interpolation filter which the decoder must use. only the N most significant bits of each coefficient are encoded (N is specifiable) and in successive scans. that is. each scan encodes all the coefficients within a block. Encode the reduced resolution image from the topmost layer of the pyramid . Hierarchical encoding: The hierarchical encoding is also known as the pyramidal encoding in which the image to be encoded is organized in a pyramidal structure of multiple resolutions. Use this interpolated and up-sampled image as a predicted image for encoding the next lower layer (finer resolution) of the pyramid. reduce the resolution by a factor of two. with the original. Hierarchical encoding may be regarded as a special case of progressive encoding with increasing spatial resolution between the progressive stages. starting with low frequency and encodes them to full resolution. as the high frequency coefficients are present from the initial scans. In the first scan. Each layer decreases its resolution with respect to its adjacent lower layer by a factor of two in either the horizontal or the vertical direction or both.

IDCT can not exactly recover what the image was before IDCT. the image quality at low bit rates surpass the other JPEG encoding methods. the image may be printed by a high-resolution printer. it should have been possible to achieve lossless encoding by eliminating the quantization block. Repeat the steps of encoding and decoding until the lowermost layer (finest resolution) of the pyramid is encoded. Theoretically. In hierarchical encoding. but at the cost of increased number of bits at the full resolution. This led to a modified and simpler mechanism of predictive coding. but because of finite precision representation of the cosine kernels. progressive or lossless encoding. while it is being displayed on a low resolution monitor. For example. Lossless encoding: The lossless mode of encoding in JPEG follows a simple predictive coding mechanism. rather than having FDCT + Entropy coder for encoding and Entropy decoder + IDCT for decoding. Hierarchical encoding is used for applications in which a high-resolution image should be accessed by a low resolution display device. Hierarchical encoding (Pyramid structure) Figure illustrates the hierarchical encoding process. .• • Encode the difference between the image in the next lower layer and the predicted image using baseline.

Lossless JPEG encoding finds applications in transmission and storage of medical images.In lossless encoding. the encoding of which may be regarded as three independent gray scale image Prediction None A B C A+B-C A+(B-C)/2 B+(A-C)/2 (A+B)/2 . as illustrated in figure using one of the eight possible predictor modes listed here. the 8x8 block structure is not used and each pixel is predicted based on three adjacent pixels. Predictive coding for lossless JPEG An entropy encoder is then used to encode the predicted pixel obtained from the lossless encoder. Selection Value 0 1 2 3 4 5 6 7 Color image formats and interleaving The most commonly used color image representation format is RGB. Lossless codecs typically produce around 2:1 compression for color images with moderately complex scenes.

U3.Y2.5 2 R −Y + 0.3R + 0. Scan-3: 1.V3.U2. from efficient encoding considerations. since our eyes are relatively insensitive to the high frequency information from the chrominance channels and thus the chrominance components can be represented at a reduced resolution as compared to the luminance components for which full resolution representation is necessary.Y16. However.Y15. . It is possible to convert an RGB image into YUV.1B U= B −Y + 0. Y16. CIELUV.V4.V2. Scan-2: U1.6 V= YUV representation of an example 4x4 image Figure illustrates the YUV representation by considering an example of a 4x4 image.U4.6G + 0.5 1.Y3. The non-interleaved ordering can be shown as Scan-1: Y1. The U and the V components are sub-sampled by a factor of two in both horizontal and vertical directions and are therefore of 2x2 size. ……. The Y components are shown as Y1.encoding. Color spaces such as YUV. The three components may be transmitted in either a noninterleaved manner or an interleaved manner. using the following relations: Y = 0. These formats are more efficient from image compression considerations. CIELAB and others represent the chromatic (color) information in two components and the luminance (intensity) information in one component. Y2.……. RGB is not the best format.

the following image qualities were measured subjectively: Bits/pixel ≥2 1. Y4. This will be our topic in the next lesson. if both U and V are sub-sampled by a factor of two in either of the directions.5 0. Y6. Y5.75 0. Y3. . Y8.7:1 21. V1.5 0. U2.25 Quality Indistinguishable Excellent Very good Good Fair Compression Ratio 8:1 10. ……… Interleaving requires minimum of buffering to decode the image at the decoder. U1.The interleaved ordering encodes in a single scan and proceeds like Y1. each pixel requires 16-bits for representation.bits/sample for each of the two chrominance components U and V. JPEG Performance Considering color images having 8-bits/sample luminance components and 8.4:1 32:1 64:1 A more advanced still image compression standard JPEG-2000 has evolved in recent times. Y7. Using JPEG compression on a wide variety of such color images. Y2. V2.

Arithmetic coding b. Explain about Lossy compression? • Lossy predictive coding • Transform coding • Wavelet coding . • Definition of image compression • Variable Length Coding * Huffman coding * B2 Code * Huffman shift * Huffman Truncated * Binary Shift *Arithmetic coding 3.UNIT IV 2 Marks 1. Lossless Predictive coding 5. What are the operations performed by error free compression? 11. What are two main types of Data compression? 4. What is the need for Compression? 5. LZW coding c. What is run length coding? 9. Variable Length coding i. What is Variable Length Coding? 12. Define Huffman coding 16 Marks 1. Define interpixel redundancy? 8. Bit Plane coding d. Explain about Image compression model? • The source Encoder and Decoder • The channel Encoder and Decoder 4. Define compression ratio. What is image compression? Explain any four variable length coding compression schemes. Explain about Error free Compression? a. What is data redundancy? Explain three basic data redundancy? Definition of data redundancy The 3 basic data redundancy are > Coding redundancy > Interpixel redundancy > Psycho visual redundancy 2. What is Data Compression? 3. What is image compression? 2. Huffman coding ii. What are different Compression Methods? 7. 10.

Explain the schematics of image compression standard JPEG. • Lossy baseline coding system • Extended coding system • Lossless Independent coding system 7. Explain about Image compression standards? • Binary Image compression standards • Continuous tone still Image compression standards • Video compression standards 10. application • 1D. MPEG-2 3. MPEG-1 2.2D DCT 8. Explain how compression is achieved in transform coding and explain about DCT • Block diagram of encoder • decoder • Bit allocation • 1D transform coding • 2D transform coding. MPEG-4 • Block diagram • I-frame • p-frame • B-frame . Discuss about MPEG standard and compare with JPEG • Motion Picture Experts Group 1. Explain arithmetic coding • Non-block code • One example 9.6.

if G x. Usually in order to get the optimal value of T. It is a binary image.y): The segmentation result of G.y) indicates the intensity value of pixel (x.y): The input gray image that we want to segment. If GB(x.K] . otherwise it is classified as a background pixel. y 1 . Of course you can reverse the equation when you need to set the low intensity region as the foreground. which separates an image into two meaningful regions: foreground and background.UNIT V IMAGE SEGMENTATION AND REPRESENTATION Edge detection – Thresholding – Region based segmentation – Boundary representation – Chair codes– Polygonal approximation – Boundary segments – Boundary descriptors – Simple descriptors– Fourier descriptors – Regional descriptors – Simple descriptors– Texture. K takes the value of 255 and T is in the range of [0. Whenever the value of T is decided. . G(x. the segmentation procedure is indicated by the following equation: GB x. the value of GB(x.y) in the image G is classified as a foreground pixel. Equation (1) is formulated under the assumption that foreground pixels in the image G have relatively high intensity values and background pixels take low intensity values. GB(x.y) in the grey image G. Before talking about the algorithm.. Basic notations G(x. then pixel (x. first we list all the notions and statistic definitions that relate to histogram as follows. through a selected threshold value T. For example. If the image is a grey image. y T T (1) In equation (1). if the image is an 8-bit gray image. y 0 . How to select the value of T The major problem of thresholding segmentation is how to select the optimal value of threshold T.y) gives the category (foreground or background) that the corresponding pixel belongs to. T is an integer in the range of [0.y) = 1.255]. where K is the maximum intensity value. GB is the segmentation result. if G x. Actually it forms a binary image. in which each value of GB(x. What is thresholding segmentation? Thresholding segmentation is a method.y) is either 0 or 1 indicating the corresponding pixel (x..y) in G belongs to background or foreground respectively. we need to statically analyze the so-called “histogram” (or “intensity histogram”) of the input gray image G.

The frequency of background. The mean intensity values of background and foreground. then of course N = w h. F T i T 1 PG i (3) Of course the frequency of the entire image G is calculated as = B(T) + F(T) = 1. where i [0. K is the maximum intensity value as mentioned above (for example K = 255 for 8-bit grey images). Clearly PG(i) is a real value within the range [0. F(T) are defined as follows: T B K T i 0 PG i . Statistic analysis of normalized histogram Assume the current thresholding value is T. 2 F T i T 1 i F T F 2 P i T (5) Having the definition of variances of the background and the foreground. . we can get the so-called normalized histogram PG. T = 0: Calculate the mean intensity of the entire image. The thresholding value. .K] . the value of each PG(i) indicates the percentage of pixels in G that takes the intensity value i. Obviously HG(i) is an integer value within range [0. it is the time to define the so-called “within-class” variance. The value of HG(i) indicates the number of pixels in G that takes the intensity value.1] ... It is defined as follows: PG(i) = HG(i) / N (2) In equation (2). and height = h. 2 = 2within(T)+ 2between(T). B and F according to equation (7). where 2 between(TOpt) = max 0 T K 2 between T (10) In fact equation (10) is the usual way that we use to find the optimal thresholding value. therefore. 2B(T) and T 2 B Clearly no matter what value are defined as: T i 0 i B T B 2 P i K T . minimization of means maximization of 2between. N is the total number of pixels in G as mentioned above. The intensity variances of background and foreground. i. and 2 is independent of the selection of T. It is because that for each T. And the definition of normalized histogram makes this kind of comparison meaningful. If G has width = w. keeps the same. The total number of pixels in G. So the optimal value of T can also be taken as: Optimal value of T = TOpt. 2within: 2 within T B T B T F T F T 2 between: F 2 (6) Also we can define the so-called “between-class” variance. the calculation of 2between only needs the calculations of B..K] . no matter what value T takes. B(T) and the frequency of foreground. And these values can be updated iteratively: Initially.K: T: N: The maximum possible intensity value defined by G. We let T try all the intensity values from 0 to K and choose the one that gives the minimum “within-class” variance 2within as the optimal thresholding value. Definition of histogram and normalized histogram HG is the intensity histogram of image G and it maps from each intensity value to an integer. which separates the input image G into two regions: foreground and background according the equation (1). F. 2 F(T) The mean intensity value of the entire image can be calculated as: = B(T) B(T) + F(T) T takes. F T i T 1 i PG i F (4) F(T). Formally speaking: Optimal value of T = TOpt.N] .. Based on the definition of histogram HG. The main reason of introducing the normalized histogram is that sometime we need to compare two histogram from two images that contains different number of pixels. If G is an 8-bit gray image. K 2 i 0 2 indicates the intensity variance of the entire image G and it is calculated as: 2 i P i 2 (8) is a constant value independent to the selection of the value of T. B(T) and F(T) are calculated as: T B K T i 0 i PG i B . Otsu’s algorithm The Otsu’s algorithm is simple. Obviously given the image G.. then K takes the value 255. 2 between T 2 2 within T B T F T B T T (7) In the above equation. where 2 within(TOpt) = min 0 T K 2 within T (9) 2 within As we said before. It is an integer within the range [0.

y) is a foreground pixel.y)][GL(x’. FOR each neighborhood pixel (x’. ELSE B(T+1) = [ B(T) PG(T+1)] / B(T+1). and each element in the matrix is first set to 0. B(T) + (T+1) If F(T+1) = 0. (0) = 0. Th e entire algorithm of connect object counting is described as follows: Step 1: Create a label image GL with the same size (width and height) as GB.y) = –1. be careful if F(0) =0.. Assume here we interest in the foreground (for background region. B (0) Part2: Connect Object Recognition After obtaining the binary image GB.y). F(T+1) = 1 B(T+1). It means: set M_T[i][i]=1.y’) IF its label is nonnegative. SET M_T[GL(x’. then F(0) = 0. T = T+1: B (T+1) = B(T) + PG(T+1). where i is from 0 to current_label–1. then F(T+1) = 0.y) = 1. THEN Check the 8 neighborhood pixels around the pixel (x. then B(T+1) = 0.y) = current_label.= PG(0).y) = GL(x’. Then assign 1 to each element of the matrix that locates at the diagonal. F(0) = 1 B(0) = 1 PG(0). END IF END FOR END IF END FOR END FOR .y’)>=0 THEN SET M_T[GL(x. SET current_label = current_label +1. After the above initialization. The update procedure is given as follows: FOR each y FROM 0 TO height – 1 FOR each x FROM 0 TO width –1 IF pixel (x. which means GL(x’.y).y’) IF it has a nonnegative label in the label image GL. current_label. F(0) = / F(0). you just need to reverse the equation 1). Initially create an empty matrix: M_T[0. it is the time to count the number of connected objects in the foreground region (or in the background region if you want).y’)>=0.y’). Step 2: Scan the binary image GB sequentially and update the label image GL as follows: FOR each y FROM 0 TO height – 1 FOR each x FROM 0 TO width –1 IF pixel (x.current_label–1] . END IF END FOR END IF END FOR END FOR Step 3: Build the 2D transit matrix M_T. THEN Check the 8 neighborhood pixels around pixel (x. B Iteratively. which means GB(x. ELSE SET GL(x. The way we used to count the connected objects in the foreground region is based on the warshell’s algorithm. which means GB(x.y) = 1. Clearly it is an 2D array with size=(current_label) (current_label). we need to update the matrix M_T according to the label image GL and let M_T become the transit matrix of GL.. Create a variable. which means GL(x’.current_label–1][0. THEN SET GL(x. and initially set each GL(x. ELSE F(T+1) = [ B(T+1) B(T+1)] / F(T+1).y’)] = 1.y’)][GL(x.y)] = 1. If B(T+1) = 0.y) is a foreground. for recording the current available label and initially current_label = 0. FOR each neighborhood pixel (x’.

which means we got the transit closure matrix. where i j. We find M_1 is different from M_0. current_label–1] that M_TC[i][k] M_TC[j][k] .. of M_T. which is: FOR i FROM 0 TO current_label–1 FOR j FROM 0 TO current_label–1 SET M_0[i][j] = M_1[i][j] = M_T[i][j]. Then we do some operations on the matrix M_1 as described in the Step 4 (2). and copy M_T to these two matrixes. which is: FOR i FROM 0 TO current_label–1 FOR j FROM 0 TO current_label–1 FOR k FROM 0 TO current_label–1 IF M_1[i][j] = 1 AND M_1[j][k] = 1 THEN SET M_1[i][k] = 1. If not. If so. we initially set two temporary matrixes M_0 and M_1. This calculation of transit closure matrix is based on the warshell’s algorithm which is an iteration procedure described as follows: (1) Initially create two temporary matrixes M_0 and M_1. In step 4 (1). Step 6: Output the number of connected objects (or the number of distinct rows of M_TC) and return. We say these two rows are distinct if and only if there exists at least one k [0. Therefore we copy M_1 to M_0. copy M_1 to M_0 and go back to (2). Copy each value in M_T into the corresponding position in M_0 and M_1. as shown in Figure 1. we compare matrix M_1 (Figure 2) with matrix M_0 (Figure 1). which represents the transit relationship in GL. M_TC. It is not hard to see that the number connected objects equals to the number of distinct rows (or columns) in matrix M_TC. you get the updated matrix M_T. which have the same size of the matrix M_T. Then according to Step 4 (3). Step 5: Count the number of connected objects (or the number of equivalent classes) in the transit closure matrix M_TC. Figure 2: Updated M_1 by applying Step 4 (2). set M_TC = M_1. Then go back to (2) do the same operations on M_1 again. as shown in Figure 4. Assume M_TC[i] and M_TC[j] are the two rows of matrix M_TC. .After the above procedure. (2) Update the matrix M_1 using the transitivity law. END IF END FOR END FOR END FOR (3) Compare M_1 and M_0 to see if they are exactly the same. One example of transit closure calculation (step 4) Assume after step 3. and get M_1 updated again. as shown in Figure 3. SET M_1[k][i] = 1. we got the transit matrix M_T. Step 4: Calculate the transit closure matrix. we get an updated M_1 as shown in Figure 2: Figure 1: Copy M_T to M_0 and M_1. which means each element from M_1 has the same value as the corresponding element from M_0.

This time we find that M_1 did not change.  Detection of Discontinuities  Edge Linking and Boundary Detection  Thresholding  Region-Based Segmentation  Segmentation by Morphological Watersheds  The Use of Motion Segmentation . Figure 6: M_1 is updated again. It means that there are two connected objects.Figure 3: Copy M_1 to M_0. Again we find that they are different. Furthermore we discover there are two distinct rows in the transit closure matrix: (1111100) and (0000011). So we need to copy M_1 to M_0 (as shown in Figure 5) and go back to (2) to get M_1 updated again (as shown in Figure 6). Figure 4: M_1 is updated again. Then we compare M_1 (Figure 4) and M_0 (Figure 3). and set M_TC = M_1. Figure 5: Copy M_1 to M_0. which means M_0 (Figure 5) and M_1 (Figure 6) are identical. So we say the current M_1 is the transit closure matrix that we want.







Explain in detail. * Gradient Operators * Laplacian Operators 3. 4. Write about linking edge points. What is segmentation? 2. Explain Boundary descriptors. * Region Growing * Region splitting and merging * Comparison 5. • Fourier descriptors. Line. Define and explain the various representation approaches? • chain codes • Polygon approximations • Signature • Boundary segments • Skeletons. Define compactness 16 Marks 1. Define Thresholding and explain the various methods of thresholding in detail? • Foundation • The role of illumination • Basic adaptive thresholding • Basic adaptive thresholding • Optimal global & adaptive thresholding. 6. Define Gradient Operator? 8.image segmentation • Discontinity – Point. What are the three types of discontinuity in digital image? 4. What are the two properties used for establishing similarity of edge pixels? 7. Write the applications of segmentation. Edge • Similarity – Thresholding. How the derivatives are obtained in edge detection during formulation? 5. • Definition . What is image segmentation. Explain Edge Detection in details? * Basic formation. Splitting and merging 2. Discuss about region based image segmentation techniques.UNIT V 2 Marks 1. . • Simple descriptors. 3. 6. Compare threshold region based techniques. Region Growing. Define region growing? 9.

7. Explain regional descriptors • Simple descriptors • Texture i. Statistical approach ii. Structural approach iii. Spectral approach 8. Explain the two techniques of region representation. • Chain codes • Polygonol approximation 9. Explain the segmentation techniques that are based on finding the regions directly. • Edge detection line detection • Region growing • Region splitting • region merging 10. How is line detected? Explain through the operators • Types of line masks 1. horizontal 2. vertical 3. +45˚,-45˚