This didn’t happen when I used other cameras. Compared to other good cameras, this camera uses a rolling shutter. Are there any values that need to be set separately when using a rolling shutter camera?
`V4L2_CID_EXPOSURE`: sets the exposure time in lines. The application needs to use `V4L2_CID_PIXEL_RATE`, `V4L2_CID_HBLANK`, and the frame width to compute the line time.
You might also look into whether your camera supports this control:
This lets you set the exposure in absolute time units. The documentation says that the value should be interpreted as 100us, but I would suggest you verify that. (I use a camera that interprets the units as 1 ms, I think.)
However you approach it, you want your exposure time to match the lighting. So if your lights are exhibiting a 60Hz flicker (which is common but not guaranteed), you want an exposure time of 1/60th of a second or some integer multiple (1/30th, 1/20th, 1/15th)
Note, as Crackwitz alluded to, the flicker frequency can actually be double the line frequency. (so you might be able to use a 1/120th of a second exposure time as well as integer multiples)
That’s what I would expect - higher values are longer exposure times, so all else being equal, the image should get brighter. Smaller values ( < 1/60th of a second, say) flicker because some of the lines are being exposed when the lighting is “pulsing”, and other lines are exposed while the light is off (loosely speaking).
What values did you try for EXPOSURE_ABSOLUTE?
I’d try values of 167, 333, 500, 667. (assuming the units of 100us are correct for your camera)
You will probably need to adjust your gain to compensate for the longer exposure times. Also, your frame rate might be limited by these longer exposure times. If that’s an issue, consider getting different lighting (or a camera with a global shutter.)