2019 Quiz 2 - Solutions

pdf

School

Western University *

*We aren’t endorsed by this school

Course

9201

Subject

Mechanical Engineering

Date

Dec 6, 2023

Type

pdf

Pages

4

Report

Uploaded by PresidentThunderMoose7

ECE4445 / MBP4445 / ECE9201 / ECE9021 / BME9509 / MBP9509 2019 - Page 1/4 Last name: Solutions First name: Student number: Course Code: ECE4445 / MBP4445 / ECE9201 / ECE9021 / BME9509 / MBP9509 INTRODUCTION TO DIGITAL IMAGE PROCESSING: QUIZ 2 INSTRUCTIONS Print your name and student number at the top of each page in the space provided. ***** Please indicate the course code in which you are registered. ***** Closed book. All calculators are allowed but be prepared to show that the memory is empty. Write answers in the space indicated in each question. 1. [3 marks] Table I gives the histogram H A ( D A ) of a digital image A ( i , j ). Using the algorithm presented in class, design a point operation that equalizes the image’s histogram to produce an output image B ( i, j ). Specify the point operation by creating and filling in Table II below that relates gray levels in the input image, D A , to those in the output, D B . Show all work in the space below Tables I and II. State any formulae you used, including how constants in the formulae were determined. Table I Table II D A H A ( D A ) D A D B 0 (black) 1,000 0 (black) 1 0 1 2 1,000 2 3 (white) 0 3 (white) Solution: D A H A 𝑆 = ∑ 𝐻 𝐴 (𝑖) 𝐷 𝐴 𝑖=0 D m /A 0 x S D B 0 1000 1000 1.5 2 1 0 1000 1.5 2 2 1000 2000 3.0 3 3 0 2000 3.0 3 where D m = 3, 𝐴 0 = ∑ 𝐻 𝐴 (𝑖) = 1000 + 0 + 1000 + 0 = 2000 3 𝑖=0 This question is similar to that from the lecture on October 3 (slide 6). I had told the class that this would be tested with different numer- ical values.
ECE4445 / MBP4445 / ECE9201 / ECE9021 / BME9509 / MBP9509 2019 - Page 2/4 Last name: Solutions First name: Student number: Course Code: 2. [7 marks] Table III gives the histogram, H 1 ( D 1 ), of a 3-bit digital image (IMAGE 1) with gray levels D 1 = 0, 1, …, 7. Table IV gives the histogram, H 2 ( D 2 ), of a second 3-bit image (IMAGE 2). Design a point operation that will match the histogram of IMAGE 1 to that of IMAGE 2. Specify the point operation by filling in Table V that provides a value of D 2 that each value of D 1 maps to. In the space below Tables III, IV and V, show all work, and explicitly state what you are doing. State rules you used when inverting any functions. Use the reverse side of this page if you need more space. Table III Table IV Table V D 1 H 1 ( D 1 ) D 2 H 2 ( D 2 ) D 1 D 2 0 (black) 0 0 (black) 0 0 1 4016 1 2470 1 2 2954 2 2536 2 3 1630 3 1953 3 4 800 4 1337 4 5 368 5 858 5 6 162 6 529 6 7 (white) 70 7 (white) 317 7 Step 1) Equalize Image 1 to get Image 3: D m = 7 A 0 = 10000 D 1 H 1 𝑆 = ∑ 𝐻 1 (𝑖) 𝐷 1 𝑖=0 D m /A 0 x S D 3 0 0 0 0 0 1 4016 4016 2.8 3 2 2954 6970 4.9 5 3 1630 8600 6.0 6 4 800 9400 6.6 7 5 368 9768 6.8 7 6 162 9930 6.95 7 7 70 10000 7 7 Step 2) Equalize Image 2 to get Image 3: D m = 7 A 0 = 10000 D 2 H 2 𝑆 = ∑ 𝐻 2 (𝑖) 𝐷 2 𝑖=0 D m / A 0 x S D 3 0 0 0 0 0 1 2470 2470 1.7 2 2 2536 5006 3.5 4 3 1953 6954 4.9 5 4 1337 8296 5.8 6 5 858 9154 6.4 6 6 529 9683 6.8 7 7 317 10000 7 7
ECE4445 / MBP4445 / ECE9201 / ECE9021 / BME9509 / MBP9509 2019 - Page 3/4 Last name: Solutions First name: Student number: Course Code: Step 3) Invert table in step 2 D 3 D 2 Special considerations 0 0 - 1 0 Selected value for D 3 = 0 since this is closest lower value 2 1 - 3 1 Selected value for D 3 = 2 since this is closest lower value 4 2 - 5 3 - 6 4 Selected lower of the matching values of D 3 = 6 7 6 Selected lower of the matching values of D 3 = 7 Note: The dash means no reason is given since no special consideration was required because a unique ( D 2 , D 3 ) pair existed and inversion was possible without further considerations. Step 4) Fill in Table V D 1 D 2 0 0 1 1 2 3 3 4 4 6 5 6 6 6 7 6 This question is similar to that from the lectures on October 7 and 10 (slides 10-13). I had told the class that this would be tested with different numerical values.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ECE4445 / MBP4445 / ECE9201 / ECE9021 / BME9509 / MBP9509 2019 - Page 4/4 Last name: Solutions First name: Student number: Course Code: 3. [2 marks] An image has an isolated cluster of purely black pixels on a purely white uniform background. The area of the cluster is 3 pixels. What happens to the cluster when the image is filtered with a median filter of size of 7 x 7? Explain why this happens. Answer: It is removed (i.e., replaced with purely white background pixels) because there will be more purely white pixels inside the filter window than dark pixels, so the central element of the window after sorting, which is the median value, will always be purely white. 4. [3 marks] In an industrial application, X-ray imaging is to be used to inspect the inside of certain composite castings. The objective is to look for voids in the castings, which typically appear as small blobs in the image. However, due to noise, inspection of the castings is difficult, and the decision is made to use averaging of multiple images to reduce the noise and thus improve contrast. After numerous experiments, it is found that an increase in the amplitude signal-to-noise ratio by a factor of 3 is sufficient to reduce the noise to acceptable levels. If the imaging device can produce 30 images/sec, how long would the casting have to be imaged to achieve the desired decrease in noise? Answer: Figure out number of images ( M ) that are needed using √𝑀 = ?𝑁? ̅̅̅̅̅̅ ?𝑁? = 3 since we are told that a factor of 3 increase is desired. M = 9 The time required t is then t = 9 images 30 images/sec = 0.3 sec For instructor use only. GRADE: out of 15. TA marking: Median filtering was covered on October 25 and 28. This question simply involves applying median filter- ing. I cannot make all questions identical to what I have given before in lectures and practice problems, but if you understood how to apply median filtering, you should have been able to do this question. Image averaging was covered on Oct 18. I did promise the class that I would not ask you to regurgitate the derivation as many of you did not recall probability the- ory, and I stuck to that promise. I also described the type of question I would ask to the class.