Ported gray conversion + hct parameters from ourGrayHough.py