Starting from:

$35

E9241-Assignment 01 Solved

Q1. Histogram Computation: Compute the histogram of the image coins.png. Verify your result using the MATLAB built-in function hist (or the corresponding function in python if you are using python).

Function inputs: grayscale image, number of bins

Function outputs: bin centers, corresponding frequencies (from both your function

            and MATLAB/Python function)                                                                                                                    

Q2. Otsu’s Binarization: In the class, we showed that ), where t is the threshold for binarization. Compute the threshold t for the image coins.png by:

(a)    Minimizing the within class variance .

(b)    Maximizing the between class variance σb2.

Verify that both methods are equivalent. Compare the time taken by each of the approach and also compare with the library function.

Function inputs: grayscale image

Function outputs: thresholds from both approaches, time taken by both approaches,

           binarized image and threshold from the library function.                                                                     

Q3. Foreground Extraction: For the image SingleColorText_Gray.png, separate the foreground text from the background using otsu binarization. Display the text in red color on the green background in GrassBackground.png.

Function inputs: text and background images

Function outputs: an image with the text in red color superimposed on the background. 

Q4. Connected Components: Binarize the image PiNumbers.png and count the number of digits (0 − 9) using connected component analysis. Also compute the number of occurrences of the digit

1.

Function inputs: PiNumbers.png image

              Function outputs: total number of digits, number of occurences of digit 1.                                 

1

Q5. Binary Morphology: Binarize the image NoisyImage.png and apply binary morphological operations to remove the noise in the image.

Function inputs: noisy image Function outputs: cleaned image.            

Q6. Optional Bonus Question - MSER: Maximally Stable Extremal Regions (MSER) correspond to regions of connected components which when thresholded around a certain threshold are stable in terms of the size of the component. This allows an adaptive thresholding method where different regions can be thresholded using different thresholds automatically. Determine the binarized image for DoubleColorText\_Gray.png based on MSER using the following steps:

(a)    Sweep over all thresholds.

(b)    For each threshold, determine connected components in the image.

(c)    A connected component is termed an MSER if the size of the component does not changemuch (within δ) for a small perturbation  in the choice of the threshold. Note that both δ and  are parameters that need to be chosen. Determine the stable threshold for each connected component.

(d)   Ignore extremely large or extremely small connected components in the above analysis.

Compare the performance of Otsu’s binarization with the above method on DoubleColorText_ Gray.png. Think about why Otsu will not be able to extract both the words in this case.

Function inputs: the DoubleColorText_Gray.png image

Function outputs: MSER binary image, Otsu binary image, number of connected components detected by MSER, number of connected components when applied on

          Otsu binarized image.                                                                                                                                        

2

More products