this conversion back to an image msg is probably not necessary, as we only need an opencv image below. Have a look at line 398 in your version where 
```
cv::Mat img(msg->height, msg->width, CV_8U, const_cast<uint8_t*>(&(msg->data[0])));
detector->process(img, opticalCenter, detections);
```