ガウシアンフィルタ

V2.4.11, V3.0.0
In [6]:
# -*- coding: utf-8 -*-
import cv2

#Ipythonで表示用の設定
import matplotlib.pyplot as plt
%matplotlib inline

#画像読込
in_img = cv2.imread("lena.jpg")

#ガウシアンフィルタ処理
out_img = cv2.GaussianBlur(in_img,(15,15),0)

#OpenCVがBGRなのでRGBに変換
disp_in_img  = cv2.cvtColor(in_img,  cv2.COLOR_BGR2RGB)
disp_out_img = cv2.cvtColor(out_img, cv2.COLOR_BGR2RGB)

#画像表示
plt.subplot(121)
plt.imshow(disp_in_img)
plt.subplot(122)
plt.imshow(disp_out_img)
Out[6]:
<matplotlib.image.AxesImage at 0x9a1a230>
inserted by FC2 system