Does anyone know of a more efficient OpenCV practice to perform the following operation on each Mat element ? Each element undergoes the same function.
Mat calcDepthValues(Mat &depth){
Mat realDepth= depth.clone();
Mat_<double>::iterator it = realDepth.begin<double>();
Mat_<double>::iterator itend = realDepth.end<double>();
for (; it != itend; ++it) {
(*it) = 448.251214 + ((1- (*it)/255) * 10758.02914);
}
return realDepthValues;