-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Processing blocks frameset support #2245
Processing blocks frameset support #2245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very profound rework.
Some minor remarks in code
You also need to record the new tests to add it to CI
examples/example.hpp
Outdated
|
||
rect calc_grid(float2 window, int streams) | ||
{ | ||
float ratio = window.x / window.y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add sanity checks : streams=0, win=[0,0]
examples/example.hpp
Outdated
@@ -323,4 +405,4 @@ void register_glfw_callbacks(window& app, glfw_state& app_state) | |||
app_state.yaw = app_state.pitch = 0; app_state.offset_x = app_state.offset_y = 0.0; | |||
} | |||
}; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls add empty EOL
include/librealsense2/h/rs_frame.h
Outdated
@@ -276,6 +276,17 @@ int rs2_is_frame_extendable_to(const rs2_frame* frame, rs2_extension extension_t | |||
rs2_frame* rs2_allocate_synthetic_video_frame(rs2_source* source, const rs2_stream_profile* new_stream, rs2_frame* original, | |||
int new_bpp, int new_width, int new_height, int new_stride, rs2_extension frame_type, rs2_error** error); | |||
|
|||
/** | |||
* Allocate new points frame using a frame-source provided form a processing block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
form from
|
||
_block->start(_queue); | ||
} | ||
align(rs2_stream align_to) : processing_block(init(align_to), 1) {} | ||
|
||
/** | ||
* Run the alignment process on the given frames to get an aligned set of frames | ||
* | ||
* \param[in] frame A pair of images, where at least one of which is a depth frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
param[in] frames A pair the frameset may include more than two frames
pointcloud(rs2_stream stream, int index = 0) : processing_block(init(), 1) | ||
{ | ||
set_option(RS2_OPTION_STREAM_FILTER, float(stream)); | ||
set_option(RS2_OPTION_STREAM_INDEX_FILTER, float(index)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if specifying stream format is required (e.g. disparity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need the intrinsic & extrinsic data of the "other stream" sensor, so the format has no effect here
src/proc/align.cpp
Outdated
//Find the depth frame | ||
for (int i = 0; i < composite->get_embedded_frames_count(); i++) | ||
auto curr_depth = depth_frame.get_profile().as<rs2::video_stream_profile>(); | ||
if (_prev_depth_res.first != curr_depth.width() || _prev_depth_res.second != curr_depth.height()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO for future refactoring based on sensor/profile id.
This will handle the case that two different depth streams with similar resolution being proceesed by the same "align" object
}}; | ||
|
||
static color_map classic { { | ||
static color_map jet{ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert alignment
if (!sub.first(f.get_profile().stream_type(), f.get_profile().format())) | ||
return false; | ||
} | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case both "full" and "sub" are empty the function returns true. Is this the expected behavior?
return true; | ||
} | ||
|
||
bool is_equel(rs2::frameset org, rs2::frameset processed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equel equal
REQUIRE(org_depth.get_width() == from_disp_processed_frame.get_width()); | ||
|
||
pipe.stop(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOL
All processing-blocks must work on framesets in addition to frames
Jira issue - DSO-10202