Здравствуйте, Артём, Вы писали:
https://www.codeconvert.ai/python-to-c++-converter
#include <iostream>
#include <opencv2/opencv.hpp>
int main() {
float scale = 1.0 / 255.0;
cv::Size shape(1, 1, 3);
cv::Mat mean = (cv::Mat_<float>(3, 1) << 0.485, 0.456, 0.406);
cv::Mat std = (cv::Mat_<float>(3, 1) << 0.229, 0.224, 0.225);
CV_Assert(img.type() == CV_32F);
cv::Mat normalizedImg = (img * scale — mean) / std;
return 0;
}