Detect each frame of image

I now have the SVO video data I have taken. My goal is to obtain RGB images from SVO files through ROS and carry out image processing related work. What I want to achieve is similar to reducing the speed of SVO file output image, so that each frame of image in SVO file can get the result of image detection. (the image must be transmitted through the topic of ROS)

Hi @kankanzheli
You can modify the code of the ZED Nodelet to achieve this goal.

First of all you must force the SVO real-time mode to false here:

Then you must change the sleep period at the end of the grab loop to get the frequency that you need.
Here

I don’t quite understand what you mean.
I changed the mZedParams.svo_real_time_mode = true; to mZedParams.svo_real_time_mode = false;
I changed if (!loop_rate.sleep()) { to if (!loop_rate.sleep(10000)) {

Then, I running: roslaunch zed_wrapper zedm.launch svo_file:=/home//Data/my_data.svo
At this time, I can see from rviz that the obtained left view still outputs the image at a very fast speed. It still seems to work at 60fps/s

I want to get an image similar to 1 second output. The first frame of image is output in the first second. Output the second frame image in SVO file next second. In this way, every frame image in SVO can be workd with image detection method.

This is not the right way. You must set the loop_rate frequency to the required FPS here:

You means I should change the following part?
ros::Rate loop_rate(mCamFrameRate); into ros::Rate loop_rate(1);
mZedParams.svo_real_time_mode = true; into mZedParams.svo_real_time_mode = false;

Only this two part? Because when I check the output by rviz, I found the output fps still is 60. It is not changed.

Where are you getting such frequency information in Rviz?

The correct way to check for a topic frequency is by using the “Topic Monitor” plugin in rqt or the CLI command rostopic hz <topic_name>

It’s actually very simple. View the output image of topic through rviz. It is found that the output speed does not change after changing FPS. Theoretically, you should see the next frame of image one second after FPS is 1. But the reality is that the output image does not realize one frame per second.

Modifying the ZED Wrapper in order to change the default behaviors is not straightforward.
I think that it’s easier to write a simple node that does what you need leaving behind all the advanced features that you do not need.