Complement lines feature detector with a better adaptive thresholder. Clean up the code.