• About
  • Magic Mirror
  • OpenCV and Pi Camera Board
  • Raspberry Pi for Smartphone Parental Control

Think RPI

~ Creative Raspberry Pi Area

Think RPI

Category Archives: Papp

My Raspberry at Mexico !

14 Saturday Feb 2015

Posted by Pierre in Papp

≈ 1 Comment

marco_02

Our wonderful robot designed by Tordal and animated with my soft running on a raspberry pi was exposed at the Museum for Contemporary Art MARCO in Mexico from september 2014 to January 2015. RPi Power ! 😀

Art, Design & Raspberry Pi

20 Tuesday May 2014

Posted by Pierre in OpenCV and Pi camera, Papp

≈ 9 Comments


Summary 
This painting was exhibited in Berlin during Pictoplasma 2014 Festival.
Eyes are following visitors (if many, change randomly).
It’s powered by a Raspberry Pi, C++ Code and Open CV (using Face Recognition)

Software written by Pierre Raufast (France)
Animatronics, Design and Built by 3753% Tordal (Norway)
More infos : tordal.no, raufast.org, thinkrpi.wordpress.com

Pictures

smallCAD

CAD by Tordal

smallView2

Plywood structure with servo and animatronics by Tordal

smallPainting

Once painted… nice eyes isn’t-it ?

smallBerlin

During Pictoplasma @Berlin, May 2014

smallView1smallGeneral

Technical Stuff – Face Recognition

Software is based on Raspberry Pi and strongly inspired from my previous “OpenCV and Pi camera” posts.
For face recognition, software is very easy : it only detects faces, without recognizing people. It’s fast.
face_cascade.detectMultiScale(imageMat, faces, 1.1,3,CV_HAAR_SCALE_IMAGE,Size(80,80));
g_nVisitors = faces.size(); // number of visitors found

Once faces are detected, instructions are sent to servos to move eyes. Actually, it looks like a physical version of XEyes, for old good X11 geeks 😉
The code implements a lot of funny behaviors :

  • if unique visitor, follow him
  • if many visitors, randomly change
  • if a new visitor appears, focus on him
  • if nobody, search visitors with funny eyes moves
  • sometimes, take a nap, close eyelids.
  • …

The tricky part was how to remember which visitor is where, frame after frame. And, when the face is lost while few seconds, be able to remember this visitor was already here (it’s not a new one, no need to focus on him/her).

Code detect faces and servo move (H/V)

Code detect faces and servo moves (H/V)

Technical Stuff – Servo Control

Eyes are controlled by 2 servos (horizontal and vertical moves). Eyelid is controlled by a third servo. Thanks to ServoBlaster, control servos with Raspberry Pi is really very easy. To move servo using shell (for testing), just type  : (0 = 1st servo, % = between 0-100)
echo 0=50% >/dev/servoblaster
echo 0=10% >/dev/servoblaster

and in C++ (fflush is important !)
FILE * servoDev;
servoDev=fopen(“/dev/servoblaster”,”w”);
fprintf(servoDev, “%d=%d%%\n”,ServoId,ServoPosition); //will be in a function
fflush(servoDev); // will be in a function
fclose(servoDev);

I used :

  • Servo 0 (Horizontal Move) = GPIO 4 = Pin 7
  • Servo 1 (Vertical Move) = GPIO 17 = Pin 11
  • Servo 2 (Eyelid Move) = GPIO 18 = Pin 12
  • GND pin is connected to gnd servo power

servo

 

Acknowledgements

Thank you Bard (from 3753% Tordal) to give me opportunity to work on such funny project ! and to show our work during Pictoplasma Festival in Berlin ! (Next : Mexico…)
Thank you Richard for your wonderful and easy-to-work-with ServoBlaster Daemon.
And Thank you Nat for your patience during all these sundays, spent in front of my Raspberry… 🙂

 

Donate

Sujets

  • About
  • Magic Mirror
  • OpenCV and Pi Camera Board
  • Raspberry Pi for Smartphone Parental Control

Recent Posts

  • 2 years ago…
  • My Raspberry at Mexico !
  • Art, Design & Raspberry Pi
  • 40 “anonymous” pictures for a better recognition
  • Use directly with a library ?
  • Change the voice of your magic mirror
  • OpenCV&Pi Cam – Step 7 : Face recognition
  • OpenCV and Pi Camera Board !

Recent Comments

nakna kvinnor on Step 6 – Face Recognitio…
pat054 on OpenCV&Pi Cam – Step 3 : c…
pat054 on OpenCV&Pi Cam – Step…

  • Follow Following
    • Think RPI
    • Join 83 other followers
    • Already have a WordPress.com account? Log in now.
    • Think RPI
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...