title: Pickling cv2.KeyPoint causes PicklingError
body: <p>I want to search surfs in all images in a given directory and save their keypoints and descriptors for future use. I decided to use pickle as shown below:</p>
  
  <pre><code>#!/usr/bin/env python
  import os
  import pickle
  import cv2
  
  class Frame:
    def __init__(self, filename):
      surf = cv2.SURF(500, 4, 2, True)
      self.filename = filename
      self.keypoints, self.descriptors = surf.detect(cv2.imread(filename, cv2.CV_LOAD_IMAGE_GRAYSCALE), None, False)
  
  if __name__ == '__main__':
  
    Fdb = open('db.dat', 'wb')
    base_path = "img/"
    frame_base = []
  
    for filename in os.listdir(base_path):
      frame_base.append(Frame(base_path+filename))
      print filename
  
    pickle.dump(frame_base,Fdb,-1)
  
    Fdb.close()
  </code></pre>
  
  <p>When I try to execute, I get a following error:</p>
  
  <pre><code>File "src/pickle_test.py", line 23, in &lt;module&gt;
      pickle.dump(frame_base,Fdb,-1)
  ...
  pickle.PicklingError: Can't pickle &lt;type 'cv2.KeyPoint'&gt;: it's not the same object as cv2.KeyPoint
  </code></pre>
  
  <p>Does anybody know, what does it mean and how to fix it? I am using Python 2.6 and Opencv 2.3.1</p>
  
  <p>Thank you a lot</p>