Check if player is on track

Let’s say I have an image for track, a white line on a black background. And my player can move accordingly to the mouse position. How can I check if the player got off the track so I can stop the game? I tried with physics2D colliders but it’s pretty hard work because my track it’s not only straight lines. It has some curves too. Do I have another option for this? Or I need to add Pollygon2D components all over the place?

You’ll have to use polygon 2D colliders and set them each as a trigger.