FAST

V3.0.0
In [7]:
# -*- coding: utf-8 -*-
import cv2

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

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

# 特徴点の抽出
fast = cv2.FastFeatureDetector_create(30, True)#cv2.FastFeatureDetector(30, True)
kp = fast.detect(img,None)

# 特徴点の描画
out_img = cv2.drawKeypoints(img, kp, img, None)

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

#画像表示
plt.figure(figsize=(15,10))
plt.subplot(121)
plt.imshow(disp_in_img)
plt.subplot(122)
plt.imshow(disp_out_img)
Out[7]:
<matplotlib.image.AxesImage at 0x9ba8190>
inserted by FC2 system