I am studying images of a projected satellite streak on LSST Camera CCDs (data taken at UC Davis) and am exploring using the Hough transform to automatically detect the location of the streaks in the images.
However, I have found that the results obtained by using the DM stack implementation are inconsistent with the implementation using Scikit-Image tools.
import lsst.kht
from skimage import feature
edge_image = feature.canny(image, sigma=10, low_threshold=1, high_threshold=25)
lines = lsst.kht.find_lines(edge_image, 10, 2, 0.5, 0.002, 2, 10)
This gives two lines, both with angles of 18.5 degrees, reported only to tenths, compared to:
from skimage import feature
from skimage.transform import hough_line, hough_line_peaks
import numpy as np
tested_angles = np.linspace(-np.pi / 2, np.pi / 2, 360)
edges = feature.canny(image, sigma=10, low_threshold=1, high_threshold=25)
h, theta, d = hough_line(edges, theta=tested_angles)
_, angle, dist = hough_line_peaks(h, theta, d)
Which also gives two lines but with angles of 18.80222841225625 degrees with seeming full precision.
Over-plotting the results of both methods, it is clear to see that the 18.5 degree results obtained from the first method is incorrect. Is there perhaps some internal rounding being performed in the DM stack implementation; I find it rather suspicious that the angle results from the DM stack KHT are perfectly to the half degree.