C#+OpenCV基础(七)_图像金字塔
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;
}
本文来自博客园,作者:꧁执笔小白꧂,转载请注明原文链接:https://www.cnblogs.com/qq2806933146xiaobai/p/18294448