FFT for line detection
You might look at trying Autocorrelation for this. Here is an SO answer describing how to perform autocorrelation with Matlab using FFTs. This could be extended for two dimensions.

I implemented your test case in numpy as follows:

a = np.zeros(300)
a[::30] = 1
plt.acorr(a, maxlags=50)


This gives the following plot:



As you can see, the peaks pop up at +/- 30.