antima55 | adventures in reality

CAT | face projector

i have been working on how to get access to framerate, resolution and quality of both the movie file and the ps3eye capture so here comes an update on that.

to use ps3eye with processing i recommend using the newest of the old (pre 4.0) version of alex p’s windows driver. together with Den Ivanov’s ps3 eye processing library.

get the ps3 eye driver here:
http://codelaboratories.com/downloads/archive/
and the library here:
http://www.cleoag.ru/2009/11/23/ps3-eye-processing-library/

follow the install instructions closely!

to implement the ps3 eye library i needed to do some recoding as i left the jmyron library that i normally used for capturing and replaced it by ps3eye lib.
this was done by using the example that came together with the library files.
in the example i learned what general functions ps3eyelib uses:
import ru.cleoag.*;
PS3Eye p;
PImage img;

int cameraWidth = 640;
int cameraHeight = 480;
int cameraRate = 30;

p = new PS3Eye(this);
p.start(cameraWidth,cameraHeight,cameraRate);
img = createImage(cameraWidth,cameraHeight,RGB);

p.update();
p.imageCopy(img.pixels);
img.updatePixels();
image(img,0,0,width,height);

p.stop();

these replaces all the jmyron and m.etc tags found in the proc55ng sketch.

the next problem was that i had realized that my movieMaker only outputted files of approx 300 *300 pixels resolution.
even though the width and height is set to 640 * 480.
so i searched the reference and got the knowledge of movimaker types and quality.
then this thread helped me pick an ideal format and in the end i had exported my recorded movie in the format type of SORENSON and with the BEST quality.

here is the final upload consisting of the processing and py file plus the data folder:
FACE_PROJECTOR_PS3EYE.zip

No tags

  • making the processing sketch copy the .mov file to a subdirectory called data right after finnishing recording.
  • maybe improve the framerate, right now too fast.
  • seeing how it works on dual screen.
    one screen for running the processing app, and one for the combined py-script plus vlc
  • making python stop popping up once a while. = keep it running in the background
  • at all times keep vlc from osd (on screen display)

PhilHo from the processing forum helped me out with some general java knowledge to do the moving of the finished video file to the data folder.
to do this here is the following

void optag(){
movieName = nf(cnt, 3) + “.mov”;
mm = new MovieMaker(this, width, height, movieName ,30, MovieMaker.H263, MovieMaker.HIGH);
for(int i=0;i<100;i++){
m.update();//update the camera view
m.imageCopy(pixels);//draw image to stag
updatePixels();
mm.addFrame();
}
mm.finish();
// File (or directory) to be moved
File file = saveFile(movieName);

// Destination file
File dest = new File(savePath(”data”), movieName);

// Move file to new directory
boolean success = file.renameTo(dest);
if (!success) {
println(”not moved”);
}

cnt++;

noLoop();
}

what is new is the text in black.
PhilHo also helped out by showing me the nf() function that let you specify how long a number is with zeroes displayed.

No tags

right now i have been working on the software side of the face projector for some days, with help from different friends i have now accomplished to make a processing sketch that when 1 is pressed on the keyboard, records a video clip of 300 frames with 30fps, and saves it in .mov format in the following sequence, 000, 001, 002, 003, etc.

a python script i got from jorgen then plays all the videos using some custom scripts for VLC media player. which results in playing the newest clip every third time and random clips in between.

so right now the idea of cycling through the clips have been thrashed and replaced by a one button solution and software to show the newest clip most frequent.
this is not what i had in mind in the beginning but its ok for now.

below i have pasted the code from the py script and the processing sketch.
keep in mind that this is only alpha stage, still improving.

the processing sketch:

/*
when you press 1 on either your keyboard or numpad,
a video clip of 100 frames and 30fps is recorded
and named after the sequence 000, 001, 002, 003, 004, etc.
you can make changes to wherever you like.
i have pointed out where the number of frames to record
is to be editted.

if you use it please leave a comment at my site:
http:ibeams.org

kind regards antima55
*/
import processing.video.*;
import JMyron.*;

MovieMaker mm; // Declare MovieMaker object

JMyron m;//a camera object
int cnt=0;
int cnt2=0;
int cnt3=0;
String str2;
int a=1;

void setup(){
size(640,480);

m = new JMyron();//make a new instance of the object
m.start(width,height);//start a capture at 320×240

m.findGlobs(0);//disable the intelligence to speed up frame rate
println(”press 1 to reord a video clip”);
loadPixels();
}

void draw(){
background(0);
}

void record(){
str2=”"+cnt3+cnt2+cnt;
mm = new MovieMaker(this, width, height, str2 +”.mov”,30, MovieMaker.H263, MovieMaker.HIGH);
for(int i=0;i<300;i++){
m.update();//update the camera view
m.imageCopy(pixels);//draw image to stag
updatePixels();
mm.addFrame();
}
mm.finish();
cnt=cnt+1;
if(cnt>9){
cnt=0;
cnt2=cnt2+1;
if(cnt2>9){
cnt2=0;
cnt3=cnt3+1;
}
}
noLoop();
}

void keyPressed() {
if(key==’1′){
println(”recording”); // Does not execute
record();
println(”finnished recording clip number:”+str2);
}
}

public void stop(){
m.stop();//stop the object
super.stop();
}

and the python script from jorgen:

import glob
import random
import subprocess
import time

vlc=r”PATH TO YOUR VLC.EXE”
movieglob=r”PATH TO DIRECTORY CONTAINING YOUR PROCESSING SKETCH\*.mov”
cycletime=250/30 -0.1

cyclecount = 0
while True:
movies = list(reversed(glob.glob(movieglob)))
if cyclecount % 3:
subprocess.Popen([vlc,'-f',movies[0]])
else:
subprocess.Popen([vlc,'-f',movies])
time.sleep(cycletime)
cyclecount +=1

what needs further improvement is:

  • making the processing sketch copy the .mov file to a subdirectory called data right after finnishing recording.
  • maybe improve the framerate, right now too fast.
  • seeing how it works on dual screen.
    one screen for running the processing app, and one for the combined py-script plus vlc
  • making python stop popping up once a while. = keep it running in the background
  • at all times keep vlc from osd (on screen display)

if anyone can help with the above feel free to contact me:
johannesgj checkmeoutat googles email system dot com :-)

No tags

hehe, today i saw an instructable by graffiti research lab houston that overly reminded me of my face projector. anyway i feel proud having invented this on my own and seeing the gurus at GRL inventing exactly the same. well, the only difference is that my idea hasn’t reached the physical stage in same outstanding way as theirs.
(btw. i also think its really funny to see an idea i had months ago gotten realized in a video with ghetto-booty background music hehe)
here is some sample photos for you to see the resemblance of the two projects, mine and GRL’s version.


- the face projector

- Texas Big Face - 3D Face Projection How To

i am happy to see that some of my projects work in the real world even though i don’t manage to outlive them myself, they pop up in somebody else’s mind. its like some idea’s have such a strong will to get into reality that if you choose to put them aside for some time, they just find other minds from which they can get expressed. very weard thought. hehe :-)
check out their video below:

No tags

Dec/09

26

virtual talking face

here is some others attempt at doing exactly the same as the face projector

No tags

Older posts >>