cvtUChar on the Mat to retain file stuff in the template