I play a bit of flightsim and our head tracking works the same way. Camera receives IR LED position for head movement axis, program does the interpretation of movement.
There's a homebrew head tracking demo [0] for the wii that has you put a sensor bar on your head, and a wiimote on top of your TV. I messed around with it over a decade ago and found it very convincing.
0: https://www.wiibrew.org/wiki/Headtracking