Tracking FX en Realtime con FaceRecognition
Posted on 07.20.09 by i2off @ 6:47 PM

y el codigo para Processing

import processing.opengl.*;
import hypermedia.video.*;
OpenCV opencv;

int ancho_sketch = 800; //
int alto_sketch = 600; //
//-----------------------//
int ancho_captura = 320;
int alto_captura = 240;

PImage cara;

void setup() {
size(ancho_sketch,alto_sketch,OPENGL);
opencv = new OpenCV(this);
opencv.capture( ancho_captura , alto_captura );
opencv.cascade(OpenCV.CASCADE_FRONTALFACE_ALT);
cara = createImage(80, 60, RGB);
}
void draw() {
background(0);
Rectangle[] faces = opencv.detect();
opencv.read();
//image( opencv.image(),0,0);
//saveFrame(”cam####.png”);
//background(0);
for( int i=0; i int x = faces[i].x;
int y = faces[i].y;
int w = faces[i].width;
int h = faces[i].height;
//cara.copy(opencv.image(),x,y,w,h,0,0,cara.width,cara.height);
x = (x*100)/ancho_captura;
x = (width*x)/100;
y = (y*100)/alto_captura;
y = (height*y)/100;
w = (w*100)/ancho_captura;
w = (width*w)/100;
h = (h*100)/alto_captura;
h = (height*h)/100;

float dw=120.0/w;
float cx=(x+w/2.0);
float cy=(y+h/2.0);
translate(width/2,height/2,0);
scale(dw,dw,dw);
translate(-cx,-cy,0);

image( opencv.image(), 0, 0,width,height );
//saveFrame("fx####.png");
}

}


Filed under: opencv and processing and sourcecode
Comments:

1 Comment »

  1. [...] Fuente: Stream.i2offPlusR3nder [...]

    Pingback by Processing: Tracking FX en Realtime con FaceRecognition - Talleres - MCCWN — July 20, 2009 @ 8:20 PM

RSS feed for comments on this post. TrackBack URI

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Stream.i2offPlusR3nder

Main Menu
Home
audio
maxmsp
opencv
processing
quartzcomposer
sourcecode
Uncategorized
videomapping

Search

  • Sites

  • Social


  • Syndication
    RSS 2.0
    Comments RSS 2.0
    WordPress

    Credits and Copyright
    Proudly powered by WordPress. All content © 2004-2005 Author
    Wordpress Firewall (*)

    Archives
    August 2009
    July 2009
    April 2009
    March 2009
    December 2008
    September 2008
    August 2008

    Recent Entries
    scratch con max/msp y processing [VIDEO] and some source
    SamsungDJ (scratch con maxmsp/processing en un touchscreen)[pruebas y codigo en max/msp]
    SamsungDJ (scratch con maxmsp/processing en un touchscreen)
    Guia de Setup de OpenCV con XCode
    Tracking FX en Realtime con FaceRecognition
    Video Mapping sobre superficie Curva, solucion 1
    Nueva Version de OpenFrameworks [permite exportar para iPhone]
    Entorno Para programacion tipo Max/Msp en Processing
    About
    Multitouch para el gobierno de la ciudad de buenos aires
    Automapeo para proyeccion
    Proximas Fechas [Paris y Emiratos Arabes Unidos]
    Proxima fecha, BOGOTA!
    LightPixelApp+ RegnumLuminis [que hay tras LightPixelJockey] [arduino+processing]
    CLANDESTINA WEEKEND NERD NUMBER 3