Items with no label
3335 Discussions

upload images and then map depth image to color image

idata
Employee
1,673 Views

I've been struggling with the next problem for a few days now:

I have a color image and a corresponding depth image that are not aligned, i took them with RS300 (I've attached an example)

I am wondering if there is a way to upload those images (tiff format) and map the depth image to the color one using the RS300 sdk.

I know MapColorToDepth method can do it, but as far as i know this method requires live frames from the camera, and i want to upload a color and depth images which i already took and saved on the disk.

maybe using camera intrinsic and extrinsic parameters?

I would be happy to solve this problem because I have a database of such images that would be a problem for me to take again

Thanks in advance

0 Kudos
5 Replies
MartyG
Honored Contributor III
298 Views

Apologies for the delay in responding. I was giving careful consideration to your problem and doing some research.

Assuming that you'd prefer to stick with using the old RealSense Windows SDKs such as '2016 R2', one possibility to make your images useful may be to convert them into a video in H.264 video format. This is the format that the old SDK's .RSSDK data videos is based on.

You could conceivably convert your TIFFs into an H.264 video using the utility FFMpeg and try importing the resultant video into the SDK as an RSSDK. The SDK is capable of using pre-recorded data instead of a live stream as though the recorded data is live, and perform the same operations on it as a live stream.

https://duduf.com/easily-transcode-any-media-to-any-format-using-ffmpeg/ https://duduf.com/easily-transcode-any-media-to-any-format-using-ffmpeg/

0 Kudos
idata
Employee
298 Views

Thank you very much for your replay and for the attention to this matter

actually i am using RealSense Windows SDK 'R3' (version 11), is it considered an old version and the videos bases on the format you mentioned? or i have to look for another solution?

Thank you again for your effort

0 Kudos
MartyG
Honored Contributor III
298 Views

You're very welcome!

SDK 2016 R3 was the last version in the previous generation of SDKs before the current 'SDK 2.0' and is no longer updated by Intel (though I am happy to do my best to answer questions about it).

SDK 2.0 is compatible with the SR300 camera, though it is not compatible with the previous SDKs and their scripting language and uses a different recording and playback system, where data can either be recorded into files called 'rosbags' or saved as PNG images. If you are interested in SDK 2.0, it can be downloaded from here:

https://github.com/IntelRealSense/librealsense/releases/ Releases · IntelRealSense/librealsense · GitHub

0 Kudos
idata
Employee
298 Views

ok, thank you, i will try your suggestion and update as soon as i finish

0 Kudos
jb455
Valued Contributor II
298 Views

Do you still have access to the device? I'm not sure if this would work, but you could try starting up the camera, acquiring depth/colour images, replacing the image data buffers with your saved images, then using MapColorToDepth or similar on these modified images.

Alternatively, the new SDK (librealsense2) has provision for doing things like this with the SoftwareDevice interface (see sample: https://github.com/IntelRealSense/librealsense/tree/master/examples/software-device librealsense/examples/software-device at master · IntelRealSense/librealsense · GitHub) but you'd need the intrinsic/extrinsic parameters.

0 Kudos
Reply