How to store Mat in std::array

that’s creating a Mat that is a view into another Mat.

perhaps you want to .clone()