- The Prewitt edge detection operator is used in image processing to detect edges by calculating the gradient of image intensity at each pixel.
- It works by convolving the image with Prewitt filters (kernels) that approximate the gradient in the horizontal and vertical directions.
- The operator uses two 3*3 kernels which are convolved with the original image to calculate approximations of the derivatives – one for horizontal changes and one for vertical
Gx is given as: (Horizontal Kernel)
-1 | 0 | 1 |
-1 | 0 | 1 |
-1 | 0 | 1 |
Gy is given as: (Vertical Kernel)
-1 | -1 | -1 |
0 | 0 | 0 |
1 | 1 | 1 |
Gradient represents change in color or intensity
Problem
Detect the edges for the image shown as:
- Apply prewitt operators at the position (0,0) (0,4)(4,2)
- Apply prewitt operators for all the non border cells
- Detect vertical edges
- Detect horizontal edges
- Compute gradient magnitude
- Compute gradient angle
1 | 2 | 4 | 5 | 2 |
5 | 2 | 5 | 6 | 2 |
5 | 4 | 2 | 7 | 1 |
1 | 1 | 3 | 5 | 6 |
2 | 4 | 6 | 4 | 7 |







































Views: 3