Design, develop, and test a program that labels groups of connected pixels in a binary image....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design, develop, and test a program that labels groups of connected pixels in a binary image. For this project, a binary image will be represented as a 2-D array of r rows and c columns of characters. A.' character represents a black pixel and a character represents a white pixel. A group of white pixels are said to be connected if they share a common north, south, east or west edge (not diagonal). For example, in the following 8 x 10 image... **. **** ** one such coloring would be the following... ...bb....a .... ....c..d.. .e...d.. .dd. .ff. There are two groups of one pixel (c and e), three groups of two pixels (a, b and f) and one group of four pixels (d). Your program is to "color" the white pixels with a unique alphabetic character that identifies all the 4-way (north, south, east and west) adjacent pixels in a common connected component. Your program must implement a recursive solution to find the connected components. 2 Input Your program will read several images from keyboard input. The following is the input format: 1. An integer n indicating the number of images that follow. 2. Two integers r and c representing the dimensions (rows and columns) of the image. 3. The image characters consisting of r rows and c characters per row. 4. A blank line will separate each image. For example, the following input is valid. 2 3 3 *. ** *.. 8 10 ** ** Here is the output for the above sample input. a.. .bb C.. 1 2 2 1 ...bb. ....c..d.. ...e...d.. a b.. .cc a.. a 1 2 2 3 4 1 linux$ The grader will strictly follow the aforementioned input and output format specifications. . Have sufficient comments in your code to facilitate others to understand it. Compress your solution in a .zip file and submit it on TCU Online. The .zip file name is of your choice. This project is worth 100 points. Design, develop, and test a program that labels groups of connected pixels in a binary image. For this project, a binary image will be represented as a 2-D array of r rows and c columns of characters. A.' character represents a black pixel and a character represents a white pixel. A group of white pixels are said to be connected if they share a common north, south, east or west edge (not diagonal). For example, in the following 8 x 10 image... **. **** ** one such coloring would be the following... ...bb....a .... ....c..d.. .e...d.. .dd. .ff. There are two groups of one pixel (c and e), three groups of two pixels (a, b and f) and one group of four pixels (d). Your program is to "color" the white pixels with a unique alphabetic character that identifies all the 4-way (north, south, east and west) adjacent pixels in a common connected component. Your program must implement a recursive solution to find the connected components. 2 Input Your program will read several images from keyboard input. The following is the input format: 1. An integer n indicating the number of images that follow. 2. Two integers r and c representing the dimensions (rows and columns) of the image. 3. The image characters consisting of r rows and c characters per row. 4. A blank line will separate each image. For example, the following input is valid. 2 3 3 *. ** *.. 8 10 ** ** Here is the output for the above sample input. a.. .bb C.. 1 2 2 1 ...bb. ....c..d.. ...e...d.. a b.. .cc a.. a 1 2 2 3 4 1 linux$ The grader will strictly follow the aforementioned input and output format specifications. . Have sufficient comments in your code to facilitate others to understand it. Compress your solution in a .zip file and submit it on TCU Online. The .zip file name is of your choice. This project is worth 100 points.
Expert Answer:
Related Book For
Numerical Methods For Engineers
ISBN: 9780071244299
5th Edition
Authors: Steven C. Chapra, Raymond P. Canale
Posted Date:
Students also viewed these algorithms questions
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
At its headquarters in Ventura, California, Patagonia's office space feels more like a national park lodge than the main office of a $400 million retailer. It has a Douglas fir staircase and a...
-
How could IT, information and knowledge create value for this organization in the next 5 years
-
What capacitance is required to store energy of 10 kW h at a potential difference of 1000 V?
-
Dhruv Udhyog Ltd. has established a new project. Details of fixed assets and expenditure incurred during the construction of the project are given hereunder. Determine the cost of each asset at the...
-
Nazari Electrical Services has an August 31 fiscal year end. The company's trial balance prior to adjustments follows: Additional information: 1. The equipment has an expected useful life of 12...
-
Differentiate between accelerator principle of investment and investment multiplier. Explain the determinants of induced investment in an economy. Given C=a+bY, explain "a" and "b" and then sketch...
-
On December 5 th 2011, Alison was advised by her bank that her application for a bill acceptance facility that would allow her to issue 120-day bank bills with a total face value of $850,000 in June...
-
Suppose a company pays its regular wage for employees working up to 40 hours a week, and overtime pay 50% greater(time and a half) for hours worked over 40 hours. Assuming employe es have full...
-
An experiment finds that the force acting on a particle follow this equation very closely: F = Ax + 6 Cx+ where F has units of Newtons (N) and x B has units of meters (m). Sect all true statements. D...
-
1. The capital market is a market prepared for trading stocks, securities. The capital market acts as a liaison between investors and companies or government institutions through long-term trading...
-
The price of a laser printer purchased by Paul's Printers and Office Supplies was $713. It cost $27 for delivery. The salvage value at the end of a 5-year life is $65. what is the depreciation...
-
Find the range of the function defined by the equation and the given domain. f(x) = 4x3; domain= {0, 1, 2, 3}
-
Adventure Airlines recently purchased a new baggage crusher for 50,000$. It is expected to last for 14 years and have an estimated salvage value of 8,000$. Determine 1. The depreciation charge on the...
-
Why is a help desk and production support critical to system implementations? Discuss its interrelationship with the problem management and reporting system.
-
Use the Excel Data Analysis Toolpack to fit a straight line to the following data. Determine the 90% confidence interval for the intercept. If it encompasses zero, redo the regression, but with the...
-
Repeat Prob. 24.35, but use Simpsons 1/3 rule.
-
Repeat Prob. 24.27, but use is five-segment Simpsons 1/3 rule.
-
The median is different from 120. An analysis of the data reveals that there are 35 minus signs and 28 plus signs. Use the sign test to test the given alternative hypothesis at the \(\alpha=0.05\)...
-
The median is less than 8 . An analysis of the data reveals that there are 10 minus signs and 8 plus signs. Use the sign test to test the given alternative hypothesis at the \(\alpha=0.05\) level of...
-
One important variable to consider in trading stock is the daily volume. Volume is measured in number of shares traded in the stock. Stocks with lower volume tend to have more variability in the...
Study smarter with the SolutionInn App