Yes, more or less.
I think this shape and thus also the slice might be wrong:
{img.cols, img.rows, 3}

OpenCV should use a [height, width, channels] layout, so shouldn’t it be {img.rows, img.cols, 3}?