Class 6 ICM – KINECT and PHOTOS! blogging during class….

Screen Shot 2013-10-16 at 1.09.15 PM

code:

 

PImage img;

void setup() {
size(900, 600);
img = loadImage(“http://2.bp.blogspot.com/-HeiLXL6PDSE/UDt6kuscRFI/AAAAAAAAJHM/znGighNbnX0/s1600/new-york-city-aerial-view.jpeg”);
}

void draw() {

for (int i=0;i<img.pixels.length;i++) {
float bright=brightness(img.pixels[i]);
if (bright<189) {
img.pixels[i]=0xD3D3D3;
if (bright<188) {
img.pixels[i]=0xA56FB4;

}
/* loadPixels();
for(int i = 0; i < pixels.length; i++){
if (i < pixels.length/2){
pixels[i] = 0xDBD7BA;
}
}
//updatePixels();
*/
}

}
image(img, 0, 0);
}

 

Screen Shot 2013-10-16 at 1.41.25 PM

import processing.video.*;

Capture cam;

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

String[] cameras = Capture.list();
/*
if (cameras.length == 0) {
println(“There are no cameras available for capture.”);
exit();
}
else {
println(“Available cameras:”);
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}

// The camera can be initialized directly using an element
*/  // from the array returned by list():
cam = new Capture(this, 640,480);
// Or, the settings can be defined based on the text in the list
//cam = new Capture(this, 640, 480, “Built-in iSight”, 30);

// Start capturing the images from the camera
cam.start();
}

void draw() {
if(cam.available()==true){cam.read();}
for (int i=0;i<cam.pixels.length;i++) {
float bright=brightness(cam.pixels[i]);
if (bright<127) {
cam.pixels[i]=0x869301;

}
}
image(cam,0,0);
}

Comments Are Closed