I have a binary plot in some coordinate space, how do I find slope most efficiently?

33 Views Asked by At

So basically I have a 2d array filled with 1s and 0s. There should be a linear slope associated with the 1s, and I need to find that linear slope with the best accuracy and quickness possible.

How could I do this (please note, there could be multiple lines, but they should all be of similar slope)? (picture of plot below)

enter image description here

enter image description here