Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y16 "Save snapshot" Crashes RealSense Viewer #1998

Closed
apoorva-sriv opened this issue Jul 3, 2018 · 6 comments
Closed

Y16 "Save snapshot" Crashes RealSense Viewer #1998

apoorva-sriv opened this issue Jul 3, 2018 · 6 comments
Assignees
Labels

Comments

@apoorva-sriv
Copy link
Contributor

apoorva-sriv commented Jul 3, 2018

Required Info
Camera Model D415
Firmware Version 05.09.13.00
Operating System & Version Win 10
Platform PC
SDK Version 2.12.0
Segment Computer vision in healthcare

Issue Description

"Save snapshot" in RealSense Viewer crashes when saving Y16 with either Infrared 1 or 2. It outputs files that are incomplete.

@timprepscius
Copy link

I am also interested in this. I think I recall in the specs that onboard the d435, the infrared is 10bit.

Besides asking the d435 SDK for Y16 (which also failed for me) I also asked for RS2_FORMAT_RAW10 and that failed as well.

I would be interested in getting the stereo camera output in the highest resolution and contrast possible.

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hello,

The Y16 format is reserved for custom calibration. Y16 provides unrectified images. For applications, only use the Y8 format. The supported depth formats are listed in the datasheet, page 52, table 4-2. The Y8 format provides rectified images.

Do not use Y16 in your applications. Use only the Y8 format in your applications.

We will take a look at why the RealSense Viewer crashes.

Regards,
Jesus G.
Intel Customer Support

@timprepscius
Copy link

A little bit more information btw, may relate to the viewer:

the rs-save-to-disk.cpp line:

            // Write images to disk
            stbi_write_png(png_file.str().c_str(), vf.get_width(), vf.get_height(),
                           vf.get_bytes_per_pixel(), vf.get_data(), vf.get_stride_in_bytes());

doesn't seem to work properly with Y16
or every other program I have doesn't read the output correctly - could be them though - looks like an endian issue perhaps.

If I save the frames data to a raw file, I can read it back and view it. So the data is correct before transformation to png.

@dorodnic
Copy link
Contributor

@apoorva2398 @timprepscius
We are using stb inside the Viewer, and not something like OpenCV, to simplify life for users who are building the SDK from source. It should be easy enough to modify the code to export raw 16-bit data, or integrate other 3rd party.
If you find lightweight enough solution we would be happy to integrate it via a pull-request.

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
hi @apoorva2398,

pull request 2201 for this, please have a try.

@dorodnic
Copy link
Contributor

I believe this issue has been partially resolved.
Trying to save Y16 no longer crashes the Viewer but we still do not support saving 16-bit greyscale data. Other libraries like OpenCV can come to rescue if this must be done, however, since Y16 format for RealSense devices is only intended to be used in calibration flows, I'm Ok with not supporting this out of the box.
Feel free to open a separate issue if you must have this capability in the SDK and we will handle it as an enhancement request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants