I'm currently working on the same subject and this publication might help you in all the steps.
Regarding step 5:
- first you should filter out all the almost horizontal and vertical lines.
- differentiate the left and right side of the image, so on one side u filter out the lines with one orientation and on the other side with the other. If y=ax+b than left side a>0 and on the right a<0...
- I would suggest to do line unification in case you detect more the one line close by each other