in inference_pkg/src/image_process.cpp [163:181]
void Grey::processImageVec(const std::vector<sensor_msgs::msg::Image> &frameDataArr, cv::Mat &retImg,
const std::unordered_map<std::string, int> ¶ms) {
// Left camera image is sent as the top image and the right camera image is sent as second in the vector.
// Stack operation replaces the beginning values as we loop through and hence we loop in decreasing order
try {
std::vector<cv::Mat> channels;
for (const auto& image_msg : frameDataArr) {
cv::Mat img;
cvtToCVObjResize(image_msg, img, params);
cv::cvtColor(img, img, cv::COLOR_BGR2GRAY);
channels.push_back(img);
}
cv::merge(channels, retImg);
}
catch (...) {
RCLCPP_ERROR(rclcpp::get_logger("rclcpp"), "Conversion to Grey Scale and vector stacking failed");
return;
}
}