Best way to track/follow 3cm thick solid line with sharp inclinations!

Hello guys,
I want to make a line following bot that will follow a thick solid line.
What will be the best way to follow a 3cm thick line with pointed inclination of 45 and 90 degrees?
A sample of line and color contrast is given below:

any help will really be appreciated!

The code may be too fast for what you want. But, I think you can see what’s going on and what to do from it.