Monday, April 11, 2011

Camshift vs Predator

I got opencv to build correctly on Friday. I immediately tried out the camshiftdemo and it worked like a charm! Sort of. Some problems I encountered right away were:

(1) incorrect parameters for the lighting of the room which would have been approximate to that of a grocery store.
(2) when I moved out of the field of view and returned, the tracker was not able to re-recognize my face.
(3) this tracker would only be appropriate for the hand portion of the tracking because it is dependent on colorspace information.
(4) there may be issues with using this as a hand tracker because the arm will be included and since an ellipse is usually fitted to the face while tracking, it may not be directly adaptable to the arm

If I do use a camshift tracker for tracking the hand I may try to fit the ellipse to the hand alone and figure out how to ignore the arm

I wanted to use the markerless AR tracking displayed by Taehee Lee here, but it looks like I won't have time to use this approach for determining the coordinate system because not only is it relatively involved, but it would require quite a bit of revision to make it work for my needs, since the computations rely heavily on "seeing" all 5 fingers at once, which isn't realistic if the data is going to come from someone reaching naturally for an object (and many of their fingers, if not all of them, will be obscured by the hand itself).

I have acquired the Predator code for fast scale-invariant and very adaptable tracking of objects and my try to use this for tracking grocery products. This would be ideal because
(1) it does not rely on colorspace information like camshift does
(2) if the product goes out of the field of view and then returns, Predator will recover just fine--this would be helpful in the case of occlusion (if a person walks by while they are searching for the product or if they simply move too far away from a product).

I have been trying to figure out how to use git to access this code.Hopefully I'll figure that out in the next few days.

I have downloaded a very simple camshift wrapper to get started on the hand tracking (here). There was a useful explanation about how the tracker works and how to use it here. The demo works with captured footage from a webcam, so to get a quick jumpstart I should be able to adapt it pretty easily by just capturing from an .avi file (one of the test movies I've taken). I have this coded but am having trouble compiling with pkg-config because the newly introduced .h files still aren't found... hopefully this gets resolved soon.

next steps:
(1) get a git repository and unpack the Predator code!
(2) get camshift running on my home movies
(3) record new movies in which
- my hand is not obscured by a target (since camshift relies on colorspace data)
- the background is not a green whiteboard, but a real product on a shelf
- still no occlusion, not much clutter

(4) get the Predator code running on the same movies, but not yet at the same time
(5) figure out how to integrate the two trackers, each tracking their respective targets in the same movie!

No comments:

Post a Comment