Wednesday 9 December 2009

The Limits...


I have found the limits of how many feeds you can clearly see on my screen & the answer is...
20! I can get a 5x4 grid of feeds on my computer screen which are big enough to understand what is being seen. I just need to find 8 extra feeds now!

Monday 7 December 2009

Button Test

A cheeky little vid to show the system working.

Everywhere

I've managed to combine 8 web feeds with my 3 webcams to get a grid of 11 showing different place around the world - from Adelaide to Copenhagen! Here's a screenshot:


The only problem with this is that the whole programme slows down, including my webcams, to around 1 frame every 3 seconds...

Around the world!

After speaking to some people on the Processing website, asking if I could stream live feeds from the internet, they said no - but only to movie files, not jpegs that refresh every couple of seconds on the web page. I just had to write a simple programme that tells processing to look for the exact picture - simple! It's not the smoothest thing in the world, but it works. The best feed I could find so far is from the Brooklyn Bridge that refreshes the picture every second. To view it just copy & paste this code into a processing application:

PImage a; // Declare variable "a" of type PImage

void setup() {
frameRate(1);
size(1024, 768);
}

void draw() {
// Displays the image at its actual size at point (0,0)
a = loadImage("http://brooklyn-bridge.mobotixcam.de/record/current.jpg?rand=380424");
image(a, 0, 0);


}

Peephole MKI





To test the view of the webcam feeds, I set up a rig to look through a standard peephole. You hold it up to the screen & look through: the initial tests were positive.
Although you can't see much, it actually gives you a really weird view, which looks really nice.

Inside the mouse...





To take the input (opening the peephole) away from the computer & avoid using arduino for now, I have bought an optical mouse to take apart & use the buttons.

Also

The mouse buttons can be used to control the webcam feeds too!

Making Noise

After talking to Jon about my progress, he thought that I should explore the receiving end of the system - the people who are being looked at & ways they could become aware of someone watching them. So to do this, I am playing around with sounds - when an individual peephole is activated, the corresponding webcam makes a sound.

Currently the sounds are limited to being played off my computer (each alert is controlled from a different mouse button) & the sounds are from Metal Gear Solid, but hopefully I'll be able to play them in separate speakers.

"Hears" the code:

import ddf.minim.*;

AudioPlayer leave;
AudioPlayer codeccall;
AudioPlayer alert;
Minim minim;

void setup()
{
size(200, 200);

minim = new Minim(this);

// load a file, give the AudioPlayer buffers that are 1024 samples long
// player = minim.loadFile("found.wav");

// load a file, give the AudioPlayer buffers that are 2048 samples long
alert = minim.loadFile("found.wav", 2048);
codeccall = minim.loadFile("codeccall.wav", 2048);
leave = minim.loadFile("leave.wav", 2048);
// play the file

}

void draw()
{
background(0);

if((mousePressed)&& (mouseButton == RIGHT)){
alert.play();
alert.rewind();
delay (1000);
}

if((mousePressed)&& (mouseButton == LEFT)){
codeccall.play();
codeccall.rewind();
delay (1000);
}

if((mousePressed)&& (mouseButton == CENTER)){
leave.play();
leave.rewind();
delay (1000);
}
}

Keyboard Fail

After waiting for around for four days for the keyboard adapter, it turns out my laptop doesn't recognise the hardware & essentially wont work! AAH! I thought this would make my life easier but quite the opposite. Grr!

Sunday 29 November 2009

The Buttons

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.

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.






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

As this is the start of the play stage, I have not finalised on an idea. The two contenders are; a device that lets you listen to someone's movements but not their location & a door that is covered in spy holes so you can see many mysterious places. Their pictures are below.

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.