title: OpenCV - How to obtain the last position of white pixels in a video?
body: <p>I was trying to create a driving aid system using python and OpenCV. I used some binary threshold to get the lane lines white. </p>
  
  <p>How can I get the last X value of the white pixels? I only found guides on detecting faces and lines. </p>
  
  <p>Here is the <a href="https://gyazo.com/48b38ec4c790943d3c55b98b6e41fb8e" rel="nofollow noreferrer">Video</a></p>
  
  <p>Current code:</p>
  
  <pre><code>#Video Feed
  ret, frame = cap.read()
  
  #Grayscale
  gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
  #thresholding
  thresh = cv2.threshold(gray, 140, 255, cv2.THRESH_BINARY)[1]
  </code></pre>