{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import cv2\n",
    "import matplotlib.pyplot as plt\n",
    "import dautil as dl\n",
    "from scipy.misc import face"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "img = face()\n",
    "plt.title('Original')\n",
    "dl.plotting.img_show(plt.gca(), img)\n",
    "gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n",
    "\n",
    "plt.figure()\n",
    "plt.title('Gray')\n",
    "dl.plotting.img_show(plt.gca(), gray, cmap=plt.cm.gray)\n",
    "sift = cv2.xfeatures2d.SIFT_create()\n",
    "(kps, descs) = sift.detectAndCompute(gray, None)\n",
    "img2 = cv2.drawKeypoints(gray, kps, None, (0, 0, 255))\n",
    "\n",
    "plt.figure()\n",
    "plt.title('With Keypoints')\n",
    "dl.plotting.img_show(plt.gca(), img2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
