The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
hey! here is Question # 3 as per your request. Thank you
(25 pts)You are developing the next great graphics program to compete with the likes of Adobe Photoshopand GIMP.At the moment, your program works only on binary images (i.e., each pixel can be only black orwhite).You are working on a “magic wand” feature where clicking on a single pixel will select that pixel as well asall contiguous pixels. Two pixelsAandBare considered contiguous if 1) they are the same color, and 2)they can be connected by a path of pixels that have the same color asAandB. Diagonal pixels are notconsidered contiguous. For example, in the image below, pixelsAandBare contiguous, butAandCarenot.ACBWrite a program that allows the user to specify a text file to read image data from. Each row of pixelsconsists of 0’s and 1’s separated by spaces, with 0 indicating white and 1 indicating black. You can assumethat each row of the text file will have the same number of columns. However, the number of rows andcolumns can be anything. For example, the image above would be represented in the text file as1 1 1 1 0 0 1 1 11 1 1 1 0 0 0 1 11 1 1 1 0 0 0 0 11 1 1 1 1 0 1 1 01 1 1 1 1 1 1 1 00 0 1 1 0 0 1 0 00 0 1 1 0 0 1 0 0Once the image data is loaded, display the data using the space character for a white pixel and thecharacter.for a black pixel.For example, the image above would be displayed as.......................................The user should then be able to select the row and column to start the magic wand operation from, and theprogram should display the selected pixels using the*character.Here are some examples using the imageabove:Starting from row 0, column 0:****
Attachments: