Question: We can represent bitmap images as binary matrices where 0 refers to a black pixel, and 1 refers to a white pixel. Such matrices are

We can represent bitmap images as binary matrices where 0 refers to a black pixel, and 1 refers to a white pixel. Such matrices are useful to show characters on monochromatic displays. The example below shows the matrix values to display the digit 0: 1 1 1 1 1 1 1 1000000 1000000 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 100 11001 10011001 1 0 0 1 1 0 0 1 10011001 1000000 1 1 0 0 0 0 0 0 1 11111111 We can represent all numeric digits (0 to 9) as a sequence of connected pixels. That is, starting on any black pixel, we can traverse through all the respective digit's black pixels using top, right, bottom, and left movements. Consider a bitmap image of pixels containing 0 or more digits in it using binary matrices. Write a high- level pseudocode to count the number of digits in the image. Write down the steps using bullet points for solving this problem such that your pseudocode is easier to understand. Finally, analyze the runtime analysis of your program. The following are input examples with their respective output: Input image Output Comment 0 Since there are no characters 3 Since there are three characters 0 1 2 O 1234 5 6 7 8 9 10 There are ten characters in the image 2 You are not actually recognizing digits but clusters of black pixels. And the pixel in the same cluster should be accessed only going left/right/up/down but not the corner. We can represent bitmap images as binary matrices where 0 refers to a black pixel, and 1 refers to a white pixel. Such matrices are useful to show characters on monochromatic displays. The example below shows the matrix values to display the digit 0: 1 1 1 1 1 1 1 1000000 1000000 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 100 11001 10011001 1 0 0 1 1 0 0 1 10011001 1000000 1 1 0 0 0 0 0 0 1 11111111 We can represent all numeric digits (0 to 9) as a sequence of connected pixels. That is, starting on any black pixel, we can traverse through all the respective digit's black pixels using top, right, bottom, and left movements. Consider a bitmap image of pixels containing 0 or more digits in it using binary matrices. Write a high- level pseudocode to count the number of digits in the image. Write down the steps using bullet points for solving this problem such that your pseudocode is easier to understand. Finally, analyze the runtime analysis of your program. The following are input examples with their respective output: Input image Output Comment 0 Since there are no characters 3 Since there are three characters 0 1 2 O 1234 5 6 7 8 9 10 There are ten characters in the image 2 You are not actually recognizing digits but clusters of black pixels. And the pixel in the same cluster should be accessed only going left/right/up/down but not the corner
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
