title: OpenCV C++ Draw Rectangle Based on two line
body: <p>I want to do a car park lot detection program for my school assignment but I am rookie on openCV and image process. </p>
  
  <p>What i plan to do is using houghLine to detect the white line on the car park lot and draw a box.
  However, the line of the car park lot is not a complete rectangle. </p>
  
  <p>Example :: </p>
  
  <p><img src="https://i.stack.imgur.com/jT4Fu.jpg" alt="4nFaLkI.jpg"> </p>
  
  <p>The output i need :: </p>
  
  <p><img src="https://i.stack.imgur.com/Cty4T.jpg" alt="YMDuuHr.jpg"></p>
  
  <p>I able to use houghLine to draw the vertical line ( <strong>Red Line</strong> ) but i have no idea how to join the line ( <strong>green line</strong> ) to form a box since houghLine detect multiple point of the line, it will not detect the start point and end point of the straight line. 
  I also try the convex hull method but i didnot manage to do it. Any opencv function can overcome this porlbem ??</p>
  
  <p>I really have no idea and hope anyone can give me some idea to solve the problem.
  Thank you.</p>