SlideShare a Scribd company logo
1 of 28
EDGE DETECTION
Presented by: Vaddi Manikanta
B212053
ETC
INTRODUCTION
Edges are significant local
changes of intensity in an
image.
Edge Detection is the
process of identifying and
locating sharp discontinuities
in an image.
Abrupt change in pixel
intensity characterize
boundary of an object and
usually edges occur on the
boundary of two regions.
Tulips image
Edges of the Tulips image
Tulips Image Part of the image Edge of the part of the image
Matrix generated by the part of the image
CAUSES OF INTENSITY CHANGE
Geometric events
Discontinuity in depth and
surface colour and texture
Non-geometric events
Reflection of light
Illumination
shadows
Edge formation due to
discontinuity of surface
Reflectance Illumination Shadow
APPLICATIONS
Enhancement of noisy images like satellite images,
x-rays, medical images like cat scans.
Text detection.
Traffic management.
Mapping of roads.
Video surveillance.
DIFFERENT TYPES OF EDGES OR
INTENSITY CHANGES
Step edge: The image intensity abruptly changes from
one value on one side of the discontinuity to a different
value on the opposite side.
Ramp edge: A step edge where the intensity change is
not instantaneous but occur over a finite distance.
Ridge edge: The image intensity abruptly changes value
but then returns to the starting value within some short
distance (i.e., usually generated by lines).
Roof edge: A ridge edge where the intensity change is
not instantaneous but occur over a finite distance (i.e.,
usually generated by the intersection of two surfaces).
MAIN STEPS IN EDGE DETECTION
Smoothing: Suppress as much noise as possible,
without destroying true edges.
Enhancement: Apply differentiation to enhance the
quality of edges (i.e., sharpening).
Thresholding: Determine which edge pixels should be
discarded as noise and which should be retained (i.e.,
threshold edge magnitude).
Localization: Determine the exact edge location. Edge
thinning and linking are usually required in this step.
EDGE DETECTION USING
DERIVATIVE (GRADIENT)
The first derivate of an image can be computed using the
gradient
(or)f
GRADIENT REPRESENTATION
The gradient is a vector which has magnitude and
direction.
or
Magnitude: indicates edge strength.
Direction: indicates edge direction.
| | | |
f f
x y
 

 
(approximation)
EDGE DETECTION STEPS USING
GRADIENT
(i.e., sqrt is costly!)
GENERAL APPROXIMATION
Consider the arrangement of pixels about the pixel [i, j]:
The partial derivatives , can be computed by:
The constant c implies the emphasis given to pixels
closer to the centre of the mask.
3 x 3 neighborhood:
SOBEL OPERATOR
3×3 convolution mask.
Setting c = 2, we get the Sobel operator:
EDGE DETECTOR USING SOBEL
OPERATOR IN C LANGUAGE
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include "mypgm.h"
void sobel_filtering( )
/* Spatial filtering of image data */
/* Sobel filter (horizontal differentiation */
/* Input: image1[y][x] ---- Outout: image2[y][x] */
{
/* Definition of Sobel filter in horizontal direction */
int weight[3][3] = { { -1, 0, 1 },
{ -2, 0, 2 },
{ -1, 0, 1 } };
double pixel_value;
double min, max;
int x, y, i, j; /* Loop variable */
/* Maximum values calculation after filtering*/
printf("Now, filtering of input image is performednn");
min = DBL_MAX;
max = -DBL_MAX;
for (y = 1; y < y_size1 - 1; y++) {
for (x = 1; x < x_size1 - 1; x++) {
pixel_value = 0.0;
for (j = -1; j <= 1; j++) {
for (i = -1; i <= 1; i++) {
pixel_value += weight[j + 1][i + 1] * image1[y + j][x + i];
}
}
if (pixel_value < min) min = pixel_value;
if (pixel_value > max) max = pixel_value;
}
}
if ((int)(max - min) == 0) {
printf("Nothing exists!!!nn");
exit(1);
}
/* Initialization of image2[y][x] */
x_size2 = x_size1;
y_size2 = y_size1;
for (y = 0; y < y_size2; y++) {
for (x = 0; x < x_size2; x++) {
image2[y][x] = 0;
}
}
/* Generation of image2 after linear transformtion */
for (y = 1; y < y_size1 - 1; y++) {
for (x = 1; x < x_size1 - 1; x++) {
pixel_value = 0.0;
for (j = -1; j <= 1; j++) {
for (i = -1; i <= 1; i++) {
pixel_value += weight[j + 1][i + 1] * image1[y + j][x + i];
}
}
pixel_value = MAX_BRIGHTNESS * (pixel_value - min) / (max - min);
image2[y][x] = (unsigned char)pixel_value;
}
}
}
main( )
{
load_image_data( ); /* Input of image1 */
sobel_filtering( ); /* Sobel filter is applied to image1 */
save_image_data( ); /* Output of image2 */
return 0;
}
SOBEL EDGE DETECTOR
PREWITT OPERATOR
3×3 convolution mask.
Setting c = 1, we get the Prewitt operator:
PREWITT EDGE DETECTOR
GENERAL EXAMPLE
I
dx
d
I
dy
dI
22
d d
I I
dx dy
  
    
   
100Threshold  
I
PRACTICAL ISSUES
Choice of threshold
Gradient Magnitude
Low Threshold High Threshold
Edge thinning and linking.
CONCLUSION
Reduces unnecessary information in the image while
preserving the structure of the image.
Extract important features of an image like corners, lines
and curves.
Recognize objects, boundaries, segmentation.
Part of computer vision and recognition.
Sobel and prewitt operators are similar.
REFERENCES
Machine Vision – Ramesh Jain, Rangachar Kasturi, Brian
G Schunck, McGraw-Hill, 1995
A Computational Approach to Edge Detection – John
Canny, IEEE, 1986
CS485/685 Computer Vision – Dr. George Bebis
THANK YOU!

More Related Content

What's hot

5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
Gichelle Amon
 
Edge detection of video using matlab code
Edge detection of video using matlab codeEdge detection of video using matlab code
Edge detection of video using matlab code
Bhushan Deore
 
Image segmentation 2
Image segmentation 2 Image segmentation 2
Image segmentation 2
Rumah Belajar
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Deepak Kumar
 

What's hot (20)

Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filters
 
Canny edge detection
Canny edge detectionCanny edge detection
Canny edge detection
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
 
Edge detection of video using matlab code
Edge detection of video using matlab codeEdge detection of video using matlab code
Edge detection of video using matlab code
 
Image segmentation 2
Image segmentation 2 Image segmentation 2
Image segmentation 2
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Edge Detection
Edge Detection Edge Detection
Edge Detection
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Segmentation
SegmentationSegmentation
Segmentation
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
CV_Chap 6 Motion Representation
CV_Chap 6 Motion RepresentationCV_Chap 6 Motion Representation
CV_Chap 6 Motion Representation
 
Intensity Transformation
Intensity TransformationIntensity Transformation
Intensity Transformation
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
HIGH PASS FILTER IN DIGITAL IMAGE PROCESSING
HIGH PASS FILTER IN DIGITAL IMAGE PROCESSINGHIGH PASS FILTER IN DIGITAL IMAGE PROCESSING
HIGH PASS FILTER IN DIGITAL IMAGE PROCESSING
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 

Similar to Edge Detection algorithm and code

Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251
Editor IJARCET
 
Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251
Editor IJARCET
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1
ankuredkie
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 
De-speckling of underwater ultrasound images
De-speckling of underwater ultrasound images De-speckling of underwater ultrasound images
De-speckling of underwater ultrasound images
ajujohnkk
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 

Similar to Edge Detection algorithm and code (20)

Notes on image processing
Notes on image processingNotes on image processing
Notes on image processing
 
Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251
 
Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251
 
Math behind the kernels
Math behind the kernelsMath behind the kernels
Math behind the kernels
 
Seminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab codeSeminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab code
 
image segmentation by ppres.pptx
image segmentation by ppres.pptximage segmentation by ppres.pptx
image segmentation by ppres.pptx
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Comparative Analysis of Common Edge Detection Algorithms using Pre-processing...
Comparative Analysis of Common Edge Detection Algorithms using Pre-processing...Comparative Analysis of Common Edge Detection Algorithms using Pre-processing...
Comparative Analysis of Common Edge Detection Algorithms using Pre-processing...
 
Removal of Gaussian noise on the image edges using the Prewitt operator and t...
Removal of Gaussian noise on the image edges using the Prewitt operator and t...Removal of Gaussian noise on the image edges using the Prewitt operator and t...
Removal of Gaussian noise on the image edges using the Prewitt operator and t...
 
Ijcet 06 10_001
Ijcet 06 10_001Ijcet 06 10_001
Ijcet 06 10_001
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
Image fusion
Image fusionImage fusion
Image fusion
 
Basic image processing techniques
Basic image processing techniquesBasic image processing techniques
Basic image processing techniques
 
Introduction to Digital image processing
Introduction to Digital image processing Introduction to Digital image processing
Introduction to Digital image processing
 
De-speckling of underwater ultrasound images
De-speckling of underwater ultrasound images De-speckling of underwater ultrasound images
De-speckling of underwater ultrasound images
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoring
 
Image denoising using curvelet transform
Image denoising using curvelet transformImage denoising using curvelet transform
Image denoising using curvelet transform
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 

Recently uploaded

Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
Lokesh Kothari
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
RizalinePalanog2
 

Recently uploaded (20)

Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 

Edge Detection algorithm and code

  • 1. EDGE DETECTION Presented by: Vaddi Manikanta B212053 ETC
  • 2. INTRODUCTION Edges are significant local changes of intensity in an image. Edge Detection is the process of identifying and locating sharp discontinuities in an image. Abrupt change in pixel intensity characterize boundary of an object and usually edges occur on the boundary of two regions. Tulips image Edges of the Tulips image
  • 3. Tulips Image Part of the image Edge of the part of the image Matrix generated by the part of the image
  • 4. CAUSES OF INTENSITY CHANGE Geometric events Discontinuity in depth and surface colour and texture Non-geometric events Reflection of light Illumination shadows Edge formation due to discontinuity of surface Reflectance Illumination Shadow
  • 5. APPLICATIONS Enhancement of noisy images like satellite images, x-rays, medical images like cat scans. Text detection. Traffic management. Mapping of roads. Video surveillance.
  • 6. DIFFERENT TYPES OF EDGES OR INTENSITY CHANGES Step edge: The image intensity abruptly changes from one value on one side of the discontinuity to a different value on the opposite side.
  • 7. Ramp edge: A step edge where the intensity change is not instantaneous but occur over a finite distance. Ridge edge: The image intensity abruptly changes value but then returns to the starting value within some short distance (i.e., usually generated by lines).
  • 8. Roof edge: A ridge edge where the intensity change is not instantaneous but occur over a finite distance (i.e., usually generated by the intersection of two surfaces).
  • 9. MAIN STEPS IN EDGE DETECTION Smoothing: Suppress as much noise as possible, without destroying true edges. Enhancement: Apply differentiation to enhance the quality of edges (i.e., sharpening). Thresholding: Determine which edge pixels should be discarded as noise and which should be retained (i.e., threshold edge magnitude). Localization: Determine the exact edge location. Edge thinning and linking are usually required in this step.
  • 10. EDGE DETECTION USING DERIVATIVE (GRADIENT) The first derivate of an image can be computed using the gradient (or)f
  • 11. GRADIENT REPRESENTATION The gradient is a vector which has magnitude and direction. or Magnitude: indicates edge strength. Direction: indicates edge direction. | | | | f f x y      (approximation)
  • 12. EDGE DETECTION STEPS USING GRADIENT (i.e., sqrt is costly!)
  • 13. GENERAL APPROXIMATION Consider the arrangement of pixels about the pixel [i, j]: The partial derivatives , can be computed by: The constant c implies the emphasis given to pixels closer to the centre of the mask. 3 x 3 neighborhood:
  • 14. SOBEL OPERATOR 3×3 convolution mask. Setting c = 2, we get the Sobel operator:
  • 15. EDGE DETECTOR USING SOBEL OPERATOR IN C LANGUAGE #include <stdio.h> #include <stdlib.h> #include <float.h> #include "mypgm.h" void sobel_filtering( ) /* Spatial filtering of image data */ /* Sobel filter (horizontal differentiation */ /* Input: image1[y][x] ---- Outout: image2[y][x] */ { /* Definition of Sobel filter in horizontal direction */ int weight[3][3] = { { -1, 0, 1 }, { -2, 0, 2 }, { -1, 0, 1 } }; double pixel_value; double min, max; int x, y, i, j; /* Loop variable */
  • 16. /* Maximum values calculation after filtering*/ printf("Now, filtering of input image is performednn"); min = DBL_MAX; max = -DBL_MAX; for (y = 1; y < y_size1 - 1; y++) { for (x = 1; x < x_size1 - 1; x++) { pixel_value = 0.0; for (j = -1; j <= 1; j++) { for (i = -1; i <= 1; i++) { pixel_value += weight[j + 1][i + 1] * image1[y + j][x + i]; } } if (pixel_value < min) min = pixel_value; if (pixel_value > max) max = pixel_value; } }
  • 17. if ((int)(max - min) == 0) { printf("Nothing exists!!!nn"); exit(1); } /* Initialization of image2[y][x] */ x_size2 = x_size1; y_size2 = y_size1; for (y = 0; y < y_size2; y++) { for (x = 0; x < x_size2; x++) { image2[y][x] = 0; } }
  • 18. /* Generation of image2 after linear transformtion */ for (y = 1; y < y_size1 - 1; y++) { for (x = 1; x < x_size1 - 1; x++) { pixel_value = 0.0; for (j = -1; j <= 1; j++) { for (i = -1; i <= 1; i++) { pixel_value += weight[j + 1][i + 1] * image1[y + j][x + i]; } } pixel_value = MAX_BRIGHTNESS * (pixel_value - min) / (max - min); image2[y][x] = (unsigned char)pixel_value; } } } main( ) { load_image_data( ); /* Input of image1 */ sobel_filtering( ); /* Sobel filter is applied to image1 */ save_image_data( ); /* Output of image2 */ return 0; }
  • 20. PREWITT OPERATOR 3×3 convolution mask. Setting c = 1, we get the Prewitt operator:
  • 23. 22 d d I I dx dy             100Threshold   I
  • 24. PRACTICAL ISSUES Choice of threshold Gradient Magnitude Low Threshold High Threshold
  • 26. CONCLUSION Reduces unnecessary information in the image while preserving the structure of the image. Extract important features of an image like corners, lines and curves. Recognize objects, boundaries, segmentation. Part of computer vision and recognition. Sobel and prewitt operators are similar.
  • 27. REFERENCES Machine Vision – Ramesh Jain, Rangachar Kasturi, Brian G Schunck, McGraw-Hill, 1995 A Computational Approach to Edge Detection – John Canny, IEEE, 1986 CS485/685 Computer Vision – Dr. George Bebis