How to record depth?
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.
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!
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.
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.
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.
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.
There have been few contributions that have made FPS much smoother while recording images. I would suggest try out the new version!
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
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?