The original template based mat ptr for indexing is not implemented, add the similar implementation as uchar type, but cast to user-defined type from the uchar pointer.