C#+OpenCV实战(二)_春天转秋天
/// <summary>
/// 春天转化为秋天
/// </summary>
/// <param name="mat">图片</param>
/// <returns>结果图片</returns>
public static Mat Cvt_Spring2Autumn(Mat mat)
{
Mat dstMat = new Mat();
Cv2.CvtColor(mat, dstMat, ColorConversionCodes.BGR2Lab);
Mat[] mats = Cv2.Split(dstMat);
mats[1] = mats[1] * 0 + 127;
Cv2.Merge(mats, dstMat);
Cv2.CvtColor(dstMat, dstMat, ColorConversionCodes.Lab2BGR);
return dstMat;
}
本文来自博客园,作者:꧁执笔小白꧂,转载请注明原文链接:https://www.cnblogs.com/qq2806933146xiaobai/p/18295827