To keep the electronics as simple as possible, I will be hacking a keyboard (as processing can deal with keyboard input very easily). To activate each of the camera feeds, I will have to press a certain key - so far they are B, G, T.
As I am wanting to take the inputs away from my laptop keyboard I bought a cheap keyboard. However, I did not realise that the connection was not USB & was a PS2, so I am currently waiting for a converter from Amazon. But once I get it, good things will happen!
I took the keyboard apart to find the circuit that I need & discovered how it really works - it's a lot more complicated & prettier than I thought!
To determine what keys I can use for the system, I will be experimenting with this circuit with a simple piece of wire to determine the location of each letter. Watch this space.
Sunday, 29 November 2009
The System Works!
After playing around with Processing for a few days with no success - trying to make webcam feeds appear when a certain switch is activated - I finally got my eureka moment! Instead of making a singular feed appear on the screen when a button is pressed, I could have all three feeds on at the same time, making two disappear (covering them with squares that are the same colour as the background) leaving a certain one on the screen - simple! The code for this program is below:
import processing.video.*;
Capture camera;
Capture camera2;
Capture camera3;
void setup()
{
size(1010, 730);
int value = 0;
// List all available capture devices to the console
// Use the information printed to the text area to
// correctly set the variable "s" below
println(Capture.list());
// Specify your own device by the name of the capture
// device returned from the Capture.list() function
camera = new Capture(this, width/3, height/3, "USB PC Camera-WDM");
camera2 = new Capture(this, width/3, height/3, "PC Camer@-WDM");
camera3 = new Capture(this, width/3, height/3, "Labtec WebCam-WDM");
// If no device is specified, will just use the default
//camera = new Capture(this, 320, 240, 12);
// Opens the settings page for this capture device
//camera.settings();
}
void captureEvent(Capture camera)
{
camera.read();
}
void draw()
{
image(camera, width/3, height/3);
image(camera2, 0, height/3);
image(camera3, 671, height/3);
if (keyPressed){
if (key == 'b' || key == 'B'){
rect(0, 0, width/3, height);
fill(0);
rect(width/3, 0, width/3, height);
fill(0);
}
}
if (keyPressed){
if (key =='t' || key == 'T'){
rect(width/3, 0, width/3, height);
fill(0);
rect(671, 0, width/3, height);
fill(0);
}
}
if (keyPressed){
{if (key == 'g' || key == 'G'){
rect(671, 0, width/3, height);
fill(0);
rect(0, 0, width/3, height);
fill(0);
}
}
}
}
The code is still a work in progress - trying to make it more slimline & efficient, but it works!
The screen shots are below.
import processing.video.*;
Capture camera;
Capture camera2;
Capture camera3;
void setup()
{
size(1010, 730);
int value = 0;
// List all available capture devices to the console
// Use the information printed to the text area to
// correctly set the variable "s" below
println(Capture.list());
// Specify your own device by the name of the capture
// device returned from the Capture.list() function
camera = new Capture(this, width/3, height/3, "USB PC Camera-WDM");
camera2 = new Capture(this, width/3, height/3, "PC Camer@-WDM");
camera3 = new Capture(this, width/3, height/3, "Labtec WebCam-WDM");
// If no device is specified, will just use the default
//camera = new Capture(this, 320, 240, 12);
// Opens the settings page for this capture device
//camera.settings();
}
void captureEvent(Capture camera)
{
camera.read();
}
void draw()
{
image(camera, width/3, height/3);
image(camera2, 0, height/3);
image(camera3, 671, height/3);
if (keyPressed){
if (key == 'b' || key == 'B'){
rect(0, 0, width/3, height);
fill(0);
rect(width/3, 0, width/3, height);
fill(0);
}
}
if (keyPressed){
if (key =='t' || key == 'T'){
rect(width/3, 0, width/3, height);
fill(0);
rect(671, 0, width/3, height);
fill(0);
}
}
if (keyPressed){
{if (key == 'g' || key == 'G'){
rect(671, 0, width/3, height);
fill(0);
rect(0, 0, width/3, height);
fill(0);
}
}
}
}
The code is still a work in progress - trying to make it more slimline & efficient, but it works!
The screen shots are below.
Monday, 23 November 2009
Processing
After deciding that I will concentrate on the peeping tom idea (as it is more technically challenging & has more social impact) I have begun using the open source program Processing. This program allows you to sketch code, testing & changing it quickly. I'm a bit of a novice at, but I'm starting to get the hang of it!
I have bought a webcam & currently experimenting with it...
Tuesday, 17 November 2009
Two Paths
Monday, 16 November 2009
It Begins...
This is the first post in the PLAY section of my 4th year project - during this time I will be recording the experiments I carry out to resolve & perfect my project. So here's hoping that there's many successes along with many failures.
Subscribe to:
Posts (Atom)