This topic 4 should have some valid approaches to convert a cv::Mat to a tensor.
You could try to resize the cv::Mat to the right spatial size in OpenCV and add a batch dimension in libtorch (or create a batch of image tensors).