endsem Numericals
-
Upload
ashish-kumar-sahu -
Category
Documents
-
view
237 -
download
12
Transcript of endsem Numericals
![Page 1: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/1.jpg)
IMAGE PROCESSING NUMERICAL QUESTIONS
![Page 2: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/2.jpg)
Problem 8.4
Consider an 8-pixel line of intensity data, {108,139,135,244,172,173,56,99}. If it is quantized with IGS quantization with 4 bit accuracy, compute the rms error and rms signal to noise ratios for the quantized data.
![Page 3: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/3.jpg)
![Page 4: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/4.jpg)
![Page 5: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/5.jpg)
Problem 8.5
A 1024*1024 8 bit image with 5.3 bits/pixel entropy is to be Huffman coded.• What is the maximum compression that can
be expected?• The maximum compression with Huffman
coding is C = 8/5.3 =1.509.
![Page 6: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/6.jpg)
• If a greater level of lossless compression is required, what else can be done?
• One possibility is to eliminate spatial redundancies in the image before Huffman encoding. For instance, compute the differences between adjacent pixels and Huffman code them.
![Page 7: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/7.jpg)
Problem 8.9
Consider the simple 4*8, 8-bit image:
21 21 21 95 169 243 243 24321 21 21 95 169 243 243 24321 21 21 95 169 243 243 24321 21 21 95 169 243 243 243
![Page 8: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/8.jpg)
Compute the entropy of the image• Total number of pixel = 32
Grey level Value Probability R1 21 0.375
R2 95 0.125
R3 169 0.125
R4 243 0.375
![Page 9: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/9.jpg)
Compress the image using Huffman Coding, and compute the compression achieved.
Compression:
![Page 10: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/10.jpg)
What is the entropy of the image when looked at as pairs of pixel?
![Page 11: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/11.jpg)
• The difference between this value and the entropy in first part tells us that a mapping can be created to eliminate (1.811−1.25) =0.56 bits/pixel of spatial redundancy.
• Difference image:21 0 0 74 74 74 0 021 0 0 74 74 74 0 021 0 0 74 74 74 0 021 0 0 74 74 74 0 0
![Page 12: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/12.jpg)
The entropy of the difference image:
Difference removes most of the spatial redundancy, leaving only (1.41−1.25) = 0.16 bits/pixel.
![Page 13: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/13.jpg)
Problem 8.19
Use the LZW coding algorithm to encode the ASCII string “aaaaaaaaaaa”.• Assume that the first 256 codes in the starting
dictionary are the ASCII codes. If you assume 7-bit ASCII, the first 128 locations are all that are needed. In either case, the ASCII ”a” corresponds to location 97.
![Page 14: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/14.jpg)
The encoded output is :97 256 257 258 97.
![Page 15: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/15.jpg)
Problem (10.2)
•
15
![Page 16: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/16.jpg)
Solution (10.2)
• mask
16
![Page 17: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/17.jpg)
Solution (10.2) Cond…
• Each mask would yield a value of 0 when centered on a pixel of an unbroken 3-pixel segment oriented in the direction favored by that mask.
• Conversely, the response would be a +2 when a mask is centered on a one-pixel gap in a 3-pixel segment oriented in the direction favored by that mask.
17
![Page 18: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/18.jpg)
Problem (10.5)
Suppose that we compute the gradient magnitude of each of the these models
Using the Prewitt operator , sketch what a horizontal profile through the center of each gradient image would look like.
18
![Page 19: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/19.jpg)
Solution (10.5)
• -1 0 1
-1 0 1
-1 0 1
19
![Page 20: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/20.jpg)
Cond(10.5)…
20
![Page 21: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/21.jpg)
Problem(10.22)
•
21
![Page 22: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/22.jpg)
Solution (10.22)
Y=ax+b
b
-b/a
Normal form xcosθ + ysinθ = ρ
22
![Page 23: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/23.jpg)
Solution (10.22)
•
23
![Page 24: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/24.jpg)
Problem(10.39)
• Segment the image shown by using the split and merge procedure . Show the quad tree corresponding to the your segmentation.
24
![Page 25: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/25.jpg)
Solution (10.39)
•
25
![Page 26: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/26.jpg)
Solution (10.39)
26
![Page 27: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/27.jpg)
Problem(10.49)
•
27
![Page 28: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/28.jpg)
Problem(10.49)-(a)
• Determine the maximum value of K that will guarantee that the blur from motion does not exceed 1 pixel.
28
![Page 29: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/29.jpg)
Solution (10.49)-(a)
It is given that 10% of the image area in the horizontal direction is occupied by a bullet that is 2.5 cm long. Because the imaging device is square (256 ×256 elements) the camera looks at an area that is 25cm×25cm, assuming no optical distortions.
Thus, the distance between pixels
25/256=0.098 cm/pixel.
29
![Page 30: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/30.jpg)
Solution Cond…(49.(a))
The maximum speed of the bullet
1000m/sec = 100,000 cm/sec.At this speed, the bullet will travel
100,000/0.98 = 1.02×10^6 pixels/sec.Here it is required that the bullet should not travel
more than one pixel during exposure.That is,
(1.02×10^6 pixels/sec) ×K sec ≤ 1 pixel.
So, K ≤ 9.8×10−7 sec.30
![Page 31: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/31.jpg)
Problem(10.49)-(b)
• Determine the minimum number of frames per second that would have to be acquired in order to calculate the speed of the bullet.
31
![Page 32: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/32.jpg)
Solution (10.49)-(b)
• The frame rate must be fast enough to capture at least two images of the bullet in successive frames so that the speed can be computed.
32
![Page 33: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/33.jpg)
Solution Cond…(49.(b))
• If the frame rate is set so that the bullet cannot travel a distance longer (between successive frames) than one half the width of the image, as in the case of A and E.
• In the other cases we get partial bullets. Although these cases could be handled with some processing (e.g., by determining size, leading and trailing edges, and so forth)
33
![Page 34: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/34.jpg)
Solution Cond…(49.(b))
The length of the bullet in pixels is (2.5cm)/(0.098cm/pixel) ≈ 26 pixels. One half of the image frame is 128 pixels, so the maximum travel distance allowed is 102 pixels. Because the bullet travels at a maximum speed of
1.02×106 pixels/sec, The minimum frame rate
1.02×106/102 = 106frames/sec.34
![Page 35: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/35.jpg)
Problem 11.1 Show that redefining the starting point of a chain code so that the resulting sequence of a no. forms an integer of min magnitude makes the code independent of the initial starting point on the boundary .
Solution:
The key to this problem is to recognize that the value of every element in a chain code is relative to the value of its predecessor. The code for a boundary that is traced in a consistent manner (e.g., clockwise) is a unique circular set of numbers. Starting at different locations in this set does not change the structure of the circular sequence.
Selecting the smallest integer as the starting point simply identifies the same point in the sequence. Even if the starting point is not unique, this method would still give a unique sequence.
For example, the sequence 101010 has three possible starting points, but they all yield the same smallest integer 010101.
![Page 36: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/36.jpg)
Problem 11.6 Find an expression for the signature of the boundary of an equilateral triangle and plot the signature.
Solution:
we see that the distance from the origin to the triangle is givenby r(μ) =D0/cos μ 0± · μ < 60± =D0/cos(120± ¡ μ) 60± · μ < 120± =D0/cos(180± ¡ μ) 120± · μ < 180± =D0/cos(240± ¡ μ) 180± · μ < 240±
=D0/cos(300± ¡ μ) 240± · μ < 300±
=D0/cos(360± ¡ μ) 300± · μ < 360±
![Page 37: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/37.jpg)
whereD0 is the perpendicular distance from the origin to one of the sides of the triangle, and D = D0= cos(60±) = 2D0. Once the coordinates of the vertices of the triangle are given, determining the equation of each straight line is a simple problem, and D0 (which is the same for the three straight lines) follows from elementary geometry.
![Page 38: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/38.jpg)
Problem 11.7: Draw the medial axis of a.) A circle b.) A square
Solution:
![Page 39: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/39.jpg)
Problem 11.16 Obtain the gray level co-occurrence matrix of 5*5 image composed of a checkerboard of alternating 0’s and 1’s ifThe position operator p is defined as “one pixel to the right”
Solution: The image is
0 1 0 1 0 1 0 1 0 10 1 0 1 01 0 1 0 10 1 0 1 0
![Page 40: endsem Numericals](https://reader033.fdocuments.us/reader033/viewer/2022061416/55354c6b4a79596c038b4697/html5/thumbnails/40.jpg)
Let z1 = 0 and z2 = 1. Since there are only two gray levels the matrix A is of order 2x2 . Element a11 is the number of pixels valued 0 located one pixel to the right of a 0.
By inspection, a11 = 0. Similarly, a12 = 10, a21 = 10, and a22 = 0 The total number of pixels satisfying the predicate P is 20, so
C = 0 1/2 1/2 0