Closed ysh625 closed 6 years ago
It's default value is(Jet),how can I set the value in matlab or python? Thank you
Would the information linked to below about colorizing in MATLAB be of any use to you, please?
Would the information linked to below about colorizing in MATLAB be of any use to you, please?
I just want to visualize depth data in matlab ,and I need the type "White to Black",not "Jet". Is there any easy way to do it? thank you.
You can select White To Black mode from a drop-down menu in the RealSense Viewer or set it with scripting.
You can select White To Black mode from a drop-down menu in the RealSense Viewer or set it with scripting.
I selected White To Black mode and recorded.Then I use "realsense.rosbag_example" to read the .bag file, which shows in mode Jet like that Still in mode Jet I know there is a class colorizer and it can be used well in C++ How can I use it in matlab?
Apologies for the delay in responding, I was investigating your case further.
In my own test, although the bag defaulted back to Jet when opened in the RealSense Viewer, I was able to change the bag back to White To Black by selecting this mode again in the Depth Visualization section of the Viewer's options panel.
You can playback a bag in the Viewer instead of rosbag_example by going to the Add Source menu at the top of the Viewer's options panel and selecting the Load Recorded Sequence option. Or you can just drag-and-drop the bag file onto the Viewer's center panel.
It is possible you may also be able to change the visualization mode through the SDK's MATLAB wrapper, but I do not have the scripting code for doing that. Hopefully one of the Intel team can help you with that later.
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/matlab
Hi @YSH6 @MartyG-RealSense
Based on user report (#2487) there seems to be a bug in setting processing options right now for the Matlab wrapper. We are looking into it.
This can be done with the python wrapper, by calling colorizer.set_option
and choosing a different color-scheme.
That said, both python (via numpy and opencv) and Matlab have plenty of work-around ways to do this.
Hi @YSH6 @MartyG-RealSense Based on user report (#2487) there seems to be a bug in setting processing options right now for the Matlab wrapper. We are looking into it. This can be done with the python wrapper, by calling
colorizer.set_option
and choosing a different color-scheme. That said, both python (via numpy and opencv) and Matlab have plenty of work-around ways to do this.
I saw the set_option but I don't know how to use it.... I am new to python. Could you please show me more details or an example?
Certainly:
import matplotlib.pyplot as plt
import pyrealsense2 as rs
...
colorizer = rs.colorizer()
colorizer.set_option(rs.option.color_scheme, 2); // white to black
colorized_depth = np.asanyarray(colorizer.colorize(depth_frame).get_data())
plt.imshow(colorized_depth)
There is no closed enumeration for the different color schemes, but you can play around with different values and other options. You can also test it in an interactive notebook
We also have additional notebook explaining post-processing and post-processing options, but it is missing the colorizer options
Certainly:
import matplotlib.pyplot as plt import pyrealsense2 as rs ... colorizer = rs.colorizer() colorizer.set_option(rs.option.color_scheme, 2); // white to black colorized_depth = np.asanyarray(colorizer.colorize(depth_frame).get_data()) plt.imshow(colorized_depth)
There is no closed enumeration for the different color schemes, but you can play around with different values and other options. You can also test it in an interactive notebook That works, I really appreciate your help
[Realsense Customer Engineering Team Comment] @ysh6 Any other questions about this ticket? Please update. Thanks!
PR #2492 Added the missing constructor argument to matlab's colorizer class, so the ability to set the color scheme should be working there too
[Realsense Customer Engineering Team Comment] @YSH6 Any other questions for this ticket? Please update. Thanks!
[Realsense Customer Engineering Team Comment] @YSH6 Any other questions for this ticket? Please update. Thanks! Apologies for the delay in responding,My problem was settled.
PR #2492 Added the missing constructor argument to matlab's colorizer class, so the ability to set the color scheme should be working there too
That's good news. Thank you!
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
<Describe your issue / question / feature request / etc..>