Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Consider an image I where you access the intensity value of each pixel of the image with Ily. Suppose the image is grayscale, so

image text in transcribed

3. Consider an image I where you access the intensity value of each pixel of the image with Ily. Suppose the image is grayscale, so I y returns an integer. Given a pixel p, you can use I[p] as a shortcut. We wish to find all connected components where a connected component is a grouping of pixels that are connected and have identical intensity values. Two pixels are connected if they share an edge. They are not connected if they share only a corner. (a) Assume that you know nothing about disjoint sets. Give an algorithm in pseudocode for finding the connected components. Think carefully about what data structure you will use. Your algo- rithm doesn't necessarily need to be efficient. And the end of the algorithm you should have one instance of the data structure per connected component. You do not need to be super precise in your description - just give the general idea. (b) Now give an algorithm for finding the connected components using disjoint sets. You'll want to start by creating and initializing a 2-dimensional array of representative nodes - one node for each pixel. You can assume you have makeSet() (which returns a representative node), union() and find(). You may not necessarily use all three. Describe your algorithm in pseudocode. 3. Consider an image I where you access the intensity value of each pixel of the image with Ily. Suppose the image is grayscale, so I y returns an integer. Given a pixel p, you can use I[p] as a shortcut. We wish to find all connected components where a connected component is a grouping of pixels that are connected and have identical intensity values. Two pixels are connected if they share an edge. They are not connected if they share only a corner. (a) Assume that you know nothing about disjoint sets. Give an algorithm in pseudocode for finding the connected components. Think carefully about what data structure you will use. Your algo- rithm doesn't necessarily need to be efficient. And the end of the algorithm you should have one instance of the data structure per connected component. You do not need to be super precise in your description - just give the general idea. (b) Now give an algorithm for finding the connected components using disjoint sets. You'll want to start by creating and initializing a 2-dimensional array of representative nodes - one node for each pixel. You can assume you have makeSet() (which returns a representative node), union() and find(). You may not necessarily use all three. Describe your algorithm in pseudocode

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago