Along the lines of your idea, we've looked at using the CCD array out of desktop scanners with a spiral pattern printed on the crank. But bike bottom brackets are a hostile environment, plus (ideally) we'd actually be measuring the angle against local vertical (i.e. the direction in which gravity sucks).
Our test bike currently runs 4 Pi zeros, 4 Cortex M0s (nRF52), a fistful of 24-bit ADCS, 2 high precision gyros, air pressure/air speed sensors and a 2.4GHz network, all in order to measure realtime CdA. Still unable to crack the angle problem though.