C#+OpenCV基礎(五)_新增邊框

꧁执笔小白꧂發表於2024-07-10
/// <summary>
/// 新增邊框
/// </summary>
/// <param name="srcMat">圖片</param>
/// <param name="top">頂部</param>
/// <param name="bottom">底部</param>
/// <param name="left">左部</param>
/// <param name="right">右部</param>
/// <param name="borderType">邊界型別;Constant純色,Default擴散</param>
/// <param name="value">邊界顏色</param>
/// <returns></returns>
public static Mat CopyMakeBorder(Mat srcMat, int top, int bottom, int left, int right, BorderTypes borderType, Scalar? value = null)
{
    Mat dstMat = new Mat();
    Cv2.CopyMakeBorder(srcMat, dstMat, top, bottom, left, right, borderType, value);
    return dstMat;
}

相關文章