Constancy of const cv::Mat
One of the possibilities of changing the cv::Mat would be to take part of the data with ROI and change their values what in the end would mean, that the values of original cv::Mat were changed. Is it somehow possible that such operation (or any other, which I didn't think about, excluding some dirty tricks with casting) would change the values of the const cv::Mat or can I assume that this will not be allowed and every const Mat is actually constant?
The problem could be that under the hood we are dealing with smart pointers, but maybe this is not an issue, it was somehow taken care of?
EDIT: Maybe to rephrase my question: should I pass input array as read only with cv::InputArray or rather const cv::Mat& ? What would be more desired from the performance and immutability (constancy) point of view?
InputArray implies const.
Ok, I will stick to InputArray then, thank you!
And InputArrayOfArrays in case of vector and access with src.getMatVector(vector<mat> output). Just in case someone will be looking at this question in the future.