1.Read Reg[0x00](Gain) to judge switch between normal and night mode.
2. suppose you use sensor AGC/AEC.
3.suppose normal mode: 15fps gain ceiling 8X, night mode: 3.75fps gain ceiling 8x
4. set proper thredhold value.
in normal mode: if Gain>7X switch to night mode.
in night mode: if gain<1.2X switch back to normal mode.