How to generate Edges from attached image?

  deep-learning, opencv, python-3.x

Using DL Model had generated the attached image. Now in the next step, I want to detect corner edges and use Contours & other OpenCV Libs and further extract areas.

Now, since the lines are deformed it is unable to detect corner edges. I tried using OpenCV edges, hough, gaussian libs but it didn’t work.

Please advise, how to correct image in order detect all the corner edges.

enter image description here

Source: Python-3x Questions