OpenCV slideshow

Spotting some green

Do you ever get, while giving a presentation, that uncanny feeling that something’s missing? Well, of course, you just need my color-powered slide changer!

Thanks to this gimmick you can change slide just by showing a green object to your computer’s webcam. My program will detect the specified kind of green and it will simulate the SPACE key pressure, used by any serious presentation tool to advance to the next slide.

The green that should be detected is determined by three parameters, adjustable at run time using slider controls:

  1. minimum green level (0-255);
  2. minimum green/red ratio;
  3. minimum green/blue ratio;

I suggest to calibrate the program by following this procedure:

  1. start the program;
  2. show to the webcam the green object that you intend to use;
  3. lower down to zero each slider;
  4. raise the minimum green level until most of the detected green is located on your object;
  5. raise the other two sliders in order to remove the environmental noise (e.g. green detected outside your object); this might lower the quantity of green detected on your object to a bare minimum, but as far as there is any the program will work as expected.

Caveat: in order to avoid uncontrolled slide advancing the program will wait 2 seconds after detecting the green object before restarting the detection again; you can use these two seconds to remove your green object from the webcam sight, after changing slide.

This toy works surely on Linux, I didn’t bother trying it on other platforms; anyway it should work anywhere there is OpenCV and Xorg.

I used this program to do my master degree dissertation and it worked quite well; in that occasion the green object was a green dot in the middle of a black glove.


2 thoughts on “OpenCV slideshow

    • Paolo Bernardi Reply

      Hahaha erano mesi che volevo mettere su Internet ‘sta roba, finalmente l’ho fatto. 😀 Tra l’altro, ricordi la storia delle libc6 & co. come dipendenze? Sul progetto in Mono nada, ma su questo che ha un’eseguibile normale “debuild” guarda quali librerie usa (con ldd credo) e ce le mette in automatico (al posto della variabile shlibs o qualcosa del genere)!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.