GrayScale Image
Algorithm
g(x,y)=(B(x,y)+G(x,y)+R(x,y)) / 3
img.png
Edge detection using sobel operator
Algorithm
Sobel Operators
Image sub matrix
-1,-1 | 0,-1 | 1,-1 |
---|---|---|
-1,0 | 0,0 | 1,0 |
-1,1 | 0,1 | 1,1 |
- Pad image by one pixel on all edges
- For every pixel in image, extract sub matrix as shown above and perform matrix multiplication with sobel operators. Sum all the elements and assign it to the new image at corresponding pixel.
- Calculate average of the outputs generated by matrix multiplication to combine horizontal and vertical edge detection
- Perform thresholding and generate binary image