# How can I detect center of road(as a line) if contours for road are drawn.

I am interested in obtaining a center line of road. I am working on video frames(bgr). Then applying threshold,erosion and canny edge detection.

Further I am applying sobel derivative and then finally drawing contours.

I am thinking of taking small strips along y axis, obtaining x coordinates and the finding the mean of these x coordinates. But so far I have not come across any function which would allow me to do this.

Also if I get these values how should I store them ?

So, you have the border lines and want to compute from them the center line? Or do you currently have nothing and want to detect all the road lines?

Yes. I do have the edges of the road. But now I am not sure how to proceed. And also the contours I have drawn aren't conforming to roads.