Better traces detection. Added Canny filter.
Minor fixes.