In opencv mat is an image image is a mat. Opencv matrix does not respect the const modifier. So if a function has one or more input arrays cv mat instances and some output arrays.