I have already done similar work of what you are asking for ,
[login to view URL]
this is a ROS enabled visual tracker following robot . I have written scripts which subscribes to image topics (i have written it on python ,but I would be able to adapt it to C++) .
I can also handle different formats of image , such as compressed , theora etc .
please check out my YouTube channel , to see my previous work on ROS platform.
I have worked on fully autonomous robotic platform with Gmapping , visual slam etc . (check out [login to view URL])