AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

How to record depth?

Open rmalav15 opened this issue 9 years ago • 8 comments

I am sorry for the newbie question. I must be missing something obvious.

I have build the Airsim and running it with sitl simulator. When I press the record button, it only stores scene view screenshots into my document/Airsim folder. Neither depth nor segmentation images are stored. Please let me know the solution.

rmalav15 avatar Jun 10 '17 15:06 rmalav15

Hey!

You could easily do that using the python API or C++ API along with the openCV function imwrite.

Another way which is typically better is to change EPIPCameraType::PIP_CAMERA_TYPE_SCENE to the desired type, (in this case EPIPCameraType::PIP_CAMERA_TYPE_DEPTH) in line 41 of the RecordingThread.cpp:

            USceneCaptureComponent2D* capture = cam->getCaptureComponent(EPIPCameraType::PIP_CAMERA_TYPE_SCENE, true);

This changes the record button to record depth images instead of scene images.

Hope that helps!

Mayankm96 avatar Jun 10 '17 15:06 Mayankm96

Hey thanks for quick reply. I saw that you have opened a issue earlier https://github.com/Microsoft/AirSim/issues/244. I need to do exactly the same. can you share your python API with me that record both view and depth simultaneously? It will be a huge help.

rmalav15 avatar Jun 10 '17 15:06 rmalav15

Yeah well you can find the script here. If you're trying to record the images synchronously you might face a bit of trouble. I am still thinking a way out to do this.

Mayankm96 avatar Jun 10 '17 15:06 Mayankm96

Ok much thanks. So I need to run both the unreal editor environment and this script simultaneously. And it will record both things. And I am not much worried about synchronization. A small gap would work for me.

And Again much thanks.

rmalav15 avatar Jun 10 '17 15:06 rmalav15

Well, on my system, the frame rate is not good and the little gap ends up being large.

Let me know though if it works on your system.

Mayankm96 avatar Jun 10 '17 15:06 Mayankm96

There have been few contributions that have made FPS much smoother while recording images. I would suggest try out the new version!

sytelus avatar Jul 09 '17 10:07 sytelus

The feature to record images from multiple cameras simultaneously is now available. You can, for example, record scene and depth images simultaneously.

Please see the doc: https://github.com/Microsoft/AirSim/blob/master/docs/settings.md#recording

sytelus avatar Dec 12 '17 05:12 sytelus

I could not find "EPIPCameraType::PIP_CAMERA_TYPE_SCENE" in RecordingThread.cpp (please see attached file). What can I do in order to be able to record depth and scene simultaneously?

RecordingThread.txt

dehuachen2017 avatar Mar 08 '18 08:03 dehuachen2017