Edge Detection in the Visual Cortex
Edge detection is widely used in image processing. It is extremely important as the main preprocessing stage in pattern recognition. We are offering a new approach to this field.
The Sobel kernel Gy shown below is “tuned” to detect horizontal edges.
1 0 -1 1 2 1
Gx = 2 0 -2 Gy = 0 0 0
1 0 -1 -1 -2 -1
As the deviation from the horizontal direction increases, the Sobel filter’s sensitivity falls. As a result, the vertical image edges become invisible (see image on the right below). As you can tell from the image, they are all concealed in the “blind zone” of the filter.
As we will discuss more in our next story, there are two ways to perform image processing and, in particular, Sobel filtering:
- Spatial domain: filtering is done by convolving the image with a Sobel kernel. OpenCV has a ready-made solution for this — cv2.Sobel(image, cv.CV_64F, 0, 1, ksize=3).
- Frequency domain: multiplying Fourier transform of an image with Fourier transform of Sobel kernel, and compute inverse Fourier transform of the resulting product:
We propose to modify the procedure above as follows:
Here rot(b, alpha) denotes rotation of the Sobel kernel spectrum by angle alpha. This rotation changes the position of the blind zone since the modified Sobel filter is tuned to the new alpha direction.
The modified procedure applied to the image above demonstrates the repositioning of the blind zone for alpha = 0, 30, 60, and 90 degrees. The magnitude of the rotated kernel spectrum rot(b, alpha) is shown on the right.