Giter Site home page Giter Site logo

rs_bag2image's Introduction

rs_bag2image

This is convert tool that works on cross-platform (Windows, Linux, MacOS) for RealSense.
This tool converts all data of each stream types (Color, Depth, Infrared) that contained in bag file to image file.

Sample

Command

rs_bag2image -b="./file.bag" -s=true -d=true

Output

rs_bag2image.exe
file.bag
file
  |-Color
  |   |-000001.jpg
  |   |-000002.jpg
  |
  |-Depth
  |   |-000001.png
  |   |-000002.png
  |
  |-Infrared 1
  |   |-000001.jpg
  |   |-000002.jpg

Option

option description
-b input bag file path. (requered)
-s enable depth scaling for visualization. false is raw 16bit image. (bool)
-q jpeg encoding quality for color and infrared. [0-100]
-d display each stream images on window. false is not display. (bool)

Environment

  • Visual Studio 2015/2017 / GCC 5.3 / Clang (require <filesystem> supported)
  • RealSense SDK 2.x (librealsense v2.x)
  • OpenCV 3.4.0 (or later)
  • CMake 3.7.2 (latest release is preferred)

License

Copyright © 2018 Tsukasa SUGIURA
Distributed under the MIT License.

Contact

rs_bag2image's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rs_bag2image's Issues

ビルドエラーが起こりました

環境
Ubuntu 18.04
Cmake 3.14.1
GCC 8.4.0

cd rs_bag2image/rs_bag2image/
mkdir build
cd build/
cmake ..
make

上記を実行すると以下のエラーが起こりました。

[ 33%] Building CXX object CMakeFiles/rs_bag2image.dir/realsense.cpp.o
[ 66%] Building CXX object CMakeFiles/rs_bag2image.dir/main.cpp.o
[100%] Linking CXX executable rs_bag2image
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::filesystem::__cxx11::path::format)':
realsense.cpp:(.text._ZNSt10filesystem7__cxx114pathC2EONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS1_6formatE[_ZNSt10filesystem7__cxx114pathC5EONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS1_6formatE]+0x4f): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::clear()':
realsense.cpp:(.text._ZNSt10filesystem7__cxx114path5clearEv[_ZNSt10filesystem7__cxx114path5clearEv]+0x20): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::operator==(std::filesystem::__cxx11::path const&, std::filesystem::__cxx11::path const&)':
realsense.cpp:(.text._ZNSt10filesystem7__cxx11eqERKNS0_4pathES3_[_ZNSt10filesystem7__cxx11eqERKNS0_4pathES3_]+0x1f): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::stem() const':
realsense.cpp:(.text._ZNKSt10filesystem7__cxx114path4stemEv[_ZNKSt10filesystem7__cxx114path4stemEv]+0x28): undefined reference to `std::filesystem::__cxx11::path::_M_find_extension() const'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::extension() const':
realsense.cpp:(.text._ZNKSt10filesystem7__cxx114path9extensionEv[_ZNKSt10filesystem7__cxx114path9extensionEv]+0x28): undefined reference to `std::filesystem::__cxx11::path::_M_find_extension() const'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::is_regular_file(std::filesystem::__cxx11::path const&)':
realsense.cpp:(.text._ZNSt10filesystem15is_regular_fileERKNS_7__cxx114pathE[_ZNSt10filesystem15is_regular_fileERKNS_7__cxx114pathE]+0x14): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `RealSense::initializeSave()':
realsense.cpp:(.text._ZN9RealSense14initializeSaveEv[_ZN9RealSense14initializeSaveEv]+0x73): undefined reference to `std::filesystem::__cxx11::path::parent_path() const'
realsense.cpp:(.text._ZN9RealSense14initializeSaveEv[_ZN9RealSense14initializeSaveEv]+0x158): undefined reference to `std::filesystem::create_directories(std::filesystem::__cxx11::path const&)'
realsense.cpp:(.text._ZN9RealSense14initializeSaveEv[_ZN9RealSense14initializeSaveEv]+0x30c): undefined reference to `std::filesystem::create_directories(std::filesystem::__cxx11::path const&)'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::path<char const*, std::filesystem::__cxx11::path>(char const* const&, std::filesystem::__cxx11::path::format)':
realsense.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IPKcS1_EERKT_NS1_6formatE]+0x73): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
CMakeFiles/rs_bag2image.dir/realsense.cpp.o: In function `std::filesystem::__cxx11::path::path<char [5], std::filesystem::__cxx11::path>(char const (&) [5], std::filesystem::__cxx11::path::format)':
realsense.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IA5_cS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IA5_cS1_EERKT_NS1_6formatE]+0x6d): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
CMakeFiles/rs_bag2image.dir/build.make:166: recipe for target 'rs_bag2image' failed
make[2]: *** [rs_bag2image] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/rs_bag2image.dir/all' failed
make[1]: *** [CMakeFiles/rs_bag2image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

見るポイントがわからなかったのでそのままコピペしましたが、よろしくお願いします。

ビルドエラーが起こりました

環境
Ubuntu16.04
Cmake 3.10.3

git clone https://github.com/UnaNancyOwen/rs_bag2image.git
cd   ~/rs_bag2image/rs_bag2image
mkdir build
cd build
cmake ..
make 

上記の実行をすると以下のエラーが出ます。

In file included ~/rs_bag2image/rs_bag2image/realsense.cpp:1:0:
~/rs_bag2image/rs_bag2image/realsense.h:12:22: fatal error: filesystem: No such file or directory
compilation terminated.
CMakeFiles/rs_bag2image.dir/build.make:62: recipe for target 'CMakeFiles/rs_bag2image.dir/realsense.cpp.o' failed
make[2]: *** [CMakeFiles/rs_bag2image.dir/realsense.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/rs_bag2image.dir/all' failed
make[1]: *** [CMakeFiles/rs_bag2image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

よろしくお願いいたします。

Error occurs with find_package

I just started with run D435i

want to learn about ROS bag file format.

but had a problem with running rs_bag2image with find_package

what should I change CMakeLists.txt

Please help me find a right way to run

Thanks

=====================================================
CMake Error at CMakeLists.txt:18 (find_package):
By not providing "Findrealsense2.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"realsense2", but CMake did not find one.

Could not find a package configuration file provided by "realsense2" with
any of the following names:

realsense2Config.cmake
realsense2-config.cmake

Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set
"realsense2_DIR" to a directory containing one of the above files. If
"realsense2" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "C:/rs_bag2image/build/CMakeFiles/CMakeOutput.log".

Export image failed with "file does not contain topic /file_version"

Hi @UnaNancyOwen

I run program as the instruction,
./rs_bag2image -b="/home/dji/bag/sensors00.bag" -s=true -d=true
It shows the error,

rs_bag2image 0.1.3
[ INFO:0] Initialize OpenCL runtime...
Failed to create ros reader: Invalid file format, file does not contain topic "/file_version" nor "/FILE_VERSION"

Information for the environment I used,

  • OS: Ubuntu 16.04.
  • cmake 3.12, librealsense 2.20, opencv 3.2.0

Any suggestion?

Thanks

not exporting infrared

This convert tool is working beautifully for exporting the monochrome depth and color streams, but so far I have not been able to extract the infrared video. Is this only possible on certain camera models, is there a specific setting I need to use, or could it be another issue?

get_frame_number is different between color and depth

Hi,
I use the program to extract the color image and the depth image from a single .bag file and it works well.
however, I noticed that the index number is different between color and depth,
for example, color frames start from 057625.jpg 057626.jpg ...
but the depth frames start from 057983.jpg 057984.jpg ...
and most import of all is the total image number is not equal, in my case, there are 641 color frames but 645 depth frames.

I traced the code in creating the index, it comes from get_frame_number()

is there any solution about this? thanks

Failed to convert .bag to image

I was using the pre-built rs_bag2image downloaded from here.
And then I ran the following command:
./rs_bag2image.exe -b="./20200615_181657.bag" -s=true -d=true
but it seems cannot output the relative depth and color image, and gave the following verbose:

rs_bag2image 0.1.1 Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Depth Color Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info Failed to convert source: "" to matching rs2_camera_info

I am using Windows 10, librealsense-2.35.2, and the image was acquired by Intel RealSense D435.
As I am new to realsense, I appreciate any guides.

Thank you!

Image2Bag

Very impressive work! Thanks for sharing your code. I have RGB images (jpeg) and depth images (png) that were recorded on a realsense device, but the two images are not in the same coordinate frame, so I am trying to map depth to color. It seems that the rs library only provides the mapping for either bag files or streamed data.

So I was looking for code that can convert images to bag and do the alignment in bag files. I am wondering if you know any repository that does it? It would be nice if you could point me to a link? Thanks. :)

Cannot install

I have already installed Realsense SDK in Ubuntu 18.04 LTS. In CMakelists.txt , there are 2 directories. Do I have to change them because I have this problem.
Screenshot from 2019-07-08 16-16-19

rs_bag2image not found

I'm new in Ubuntu, I cloned git, and write command. But I got follow issue

rs_bag2image: command not found

How can I solve this issue?
Thanks

no prompts or updates for "make" command

Hi, I have followed instructions and successfully use the command "cmake .." to build the folder and Makefile under the "build" folder. However, after I type the command "cmake --build . --config Release", there is either no prompts in the terminal nor could I see any ./rs_bag2image file under the build directory. Could I know why?

rs_bag2image can't find the files

hello,

When I use CMAKE-GUI to make the rs-bag2image, I found in the CMakeList.txt , librealsense2 package shoule be package from the path("C:/Program Files/librealsense2/lib/cmake/realsense2"),but the files in the SDK 2.0 can't be found, so how to solve it?

Thank you,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.