title: opencv detect light frequency
body: <p>I am currently working on a hobby project for a robot car.
  In front of the camera, I will place 2 light sources and with computer vision I want to detect the light sources and position my robot car in front of it.</p>
  
  <p>With Python and OpenCV on a Raspberry Pi 3, I have the following working:
  I am using 2 red light sources. Using the following OpenCV functions: cvtColor(frame to HSV), inRange(red filter), findContours(find the 2 light sources), Moments(get the x,y coordinates of the light sources), calculate distance of the light sources compared to the edge of the frame and generate which direction the car have to move.</p>
  
  <p>The problem now is, I cannot determine which red light source is left and which one is right. If I turn for example my breadboard with 2 red light sources, the program won't be able to tell that the car has to move around the light sources.</p>
  
  <p>I have 2 ideas to fix this:
  - using frequency to let the light sources blink different. let's say LEFT(1, 0, 1) and RIGHT(0, 1, 0). I might not be able to use threading here, since I need 'every frame'.
  - using 1 red and 1 green light source. For this I have to add separate functions to detect green, which means more processing power.</p>
  
  <p>I'm struggling with choosing the best option since I'm inexperienced in this field. Do you have any tips? Or which idea is better?</p>