Issue: Bag of Features Training SIFT or SURF for car detection within Video with OpenCV + Python
I am trying to dump keypoints of cars with SIFT or SURF and match these keypoints to a video in order to detect cars. Keypoints are more convenient to use instead of Haar Cascades because I would have to use a lot of images for example 5000 to train, which will take a lot of computation process. Keypoints from SURF or SIFT are scale invariant which will be almost the same in every car. The code for dumping keypoints into a txt file is: import cv2 import numpy as np import os import cPickle surf = cv2.xfeatures2d.SURF_create() descriptors = [] image = cv2.imread('1.jpg') kp, dsc = surf