Skip to content

Commit

Permalink
videoio: realsense - add cvtColor as the pixel-format is only a hint
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jun 19, 2018
1 parent bfc227b commit 2047abd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/videoio/src/cap_librealsense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ bool VideoCapture_LibRealsense::retrieveFrame(int outputType, cv::OutputArray fr
// we copy the data straight away, so const_cast should be fine
void* data = const_cast<void*>(_frame.get_data());
Mat(_frame.get_height(), _frame.get_width(), type, data, _frame.get_stride_in_bytes()).copyTo(frame);

if(_frame.get_profile().format() == RS2_FORMAT_RGB8)
cvtColor(frame, frame, COLOR_RGB2BGR);
}
catch (const rs2::error&)
{
Expand Down

0 comments on commit 2047abd

Please sign in to comment.