Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/highgui/highgui.hpp>
- #include <opencv2/ml/ml.hpp>
- #include <opencv2/imgproc/imgproc.hpp>
- using namespace cv;
- int main(int argc, char** argv) {
- printf("hhello!");
- Mat src = imread(argv[1]);
- Mat rgb = Mat(src.cols, src.rows, 8, 3);
- std::vector<Mat> splitedRgb = std::vector<Mat>();
- cvtColor(src, rgb, CV_BGR2RGB);
- split(rgb, splitedRgb);
- for (int y = 0; y < rgb.cols; y++) {
- for (int x = 0; x < rgb.rows; x++) {
- src.at<Vec3b>(x, y)[0] = 0;
- src.at<Vec3b>(x, y)[2] = 0;
- }
- }
- imwrite(argv[1], src);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement