// single-color-filter.cpp
// @mango
#include<iostream>#include<opencv2/opencv.hpp>intmain(){cv::Matimg=cv::imread("fruit.jpg");for(size_ti=0;i<img.rows;i++){for(size_tj=0;j<img.cols;j++){// 保留绿色 | remain green
img.at<cv::Vec3b>(i,j)[0]=0;// blue
img.at<cv::Vec3b>(i,j)[2]=0;// red
}}cv::imshow("单色滤镜-绿色",img);cv::waitKey(0);return0;}