1、高斯金字塔(向下取样;大->小)
/// <summary>
/// 高斯金字塔(向下取样;大->小)
/// 分辨率变小而模糊
/// </summary>
/// <param name="mat">图片</param>
/// <param name="dstSize">输出图像的大小</param>
/// <param name="borderType">外部像素的边界模式</param>
/// <returns></returns>
public static Mat PyrDown(Mat mat, Size? dstSize = null, BorderTypes borderType = BorderTypes.Default)
{
Mat dstMet = new Mat();
// 向下取样
Cv2.PyrDown(mat, dstMet, dstSize, borderType);
return dstMet;
}
2、拉普拉斯金字塔(向上取样;小->大)
/// <summary>
/// 拉普拉斯金字塔(向上取样;小->大)
/// 放大失真而模糊
/// </summary>
/// <param name="mat">图片</param>
/// <param name="dstSize">输出图像的大小</param>
/// <param name="borderType">外部像素的边界模式</param>
/// <returns></returns>
public static Mat PyrUp(Mat mat, Size? dstSize = null, BorderTypes borderType = BorderTypes.Default)
{
Mat dstMet = new Mat();
// 向上取样
Cv2.PyrUp(mat, dstMet, dstSize, borderType);
return dstMet;
}
标签:Mat,dstMet,C#,borderType,OpenCV,取样,金字塔,mat
From: https://www.cnblogs.com/qq2806933146xiaobai/p/18294448