What is the simplest and cleanest way to write a function accepting input arguments of type Mat or UMat? Should i use InputArray, use templates or is there a better alternative? I am currelnlty having functions with identical implementation written for both Mat and UMat.