Rolling shutter strobe pattern I'm trying to implement a vision-based "lidar" system as described here: https://hackaday.com/2016/04/04/smartphone-and-ir-line-laser-measure-distance/

the idea is to capture video at 30fps and pulse a laser at 15hz such that the laser appears in odd frames and does not appear in even frames. By taking the difference between odd and even frames we can isolate the laser line.

when I implemented this, the isolated laser phases in and out with a period of ~1 second. Looking at the raw frames, sometimes the laser is full-brightness, sometimes it is not visible, and sometimes it's at 50% brightness.

Given that the laser is either on or off, I'm not sure why the partial-brightness frames occur. My current theory is that CMOS rolling shutter might not just scan top->bottom like I'd expect, but that doesn't make much sense. I checked to make sure that I'm getting video at 30fps and I'm using a usb camera with the ov9712 chip.
No matter when the camera shutter is active, if the frequencies of the video vertical timing (the frame rate) and the laser pulse are not congruent, you'll see partial exposures as they drift apart.

The solution is to trigger the laser pulse on every other vertical sync time. The details on extracting the vertical interval will depend on the camera, and how to trigger the laser will depend on the details of that device. But some sort of forced sync is the only way to get exactly what you want.