Steger_line_algorithm
Steger_line_algorithm copied to clipboard
Wrong convolution kernels
The kernels are not the kernels specified in the paper (eq 25 - 29). In fact they are in weird column/row - vector shapes when they should be square matrices.
It's not wrong in term of edge extraction but it's not similar to the one used in the paper. Yet, the output behavior is still the same : 1D Gaussian filter * 1D x-derivative = sobel x and 1D y-derivative * 1D Gaussian filter = sobel y.
Thanks for clarifying. I need to understand that myself why this is equivalent. I have also implemented the kernels like in the paper:
temp = np.arange(-kernelSize, kernelSize+1) X,Y = np.meshgrid(temp, temp, indexing='ij')
# create filter for derivative calulation
dxFilter = 1/(2*np.pi*sigma**4)*(-X) * np.exp(-(X**2 + Y**2)/(2*sigma**2));
dyFilter = 1/(2*np.pi*sigma**4)*(-Y) * np.exp(-(X**2 + Y**2)/(2*sigma**2));
dxxFilter= 1/(2*np.pi*sigma**4) * (X**2/Sigma**2 - 1) * np.exp(-(X**2 + Y**2)/(2*sigma**2));
dyyFilter= 1/(2*np.pi*sigma**4) * (Y**2/Sigma**2 - 1) * np.exp(-(X**2 + Y**2)/(2*sigma**2));
dxyFilter= 1/(2*np.pi*sigma**6) * (X * Y) * np.exp(-(X**2 + Y**2)/(2*sigma**2));