The challenge: I want to use the edges highlighted by the green dots to crop the image. I need to locate the points, and then use that to crop.
What I've done: I've tried to use threshold to get to the point where I eliminate the rest of the picture and only highlight the corner points and it works. Only issue is that I can't find a way to highlight the edge (the ones in green in the second picture) as the outermost pixel. All the techniques I'm reading up on use contours, but because these become independent dots, connected components seems better in theory. I am however stumped how to use connected components for this task.
Here is the picture with the green dots illustrating the corners of interest:

Here is the picture after threshold:

Clearly contouring won't work. Is there a better way to approach this problem?

