We have to say that the example game [murtaza] in its latest video is not exciting. However, it is very interesting that he uses opencv technology to track a hand and determine its distance from a camera. The demo displays a random button on the screen. You must press the button by hand and then move the button so that you can try again. Manual measurements seem to be accurate to a few centimeters, which is sufficient for many applications.
Python code is actually very simple. Essentially, the software tracks your hand and determines how far it is from you by estimating its relative size. Of course, your hand may also rotate, [murtaza] handles all cases step by step. If we want to know the distance, we may turn to ultrasonic or time-of-flight sensors. The problem is that these sensors can’t distinguish your hand from anything in front of it. Using a camera to track and locate is very impressive.
If you haven’t used opencv before, there are many tutorials on this channel, which are worth watching. Computer vision is a great technology, which can replace many things in some applications. For example, global positioning system. Or, try this creepy tracking app next Halloween.