0

I wrote a script using opencv to read bottle level.

https://i.stack.imgur.com/JMaDE.jpg is an example of the project

My question is:

Every time that show the red line I need to call a two-second interval function, but in that range there may be other red lines. So, how can I call a function for each red line?

F.M
  • 1,369
  • 1
  • 16
  • 31
  • 1
    keep a dequeue of times you need to call the function, in the loop check if you need to call the function and remove item from dequeue. You also need a shorter exposure time and a bigger light source (flash) – rioV8 Aug 10 '20 at 02:08

1 Answers1

0

You could import datetime and have it calculate the time 2 seconds later and wait until it is (or after) that 2 seconds using the datetime.timedelta() command. More info about timedelta here.

Hussein Esmail
  • 353
  • 5
  • 21