1.将图像色调取反
2.克隆 创建空白图像
3.将原图转换为hsv和灰度图像
4.腐蚀图像
#include<opencv2/opencv.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<iostream>
#include<math.h>
using namespace cv;
class quickdemo
{
public:
void pixel_demo(Mat& img) //将像素取反
{
int w = img.cols;
int h = img.rows;
int dims = img.channels();
int pv;
for (int i = 0;i < h;i++) //注意写清楚行列 容易写反!
{
for (int j = 0;j < w;j++)
{
if (dims == 1)
{
try
{
pv = img.at<