flashing led detection with changing ambiant light

Dear all,

I would like to discuss the best way (accuracy and consumption) to detect a flashing green led with a changing ambiant light from night to day.
The led is lighting very quickly (around 20ms) every 4s.

To be accurate, i used QQQVGA frame rate to have 84fps and catch the flashing light.

I tried these three methods to detect the light :

  • images difference: very sensitive to ambiant light change and to reflecting ambiant light
    find_blob : very sensitive to ambiant light change and to reflecting ambiant light
    grayscale threshold: very sensitive to reflecting ambiant light

Have you an idea which is the best method ?

Thanks,

I’d use get_stats() to get the color distribution of the area the light is in and then monitor the area color distribution over time. When the LED is flashing it should change the green color average of the area.