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

Fix for conversion from RGB to BGR in the OpenCV wrapper helpers file #5702

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions wrappers/opencv/cv-helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ cv::Mat frame_to_mat(const rs2::frame& f)
}
else if (f.get_profile().format() == RS2_FORMAT_RGB8)
{
auto r = Mat(Size(w, h), CV_8UC3, (void*)f.get_data(), Mat::AUTO_STEP);
cvtColor(r, r, COLOR_RGB2BGR);
return r;
auto r_rgb = Mat(Size(w, h), CV_8UC3, (void*)f.get_data(), Mat::AUTO_STEP);
Mat r_bgr;
cvtColor(r_rgb, r_bgr, COLOR_RGB2BGR);
return r_bgr;
}
else if (f.get_profile().format() == RS2_FORMAT_Z16)
{
Expand Down