使用 OpenCV 函式高斯模糊對影像進行模糊處理


在此程式中,將使用 OpenCV 函式高斯模糊對影像進行模糊處理。高斯模糊是使用高斯函式對影像進行模糊處理的過程。它在圖形軟體中廣泛用於去除影像噪音並減少細節。

演算法

Step 1: Import cv2.
Step 2: Read the original image.
Step 3: Apply gaussian blur function. Pass the image and the kernel size as parameter.
Step 4: Display the image.

原圖

示例程式碼

import cv2
image = cv2.imread("testimage.jpg")
Gaussian = cv2.GaussianBlur(image, (7,7), 0)
cv2.imshow("Gaussian Blur", Gaussian)

輸出

高斯模糊:

更新於: 2021-3-17

446 次瀏覽

開啟你的職業生涯

完成課程即可獲得認證

開始
廣告