OpenCV loads images in BGR format by default, while PIL uses RGB.
I cannot find a transformation between these color formats in your C++ code, so besides the wrong normalization of the tensor you are passing it in a flipped format to the model.