Create a shallow copy of a single channel in OpenCV

43 Views Asked by At

In OpenCV, it's possible to create a cv::Mat representing a sub-rectangle of an existing cv::Mat, with cv::Mat::operator() functions. This is made possible by the Mat step parameter which enables non contiguous data, allowing padding bytes in each axis.

Is it possible to have a single channel shallow copy selected in an RGB image, the same way? I can't find whether cv::split is a shallow or deep copy.

What I need to do is applying gaussian blur on the G channel of a RGB image. Do I necessarily have to deep copy the G channel to a single channel image first?

0

There are 0 best solutions below