Writing functions accepting inputs of type cv::Mat or cv::UMat
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.
do you write your own opencl kernels ?
Not for the moment. I just use a combination of other OpenCV functions supporting both Mat and UMat inputs, typically trough InputArray input arguments. I do use local Mat and UMat variables in my code depending on the input type.