Edge Detection Code Review

This is kinda a mix of code help and code review but more code review since the code already works.

The purpose of this script is to get all the parts specified and make an outline where ever there is an edge. It went through many revisions already to dodge every edge and corner case, but it’s still pretty slow. There are also still some cases in which it messes, but I haven’t fully understood why. I’m very new to the math I used in this so it’s likely a lot of the processes could change too.

What I’m looking to improve:

  • Accuracy
  • Performance
  • Process

Files: