how to make bounding box on surf features ?

asked 2017-11-24 13:44:37 -0600

kzbr93 gravatar image

updated 2017-11-26 07:28:48 -0600

Hello all,

i am working on SURF features and i will be glad if someone could help me out in knowing how can i make bounding box on my good features on a live video. this (using this link as reference). i am not able to understand that in a live video if i have features on my face how to to just put bounding box where the good features clusters are more !! can anyone help me out in this ?? please see this image below, features on the packet are matched so it should give me result that this is is the object with same features match, image

https://pastebin.com/2RNSY2G9

thanks all in advance

edit retag flag offensive close merge delete

Comments

please understand, that feature detection has no notion at all about "objects" , it will retrieve keypoints in the whole image, thus the idea of a "bounding box" for those does not make sense.

berak gravatar imageberak ( 2017-11-24 15:31:17 -0600 )edit

@berak thanks for the reply, but i was wondering what is the use of feature points if we cannot distinguish those with rest of the image or scene. Also, the link i gave in my question has surf feature with homography but the object is already in database, but i am capturing object image after some delay so if the features match with the scene it should give me bounding box on my scene frame !! right ?

kzbr93 gravatar imagekzbr93 ( 2017-11-24 16:28:38 -0600 )edit

i have video frames, is there then any other way i can make a bounding box on objects approaching near ??

kzbr93 gravatar imagekzbr93 ( 2017-11-24 16:29:57 -0600 )edit

As berak said, you can't put a bounding box around the points, it means nothing. You can match the points to the model, figure out where the model is, and put a bounding box around that if you want though.

Which is precisely what you see in the tutorial. So what don't you understand?

Tetragramm gravatar imageTetragramm ( 2017-11-25 20:41:03 -0600 )edit

@kzbr93, since this seems to be about human faces, you could apply face detection initially, and transform the rect from that with the homography matrix obtained from feature matching

berak gravatar imageberak ( 2017-11-25 20:49:19 -0600 )edit

@berak sorry i think i am not able to put my question properly, its not just about human faces, and i know that SURF works good if we have database or trained images (please see my edited question with image), if i have 2 frames and in both the frames SURF gives me features on same object then why can't it tell that this object have the same features in your current frame (eventually with the bounding box).

kzbr93 gravatar imagekzbr93 ( 2017-11-26 07:28:50 -0600 )edit

eventually its making that green color bounding box in whole of my current frame, then whats the use of those feature match. ??

kzbr93 gravatar imagekzbr93 ( 2017-11-26 07:30:49 -0600 )edit

the tutorial is using a small roi image as a template. if both images come from your webcam, they simply have the same size, and the resulting bbox will be the whole image (unless you rotate your bag of chips)

again, the problem is, that you do not have a good initial bounding box, and getting something from the keypoints won't work either, because there are a lot of them e.g. on your jacket (but could be anywhere else, too)

berak gravatar imageberak ( 2017-11-27 04:02:20 -0600 )edit

@berak ok lets make it simple, i store the image of the object and try to track it, in a video !! i am trying to do it but my book is not getting tracked using the same code but now "img_scene" contains the video frames. please check !! https://pastebin.com/Ac6WazL9 everytime i run the code the window is shutting down within seconds

kzbr93 gravatar imagekzbr93 ( 2017-11-27 16:39:50 -0600 )edit