Automatically adjust brightness

I would like to implement automatic brightness adjustment feature on video frames, like what Zoom and Teams do in video meetings. Can I do that with openCV? Or I would need ML models to achieve that?

Any hints or sample codes would be great.

Adjust Microsoft Teams camera brightness

that likely involves AI to get a segmentation on the human.