> For the complete documentation index, see [llms.txt](https://docs.aic-eec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aic-eec.com/artificial-intelligence-ai/basic-image-processing/computer-vision-for-python/lab-2-basic-cv/gaussian-blur.md).

# Gaussian blur

&#x20;    Gaussian blur เป็นการเบลอภาพด้วยการใช้ค่าเฉลี่ยแบบถ่วงน้ำหนัก ซึ่งภาพจะเบลอน้อยลง แต่เบลออย่างเป็นธรรมชาติ นอกจากนี้จากนี้จะสามารถรักษาเส้นขอบในภาพได้มากขึ้นเมื่อเทียบกับการเบลอภาพแบอื่น ๆ

```
$ cv2.GaussianBlur(image, kernal, sigmaX, sigmaY, borderType)
```

**Parameters:**

* image => ภาพที่ต้องการนำมาใช้
* kernel => องค์ประกอบโครงสร้างที่ใช้สำหรับการ blur
* sigmaX => ค่าเบี่ยงเบนมาตรฐานของ kernel ตามแนวนอน (row)
* sigmaY => ค่าเบี่ยงเบนมาตรฐานของ kernel ตามแนวตั้ง (column)
* borderType => ขอบเขตของรูปภาพในขณะที่ kernel ถูกนำไปใช้กับเส้นขอบของรูปภาพ

\
**Example:**

```
import cv2 

image = cv2.imread("/path/your/image.jpg")
cv2.imshow("original",image)

blurred = cv2.GaussianBlur(image, (7,7),0)

cv2.imshow("Gaussian", blurred)
cv2.waitKey(0)

```

![](https://paper-attachments.dropbox.com/s_ED8F33D726DEEB274B91070CD54DD9822C8EEE25152706EDC8932020507EB3FC_1600699654122_Screenshot+from+2020-09-21+21-37-30.png)
