暂时不知道OpenCV本身有没有更好的方法支持混合 ,于是自己简单的实现了一下,现提供给大伙看看
#include "stdafx.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <windows.h>
#define ChannelBlend_Normal(A,B) ((uchar)(A))
#define ChannelBlend_Lighten(A,B) ((uchar)((B > A) ? B:A))
#define ChannelBlend_Darken(A,B) ((uchar)((B > A) ? A:B))
#define ChannelBlend_Multiply(A,B) ((uchar)((A * B) / 255))
#define ChannelBlend_Average(A,B) ((uchar)((A + B) / 2))
#define ChannelBlend_Add(A,B) ((uchar)(min(255, (A + B))))
#define ChannelBlend_Subtract(A,B) ((uchar)((A + B < 255) ? 0:(A + B - 255)))
#define ChannelBlend_Difference(A,B) ((uchar)(abs(A - B)))
#define ChannelBlend_Negation(A,B) ((uchar)(255 - abs(255 - A - B)))
#define ChannelBlend_Screen(A,B) ((uc