Once the tool only for governments, universities and large corporations, computer vision is now mainstream enough to solve your problems. It's also less expensive than you probably think.
Automated range of motion measurement
Using computer vision, it's possible to measure range of motion in dynamic environments that were once impossible. See live ROM measurements during exercises, on bikes, during weight lifting. Even during fast moving exercises, ROM is measured and displayed on the screen. You can record maximums, minimums and number of times a target was reached.
In this example, the patient has targets for both flexion and extension as well as a target number of repetitions. The goals are tracked on the screen, providing real-time feedback.
Computer vision is flexible enough that you can design a system to do exactly what you want.