added option to change thresholdin detectCharacterType