small preformance improvement
improved edge detection parameters based on idea by whorl. Added settable confidence threshold. Small fix to debugging window context.