SlideShare a Scribd company logo
1 of 27
4-CONNECTED AND 8-CONNECTED
NEIGHBOR SELECTION
Submitted By
Sintiak Haque
Dept. Of CSE,
Varendra University
INTRODUCTION
• In seed fill algorithm, it has two approaches.
Boundary fill algorithm is one of them.
• Boundary fill algorithm is used frequently in
computer graphics to fill a desired color inside
a closed polygon having the same boundary
color for all of its sides.
• This filling can be done by two techniques-
 4-connected pixels
 8-connected pixels
2
BOUNDARY
FILL
ALGORITHM
 First of all take a seed pixel (x, y) inside
the polygon.
 Find the neighboring pixels until
boundary is reached.
Seed (x,
y)
3
4 - CONNECTED
In this approach, above, left, right, below pixels
are connected. Areas filled by this method are
called 4-connected neighboring points.
(x, y+1)
(x, y-1)
Seed (x, y)
(x-1, y) (x+1, y)
4
8 - CONNECTED
The pixel on the right, left, above, below and the 4
diagonal pixels. Areas filled by this method are
called 8-connected.
(x, y+1)
(x+1, y+1)
(x+1, y)
(x+1, y-1)
(x, y-1)
(x-1, y-1)
Seed (x,
y)
(x-1, y+1)
(x-1, y)
5
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
Start Position
6
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
1
2 3
3
2
1
7
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
1 4
2
4
2
1
8
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
1
2
2
1
9
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
5 1
5
1
10
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
1
1
11
BOUNDARY FILL ALGORITHM
4-CONNECTED (EXAMPLE)
 But here some problem arise in 4-connected pixels technique,
as shown where we tried to fill the entire region. Here, the
image is filled only partially. In such cases, 4-connected pixels
technique cannot be used. 12
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
Start Position
13
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
4 1 5
2 3
5
4
3
2
1
14
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
6
4 1
2 3
6
4
3
2
1
15
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
7 8
4 1
2 3
8
7
4
3
2
1
16
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
11 9 12
7 10
4 1
2 3
12
11
10
9
7
4
3
2
1 17
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
11 9
7 10
4 1
2 3
11
10
9
7
4
3
2
1 18
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
9
7 10
4 1
2 3
10
9
7
4
3
2
1 19
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
9
7
4 1
2 3
9
7
4
3
2
1 20
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
7
4 1
2 3 7
4
3
2
1 21
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
4 1
2 3
4
3
2
1 22
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
1
2 3
3
2
1 23
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
1
2
2
1 24
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
1
1 25
BOUNDARY FILL ALGORITHM
8-CONNECTED (EXAMPLE)
 In 8-connected pixel technique it
successfully to fill all the area.
26
THANK YOU...!

More Related Content

What's hot

Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesOmprakash Chauhan
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithmsKumar
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4PrathimaBaliga
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removalAnkit Garg
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformationSelvakumar Gna
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithmAparna Joshi
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingAnkit Garg
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphicsSafayet Hossain
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"Ankit Surti
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformationAnkit Garg
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fillwahab13
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)Timbal Mayank
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics systemKamal Acharya
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSnehrurevathy
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphicanku2266
 

What's hot (20)

Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
fractals
fractalsfractals
fractals
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphics
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics system
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICS
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Video display devices
Video display devicesVideo display devices
Video display devices
 

Recently uploaded

EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 

Recently uploaded (20)

EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 

4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION By Sintiak Haque