refactored colorthreshold to use optimized opencv stuff