Τελική Εξέταση. Logic Operations () In the grid areas provided below, draw the results of the following binary operations a. NOT(NOT() OR ) (4) b. ( OR ) XOR ( ND ) (4) c. (( ND ) XOR ) XOR (NOT()) (4) Λογικές Πράξεις () Στους τετραγωνισµένους χώρους, σχεδιάστε τα αποτελέσµατα των πιο κάτω λογικών πράξεων a. NOT(NOT() OR ) (4) b. ( OR ) XOR ( ND ) (4) c. (( ND ) XOR ) XOR (NOT()) (4) = = 0 a b c
. Morphological Operations (0) In the grid areas provided below, draw the results of the following morphological operations. The origin of the structuring element is indicated by the black dot. a. (7) b. C (7) c. Convex Hall of D (6) Μορφολογικές Πράξεις (0) Στους τετραγωνισµένους χώρους, σχεδιάστε τα αποτελέσµατα των πιο κάτω µορφολογικών λειτουργιών. Η αρχή των συντεταγµένων του δοµικού στοιχείου βρίσκεται στο σηµείο µε τη µαύρη κουκκίδα. d. (7) e. C (7) a. Κυρτό περίβληµα του D (6) a C b D c =without limits, = with limits
3. Thresholding and Segmentation (4, 8 each part) a. Show and calculate the iterative steps that you would follow to find the optimal threshold for segmenting two regions in an image which have the histograms shown in figure 3. &. b. Given the image in figure 3., which thresholding method would you use to separate the round objects from the background. Describe the steps and how you would handle different areas of object and background. c. Figure 3.3 shows an image of three amoeba cells () and an intensity profile from that image, through the dashed line (.) Figure 3.4 shows a similar image and cross-section of three human red blood cells. If we use the watershed segmentation, will the three cells in each image be separated? Explain your answer. Κατωφλίωση και Κατάτµηση (4, 8 κάθε µέρος) a. είξτε και υπολογίστε όλα τα βήµατα που πρέπει να ακολουθήσετε ώστε να βρείτε το βέλτιστο κατώφλι για να ξεχωρίσετε δύο περιοχές σε µια εικόνα των οποίων τα ιστογράµµατα φαίνονται στα σχήµατα 3. Α και Β. b. Ποια µέθοδο κατωφλίωσης θα επιλέγατε για να 3εχωρήσετε το στρογγυλό αντικείµενο από το φόντο στην εικόνα 3.; Περιγράψετε τα βήµατα που χρειάζονται καθώς και πως θα χειριστείτε τις διαφορετικές περιοχές του αντικειµένου και του φόντου. c. Στο σχήµα 3.3 βλέπετε µια εικόνα τριών κυττάρων αµοιβάδας (Α) και µια γραφική παράσταση της έντασης των εικονοστοιχείων που βρίσκονται κατά µήκος της διακεκοµµένης γραµµής (Β.) Η εικόνα 3.4 δείχνει επίσης µια εικόνα κυττάρων, ανθρώπινων ερυθρών αιµοσφαιρίων αυτή την φορά (Α,) όπως επίσης και µια γραφική παράσταση της έντασης (Β.) Αν χρησιµοποιήσετε κατάτµηση απορροής (watershed segmentation) θα µπορέσετε να ξεχωρίσετε όλα τα κύτταρα; Εξηγείστε την απάντηση σας. 8 6 0 8 4 6 4 0 3 4 5 6 7 8 9 0 0 3 4 5 6 7 8 9 0 Figure 3. Figure 3. Intensity Figure 3.3 Intensity Figure 3.4 3
Solution a. Start with a guess To for the threshold T o = 5.5 [ x x x x x x x ] [ x x x x x x x ] µ = ( + 4 + 3 8 + 4 3+ 5 ) + (3 + 5 ) / = 69 / = 3.36 µ = (7 3+ 8 ) + (6 + 7 4 + 8 0 + 9 9 + 0 3) / 3 = 60 / 3 = 8.5 T = 5.6 We stop here since using T as the next guess will give the same results, i.e. no change b. With global thresholding we get the results below We therefore have to use adaptive thresholding where we divide the image into smaller regions and either find a local threshold, when σ is large (red regions), or segment them together with a global threshold (the threshold for all the remaining images), when σ is small (blue regions). c. In the first case (amoeba cells) the watershed algorithm will most likely separate the two top cells as one region and the lower cell as a second region. The reason for this is that the basins of the two top cells are connected and at the same level, so unless there is some elevation at the border between them, they will start as a single basin. In the second case (red blood cells), since the basins of the three cells are completely distinct from each other to begin with, the three cells are expected to be segmented as three different regions. 4
4. Variable length (Huffman Coding) (8) Consider the image below. a. If no compression is required, what is the minimum number of bits required to digitize this image? What is the average number of bits per pixel? (8) b. Find the Huffman code for the image. What is the average number of bits per pixel? () c. Given the above results, what are the compression ratio and data redundancy for the image? (8) Κωδικοποίηση Μεταβλητού Μήκους (Huffman) (8) Για την πιο κάτω εικόνα: a. Αν δεν θα εφαρµοστεί συµπίεση, ποιος είναι ο µικρότερος αριθµός δυαδικών ψηφίων που χρειάζεται για να ψηφιοποιηθεί η εικόνα; Ποιος είναι ο µέσος όρος αριθµού ψηφίων ανά εικονοστοιχείο; (8) b. Βρέστε τον κώδικα Huffman για την εικόνα. Ποιος είναι ο µέσος όρος αριθµού ψηφίων ανά εικονοστοιχείο; () c. Με βάση τα πιο πάνω αποτελέσµατα, πόσος είναι ο λόγος συµπίεσης και πόσος ο πλεονασµός των δεδοµένων της εικόνας; (8) 0000 0000 7777777777777777/--------------------- 00000000 00000000 777777777777777/ (( (( ------------- 000 000 000 000 777 7777/---------// 000 000 000 000 7777// (( // 0000 0000 0000 0000 7777// // 0000 0000 0000 0000 7777//--------// 0000 0000 0000 0000 7777 0000 0000 0000 0000 7777 000 000 000 000 7777 000 000 000 000 77777 00000000 00000000 7777777 0000 0000 777777777 Note: The image is made off 7 x 4 characters Σηµείωση: Η εικόνα έχει διαστάσεις 7 x 4 χαρακτήρες a. If no compression is required why have to digitize 6 characters which requires 3 bits. The average number of bits per pixel is 3. b. The following table show the Huffman coding of the above image. (Note: the image is made of 7 x 4 = 008 symbols) Symbol Number Probability Code Length x Prob lank 69 0.6855 0.6855 0.6855 0.6855 0.6855 0 0,6855 0 60 0.587 0.587 0.587 0.587 0.343 0 0,374 7 83 0.083 0.083 0.083 0.556 0 0,469-5 0.0506 0.0506 0.0733 0 0,04 / 7 0.067 0.07 0 0,0835 ( 6 0.0060 0,0030 vg. Num of its per pixel,5387 c. Given the above results, the compression ratio and data redundancy for the image are 3 C = =,950 R= = 0, 487,5387 C 5
5. rithmetic Coding (6) Given the coding table below, decode the message 0.6897, considering that it ends with! Αριθµητική Κωδικοποίηση (6) Με βάση τον πίνακα πιο κάτω, αποκωδικοποιήστε το µήνυµα 0.6897, δεδοµένου ότι τελειώνει µε! Symbol/Σύµβολο Probability/Πιθανότητα ιάστηµα/range α 0.0 [0, 0.0) ε 0.5 [0.0, 0.35) ο 0.9 [0.35, 0.54) θ 0.05 [0.54, 0.59) λ 0.05 [0.59, 0.64) τ 0.7 [0.64, 0.8) σ 0.4 [0.8, 0.95) ω 0.04 [0.95, 0.99)! 0.0 [0.99, ) Solution 0 0.64 0.674 0.674 0.689045 0.689495 0,689687475 0.6995 0.689045 0.689495 0.6897335 0.6897 0.64 0.8 0.8 0.6903 0.6995 0.6903 0,689687475 0,68973875 0.6897335 0,689704835 0,68973875 τ ε λ ο σ! 6