SlideShare a Scribd company logo
Chain Code in DIP
Rishav Bhurtel 19MTRDS008
• Chain code is a lossless compression technique used for
representing an object in images. The co-ordinates of any
continuous boundary of an object can be represented as a string
of numbers where each number represents a particular direction
in which the next point on the connected line is present.
• Chain codes are used to represent the binary by a connected
sequence of straight –line segments. This represented is based
on 4-connectivity and 8-connectivity of the segments.
• The chain code works best with binary images and is a concise
way of representing a shape contour.
What is Chain Code?
The chain code direction convention is given
below:
• As an edge is traced from its beginning point to the end point
the direction that must be taken to move from one pixel to the
next is given by the number represented in either the 4-chain
code or the 8-chain code.
• As an edge can be completely described in terms of its starting
coordinate and its sequence of chain codes descriptors. Of the
two chain codes, the 4-chain is easier requiring only four
different code values.
For e.g.: Given an image, for 4-chain code for
the same.
• Let us take a starting point which is arbitrary chosen (p). From
this point on, the cursor follows the contour, usually in the
clockwise direction. For every pixel the direction is noted.
The 4-chain code is given edge is
0 0 3 0 3 3 2 2 2 1 1 1
•Hence instead of storing the coordinates of each pixel, we can store the chain code and
starting coordinates. Remember 8-connectivity is closer to the human eye than 4-connectivity.
•The chain code allows an edge to be described using vertical, horizontal as well as diagonal
descriptors at 45 0 , 135 0 , 225 0 and 315 0 .
•The problem with above chain code is, if we change starting point we will get different chain
code, even if the object is same.
•Therefore the chain code is normalized with respect to the starting point.
•We treat the chain code as a circular sequence of numbers and redefine the starting point so
that the resulting sequence of numbers, forms an integer of minimum magnitude.
•Circular codes can be also normalized for rotation by taking the first difference of chain code.
First Difference is:
• Circular difference = last – first = 0 – 0 = 0
• Therefore circular chain code =
• 0 0 0 3 0 3 3 2 2 2 1 1 1
• Shape Number: Shape no of a boundary obtained from a chain
code is defined as the smallest magnitude of the circular first
difference.
Chain-code example. a) coding the 8 directions; b) initial point and edge following
For 8-Chain code the process is same as 4 but
we will have extra directions for diagonal pixels.
Thank you!

More Related Content

What's hot

Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
Krish Everglades
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
MdFazleRabbi18
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
Karthika Ramachandran
 
Digital image processing
Digital image processing  Digital image processing
Digital image processing
kavitha muneeshwaran
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
Gayathri31093
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
kirupasuchi1996
 
Point processing
Point processingPoint processing
Point processing
panupriyaa7
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
Tawose Olamide Timothy
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
rajisri2
 
Image degradation and noise by Md.Naseem Ashraf
Image degradation and noise by Md.Naseem AshrafImage degradation and noise by Md.Naseem Ashraf
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extractionRushin Shah
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantization
BCET, Balasore
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
Nazmul Islam
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
Aishwarya K. M.
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
Mostafa G. M. Mostafa
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
A B Shinde
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
Md Shabir Alam
 

What's hot (20)

Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Digital image processing
Digital image processing  Digital image processing
Digital image processing
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
 
Point processing
Point processingPoint processing
Point processing
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
 
Image degradation and noise by Md.Naseem Ashraf
Image degradation and noise by Md.Naseem AshrafImage degradation and noise by Md.Naseem Ashraf
Image degradation and noise by Md.Naseem Ashraf
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantization
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 

Similar to Chain code in dip

Chain Code.pptx
Chain Code.pptxChain Code.pptx
Chain Code.pptx
ssuser44f11e
 
DSD.pptx
DSD.pptxDSD.pptx
DSD.pptx
FreeFire444538
 
Performance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classificationPerformance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classification
ijcga
 
Image representation
Image representationImage representation
Image representationRahul Dadwal
 
cg mod2.pdf
cg mod2.pdfcg mod2.pdf
cg mod2.pdf
ssuserf3db48
 
Encoder-and-decoder.pptx
Encoder-and-decoder.pptxEncoder-and-decoder.pptx
Encoder-and-decoder.pptx
KamranAli649587
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
Rekha dudiya
 
Rotary encoder training material
Rotary encoder training materialRotary encoder training material
Rotary encoder training materialSáng Bùi Quang
 
Anup Barman number system electronicdevice ECE.pptx
Anup Barman number system electronicdevice ECE.pptxAnup Barman number system electronicdevice ECE.pptx
Anup Barman number system electronicdevice ECE.pptx
anupbarmancoochbehar
 
representation.pptx
representation.pptxrepresentation.pptx
representation.pptx
vijayalakshmi257551
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSACryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
aritraranjan
 
base-band_digital_data_transmission-Line coding - Copy.ppt
base-band_digital_data_transmission-Line coding - Copy.pptbase-band_digital_data_transmission-Line coding - Copy.ppt
base-band_digital_data_transmission-Line coding - Copy.ppt
AbyThomas54
 
Two fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption AlgorithmTwo fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption Algorithm
Rifat Tasnim
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
noor300491
 
1516 contouring
1516 contouring1516 contouring
1516 contouring
Dr Fereidoun Dejahang
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
Hossam Hassan
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
UmerKhan147799
 
Octal encoding
Octal encodingOctal encoding
Octal encoding
rajshreemuthiah
 
Ex 1 chapter06-i-pv4-tony_chen
Ex 1 chapter06-i-pv4-tony_chenEx 1 chapter06-i-pv4-tony_chen
Ex 1 chapter06-i-pv4-tony_chenĐô GiẢn
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
NazmulHasan854383
 

Similar to Chain code in dip (20)

Chain Code.pptx
Chain Code.pptxChain Code.pptx
Chain Code.pptx
 
DSD.pptx
DSD.pptxDSD.pptx
DSD.pptx
 
Performance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classificationPerformance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classification
 
Image representation
Image representationImage representation
Image representation
 
cg mod2.pdf
cg mod2.pdfcg mod2.pdf
cg mod2.pdf
 
Encoder-and-decoder.pptx
Encoder-and-decoder.pptxEncoder-and-decoder.pptx
Encoder-and-decoder.pptx
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
 
Rotary encoder training material
Rotary encoder training materialRotary encoder training material
Rotary encoder training material
 
Anup Barman number system electronicdevice ECE.pptx
Anup Barman number system electronicdevice ECE.pptxAnup Barman number system electronicdevice ECE.pptx
Anup Barman number system electronicdevice ECE.pptx
 
representation.pptx
representation.pptxrepresentation.pptx
representation.pptx
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSACryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
 
base-band_digital_data_transmission-Line coding - Copy.ppt
base-band_digital_data_transmission-Line coding - Copy.pptbase-band_digital_data_transmission-Line coding - Copy.ppt
base-band_digital_data_transmission-Line coding - Copy.ppt
 
Two fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption AlgorithmTwo fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption Algorithm
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
 
1516 contouring
1516 contouring1516 contouring
1516 contouring
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
 
Octal encoding
Octal encodingOctal encoding
Octal encoding
 
Ex 1 chapter06-i-pv4-tony_chen
Ex 1 chapter06-i-pv4-tony_chenEx 1 chapter06-i-pv4-tony_chen
Ex 1 chapter06-i-pv4-tony_chen
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
 

More from Rishav Bhurtel

Role of unification and realization in natural language generation
Role of unification and realization in natural language generationRole of unification and realization in natural language generation
Role of unification and realization in natural language generation
Rishav Bhurtel
 
Tools & techniques used in syntactic parsing and semantic analysis
Tools & techniques used in syntactic parsing and semantic analysisTools & techniques used in syntactic parsing and semantic analysis
Tools & techniques used in syntactic parsing and semantic analysis
Rishav Bhurtel
 
Syntactic parsing
Syntactic parsingSyntactic parsing
Syntactic parsing
Rishav Bhurtel
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
Rishav Bhurtel
 
Color Production Method
Color Production MethodColor Production Method
Color Production Method
Rishav Bhurtel
 
Scrap waste In Kathmandu
Scrap waste In KathmanduScrap waste In Kathmandu
Scrap waste In KathmanduRishav Bhurtel
 

More from Rishav Bhurtel (8)

Role of unification and realization in natural language generation
Role of unification and realization in natural language generationRole of unification and realization in natural language generation
Role of unification and realization in natural language generation
 
Tools & techniques used in syntactic parsing and semantic analysis
Tools & techniques used in syntactic parsing and semantic analysisTools & techniques used in syntactic parsing and semantic analysis
Tools & techniques used in syntactic parsing and semantic analysis
 
Syntactic parsing
Syntactic parsingSyntactic parsing
Syntactic parsing
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 
Color Production Method
Color Production MethodColor Production Method
Color Production Method
 
Green IT
Green ITGreen IT
Green IT
 
Storage Technologies
Storage TechnologiesStorage Technologies
Storage Technologies
 
Scrap waste In Kathmandu
Scrap waste In KathmanduScrap waste In Kathmandu
Scrap waste In Kathmandu
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

Chain code in dip

  • 1. Chain Code in DIP Rishav Bhurtel 19MTRDS008
  • 2. • Chain code is a lossless compression technique used for representing an object in images. The co-ordinates of any continuous boundary of an object can be represented as a string of numbers where each number represents a particular direction in which the next point on the connected line is present. • Chain codes are used to represent the binary by a connected sequence of straight –line segments. This represented is based on 4-connectivity and 8-connectivity of the segments. • The chain code works best with binary images and is a concise way of representing a shape contour. What is Chain Code?
  • 3. The chain code direction convention is given below:
  • 4. • As an edge is traced from its beginning point to the end point the direction that must be taken to move from one pixel to the next is given by the number represented in either the 4-chain code or the 8-chain code. • As an edge can be completely described in terms of its starting coordinate and its sequence of chain codes descriptors. Of the two chain codes, the 4-chain is easier requiring only four different code values.
  • 5. For e.g.: Given an image, for 4-chain code for the same.
  • 6. • Let us take a starting point which is arbitrary chosen (p). From this point on, the cursor follows the contour, usually in the clockwise direction. For every pixel the direction is noted.
  • 7.
  • 8. The 4-chain code is given edge is 0 0 3 0 3 3 2 2 2 1 1 1
  • 9. •Hence instead of storing the coordinates of each pixel, we can store the chain code and starting coordinates. Remember 8-connectivity is closer to the human eye than 4-connectivity. •The chain code allows an edge to be described using vertical, horizontal as well as diagonal descriptors at 45 0 , 135 0 , 225 0 and 315 0 . •The problem with above chain code is, if we change starting point we will get different chain code, even if the object is same. •Therefore the chain code is normalized with respect to the starting point. •We treat the chain code as a circular sequence of numbers and redefine the starting point so that the resulting sequence of numbers, forms an integer of minimum magnitude. •Circular codes can be also normalized for rotation by taking the first difference of chain code.
  • 10. First Difference is: • Circular difference = last – first = 0 – 0 = 0 • Therefore circular chain code = • 0 0 0 3 0 3 3 2 2 2 1 1 1 • Shape Number: Shape no of a boundary obtained from a chain code is defined as the smallest magnitude of the circular first difference.
  • 11. Chain-code example. a) coding the 8 directions; b) initial point and edge following For 8-Chain code the process is same as 4 but we will have extra directions for diagonal pixels.