3 views

Uploaded by Diwakar Gautam

matter

- 9504146 Tcs Users Experience
- Aptitude Paper With Only Questions
- Technical Definition of Snake Game
- CS101x_S438A_Structures_and_Pointers_Part_1_IIT_Bombay.pdf
- Utility Classes in Java
- FS-8700-54_MDA_CM4
- Day 06 Redefines Renames Arrays Search
- Arrays
- Arrays Discussion
- Array
- Ak
- Practical File 2018
- 18. New Array Features
- Learning
- ppt lab 55.pdf
- TSL1401 DB Brochure
- [Goil S., Choudhary a.] High Performance Multidime(BookSee.org)
- Manual # 11
- Recibo Con Talonario Para Imprimir
- Evidence Cell Phones for Sale_AA3

You are on page 1of 3

a specific property, V. Two pixels, p and q, are connected if

there is a path from p to q of pixels with property V. A path is

an ordered sequence of pixels such that any two adjacent

pixels in the sequence are neighbors. An example of an image

with a connected component is shown at the right. All of the

pixels in the red object are connected. There are separate green

objects. It is possible to find a path between any two pixels within any of the objects, but

not between pixels in different objects.

We want to create an algorithm that can find the connected components in an image. We

will assume that all of the pixels in the image have been labeled with values that

correspond to the property of interest. In the above image there would be three values for

V, say V=0 for the white background, V=1 for red pixels and V=2 for green pixels. It

must be able to determine, for example, that the two green objects in the above picture

are distinct.

Constructing a connected component consists of growing sets of pixels that are connected

and have the same value of a property. This could be accomplished by first finding a

pixel with a given property value, then looking at all its neighbors, labeling each that has

the same value as being in the same component, and so on. This leads to a somewhat

random stepping through the image, and is somewhat inefficient. Scanning the image in a

specified order can develop a more systematic and efficient algorithm.

Let us first introduce some notation. The image will be represented by an array A that has

N columns and M rows. A[x,y] refers to the element in column x and row y, with

x {0, N 1}, y {0, M 1}. We will assume that each pixel has a value

Let Q be an array that is the same size as A. We will use this array to hold the connected

component labels.

Let L be the label index. We start with L=0 and increment L whenever we want to create

a new connected component label. The goal is to end up with all of the pixels in each

connected component having the same label and all of the distinct connected components

having different labels.

In the course of running the algorithm, it is possible that some of the pixels in the same

connected component will end up with different labels. These different label values will

be discovered and resolved at the end of the labeling process. This will be clear as you

follow the description below. We will let EQ be a vector that holds the equivalence class

relations that are discovered as the algorithm is running.

We assume that all of the pixels have a value of the property V and that we are interested

in those pixels with nonzero values. Those with value zero are assumed to be the image

background. Setting the pixel values is done before starting this algorithm. The following

algorithm will be described for 4-connected neighborhoods.

Step 1: Label pixel A[0,0]. If A[0,0]>0 then increment L and set Q[0,0]=L. This takes

care of the first pixel in the image.

Step 2: Label the pixels in row y=0. For x=1 to N-1, check the value of A[x,0]. If

A[x,0]>0 and A[x,0]=A[x-1,0] then set Q[x,0]=Q[x-1,0]. If A[x,0]>0 and

A[x,0] A[x-1,0] then increment L and set Q[x,0]=L. This will cause neighboring

pixels in the first row that have the same value to have the same label. However,

pixels in the first row that have the same value but are not connected will have

different labels. This is shown in the chart below, where there are pixels colored

red, green and blue. The labels are recorded in the cells.

Step 3: Label the rest of the rows. The first element of each row is handled a little

differently than the rest of the elements, since it has no left neighbor. For y=1 to

M-1 do the following. If A[0,y]>0 and A[0,y]=A[0,y-1] then set Q[0,y]=Q[0,y-1].

If A[0,y]>0 and A[0,y] A[0,y-1] then increment L and set Q[0,y]=L. This takes

care of labeling the first element in the row.

Labeling the rest of the elements in a row requires that we look at both the

neighbor above and the neighbor to the left. For simplicity, let us refer to the

current pixel as p, the neighbor to the left as s and the one above as t. If

A[ p ] = A[ s] but A[ p ] A[t ] then set Q[ p] = Q[ s] . If A[ p ] A[ s] but

A[ p ] = A[t ] then set Q[ s] = Q[t ]. If A[ p ] A[t ] and A[ p ] A[ s] then

increment L and set Q[ p] = L. If A[ p ] = A[t ] , A[ p ] = A[ s] and Q[ s] = Q[t ] then

set Q[ p ] = Q[t ]. This takes care of all the cases except A[ p ] = A[t ] , A[ p ] = A[ s]

and Q[ s] Q[t ] . This means that pixels s and t have the same values but

different labels. This tells us that s and t are really in the same component and

should have the same label, but we did not know that until now. We therefore

label pixel p with the smaller of the two labels and record the fact that the larger

label value is equivalent to the smaller one. Let L1 be the smaller value and L2

be the larger value. Then set Q[ p] = L1 and EQ[ L2 ] = L1 . We will resolve these

equivalencies in the next pass.

The first three rows of an image with their labels to this point are shown in the

diagram below. Because of the shape of the connected components and the order

in which pixels are examined, pixels in the same connected component may have

different labels. The system finds that the following are equivalent: (1,2), (1,6),

(3,4) and (5,7). At this point in the algorithm the equivalency table would look

like EQ=[0,1,1,3,3,5,1,5]. Labels {1,2,6}, {3,4} and {5,7} are equivalent.

Step 4: At this point the first pass has been completed. We now find the

equivalency classes from the EQ array and relable the Q matrix.

- 9504146 Tcs Users ExperienceUploaded byheerapotter
- Aptitude Paper With Only QuestionsUploaded bydarisbennison
- Technical Definition of Snake GameUploaded bykyle_r_brower
- CS101x_S438A_Structures_and_Pointers_Part_1_IIT_Bombay.pdfUploaded bysiriuslot
- Utility Classes in JavaUploaded bydineshgomber
- FS-8700-54_MDA_CM4Uploaded byEric Dunn
- Day 06 Redefines Renames Arrays SearchUploaded bySiddharth Reddy
- ArraysUploaded bymuno
- Arrays DiscussionUploaded byLars Rembrandt
- ArrayUploaded byGarima Batra
- AkUploaded byAroosh Khizer Lone
- Practical File 2018Uploaded byMaverick Shade
- 18. New Array FeaturesUploaded byFa
- LearningUploaded byPranav Chaudhari
- ppt lab 55.pdfUploaded byMuhammedYeshaw
- TSL1401 DB BrochureUploaded byMUHAMMAD SISWANTORO
- [Goil S., Choudhary a.] High Performance Multidime(BookSee.org)Uploaded bypaqsori
- Manual # 11Uploaded bymusa
- Recibo Con Talonario Para ImprimirUploaded byAlcivíades Lírico Pitvain
- Evidence Cell Phones for Sale_AA3Uploaded byJorge Ivan Carvajal
- GraphicsUploaded byapi-3742735
- DSA algosUploaded byapi-3738294
- Pointers in c programming very importantUploaded byVignesh Murali
- 2d phase unwrappingUploaded byBinoy KP
- Effective+PipeliningUploaded byprithivimay
- Computer Concepts and Problem Solving l t p c 4 0 0 4Uploaded byGhilli Tec
- MSBI Sample PaperUploaded bysajid
- a2C++Uploaded bySheethala Swaminathan
- Java Collection Interview QuestionsUploaded bysaumitra ghogale
- lab_PILAUploaded bysantiago vizcaíno

- InformationUploaded byKris Charbs
- Assignment of MBAUploaded byDiwakar Gautam
- draw.m.txtUploaded byDiwakar Gautam
- image1Uploaded byDiwakar Gautam
- Colloborative Research SchemeUploaded byDiwakar Gautam
- TransactionUploaded byDiwakar Gautam
- Menu (1)Uploaded byDiwakar Gautam
- mtechUploaded byDiwakar Gautam
- rrb_meenaUploaded byDiwakar Gautam
- Full Text 01Uploaded byDiwakar Gautam
- KeysUploaded byDiwakar Gautam
- PresentationUploaded byDiwakar Gautam
- New Text DocumentUploaded byDiwakar Gautam
- SchedLgUUploaded byDiwakar Gautam
- New Text DocumentUploaded byDiwakar Gautam
- New Microsoft Office Word DocumentUploaded byDiwakar Gautam
- sec_e_topic_1Uploaded byDiwakar Gautam
- Kuchar - Aperture Coupled Micro Strip Patch Antenna Array - 1996Uploaded bychariteb
- File ListUploaded bysrikanthreddy_konni
- New Text DocumentUploaded byDiwakar Gautam

- Goodchk HinduUploaded byIhtesham Hassan
- Install Monitorix Di Debian 6 SqueezeUploaded byPendekar Blank
- 25 PLAXIS BulletinUploaded byclarence deada
- Mission and Vision Statement for Any Ten CompaniesUploaded bymuhammad farhan
- Power-System-Restructuring-and-Deregulation-Trading-Performance-and-Information-Technology.pdfUploaded bySankalp Asawa
- Vocab PhillipsUploaded byJorge Lorenzo
- 11-7579 WP Pipeline Hydraulics D FINALUploaded byjoaquingon
- GATE Mathematics BookUploaded byMims12
- Dfe Cppsim TutorialUploaded byjit20088791
- 5 steps for tradersUploaded bysivakumar_appasamy
- ETM - PresentationUploaded byMandar Dongare
- BE CSEUploaded byMadhur D Amilkanthwar
- HDIUploaded bySandra Mohamed
- Freire Formal Review c Sac Initial ReportUploaded byKevinOhlandt
- Rushkoff_ Douglas - Program or Be Programmed. Ten Commands for a Digital AgeUploaded byМyrоslаw Бytz
- Migration GuideUploaded byVirender Kumar
- Fees 2011Uploaded byKhandakar Monalisa Akhtar
- AttitudesUploaded byRidhika Kundra
- Concentration and pH Dependent Aggregation of Hydrophobic Drug MoleculesUploaded bykmeriem
- Burning Woman - Disfunkshion MagazineUploaded byTheOwlReads
- NihilismUploaded byzukoizon
- Power MotivesUploaded bykemekal27
- (Review) Deep History_ the Architecture of Past and PresentUploaded byjuano486
- Longterm Deflection Comparison With EtabsUploaded byArnel Dodong
- property law synopsis.docxUploaded byVishnu Sun
- Storing and Querying XML Data Using Denormalized Relational Databases FulltextUploaded byaboubadr2008
- The Light of Reason; Showing the First Step the Nation Should Take Toward a Social Order Based on Justice ([c1899])Benjamin FranklinUploaded byKenneth Arctander Johansen
- IMSL_RKTAUploaded byJose Gomes
- Distance Time Velocity SemUploaded byFernando Gonzalez
- Littlejohn Human CommunicationUploaded byMarielle Sumilong