0

I want to implement an object tracking code for the Airsim simulation. I want to get the images of the simulation's camera and use them for my tracking algorithm.

I am using cv.VideoCatpure() object in my tracking code. and I get the simulation's camera as a ROS image msg. then using cv bridge I converted the ROS image msgs to OpenCV images.

Now my question is that, Is there any way to make cv.VideoCapture read the OpenCV images or to read it as ROS image msg or even to read it from the simulation API?

In short, I want to use the simulation's camera instead of a real camera or an existed video. I want it to stream the video from the simulation, not from a USB camera.

If anyone can help it will be very appreciated.

Ashraf
  • 1
  • 1
  • 1
    replace the VideoCapture object with a custom class that acts like a VideoCapture object, but returns the pictures you have instead – Christoph Rackwitz Dec 28 '21 at 16:19
  • If I understand correctly, you need to camera frame for your code at simulation. Accutally, if you search that "Using Gazebo Camera Plug-in" on google, you can learn how use simulator camera. (Note:Gazebo is robotics simulator) – DrBobs Dec 29 '21 at 07:53
  • @DrBobs I already have the camera view from the simulation I get them as ROS image msgs. I want to use these camera image msgs as input for the OpenCV VideoCapture object. because I want to apply it for object tracking code. and this code just gets the video as input for the OpenCV VideoCapture object. – Ashraf Jan 20 '22 at 12:47

0 Answers0