Roi of a shared_ptr<mat> is not correct

You don’t need std::make_sharedcv::Mat(800, 5120, CV_8UC1)
Mat already use shared data

instead of roi you should try

Mat() [13/29]

cv::Mat::Mat ( int ndims,
const int * sizes,
int type,
void * data,
const size_t * steps = 0
)
OpenCV: cv::Mat Class Reference