!7 cmodule2 FindLineInCenter > DynWebCamAnalyzer { transient BWIntegralImage ii; transient OCRCompass c; switchable bool lineIsBright = true; switchable int angles = 6; switchable int radius = 50; start { dm_onFieldChange(ll("angles", "radius", "lineIsBright"), r { c = null }); } // add controls afterVisualize { containerAddFirst(buttons, dm_checkBox lineIsBright(), dm_spinnerWithLabel angles(2, 24), dm_spinnerWithLabel radius(1, 80)); } void prepareImage { ii = new BWIntegralImage(inputImage); } void analyzeImage { Pt center = pt(w/2, h/2); if (c == null || neq(c.center, center)) { c = new OCRCompass; c.center = center; c.steps = angles*2; c.brightForeground = lineIsBright; c.radius = min(w, h)/2.0*radius/100; overlays = ll(c); } c.image = ii; c.compute(); } }