in inference_pkg/src/intel_inference_eng.cpp [103:120]
template<typename T, typename V> void load1DImg(V *inputPtr,
cv::Mat &retImg,
std::shared_ptr<InferTask::ImgProcessBase> imgProcessPtr,
const sensor_msgs::msg::Image &imgData,
const std::unordered_map<std::string, int> ¶ms) {
imgProcessPtr->processImage(imgData, retImg, params);
if (retImg.empty()) {
throw InferenceExcept("No image after pre-process");
}
int height = retImg.rows;
int width = retImg.cols;
for (int h = 0; h < height; h++) {
for (int w = 0; w < width; w++) {
inputPtr[h * width + w] = retImg.at<T>(h, w);
}
}
}