I am trying to track my hand based on the area using Media Flow Tracker but the bounding box keeps increasing after some time. It works properly for the first 10 seconds or so.
Here's a code snippet:
def main():
display = SimpleCV.Display()
cam = Kinect()
ts = []
bb = None
img = cam.getDepth().flipHorizontal()
while display.isNotDone():
depth = cam.getDepth().flipHorizontal()
filtered = depth.stretch(0, 180).binarize().dilate(1)
if bb is None:
blobs = filtered.findBlobs()
if blobs:
hand = blobs.filter(abs(7000 - blobs.area()) < 500)
print hand
if hand:
bb = hand[0].boundingBox()
print bb
if bb is not None:
ts = filtered.track("mftrack", ts, img, bb)
if ts:
ts.drawBB()
ts.showPixelVelocityRT()
ts.drawPath()
filtered.show()