1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | int loop=1; float x1=0; float x2=0; float y1=0; float y2=0; size(640, 360); PrintWriter ouput; PImage histoimg; image(img, 0, 0); int[] hist = new int[256]; ouput= createWriter("dvals.txt"); import processing.video.*; Capture dacam; PImage img; import serial; int x=0; void setup() { Serial.start(9600); img=(loadImage(a+".png")); size (640,480); dacam= new Capture(this, 320, 240, 30); dacam.start(); } void draw() { if(dacam.available()) { dacam.read(); } image(dacam, 0, 0); image(img, 0, 0); } } } void loop() { float r=0; println(one.length); println(two.length); if(loop=1){ if (mousePressed) { x1=mouseX y1=mouseY loop=2 } } if(loop=2){ if (mousePressed) { x2=mouseX y2=mouseY x1=(((x2-x1)(x2-x1))+((y2-y1)(y2-y1)) print(sqrt(x1)) loop=1 } } } |
Saturday, February 7, 2015
Cyclic laser metrology mechine
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment