I find the OpenCV memory management quite confusing. I read the documentation here http://opencv.itseez.com/modules/core/doc/intro.html#automatic-memory-management, but I really don't think it gives enough information to fully understand it.
For example consider the following snippet
Mat_<float> a,b,c;
a = b; // The header of b is copied into a and they share the data
b = c; // Now b refers to c and a != b
b = a + 1; // b still shares data with c and s.t. b = c;
Does it make any sense? Someone can explain the idea behind it?