Ask Your Question
1

BOW how to handle empty sift descriptors

asked 2017-02-24 07:01:16 -0600

Fačko gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2017-02-25 05:28:23 -0600

berak gravatar image

updated 2017-02-25 05:30:43 -0600

if you skip images in training, you'll have to skip them for the detection later, too.

inserting an empty feature vector here, like:

        if len(kp) < 1:
            no_kp = np.zeros((1, sift.descriptorSize()), np.float32)
            b_o_w.add(no_kp)

most likely, you'll have an additional, "NOT-FOUND" cluster in your BOW.

try and tell us the outcome !

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-24 07:01:16 -0600

Seen: 1,928 times

Last updated: Feb 25 '17