Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/opencv.hpp>
- int main()
- {
- uint8_t data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
- cv::Mat bgr(2, 2, CV_8UC3, data);
- cv::Mat result = cv::Mat1b(bgr.rows * 3, bgr.cols);
- std::vector<cv::Mat> views = {
- result.rowRange(0, bgr.rows)
- , result.rowRange(bgr.rows, bgr.rows * 2)
- , result.rowRange(bgr.rows * 2, bgr.rows * 3)
- };
- cv::split(bgr, views);
- std::cout << bgr << '\n';
- std::cout << result << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement