Skip to content

[Colorizer] Check Depth stream format supported or not before process - #12765

Merged
Nir-Az merged 1 commit into
realsenseai:developmentfrom
Arun-Prasad-V:colorizer_format
Mar 25, 2024
Merged

[Colorizer] Check Depth stream format supported or not before process#12765
Nir-Az merged 1 commit into
realsenseai:developmentfrom
Arun-Prasad-V:colorizer_format

Conversation

@Arun-Prasad-V

Copy link
Copy Markdown
Contributor

[Tracked by LRS-1027]

Comment thread src/proc/colorizer.cpp Outdated

if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH)
if ((frame.get_profile().stream_type() != RS2_STREAM_DEPTH) ||
(frame.get_profile().format() != RS2_FORMAT_DISPARITY32) && (frame.get_profile().format() != RS2_FORMAT_Z16))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why RS2_FORMAT_DISPARITY32 ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and why NOT Z16?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we check the colorizer::process_frame() function, it supports Z16 & DISPARITY32 formats.
https://github.com/IntelRealSense/librealsense/blob/b33b2e01d9cb716183dce8c09d751654612affc5/src/proc/colorizer.cpp#L280

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the depth format is not Z16 & not DISPARITY32, then return FALSE.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand,
Maybe it will be more readable if we will add some static array of supported formats and check here if the frame format is in the supported formats?

Comment thread src/proc/colorizer.cpp Outdated

if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH)
return false;
std::set<rs2_format> supported_formats = {RS2_FORMAT_Z16, RS2_FORMAT_DISPARITY32};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry , I meant building this set as static const or at least only once and not on every frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants