Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git@github.com:johnbentcope/tagbot.git

  • Loading branch information...
commit 851c63a07e56dc08225ef2ab16ce37e2cf94de3f 2 parents 17dede8 + f45096a
unknown authored
Showing with 38 additions and 44 deletions.
  1. +23 −0 Blob.pde
  2. +0 −39 Printer.pde
  3. +6 −4 Scanner.pde
  4. +9 −1 TagBot.pde
View
23 Blob.pde
@@ -0,0 +1,23 @@
+class Blob {
+
+ int blobsWide() {
+ return 7;
+ }
+
+ int blobsHigh() {
+ return 7;
+ }
+
+ int pixelsWide() {
+ return 7;
+ }
+
+ int pixelsHigh() {
+ return 7;
+ }
+
+ void setColor(Blob blob, color blobColor) {
+ blob.
+ }
+
+}
View
39 Printer.pde
@@ -6,43 +6,4 @@ class Printer {
}
- void displayGrid() {
- background(255);
- int inc = 0;
- int colInc = 0;
- int xNumSteps = (yMax - yMin)/xStep;
- int yNumSteps = (xMax - xMin)/yStep;
- for ( int i = 0; i < yNumSteps-1; i++ ) {
- for ( int j = 0; j < xNumSteps-1; j++ ) {
- fill(red(greyValues[inc]), 255, 255);
- noStroke();
- if (j%2 == 0) {
- if (red(greyValues[inc]) == 0) {
- ellipse(i*xStep, j, 6, 12);
- }
- } else {
- //println(inc);
- if (red(greyValues[inc]) == 0) {
- fill(255, 0, 255);
- ellipse(width-i*xStep, j*xStep, 6, 12);
- }
- }
- inc++;
- }
- }
- /*
- int derp = (ceil((yMax-yMin)/yStep))*(ceil((xMax-xMin)/xStep));
- println("derp " + derp);
- println("greyValues " + greyValues.length);
- println("inc " + inc);
- println("first color " + binary(greyValues[0]));*/
- //println("w00000000000000000000000000000000000000000000000000000000000000000000");
- }
-
- void run(int[] greyValues[]){
- for (int i = 0; i<80; i++ ) {
-
- }
- }
-
}
View
10 Scanner.pde
@@ -8,7 +8,6 @@ class Scanner {
int flip = 0;
Scanner() {
-
}
boolean update() {
@@ -68,9 +67,9 @@ class Scanner {
color splat = pixels[ i*width + j ];
int splatAvg = floor((red(splat)+green(splat)+blue(splat))/3);
if (splatAvg > 150) {
- greyValues[inc] = color(255);
+ setColor(grid[i][j], color(255));
} else {
- greyValues[inc] = color(0);
+ grid[i][j] = color(0);
}
pixels[ i*width + j ] = greyValues[inc];
inc++;
@@ -92,11 +91,14 @@ class Scanner {
inc++;
}
}
+
+ println(grid.length);
+ /*
int derp = (ceil((yMax-yMin)/yStep))*(ceil((xMax-xMin)/xStep));
println("derp " + derp);
println("greyValues " + greyValues.length);
println("inc " + inc);
- println("first color " + binary(greyValues[0]));
+ println("first color " + binary(greyValues[0]));//*/
}
View
10 TagBot.pde
@@ -1,6 +1,13 @@
+/*** IMPORTE LAS BIBLIOTECAS ***/
//PImage img;
import processing.video.*;
+
+/*** INSTANTIALIZINATE SOME OBJECTS ***/
Capture myCapture;
+Blob[][] grid;
+
+/*** Global vars... Probably too many of these
+ * TODO: trim global vars and objectify the code. ***/
int wig= 600;
int hig = 600;
int step = 20;
@@ -32,6 +39,7 @@ void setup() {
rectMode(CORNERS);
ellipseMode(CENTER);
myCapture = new Capture(this, width, height, 30);
+
scanner = new Scanner();
printer = new Printer();
}
@@ -43,7 +51,7 @@ void draw() {
// 0 is webcam capture
// 1 freezes capture and analyzes the frame
// 2 displays the capture grid
-
+ //println(grid.blobsWide());
switch(mainFlop){
// freeze capture and put the contents of the frame into Scanner's greyValues[];
Please sign in to comment.
Something went wrong with that request. Please try again.