Camera Flicker on Global Shutter

Using the global shutter sensor on the rt1062 and in a room lit by a combination of florescent and sky lights I am getting a lot of flicker frame over frame. This is resulting in many false positives when I am frame differencing. Any thoughts on how I can reduce this noise? Is this expected on the global shutter compared to the standard sensor? See short clip attached

Screen Recording 2024-04-12 at 2.41.40 PM.zip (4.8 MB)

It’s seeing the lighting from the room. To fix this you need to change the exposure to be longer. Or, if you know the freq of the room 50/60hz then make the exposure a multiple of that freq.

E.g. 5ms is a multiple of 50 hz but not of 60 hz.

1 Like

If I have labor intensive operations being performed on each frame, would that mean the shutter speed is not actually dictating this cycle? Meaning that the next frame starts after some operational delay.

Unless the camera is in triggered mode you are just sub-sampling the camera’s frames coming out which are exposed by whatever exposure algorithm.

I’m having a hard time with subdivision of 1/60th of a second. This is directly related to a separate thread where i determined that autoexposure isn’t working for my application so setting exposure manually to brighten the image is a must. But this would require me to jump from 1/60 to 2/60. Perhaps auto gain would save me in these large exposure differences, but I’m hoping that there is a better way.

I figured I would try setting frame rate to 30 hz so I am capturing a prescribed exposure only 30 times a second which should be in the same frequency of the 60hz lighting but with space between each frame. It appeared there was a conflict in manual exposure for this method.

Do you have any other suggestions?

Hi, you just need to set the manual exposure to something that’s a multiple of 1/60th in microseconds. Once you do this the aliasing should stop.

You can leave autogain on after setting the exposure. You just need to be a multiple of the light flickering.

The frame rate method just drops frames into the MCU. This has nothing to do with the sensor itself.

I don’t know about your project but you should use a flash light only for the camera or use halogon lamps in your room…

Unfortunately the facility I’m using this in is pretty well established with fluorescent already.

For using increments of 1/60 I’m finding that 16,667 microseconds vs 33,334 and so on are really large jumps in exposure. Am I missing something?

I’m also thinking that so long as I stay under 33,334 I should be able to simply set the frame rate to 30 fps and that will keep my exposure to the same phase of the AC duty cycle. Is frame rate and manual expose not compatible?

You don’t have to set the exposure that large. It just needs to be a multiple. E.g. 1667 would be fine and etc.

The goal of matching the exposure to the freq is to prevent it changing greatly each frame.

I’m also thinking that so long as I stay under 33,334 I should be able to simply set the frame rate to 30 fps and that will keep my exposure to the same phase of the AC duty cycle. Is frame rate and manual expose not compatible?

set_framerate() just controls frame dropping in the camera driver to give you the correct frame rate you asked for. The camera may generate frames faster. We also will slow/speedup the camera if applicable when this is called.

Exposure is an independent value that’s applied per frame. It generally is not equal to the frame rate. The camera exposes pixels and then reads them out.

I just read that the lights pulse at double the AC frequency once on the high and another on the low of the sine wave. So I should be fine to go to 8333 micro seconds. I guess I’m not understanding how I can set a smaller window than that. If I set it to 1666 I’d have 5 divisions of one lighting cycle and each frame could have different lighting. Right?

Is it safe to assume that there is negligible delay between frames. Meaning set at 8333 would capture 120 frames pers second. Of course my machine vision code is slowed and would use a subset of those.

If I set it to 1666 I’d have 5 divisions of one lighting cycle and each frame could have different lighting. Right?

Yeah, you want each image to have the same lighting. So, if you lower too far you’ll get beating again.

Is it safe to assume that there is negligible delay between frames. Meaning set at 8333 would capture 120 frames pers second. Of course my machine vision code is slowed and would use a subset of those.

Yes