Skip to content

Adding Depth-Filter OpenCV example - #4733

Merged
dorodnic merged 5 commits into
realsenseai:developmentfrom
dorodnic:depth-filter-opencv
Aug 27, 2019
Merged

Adding Depth-Filter OpenCV example#4733
dorodnic merged 5 commits into
realsenseai:developmentfrom
dorodnic:depth-filter-opencv

Conversation

@dorodnic

Copy link
Copy Markdown
Contributor

Based on the experience of Daniel Pohl and Markus Achtelik using RealSense cameras with outdoor drones for collision avoidance.

drone

The sample shows several techniques that should be useful to anyone solving similar problems:
a. Defining OpenCV-based depth processing block
b. Loading high-confidence preset prior to streaming
c. Filtering out low confidence depth values based on features in the infrared image

rs2::pipeline pipe;

rs2::config cfg;
cfg.enable_stream(RS2_STREAM_DEPTH, 848, 480);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The params are D435-oriented. Can the explicit params be replaced with defaults to allow using D415 and SR300?


high_confidence_filter filter;

std::ifstream file("./camera-settings.json");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not clear what the optional camera-settings.json should include

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.

It is included and copied to output folder

Comment thread src/rs.cpp
sp->set_format(format);

auto vid = std::dynamic_pointer_cast<video_stream_profile_interface>(sp);
auto i = *intr;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

VALIDATE_NOT_NULL(intr) is needed, imho

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nice crafted. Couple minor remarks inside

(cherry picked from commit 4718aa21c0cb843a932c53100b6e8886b4e0b551)
(cherry picked from commit 8a09e5be35271c6f1af0de025c6bd5bc63d743a7)
@dorodnic
dorodnic merged commit 446560b into realsenseai:development Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants