I think that this should be fairly simple and tons of guides out there would help you but the steps to take in a nutshel are
- Load an image from the robots integrated camera
- Convert the image to grayscale and apply histogram equalization to cover for lighting differences
- Now perform OTSU based thresholding, which will seperate between the white floor and the black line
- Apply a thinning / skeletization algorithm to find the line which you need to follow
Cheers!