Discovered the Hough transform.
It’s ingeniously simple, so I tried it out for line detection:
From left to right is the original image -> filtered to binary image -> a view of the hough space for the image -> the image with superimposed hough space mapped to cartesian -> detected lines
This uses the simpler y-intercept form over the Hesse normal form used in the wiki page.
Terrible, hastily-written code for the curious: http://pastebin.java-gaming.org/0e10964752f16