!7 cmodule2 FindLineInCenter > DynWebCamAnalyzer { transient BWIntegralImage ii; transient OCRCompass c; switchable bool lineIsBright = true; switchable int angles = 6; switchable int radius = 50; afterVisualize { containerAddFirst(buttons, dm_checkBox lineIsBright(), dm_spinnerWithLabel angles(2, 24), dm_spinnerWithLabel radius(1, 80)); } void analyzeImage() { ii = new BWIntegralImage(inputImage); c = new OCRCompass; c.steps = angles*2; c.brightForeground = lineIsBright; c.image = ii; c.center = pt(w/2, h/2); c.radius = min(w, h)/2.0*radius/100; //c.sensorFootprint = iceil(c.radius); //printStruct("values", c.values); //print("angle", angle); } void drawOverlays(BufferedImage img) { renderRenderable(img, c); } }