Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void splitTo8UC3_dan(const cv::Mat& input, std::vector<cv::Mat>& output)
- {
- // Allocate outputs
- cv::Mat b(cv::Mat::zeros(input.size(), input.type()));
- cv::Mat g(cv::Mat::zeros(input.size(), input.type()));
- cv::Mat r(cv::Mat::zeros(input.size(), input.type()));
- // Collect outputs
- cv::Mat out[] = { b, g, r };
- // Set up index pairs
- int from_to[] = { 0,0, 1,4, 2,8 }; // r
- cv::mixChannels(&input, 1, out, 3, from_to, 3);
- output.assign(std::begin(out), std::end(out));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement