[opencv]三通道图像反色

 

1.用纯白图像-原图

    Mat img = imread(path);
    imshow("src", img);
    waitKey();

    Mat white = cv::Mat(250,250,CV_8UC3,Scalar(255,255,255));
    imshow("white", white);
    waitKey();

    Mat dst = white - img;
    imshow("dst", dst);
    waitKey();

 

posted @ 2020-04-16 18:06  Xu_Lin  阅读(498)  评论(0编辑  收藏  举报