Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BOW how to handle empty sift descriptors

I am using BOW to object categorization. My function looks like:

 def prepare_data_for_bow_sift(self, testing_paths, b_o_w):
        for p in self:
            image = cv2.imread(p, 0)
            kp, dsc = sift.detectAndCompute(image, None)
            if len(kp) < 1:
                # what to do now? how to handle if not keypoint found
            else:
                b_o_w.add(dsc)

Sometimes happens, that Surf or Sift do not find any keypoints. My question is, how to handle with this situation? What should I add to to bow traininig set? Is there any possibility to add any simple default empty descriptors? Or just delete the specific image from process of training?