While that sort of analysis probably isn’t impossible, it is computationally unrealistic to do in realtime on a language which wasn’t designed for it.
It’s the sort of thing which is simple in 99% of cases, but the last 1% might well be impossible. Sadly it’s the last 1% you need to worry about, because anyone trying to defeat your system is going to find them
That’s deeply unwise. Nothing you cobble together yourself using a raspberry pi is going to be up to automotive safety standards.
Anyone who sets up one of these has nobody but themselves to blame when it misbehaves and gives them incorrect information, or no information, or starts flickering distractingly, and they get done for speeding/hit a pedestrian/fail whatever inspections the law requires in their part of the world