Hello everyone, I'm still kind of new to the whole programming world, but I wanted to get started using Processing and OpenCV. I've seen some cool video's which I think are a great inspiration for the project I'm working on.
I think I've done everything right, the only problem is that when I try to use the code at the end of the post it gives me an error and I'm only getting a gray screen.
Display 0 does not exist, using the default display instead.
Now the notes in the code are french (?) and I cant read them, but I think the says that it should produce some webcam feed. I hope someone can help me get started. I'm really looking forward to making this. The only problem is finding good reference for someone with almost zero experience.
So what I'm basically trying to achieve is generating a webcam feed (or other realtime video source) that is being tracked, and has a plane(?) which I can use to project an image on. I really hope you can help me!
Hello, I'm having some trouble with implementing Jsoup in my graph.
I've been trying to read the data from www.zonox.nl/test.php and to read the numbers and put them in a graph.
So far Jsoup read the data but only saves it when I press a button. And I've made my graph as that it reads data from multiple lines instead of next to each other, how the data is saved now.
final static String fileName = "data/waarden.txt";
void setup() {
size(1400, 600);
frameRate(1);
z = loadFont( "Andalus-48.vlw" );
stroke(-1);
reloadData();
}
void draw() {
if (frameCount % 1 == 0) reloadData();
textFont(z,12);
textAlign(CENTER);
fill(0);
float a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
z = vars[0];
a = vars[1];
b = vars[2];
c = vars[3];
d = vars[4];
e = vars[5];
f = vars[6];
g = vars[7];
h = vars[8];
i = vars[9];
j = vars[10];
k = vars[11];
l = vars[12];
m = vars[13];
n = vars[14];
o = vars[15];
p = vars[16];
q = vars[17];
r = vars[18];
s = vars[19];
t = vars[20];
u = vars[21];
v = vars[22];
w = vars[23];
x = vars[24];
y = vars[25];
background(bg);
ellipseMode(CENTER);
noFill();
stroke(110,225,110);
strokeWeight(3);
ellipse(25, 550 - a, a/2, a/2);
ellipse(75, 550 - b, b/2, b/2);
ellipse(125, 550 - c, c/2, c/2);
ellipse(175, 550 - d, d/2, d/2);
ellipse(225, 550 - e, e/2, e/2);
ellipse(275, 550 - f, f/2, f/2);
ellipse(325, 550 - g, g/2, g/2);
ellipse(375, 550 - h, h/2, h/2);
ellipse(425, 550 - i, i/2, i/2);
ellipse(475, 550 - j, j/2, j/2);
ellipse(525, 550 - k, k/2, k/2);
ellipse(575, 550 - l, l/2, l/2);
ellipse(625, 550 - m, m/2, m/2);
ellipse(675, 550 - n, n/2, n/2);
ellipse(725, 550 - o, o/2, o/2);
ellipse(775, 550 - p, p/2, p/2);
ellipse(825, 550 - q, q/2, q/2);
ellipse(875, 550 - r, r/2, r/2);
ellipse(925, 550 - s, s/2, s/2);
ellipse(975, 550 - t, t/2, t/2);
ellipse(1025, 550 - u, u/2, u/2);
ellipse(1075, 550 - v, v/2, v/2);
ellipse(1125, 550 - w, w/2, w/2);
ellipse(1175, 550 - x, x/2, x/2);
ellipse(1225, 550 - y, y/2, y/2);
ellipse(1275, 550 - z, z/2, z/2);
//waarden
fill (0);
text ( ""+vars[1]+"" , 25,575);
text ( ""+vars[2]+"" , 75,575);
text ( ""+vars[3]+"" ,125,575);
text ( ""+vars[4]+"" ,175,575);
text ( ""+vars[5]+"" ,225,575);
text ( ""+vars[6]+"" ,275,575);
text ( ""+vars[7]+"" ,325,575);
text ( ""+vars[8]+"" ,375,575);
text ( ""+vars[9]+"" ,425,575);
text ( ""+vars[10]+"" ,475,575);
text ( ""+vars[11]+"" ,525,575);
text ( ""+vars[12]+"" ,575,575);
text ( ""+vars[13]+"" ,625,575);
text ( ""+vars[14]+"" ,675,575);
text ( ""+vars[15]+"" ,725,575);
text ( ""+vars[16]+"" ,775,575);
text ( ""+vars[17]+"" ,825,575);
text ( ""+vars[18]+"" ,875,575);
text ( ""+vars[24]+"" ,925,575);
text ( ""+vars[20]+"" ,975,575);
text ( ""+vars[21]+"" ,1025,575);
text ( ""+vars[22]+"" ,1075,575);
text ( ""+vars[23]+"" ,1125,575);
text ( ""+vars[19]+"" ,1175,575);
text ( ""+vars[25]+"" ,1225,575);
text ( ""+vars[0]+"" ,1275,575);
//stocklijn
stroke(110,110,255);
noFill();
strokeWeight(3);
beginShape();
vertex(25, 550 - a);
vertex(75, 550 - b);
vertex(125, 550 - c);
vertex(175, 550 - d);
vertex(225, 550 - e);
vertex(275, 550 - f);
vertex(325, 550 - g);
vertex(375, 550 - h);
vertex(425, 550 - i);
vertex(475, 550 - j);
vertex(525, 550 - k);
vertex(575, 550 - l);
vertex(625, 550 - m);
vertex(675, 550 - n);
vertex(725, 550 - o);
vertex(775, 550 - p);
vertex(825, 550 - q);
vertex(875, 550 - r);
vertex(925, 550 - s);
vertex(975, 550 - t);
vertex(1025, 550 - u);
vertex(1075, 550 - v);
vertex(1125, 550 - w);
vertex(1175, 550 - x);
vertex(1225, 550 - y);
vertex(1275, 550 - z);
endShape();
//lijnen
stroke(150);
strokeWeight(1);
line(25, 550 - a, 25, 560);
line(75, 550 - b, 75, 560);
line(125, 550 - c, 125, 560);
line(175, 550 - d, 175, 560);
line(225, 550 - e, 225, 560);
line(275, 550 - f, 275, 560);
line(325, 550 - g, 325, 560);
line(375, 550 - h, 375, 560);
line(425, 550 - i, 425, 560);
line(475, 550 - j, 475, 560);
line(525, 550 - k, 525, 560);
line(575, 550 - l, 575, 560);
line(625, 550 - m, 625, 560);
line(675, 550 - n, 675, 560);
line(725, 550 - o, 725, 560);
line(775, 550 - p, 775, 560);
line(825, 550 - q, 825, 560);
line(875, 550 - r, 875, 560);
line(925, 550 - s, 925, 560);
line(975, 550 - t, 975, 560);
line(1025, 550 - u, 1025, 560);
line(1075, 550 - v, 1075, 560);
line(1125, 550 - w, 1125, 560);
line(1175, 550 - x, 1175, 560);
line(1225, 550 - y, 1225, 560);
line(1275, 550 - z, 1275, 560);
//namen
text ( "Aegon" , 25,590);
text ( "Ahold" , 75,590);
text ( "KLM" ,125,590);
text ( "Akzo" ,175,590);
text ( "Aperam" ,225,590);
text ( "Arcelor" ,275,590);
text ( "ASML" ,325,590);
text ( "Boskalis" ,375,590);
text ( "Corio" ,425,590);
text ( "DMB" ,475,590);
text ( "WeHa" ,525,590);
text ( "Fugro" ,575,590);
text ( "Heiniken" ,625,590);
text ( "ING" ,675,590);
text ( "KPN" ,725,590);
text ( "Philips" ,775,590);
text ( "Randstad" ,825,590);
text ( "Reed" ,875,590);
text ( "RDS " ,925,590);
text ( "SBM" ,975,590);
text ( "TNT" ,1025,590);
text ( "Unibail" ,1075,590);
text ( "Unilever" ,1125,590);
text ( "DSM" ,1175,590);
text ( "Wolters" ,1225,590);
text ( "AEX" ,1275,590);
}
void reloadData() {
String[] data = loadStrings(fileName);
for ( int i=0; i!=numVars; vars[i] = float(data[i++]) );
}
To sum it up, I want to have my graph to check the site every 10 sec and use these numbers to determine how the line needs to be. I hope this makes sense in some way and that you guys can help me!
Hello i've been trying to get my 2 rect to act as masks for 3 underlying images.
At first i've tried to fill them with the image but I dont want any scaling so I was thinking masks might be better.
I hope someone can help me!
Here's my code so far. Thanks!
PFont z;
final static byte numVars = 4;
final static float[] vars = new float[numVars];
final static byte marginX = 25, marginY = 50;
final static color bg = 120;
PImage img;
void setup() {
size(600, 400);
frameRate(10);
z = loadFont( "Andalus-48.vlw" );
stroke(-1);
String[] data = loadStrings("data.txt");
for ( int i=0; i!=numVars; vars[i] = float(data[i++]) );
My name is Nick and I'm new to processing. I've actually never done anythng from this sort and I ran into a little bit of a problem. I want to make an infograpic that displays one "income" and (for now) two "expanses". And so far its working. The only problem is that I want to change the float a/d from a random to a number pulled from a text file. I've been trying to get something going by using Strings but I really have no idea what I'm doing here. So I hope you guys might be able to help me!
This is my code so far:
float a;
float b;
float c;
float d;
float e;
float f;
float g;
float h;
float i;
float j;
void setup() {
size(450, 450);
stroke(255);
background(192, 64, 0);
String[] data = loadStrings("data.txt");
}
void draw() {
frameRate(1);
a = random (100);
b = random (100);
c = random (100);
d = random (100);
e = a+b;
f = a/e*400;
g = b/e*400;
h = c+d;
i = c/h*400;
j = d/h*400;
background(192, 64, 0);
fill(150);
rect(25, 25, f, 400);
fill(200);
rect(f+25, 25, g, i);
fill(255);
rect(f+25, i+25, g, j);
}
Thanks is advance, and I hope to hear something from you all soon!