1. A method for determining a position of a scan head in a scanning unit, wherein the method comprises determining that the scan head is positioned at a known location in the scanning unit based at least in part on: adjusting parameters of a first window and a second window to correspond to edges of a known pattern at the known location; moving, in accordance with the adjusted parameters, (i) the first window in steps along a line of pixels detected by the scan head and (ii) the second window in the steps along the line of pixels detected by the scan head; at each of the steps, determining (i) an average value of pixels of the line of pixels in the first window and (ii) an average value of pixels of the line of pixels in the second window; in at least a subset of the steps, determining edges in the line of pixels detected by the scan head based at least in part on a difference between the average value in the first window and the average value in the second window being greater than or equal to a predetermined threshold; and determining a correlation between (i) the edges in the line of pixels detected by the scan head and (ii) the edges of the known pattern, wherein the correlation between (i) the edges in the line of pixels detected by the scan head and (ii) the edges of the known pattern corresponds to the scan head being positioned at the known location in the scanning unit.