LOW: Streatham High Road green average: 144
HIGH: Dulwich Woods green average: 161
Obviously loads of faults in this methodology, which is unavoidably (and un-apologetically) subjective.
//peakand low moments green average
//map later to a chart
int average;
PImage woods;
//get averages for green chanel from images taken during day
//to see if exposure to green correlates to mood
float a =0;
void setup() {
size(304, 163);
woods = loadImage("woods.jpg");//161
// woods = loadImage("highrd.jpg"); //144
/*interesting the percieved greeness and actual greeness*/
}
void draw() {
noLoop();
noStroke();
image(woods, 0, 0, width, height);
//test with pure colours:
//fill(255, 125, 123);
//fill(0, 255, 0);//pure green
// rect(0, 0, width, height);
loadPixels();
// Begin our loop for every pixel
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++ ) {
int loc = x + y*width;
float g = green (pixels[loc]);
color c = pixels[loc];
a +=g;
}
}
updatePixels();
filter(BLUR, 5); //prefer blur, is like my everyday vision!
float b = height*width;
average = floor(a/b);
// println(floor(a/b)); //average greenness
Date d = new Date();
save(average+"*"+d+".jpg");
}
No comments:
Post a Comment