0 Up votes0 Down votes

3 views3 pagesmatter

Apr 15, 2015

© © All Rights Reserved

PDF, TXT or read online from Scribd

matter

© All Rights Reserved

3 views

matter

© All Rights Reserved

- c++ Reference Sheet
- Brochure RX4 2017
- Understanding Sap.ui.Table.table in 10 Minutes
- matlab.pdf
- Arrays
- Interview Questions
- Solutions to Homework 7o
- C++ assignment
- 04162501
- PRM MAJ
- EE103 Assignments
- D Block Elements
- Matlab Prog
- 03-MPIProgramStructure(testwsol)
- AR0134_DG_C
- CS PrebBoard I2010
- Ex 3 Sol
- Dynamic Array
- Data Structure 1
- Data Structure & Algorithm (Quick Introduction)

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.

- c++ Reference SheetUploaded byArun
- Brochure RX4 2017Uploaded byAnonymous MBDO0I
- Understanding Sap.ui.Table.table in 10 MinutesUploaded byJulio Rafael
- matlab.pdfUploaded bypathmakerpk
- ArraysUploaded bylirol
- Interview QuestionsUploaded bymeetkrutik942
- Solutions to Homework 7oUploaded byjcvoscrib
- C++ assignmentUploaded byarunvkumar7
- 04162501Uploaded bySudhakar Spartan
- PRM MAJUploaded byMilić
- EE103 AssignmentsUploaded byHuggins Chigidhani
- D Block ElementsUploaded byMk Gupta
- Matlab ProgUploaded byShubham
- 03-MPIProgramStructure(testwsol)Uploaded byPhương Thi Hoàng
- AR0134_DG_CUploaded byDao Thanh Mai
- CS PrebBoard I2010Uploaded bySanthosh Siva Kumar
- Ex 3 SolUploaded byNarbeh Mirzaei
- Dynamic ArrayUploaded byMahar Hasnain
- Data Structure 1Uploaded byHasanen10
- Data Structure & Algorithm (Quick Introduction)Uploaded byAnkit Gujrati
- Pop Direct ListUploaded byapi-3827492
- LAB_04 [Arrays, Passing arrays, Multi-dimensional arrays, Strings, StringBuffer, StringTokenizer].pdfUploaded byAsafAhmad
- C arraysUploaded byMohamed Badawy
- IJARCCE5LUploaded bycarya
- History Of Camera by K SaravananUploaded bybaladtm
- Activity Selection ExampleUploaded byTarun Verma
- ATOS Triple Scan en RevAUploaded bym2ryus
- Vermiculate Artefacts in Image Analysis of Granular MaterialsUploaded byjoake spas
- Arrays - C++ TutorialsUploaded byylmalaver
- New Microsoft Office Word Document - CopyUploaded byShivam Kumar singh

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

- CV060 Conversion Program DesignsUploaded byprakumr
- Musha in AyurvedaUploaded bySiddhendu Bhattacharjee
- Daewoo Fault CodesUploaded byal_capone_mk
- Linear CombinationUploaded byEka Yani
- Enron's Organizational FailureUploaded byPatty Baskerville
- CAD37Uploaded byVikram
- ForecastingUploaded bykiiadizon
- Civ Pro 5Uploaded bymccm92
- Audiencias Activas Participación de La Audiencia Social en La TelevisiónUploaded byFrancisco Garcés Caamaño
- datasheet.pdfUploaded byAknova Tsaniata
- Acts Adoption to TelanganaUploaded byBansi Bhukya
- Ashby MatProperties01Uploaded byVinayak Rao
- OM CH. 10, Problem 12Uploaded byAlex Shahrokhi
- Kathrein 80010699.pdfUploaded byAnonymous lXRESv
- Fine Woodworking 023.pdfUploaded bynicodemus.gamaliel
- Dynamic Facet Orderingf or Faceted ProductUploaded byHelloproject
- Rights of StudentUploaded bysir_vic2013
- A Simple Algebraic Proof of Farkas's Lema BroydenUploaded byLyubomir Hristov
- The dawn of research networkingUploaded byTitus Schleyer
- Coating for Steel StructuresUploaded byVendy Andhiepsa
- 100 Shortcut Keys WindowsUploaded byAnnisa Rohmah
- NAPTA Membership BenefitsUploaded byNaseer Hyden
- technical Aptitude Questions eBookUploaded byreqtech
- README_FIRST-500.txtUploaded bylucas
- ERISA Section 404(c) ChecklistUploaded byPutnam Investments
- ACE Inhibitors - Blood HypertensionUploaded byErik Silva
- DCGA form 1 - 50Uploaded bysridevi
- LPSDP-TailingsHandbookUploaded bybaberoni
- henry syUploaded byMa'am Tine Ace
- TrademarksUploaded byanon_590742113

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.