// frozen-filter.cpp : 冰冻滤镜
// @mango
#include<iostream>#include<cmath>#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++){img.at<cv::Vec3b>(i,j)[0]=cv::saturate_cast<uchar>(std::abs(img.at<cv::Vec3b>(i,j)[0]-img.at<cv::Vec3b>(i,j)[1]-img.at<cv::Vec3b>(i,j)[2])*3>>2);// blue
img.at<cv::Vec3b>(i,j)[1]=cv::saturate_cast<uchar>(std::abs(img.at<cv::Vec3b>(i,j)[1]-img.at<cv::Vec3b>(i,j)[0]-img.at<cv::Vec3b>(i,j)[2])*3>>2);// green
img.at<cv::Vec3b>(i,j)[2]=cv::saturate_cast<uchar>(std::abs(img.at<cv::Vec3b>(i,j)[2]-img.at<cv::Vec3b>(i,j)[0]-img.at<cv::Vec3b>(i,j)[1])*3>>2);// red
}}cv::imshow("冰冻滤镜",img);cv::waitKey(0);return0;}